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

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

No files matched your search

@@ -0,0 +1,55 @@
import * as React from 'react'
import { TSR_DEFERRED_PROMISE, defer } from '@tanstack/router-core'
import { reactUse } from './utils'
export type AwaitOptions<T> = {
promise: Promise<T>
}
/** Suspend until a deferred promise resolves or rejects and return its data. */
export function useAwaited<T>({ promise: _promise }: AwaitOptions<T>): T {
if (reactUse) {
const data = reactUse(_promise)
return data
}
const promise = defer(_promise)
if (promise[TSR_DEFERRED_PROMISE].status === 'pending') {
throw promise
}
if (promise[TSR_DEFERRED_PROMISE].status === 'error') {
throw promise[TSR_DEFERRED_PROMISE].error
}
return promise[TSR_DEFERRED_PROMISE].data
}
/**
* Component that suspends on a deferred promise and renders its child with
* the resolved value. Optionally provides a Suspense fallback.
*/
export function Await<T>(
props: AwaitOptions<T> & {
fallback?: React.ReactNode
children: (result: T) => React.ReactNode
},
) {
const inner = <AwaitInner {...props} />
if (props.fallback) {
return <React.Suspense fallback={props.fallback}>{inner}</React.Suspense>
}
return inner
}
function AwaitInner<T>(
props: AwaitOptions<T> & {
fallback?: React.ReactNode
children: (result: T) => React.ReactNode
},
): React.JSX.Element {
const data = useAwaited(props)
return props.children(data) as React.JSX.Element
}
@@ -0,0 +1,170 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_utils_html = require("../utils/html.js");
const require_jsx_constants = require("./constants.js");
const require_jsx_dom_context = require("./dom/context.js");
const require_jsx_base = require("./base.js");
//#region src/jsx/context.ts
const globalContexts = [];
let alsProbed = false;
let asyncLocalStorage;
let fallbackStore;
let fallbackRendersInFlight = 0;
let warnedFallbackDefault = false;
const loadAsyncLocalStorage = () => {
if (alsProbed) return asyncLocalStorage;
alsProbed = true;
const global = globalThis;
let AsyncLocalStorage;
for (const probe of [() => global.process?.getBuiltinModule?.("node:async_hooks")?.AsyncLocalStorage, () => global.process?.mainModule?.require?.("node:async_hooks")?.AsyncLocalStorage]) {
try {
AsyncLocalStorage = probe();
} catch {}
if (AsyncLocalStorage) break;
}
if (AsyncLocalStorage) asyncLocalStorage = new AsyncLocalStorage();
return asyncLocalStorage;
};
const getCurrentStore = () => {
return loadAsyncLocalStorage()?.getStore() || fallbackStore;
};
const warnIfStorelessAccess = () => {
if (fallbackRendersInFlight > 0 && !warnedFallbackDefault) {
warnedFallbackDefault = true;
console.warn("hono/jsx: AsyncLocalStorage is unavailable in this runtime, so useContext() after an await in an async component falls back to the context default value during server-side rendering. To get provided values across await boundaries, use a runtime with AsyncLocalStorage (Node.js >= 20.16, Deno, Bun, or Cloudflare Workers with the nodejs_compat flag).");
}
};
const getContextValuesIn = (store, context) => {
if (!store) {
warnIfStorelessAccess();
return context.values;
}
let values = store.get(context);
if (!values) {
values = [context.values[0]];
store.set(context, values);
}
return values;
};
const readContextValueIn = (store, context) => {
if (!store) {
warnIfStorelessAccess();
return context.values.at(-1);
}
const values = store.get(context);
return values?.length ? values.at(-1) : context.values[0];
};
const captureContextValues = (store) => (store ? globalContexts.filter((c) => store.has(c)) : globalContexts).map((c) => [c, readContextValueIn(store, c)]);
const resumeWithContextValues = (callback, store, contexts) => runWithRenderContext(() => {
const currentStore = getCurrentStore();
const valuesPerContext = contexts.map(([context, value]) => {
const values = getContextValuesIn(currentStore, context);
values.push(value);
return values;
});
const popContextValues = () => {
valuesPerContext.forEach((values) => {
values.pop();
});
};
try {
const result = callback();
if (result instanceof Promise) return result.finally(popContextValues);
popContextValues();
return result;
} catch (e) {
popContextValues();
throw e;
}
}, store);
/**
* Establish the request-scoped context store for a render.
*
* `resumeStore` continues a suspended subtree in the same store on the fallback
* path (ignored when `AsyncLocalStorage` is available, where isolation is
* automatic).
*
* Without `AsyncLocalStorage` a render can't be followed across `await`, so the
* store lives in `fallbackStore` only during synchronous work (mirroring
* React's request storage). Reading context after `await` then finds no store
* and falls back to the default value — never another request's value.
*/
const runWithRenderContext = (callback, resumeStore) => {
if (getCurrentStore()) return callback();
const store = resumeStore ?? /* @__PURE__ */ new WeakMap();
const storage = loadAsyncLocalStorage();
if (storage) return storage.run(store, callback);
fallbackStore = store;
let result;
try {
result = callback();
} finally {
fallbackStore = void 0;
}
if (!warnedFallbackDefault && result instanceof Promise) {
fallbackRendersInFlight++;
result = result.finally(() => {
fallbackRendersInFlight--;
});
}
return result;
};
/**
* Capture the current render store and return a resumer that re-establishes it
* around a deferred continuation (e.g. a re-render after a suspended promise
* settles). Shared by every suspension point so none reimplements it.
*/
const captureRenderContext = () => {
const store = getCurrentStore();
const contexts = captureContextValues(store);
return (callback) => resumeWithContextValues(callback, store, contexts);
};
/**
* Create a context whose value can be provided with `<Context.Provider>` and
* read with {@link useContext}.
*
* Server-side renders are isolated per request, so a provided value never leaks
* into a concurrent request — even across `await` in an async component, when
* `AsyncLocalStorage` is available (Node.js >= 20.16, Deno, Bun, Cloudflare
* Workers with `nodejs_compat`). Without it, reading context after `await`
* returns the default value; synchronous components and `use()`-based
* suspension are unaffected.
*/
const createContext = (defaultValue) => {
const values = [defaultValue];
const context = ((props) => {
const contextValues = getContextValuesIn(getCurrentStore(), context);
contextValues.push(props.value);
let rendered;
try {
rendered = typeof props.children === "string" ? require_jsx_base.renderChildren([props.children]) : require_jsx_base.isUntrustedObject(props.children) ? require_jsx_base.renderUntrustedObject(props.children) : props.children ? (Array.isArray(props.children) ? new require_jsx_base.JSXFragmentNode("", {}, props.children) : props.children).toString() : require_utils_html.raw("");
} catch (e) {
contextValues.pop();
throw e;
}
if (rendered instanceof Promise) return rendered.finally(() => contextValues.pop()).then((resString) => require_utils_html.raw(resString, resString.callbacks));
else {
contextValues.pop();
return require_utils_html.raw(rendered);
}
});
context.values = values;
context.Provider = context;
context[require_jsx_constants.DOM_RENDERER] = require_jsx_dom_context.createContextProviderFunction(values);
globalContexts.push(context);
return context;
};
/**
* Read the current value of a context created with {@link createContext}.
*
* Safe to call from async components after `await`. See {@link createContext}
* for the per-runtime isolation guarantees.
*/
const useContext = (context) => {
return readContextValueIn(getCurrentStore(), context);
};
//#endregion
exports.captureRenderContext = captureRenderContext;
exports.createContext = createContext;
exports.globalContexts = globalContexts;
exports.runWithRenderContext = runWithRenderContext;
exports.useContext = useContext;
@@ -0,0 +1,2 @@
export declare function isDeepKey(key: PropertyKey): boolean;
export declare function getValue<T = any>(object: any, path: PropertyKey | readonly PropertyKey[], defaultValue?: any): T;
@@ -0,0 +1,5 @@
export type MessageIds = 'errorCall' | 'errorCallThis' | 'errorNew' | 'errorTemplateTag' | 'unsafeCall' | 'unsafeCallThis' | 'unsafeNew' | 'unsafeTemplateTag';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,5 @@
import { Refs } from "../Refs.js";
export type JsonSchema7NullType = {
type: "null";
};
export declare function parseNullDef(refs: Refs): JsonSchema7NullType;
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../../../web/abort-signal.ts", "../../../web/blob.ts", "../../../web/custom-event.ts", "../../../web/dom-exception.ts", "../../../web/event.ts", "../../../web/file.ts", "../../../web/form-data.ts", "../../../web/headers.ts", "../../../web/image-data.ts", "../../../web/readable-stream.ts", "../../../web/request.ts", "../../../web/response.ts", "../../../web/url.ts", "../../../web/url-search-params.ts"],
"sourcesContent": ["import type { SerovalNode } from 'seroval';\nimport { createPlugin } from 'seroval';\n\nconst PROMISE_TO_ABORT_SIGNAL = (promise: Promise<unknown>) => {\n const controller = new AbortController();\n const abort = controller.abort.bind(controller);\n promise.then(abort, abort);\n return controller;\n};\n\nfunction resolveAbortSignalResult(\n this: AbortSignal,\n resolve: (value: unknown) => void,\n): void {\n resolve(this.reason);\n}\n\nfunction resolveAbortSignal(\n this: AbortSignal,\n resolve: (value: unknown) => void,\n): void {\n this.addEventListener('abort', resolveAbortSignalResult.bind(this, resolve), {\n once: true,\n });\n}\n\nfunction abortSignalToPromise(signal: AbortSignal): Promise<unknown> {\n return new Promise(resolveAbortSignal.bind(signal));\n}\n\nconst ABORT_CONTROLLER = {};\n\nconst AbortControllerFactoryPlugin = /* @__PURE__ */ createPlugin<object, {}>({\n tag: 'seroval-plugins/web/AbortControllerFactoryPlugin',\n test(value) {\n return value === ABORT_CONTROLLER;\n },\n parse: {\n sync() {\n return ABORT_CONTROLLER;\n },\n async async() {\n return await Promise.resolve(ABORT_CONTROLLER);\n },\n stream() {\n return ABORT_CONTROLLER;\n },\n },\n serialize() {\n return PROMISE_TO_ABORT_SIGNAL.toString();\n },\n deserialize() {\n return PROMISE_TO_ABORT_SIGNAL;\n },\n});\n\nconst AbortSignalPlugin = /* @__PURE__ */ createPlugin<\n AbortSignal,\n { reason?: SerovalNode; controller?: SerovalNode; factory?: SerovalNode }\n>({\n tag: 'seroval-plugins/web/AbortSignal',\n extends: [AbortControllerFactoryPlugin],\n test(value) {\n if (typeof AbortSignal === 'undefined') {\n return false;\n }\n return value instanceof AbortSignal;\n },\n parse: {\n sync(value, ctx) {\n if (value.aborted) {\n return {\n reason: ctx.parse(value.reason),\n };\n }\n return {};\n },\n async async(value, ctx) {\n if (value.aborted) {\n return {\n reason: await ctx.parse(value.reason),\n };\n }\n const result = await abortSignalToPromise(value);\n return {\n reason: await ctx.parse(result),\n };\n },\n stream(value, ctx) {\n if (value.aborted) {\n return {\n reason: ctx.parse(value.reason),\n };\n }\n\n const promise = abortSignalToPromise(value);\n\n return {\n factory: ctx.parse(ABORT_CONTROLLER),\n controller: ctx.parse(promise),\n };\n },\n },\n serialize(node, ctx) {\n if (node.reason) {\n return 'AbortSignal.abort(' + ctx.serialize(node.reason) + ')';\n }\n if (node.controller && node.factory) {\n return (\n '(' +\n ctx.serialize(node.factory) +\n ')(' +\n ctx.serialize(node.controller) +\n ').signal'\n );\n }\n return '(new AbortController).signal';\n },\n deserialize(node, ctx) {\n if (node.reason) {\n return AbortSignal.abort(ctx.deserialize(node.reason));\n }\n if (node.controller) {\n return PROMISE_TO_ABORT_SIGNAL(ctx.deserialize(node.controller)).signal;\n }\n const controller = new AbortController();\n return controller.signal;\n },\n});\n\nexport default AbortSignalPlugin;\n", "import type { SerovalNode } from 'seroval';\nimport { createPlugin } from 'seroval';\n\ntype BlobNode = {\n type: SerovalNode;\n buffer: SerovalNode;\n};\n\nconst BlobPlugin = /* @__PURE__ */ createPlugin<Blob, BlobNode>({\n tag: 'seroval-plugins/web/Blob',\n test(value) {\n if (typeof Blob === 'undefined') {\n return false;\n }\n return value instanceof Blob;\n },\n parse: {\n async async(value, ctx) {\n return {\n type: await ctx.parse(value.type),\n buffer: await ctx.parse(await value.arrayBuffer()),\n };\n },\n },\n serialize(node, ctx) {\n return (\n 'new Blob([' +\n ctx.serialize(node.buffer) +\n '],{type:' +\n ctx.serialize(node.type) +\n '})'\n );\n },\n deserialize(node, ctx) {\n return new Blob([ctx.deserialize(node.buffer) as ArrayBuffer], {\n type: ctx.deserialize(node.type) as string,\n });\n },\n});\n\nexport default BlobPlugin;\n", "import type { SerovalNode } from 'seroval';\nimport { createPlugin } from 'seroval';\n\nfunction createCustomEventOptions(current: CustomEvent): CustomEventInit {\n return {\n detail: current.detail as unknown,\n bubbles: current.bubbles,\n cancelable: current.cancelable,\n composed: current.composed,\n };\n}\n\ntype CustomEventNode = {\n type: SerovalNode;\n options: SerovalNode;\n};\n\nconst CustomEventPlugin = /* @__PURE__ */ createPlugin<\n CustomEvent,\n CustomEventNode\n>({\n tag: 'seroval-plugins/web/CustomEvent',\n test(value) {\n if (typeof CustomEvent === 'undefined') {\n return false;\n }\n return value instanceof CustomEvent;\n },\n parse: {\n sync(value, ctx) {\n Line truncated
"mappings": "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 truncated
"names": ["createPlugin", "createPlugin", "createPlugin", "createPlugin", "createPlugin", "createPlugin", "createPlugin", "createPlugin", "createPlugin", "createPlugin", "createPlugin", "createPlugin", "createPlugin", "createPlugin", "createPlugin", "createPlugin"]
}
@@ -0,0 +1,7 @@
import addDays from "./addDays.mjs";
function subDays(date, days) {
return addDays(date, -days);
}
export {
subDays as default
};
@@ -0,0 +1,530 @@
'use strict'
const { Writable } = require('node:stream')
const assert = require('node:assert')
const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require('./constants')
const {
isValidStatusCode,
isValidOpcode,
websocketMessageReceived,
utf8Decode,
isControlFrame,
isTextBinaryFrame,
isContinuationFrame
} = require('./util')
const { failWebsocketConnection } = require('./connection')
const { WebsocketFrameSend } = require('./frame')
const { PerMessageDeflate } = require('./permessage-deflate')
const { MessageSizeExceededError } = require('../../core/errors')
const { defaultWebSocketMaxFragments, defaultWebSocketMaxPayloadSize } = require('../../core/constants')
// This code was influenced by ws released under the MIT license.
// Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
// Copyright (c) 2013 Arnout Kazemier and contributors
// Copyright (c) 2016 Luigi Pinca and contributors
class ByteParser extends Writable {
#buffers = []
#fragmentsBytes = 0
#byteOffset = 0
#loop = false
#state = parserStates.INFO
#info = {}
#fragments = []
/** @type {Map<string, PerMessageDeflate>} */
#extensions
/** @type {import('./websocket').Handler} */
#handler
/** @type {number} */
#maxFragments
/** @type {number} */
#maxPayloadSize
/**
* @param {import('./websocket').Handler} handler
* @param {Map<string, string>|null} extensions
* @param {{ maxFragments?: number, maxPayloadSize?: number }} [options]
* A missing value uses the default limit; `0` disables the limit.
*/
constructor (handler, extensions, options = {}) {
super()
this.#handler = handler
this.#extensions = extensions == null ? new Map() : extensions
// Options come from the dispatcher's `webSocketOptions`, which only
// DispatcherBase provides. Fall back to the defaults rather than to no
// limit, so RetryAgent, MockAgent or a custom dispatcher can't turn off
// the payload and decompression limits by accident.
this.#maxFragments = options.maxFragments ?? defaultWebSocketMaxFragments
this.#maxPayloadSize = options.maxPayloadSize ?? defaultWebSocketMaxPayloadSize
if (this.#extensions.has('permessage-deflate')) {
this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions, {
maxPayloadSize: this.#maxPayloadSize
}))
}
}
/**
* @param {Buffer} chunk
* @param {() => void} callback
*/
_write (chunk, _, callback) {
this.#buffers.push(chunk)
this.#byteOffset += chunk.length
this.#loop = true
this.run(callback)
}
#validatePayloadLength () {
if (
this.#maxPayloadSize > 0 &&
!isControlFrame(this.#info.opcode) &&
this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize
) {
failWebsocketConnection(this.#handler, 1009, 'Payload size exceeds maximum allowed size')
return false
}
return true
}
/**
* Runs whenever a new chunk is received.
* Callback is called whenever there are no more chunks buffering,
* or not enough bytes are buffered to parse.
*/
run (callback) {
while (this.#loop) {
if (this.#state === parserStates.INFO) {
// If there aren't enough bytes to parse the payload length, etc.
if (this.#byteOffset < 2) {
return callback()
}
const buffer = this.consume(2)
const fin = (buffer[0] & 0x80) !== 0
const opcode = buffer[0] & 0x0F
const masked = (buffer[1] & 0x80) === 0x80
const fragmented = !fin && opcode !== opcodes.CONTINUATION
const payloadLength = buffer[1] & 0x7F
const rsv1 = buffer[0] & 0x40
const rsv2 = buffer[0] & 0x20
const rsv3 = buffer[0] & 0x10
if (!isValidOpcode(opcode)) {
failWebsocketConnection(this.#handler, 1002, 'Invalid opcode received')
return callback()
}
if (masked) {
failWebsocketConnection(this.#handler, 1002, 'Frame cannot be masked')
return callback()
}
// MUST be 0 unless an extension is negotiated that defines meanings
// for non-zero values. If a nonzero value is received and none of
// the negotiated extensions defines the meaning of such a nonzero
// value, the receiving endpoint MUST _Fail the WebSocket
// Connection_.
// This document allocates the RSV1 bit of the WebSocket header for
// PMCEs and calls the bit the "Per-Message Compressed" bit. On a
// WebSocket connection where a PMCE is in use, this bit indicates
// whether a message is compressed or not.
if (rsv1 !== 0 && !this.#extensions.has('permessage-deflate')) {
failWebsocketConnection(this.#handler, 1002, 'Expected RSV1 to be clear.')
return
}
if (rsv2 !== 0 || rsv3 !== 0) {
failWebsocketConnection(this.#handler, 1002, 'RSV1, RSV2, RSV3 must be clear')
return
}
if (fragmented && !isTextBinaryFrame(opcode)) {
// Only text and binary frames can be fragmented
failWebsocketConnection(this.#handler, 1002, 'Invalid frame type was fragmented.')
return
}
// If we are already parsing a text/binary frame and do not receive either
// a continuation frame or close frame, fail the connection.
if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {
failWebsocketConnection(this.#handler, 1002, 'Expected continuation frame')
return
}
if (this.#info.fragmented && fragmented) {
// A fragmented frame can't be fragmented itself
failWebsocketConnection(this.#handler, 1002, 'Fragmented frame exceeded 125 bytes.')
return
}
// "All control frames MUST have a payload length of 125 bytes or less
// and MUST NOT be fragmented."
if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {
failWebsocketConnection(this.#handler, 1002, 'Control frame either too large or fragmented')
return
}
if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {
failWebsocketConnection(this.#handler, 1002, 'Unexpected continuation frame')
return
}
if (payloadLength <= 125) {
this.#info.payloadLength = payloadLength
this.#state = parserStates.READ_DATA
if (!this.#validatePayloadLength()) {
return
}
} else if (payloadLength === 126) {
this.#state = parserStates.PAYLOADLENGTH_16
} else if (payloadLength === 127) {
this.#state = parserStates.PAYLOADLENGTH_64
}
if (isTextBinaryFrame(opcode)) {
this.#info.binaryType = opcode
this.#info.compressed = rsv1 !== 0
}
this.#info.opcode = opcode
this.#info.masked = masked
this.#info.fin = fin
this.#info.fragmented = fragmented
} else if (this.#state === parserStates.PAYLOADLENGTH_16) {
if (this.#byteOffset < 2) {
return callback()
}
const buffer = this.consume(2)
this.#info.payloadLength = buffer.readUInt16BE(0)
this.#state = parserStates.READ_DATA
if (!this.#validatePayloadLength()) {
return
}
} else if (this.#state === parserStates.PAYLOADLENGTH_64) {
if (this.#byteOffset < 8) {
return callback()
}
const buffer = this.consume(8)
const upper = buffer.readUInt32BE(0)
const lower = buffer.readUInt32BE(4)
// 2^31 is the maximum bytes an arraybuffer can contain
// on 32-bit systems. Although, on 64-bit systems, this is
// 2^53-1 bytes.
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
// https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
// https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
if (upper !== 0 || lower > 2 ** 31 - 1) {
failWebsocketConnection(this.#handler, 1009, 'Received payload length > 2^31 bytes.')
return
}
this.#info.payloadLength = lower
this.#state = parserStates.READ_DATA
if (!this.#validatePayloadLength()) {
return
}
} else if (this.#state === parserStates.READ_DATA) {
if (this.#byteOffset < this.#info.payloadLength) {
return callback()
}
const body = this.consume(this.#info.payloadLength)
if (isControlFrame(this.#info.opcode)) {
this.#loop = this.parseControlFrame(body)
this.#state = parserStates.INFO
// If the automatic PONG/CLOSE reply filled the socket's write buffer,
// stop parsing and resume on drain so a PING flood cannot grow the
// outbound queue without bound.
if (this.#loop && this.#handler.socket.writableNeedDrain) {
this.#loop = false
this.#handler.socket.once('drain', () => {
if (this.destroyed) return
this.#loop = true
this.run(callback)
})
return
}
} else {
if (!this.#info.compressed) {
if (!this.writeFragments(body)) {
return
}
// If the frame is not fragmented, a message has been received.
// If the frame is fragmented, it will terminate with a fin bit set
// and an opcode of 0 (continuation), therefore we handle that when
// parsing continuation frames, not here.
if (!this.#info.fragmented && this.#info.fin) {
websocketMessageReceived(this.#handler, this.#info.binaryType, this.consumeFragments())
}
this.#state = parserStates.INFO
} else {
this.#extensions.get('permessage-deflate').decompress(
body,
this.#info.fin,
(error, data) => {
if (error) {
const code = error instanceof MessageSizeExceededError ? 1009 : 1007
failWebsocketConnection(this.#handler, code, error.message)
return
}
if (!this.writeFragments(data)) {
return
}
// Check cumulative fragment size
if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {
failWebsocketConnection(this.#handler, 1009, new MessageSizeExceededError().message)
return
}
if (!this.#info.fin) {
this.#state = parserStates.INFO
this.#loop = true
this.run(callback)
return
}
websocketMessageReceived(this.#handler, this.#info.binaryType, this.consumeFragments())
this.#loop = true
this.#state = parserStates.INFO
this.run(callback)
},
this.#fragmentsBytes
)
this.#loop = false
break
}
}
}
}
}
/**
* Take n bytes from the buffered Buffers
* @param {number} n
* @returns {Buffer}
*/
consume (n) {
if (n > this.#byteOffset) {
throw new Error('Called consume() before buffers satiated.')
} else if (n === 0) {
return emptyBuffer
}
this.#byteOffset -= n
const first = this.#buffers[0]
if (first.length > n) {
// replace with remaining buffer
this.#buffers[0] = first.subarray(n, first.length)
return first.subarray(0, n)
} else if (first.length === n) {
// prefect match
return this.#buffers.shift()
} else {
let offset = 0
// If Buffer.allocUnsafe is used, extra copies will be made because the offset is non-zero.
const buffer = Buffer.allocUnsafeSlow(n)
while (offset !== n) {
const next = this.#buffers[0]
const length = next.length
if (length + offset === n) {
buffer.set(this.#buffers.shift(), offset)
break
} else if (length + offset > n) {
buffer.set(next.subarray(0, n - offset), offset)
this.#buffers[0] = next.subarray(n - offset)
break
} else {
buffer.set(this.#buffers.shift(), offset)
offset += length
}
}
return buffer
}
}
writeFragments (fragment) {
if (
this.#maxFragments > 0 &&
this.#fragments.length === this.#maxFragments
) {
failWebsocketConnection(this.#handler, 1008, 'Too many message fragments')
return false
}
this.#fragmentsBytes += fragment.length
this.#fragments.push(fragment)
return true
}
consumeFragments () {
const fragments = this.#fragments
this.#info.compressed = false
if (fragments.length === 1) {
// single fragment
this.#fragmentsBytes = 0
return fragments.shift()
}
let offset = 0
// If Buffer.allocUnsafe is used, extra copies will be made because the offset is non-zero.
const output = Buffer.allocUnsafeSlow(this.#fragmentsBytes)
for (let i = 0; i < fragments.length; ++i) {
const buffer = fragments[i]
output.set(buffer, offset)
offset += buffer.length
}
this.#fragments = []
this.#fragmentsBytes = 0
return output
}
parseCloseBody (data) {
assert(data.length !== 1)
// https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
/** @type {number|undefined} */
let code
if (data.length >= 2) {
// _The WebSocket Connection Close Code_ is
// defined as the status code (Section 7.4) contained in the first Close
// control frame received by the application
code = data.readUInt16BE(0)
}
if (code !== undefined && !isValidStatusCode(code)) {
return { code: 1002, reason: 'Invalid status code', error: true }
}
// https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
/** @type {Buffer} */
let reason = data.subarray(2)
// Remove BOM
if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
reason = reason.subarray(3)
}
try {
reason = utf8Decode(reason)
} catch {
return { code: 1007, reason: 'Invalid UTF-8', error: true }
}
return { code, reason, error: false }
}
/**
* Parses control frames.
* @param {Buffer} body
*/
parseControlFrame (body) {
const { opcode, payloadLength } = this.#info
if (opcode === opcodes.CLOSE) {
if (payloadLength === 1) {
failWebsocketConnection(this.#handler, 1002, 'Received close frame with a 1-byte body.')
return false
}
this.#info.closeInfo = this.parseCloseBody(body)
if (this.#info.closeInfo.error) {
const { code, reason } = this.#info.closeInfo
failWebsocketConnection(this.#handler, code, reason)
return false
}
// Upon receiving such a frame, the other peer sends a
// Close frame in response, if it hasn't already sent one.
if (!this.#handler.closeState.has(sentCloseFrameState.SENT) && !this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
// If an endpoint receives a Close frame and did not previously send a
// Close frame, the endpoint MUST send a Close frame in response. (When
// sending a Close frame in response, the endpoint typically echos the
// status code it received.)
let body = emptyBuffer
if (this.#info.closeInfo.code) {
body = Buffer.allocUnsafe(2)
body.writeUInt16BE(this.#info.closeInfo.code, 0)
}
const closeFrame = new WebsocketFrameSend(body)
this.#handler.socket.write(closeFrame.createFrame(opcodes.CLOSE))
this.#handler.closeState.add(sentCloseFrameState.SENT)
}
// Upon either sending or receiving a Close control frame, it is said
// that _The WebSocket Closing Handshake is Started_ and that the
// WebSocket connection is in the CLOSING state.
this.#handler.readyState = states.CLOSING
this.#handler.closeState.add(sentCloseFrameState.RECEIVED)
return false
} else if (opcode === opcodes.PING) {
// Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
// response, unless it already received a Close frame.
// A Pong frame sent in response to a Ping frame must have identical
// "Application data"
if (!this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
const frame = new WebsocketFrameSend(body)
this.#handler.socket.write(frame.createFrame(opcodes.PONG))
this.#handler.onPing(body)
}
} else if (opcode === opcodes.PONG) {
// A Pong frame MAY be sent unsolicited. This serves as a
// unidirectional heartbeat. A response to an unsolicited Pong frame is
// not expected.
this.#handler.onPong(body)
}
return true
}
get closingInfo () {
return this.#info.closeInfo
}
}
module.exports = {
ByteParser
}
@@ -0,0 +1 @@
{"version":3,"names":["_helperCompilationTargets","data","require","_options","msg","loc","type","parent","name","index","JSON","stringify","Error","access","assertRootMode","value","undefined","assertSourceMaps","assertCompact","assertSourceType","assertCallerMetadata","obj","assertObject","prop","Object","keys","propLoc","assertInputSourceMap","assertString","assertFunction","assertBoolean","Array","isArray","assertArray","assertIgnoreList","arr","forEach","item","i","assertIgnoreItem","RegExp","assertConfigApplicableTest","checkValidTest","assertConfigFileSearch","assertBabelrcSearch","assertPluginList","assertPluginItem","length","assertPluginTarget","opts","assertTargets","isBrowsersQueryValid","browsersLoc","esmodulesLoc","assertBrowsersList","browsers","esmodules","key","val","subLoc","hasOwnProperty","call","TargetNames","validTargets","join","assertBrowserVersion","Math","round","assertAssumptions","root","inPreset","source","assumptionsNames","has"],"sources":["../../../src/config/validation/option-assertions.ts"],"sourcesContent":["import {\n isBrowsersQueryValid,\n TargetNames,\n} from \"@babel/helper-compilation-targets\";\n\nimport type {\n ConfigFileSearch,\n BabelrcSearch,\n MatchItem,\n PluginTarget,\n ConfigApplicableTest,\n SourceMapsOption,\n SourceTypeOption,\n CompactOption,\n RootInputSourceMapOption,\n NestingPath,\n CallerMetadata,\n RootMode,\n TargetsListOrObject,\n AssumptionName,\n PluginItem,\n} from \"./options.ts\";\n\nimport { assumptionsNames } from \"./options.ts\";\n\nexport type { RootPath } from \"./options.ts\";\n\nexport type ValidatorSet = Record<string, Validator<any>>;\n\nexport type Validator<T> = (loc: OptionPath, value: unknown) => T;\n\nexport function msg(loc: NestingPath | GeneralPath): string {\n switch (loc.type) {\n case \"root\":\n return ``;\n case \"env\":\n return `${msg(loc.parent)}.env[\"${loc.name}\"]`;\n case \"overrides\":\n return `${msg(loc.parent)}.overrides[${loc.index}]`;\n case \"option\":\n return `${msg(loc.parent)}.${loc.name}`;\n case \"access\":\n return `${msg(loc.parent)}[${JSON.stringify(loc.name)}]`;\n default:\n // @ts-expect-error should not happen when code is type checked\n throw new Error(`Assertion failure: Unknown type ${loc.type}`);\n }\n}\n\nexport function access(loc: GeneralPath, name: string | number): AccessPath {\n return {\n type: \"access\",\n name,\n parent: loc,\n };\n}\n\nexport type OptionPath = Readonly<{\n type: \"option\";\n name: string;\n parent: NestingPath;\n}>;\ntype AccessPath = Readonly<{\n type: \"access\";\n name: string | number;\n parent: GeneralPath;\n}>;\ntype GeneralPath = OptionPath | AccessPath;\n\nexport function assertRootMode(\n loc: OptionPath,\n value: unknown,\n): RootMode | void {\n if (\n value !== undefined &&\n value !== \"root\" &&\n value !== \"upward\" &&\n value !== \"upward-optional\"\n ) {\n throw new Error(\n `${msg(loc)} must be a \"root\", \"upward\", \"upward-optional\" or undefined`,\n );\n }\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n}\n\nexport function assertSourceMaps(\n loc: OptionPath,\n value: unknown,\n): SourceMapsOption | void {\n if (\n value !== undefined &&\n typeof value !== \"boolean\" &&\n value !== \"inline\" &&\n value !== \"both\"\n ) {\n throw new Error(\n `${msg(loc)} must be a boolean, \"inline\", \"both\", or undefined`,\n );\n }\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n}\n\nexport function assertCompact(\n loc: OptionPath,\n value: unknown,\n): CompactOption | void {\n if (value !== undefined && typeof value !== \"boolean\" && value !== \"auto\") {\n throw new Error(`${msg(loc)} must be a boolean, \"auto\", or undefined`);\n }\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n}\n\nexport function assertSourceType(\n loc: OptionPath,\n value: unknown,\n): SourceTypeOption | void {\n if (\n value !== undefined &&\n value !== \"module\" &&\n value !== \"commonjs\" &&\n value !== \"script\" &&\n value !== \"unambiguous\"\n ) {\n throw new Error(\n `${msg(loc)} must be \"module\", \"commonjs\", \"script\", \"unambiguous\", or undefined`,\n );\n }\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n}\n\nexport function assertCallerMetadata(\n loc: OptionPath,\n value: unknown,\n): CallerMetadata | undefined {\n const obj = assertObject(loc, value);\n if (obj) {\n if (typeof obj.name !== \"string\") {\n throw new Error(\n `${msg(loc)} set but does not contain \"name\" property string`,\n );\n }\n\n for (const prop of Object.keys(obj)) {\n const propLoc = access(loc, prop);\n const value = obj[proLine truncated
@@ -0,0 +1,4 @@
var wordSequences = {"cardinalNumbers-en":["one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty"],"ordinalNumbers-en":["first","second","third","fourth","fifth","sixth","seventh","eighth","ninth","tenth","eleventh","twelfth","thirteenth","fourteenth","fifteenth","sixteenth","seventeenth","eighteenth","nineteenth","twentieth"],"daysOfWeek-en":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"months-en":["january","february","march","april","may","june","july","august","september","october","november","december"],"seasons-en":["spring","summer","autumn","winter"],"timePeriods-en":["morning","afternoon","evening","night","midnight","noon"],"rainbowColors-en":["red","orange","yellow","green","blue","indigo","violet"],"directions-en":["north","south","east","west"],"intermediateDirections-en":["northeast","northwest","southeast","southwest"],"sizeProgression-en":["tiny","small","medium","large","huge","giant"],"militaryAlphabet-en":["alpha","bravo","charlie","delta","echo","foxtrot","golf","hotel","india","juliet","kilo","lima","mike","november","oscar","papa","quebec","romeo","sierra","tango","uniform","victor","whiskey","xray","yankee","zulu"],"planets-en":["mercury","venus","earth","mars","jupiter","saturn","uranus","neptune","pluto"],"zodiacSigns-en":["aries","taurus","gemini","cancer","leo","virgo","libra","scorpio","sagittarius","capricorn","aquarius","pisces"],"chineseZodiac-en":["rat","ox","tiger","rabbit","dragon","snake","horse","goat","monkey","rooster","dog","pig"]};
export { wordSequences as default };
//# sourceMappingURL=wordSequences.json.mjs.map
@@ -0,0 +1 @@
module.exports={C:{"4":0.00588,"66":0.00588,"115":0.141,"116":0.00588,"120":1.38063,"121":2.79063,"124":0.00588,"128":0.01175,"131":0.01175,"132":0.00588,"140":0.00588,"146":0.00588,"147":0.01763,"150":0.00588,"152":0.00588,"153":0.01763,"154":0.10575,"155":0.29375,"156":0.25263,"157":0.00588,_:"2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 117 118 119 122 123 125 126 127 129 130 133 134 135 136 137 138 139 141 142 143 144 145 148 149 151 158 159 160 3.5 3.6"},D:{"60":0.00588,"63":0.00588,"64":0.00588,"65":0.00588,"67":0.00588,"68":0.00588,"70":0.00588,"75":0.00588,"76":0.00588,"79":0.01763,"81":0.00588,"83":0.00588,"87":0.0235,"92":0.05875,"93":0.00588,"94":0.00588,"97":0.01175,"98":0.00588,"103":0.36425,"104":0.34663,"105":0.33488,"106":0.34663,"107":0.34663,"108":0.34075,"109":0.52288,"110":0.34075,"111":0.423,"112":0.34075,"114":0.01763,"116":0.66975,"117":0.34075,"118":1.8565,"119":2.6555,"120":3.14313,"121":0.00588,"122":0.00588,"124":0.3525,"125":0.00588,"126":0.01175,"127":0.00588,"128":0.04113,"130":0.01175,"131":0.6815,"132":0.0235,"133":0.76963,"134":0.09988,"135":0.10575,"136":0.11163,"137":0.1175,"138":0.19388,"139":0.09988,"140":0.12338,"141":0.29375,"142":0.376,"143":0.00588,"144":0.60513,"145":0.10575,"146":0.188,"147":0.03525,"148":0.07638,"149":0.34663,"150":0.42888,"151":10.28125,"152":5.781,"153":5.81038,"154":1.73313,"155":0.00588,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 61 62 66 69 71 72 73 74 77 78 80 84 85 86 88 89 90 91 95 96 99 100 101 102 113 115 123 129 156 157"},F:{"51":0.00588,"53":0.00588,"54":0.00588,"55":0.00588,"56":0.00588,"89":0.00588,"95":0.01175,"106":0.00588,"107":0.00588,"111":0.00588,"122":0.00588,"134":0.12338,"135":0.53463,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 52 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 108 109 110 112 113 114 115 116 117 118 119 120 121 123 124 125 126 127 131 132 133 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00588,"92":0.0235,"100":0.00588,"109":0.00588,"119":1.35713,"120":1.39238,"122":0.00588,"124":0.00588,"141":0.00588,"142":0.00588,"143":0.00588,"144":0.00588,"145":0.01175,"146":0.01175,"147":0.0235,"148":0.01763,"149":0.0235,"150":0.094,"151":0.21738,"152":1.85063,"153":2.16788,"154":0.65213,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 123 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140"},E:{"27":0.04113,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.4 16.5 17.0 17.2 17.4 17.5 18.0 18.2 18.4 26.0 26.1 27.1 27.2 TP","13.1":0.00588,"14.1":0.00588,"15.6":0.00588,"16.3":0.00588,"16.6":0.01175,"17.1":0.01763,"17.3":0.01175,"17.6":0.0235,"18.1":0.00588,"18.3":0.00588,"18.5-18.7":0.00588,"26.2":0.00588,"26.3":0.00588,"26.4":0.00588,"26.5":0.15863,"26.6":0.3525},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00067,"5.0-5.1":0.00067,"6.0-6.1":0,"7.0-7.1":0.00134,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00671,"11.0-11.2":0.00067,"11.3-11.4":0.00134,"12.0-12.1":0,"12.2-12.5":0.01745,"13.0-13.1":0,"13.2":0.00336,"13.3":0,"13.4-13.7":0.00067,"14.0-14.4":0.00268,"14.5-14.8":0.00403,"15.0-15.1":0.00403,"15.2-15.3":0.00268,"15.4":0.00336,"15.5":0.00403,"15.6-15.8":0.08725,"16.0":0.00671,"16.1":0.01208,"16.2":0.00671,"16.3":0.01477,"16.4":0.00336,"16.5":0.00537,"16.6-16.7":0.12148,"17.0":0.0047,"17.1":0.00671,"17.2":0.00671,"17.3":0.01007,"17.4":0.01409,"17.5":0.02752,"17.6-17.7":0.07114,"18.0":0.01477,"18.1":0.02953,"18.2":0.04027,"18.3":0.0698,"18.4":0.04362,"18.5-18.7":0.90134,"26.0":0.04362,"26.1":0.0443,"26.2":0.11544,"26.3":0.12483,"26.4":0.09127,"26.5":0.61141,"26.6":3.77246,"27.0":0.28926,"27.1":0,"27.2":0.00738},P:{"4":0.00924,"22":0.00924,"23":0.01847,"24":0.01847,"25":0.00924,"26":0.01847,"27":0.06465,"28":0.09235,"29":0.11082,"30":1.44067,_:"20 21 5.0-5.4 6.2-6.4 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.05541,"8.2":0.00924},I:{"0":0.0371,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":0.19388,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":33.426},R:{_:"0"},M:{"0":0.11963},Q:{"14.9":0.00413},O:{"0":0.0495},H:{all:0}};
@@ -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 FolderCheck = createLucideIcon("FolderCheck", [
[
"path",
{
d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
key: "1kt360"
}
],
["path", { d: "m9 13 2 2 4-4", key: "6343dt" }]
]);
export { FolderCheck as default };
//# sourceMappingURL=folder-check.js.map
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.toGetWrapperPayload = toGetWrapperPayload;
exports.wrapReference = wrapReference;
var _core = require("@babel/core");
var _normalizeAndLoadMetadata = require("./normalize-and-load-metadata.js");
function toGetWrapperPayload(lazy) {
return (source, metadata) => {
if (lazy === false) return null;
if ((0, _normalizeAndLoadMetadata.isSideEffectImport)(metadata) || metadata.reexportAll) return null;
if (lazy === true) {
return source.includes(".") ? null : "lazy";
}
if (Array.isArray(lazy)) {
return !lazy.includes(source) ? null : "lazy";
}
if (typeof lazy === "function") {
return lazy(source) ? "lazy" : null;
}
throw new Error(`.lazy must be a boolean, string array, or function`);
};
}
function wrapReference(ref, payload) {
if (payload === "lazy") return _core.types.callExpression(ref, []);
return null;
}
//# sourceMappingURL=lazy-modules.js.map
@@ -0,0 +1,20 @@
# `@modelcontextprotocol/client`
The MCP (Model Context Protocol) TypeScript client SDK. Build MCP clients that connect to MCP servers.
> **This is v2 of the MCP TypeScript SDK, the stable release line**, implementing the [2026-07-28 MCP spec](https://modelcontextprotocol.io/specification/2026-07-28). It replaces the single `@modelcontextprotocol/sdk` package from v1. Start with the [documentation](https://ts.sdk.modelcontextprotocol.io/v2/); coming from v1, see the [migration guide](https://ts.sdk.modelcontextprotocol.io/v2/migration/upgrade-to-v2). Found a problem? [Open an issue](https://github.com/modelcontextprotocol/typescript-sdk/issues/new?template=v2-feedback.yml).
## Install
```bash
npm install @modelcontextprotocol/client
```
TypeScript ≥6.0 no longer auto-includes `@types/*` — add `"types": ["node"]` to your `tsconfig.json` `compilerOptions` (the published `.d.mts` references `Buffer`).
## Documentation
- **[Repository README](https://github.com/modelcontextprotocol/typescript-sdk#readme)** — overview, package layout, examples
- **[Client guide](https://ts.sdk.modelcontextprotocol.io/v2/clients/connect)** — connecting, calling tools, OAuth, and middleware
- **[API reference](https://ts.sdk.modelcontextprotocol.io/v2/)**
- **[MCP specification](https://modelcontextprotocol.io)**
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ScanText = createLucideIcon("ScanText", [
["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }],
["path", { d: "M7 8h8", key: "1jbsf9" }],
["path", { d: "M7 12h10", key: "b7w52i" }],
["path", { d: "M7 16h6", key: "1vyc9m" }]
]);
export { ScanText as default };
//# sourceMappingURL=scan-text.js.map
@@ -0,0 +1,350 @@
/**
* @license React
* scheduler.native.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
function performWorkUntilDeadline() {
needsPaint = !1;
if (isMessageLoopRunning) {
var currentTime = getCurrentTime();
startTime = currentTime;
var hasMoreWork = !0;
try {
a: {
isHostCallbackScheduled = !1;
isHostTimeoutScheduled &&
((isHostTimeoutScheduled = !1),
localClearTimeout(taskTimeoutID),
(taskTimeoutID = -1));
isPerformingWork = !0;
var previousPriorityLevel = currentPriorityLevel;
try {
b: {
advanceTimers(currentTime);
for (
currentTask = peek(taskQueue);
null !== currentTask &&
!(
currentTask.expirationTime > currentTime &&
shouldYieldToHost()
);
) {
var callback = currentTask.callback;
if ("function" === typeof callback) {
currentTask.callback = null;
currentPriorityLevel = currentTask.priorityLevel;
var continuationCallback = callback(
currentTask.expirationTime <= currentTime
);
currentTime = getCurrentTime();
if ("function" === typeof continuationCallback) {
currentTask.callback = continuationCallback;
advanceTimers(currentTime);
hasMoreWork = !0;
break b;
}
currentTask === peek(taskQueue) && pop(taskQueue);
advanceTimers(currentTime);
} else pop(taskQueue);
currentTask = peek(taskQueue);
}
if (null !== currentTask) hasMoreWork = !0;
else {
var firstTimer = peek(timerQueue);
null !== firstTimer &&
requestHostTimeout(
handleTimeout,
firstTimer.startTime - currentTime
);
hasMoreWork = !1;
}
}
break a;
} finally {
(currentTask = null),
(currentPriorityLevel = previousPriorityLevel),
(isPerformingWork = !1);
}
hasMoreWork = void 0;
}
} finally {
hasMoreWork
? schedulePerformWorkUntilDeadline()
: (isMessageLoopRunning = !1);
}
}
}
function push(heap, node) {
var index = heap.length;
heap.push(node);
a: for (; 0 < index; ) {
var parentIndex = (index - 1) >>> 1,
parent = heap[parentIndex];
if (0 < compare(parent, node))
(heap[parentIndex] = node),
(heap[index] = parent),
(index = parentIndex);
else break a;
}
}
function peek(heap) {
return 0 === heap.length ? null : heap[0];
}
function pop(heap) {
if (0 === heap.length) return null;
var first = heap[0],
last = heap.pop();
if (last !== first) {
heap[0] = last;
a: for (
var index = 0, length = heap.length, halfLength = length >>> 1;
index < halfLength;
) {
var leftIndex = 2 * (index + 1) - 1,
left = heap[leftIndex],
rightIndex = leftIndex + 1,
right = heap[rightIndex];
if (0 > compare(left, last))
rightIndex < length && 0 > compare(right, left)
? ((heap[index] = right),
(heap[rightIndex] = last),
(index = rightIndex))
: ((heap[index] = left),
(heap[leftIndex] = last),
(index = leftIndex));
else if (rightIndex < length && 0 > compare(right, last))
(heap[index] = right),
(heap[rightIndex] = last),
(index = rightIndex);
else break a;
}
}
return first;
}
function compare(a, b) {
var diff = a.sortIndex - b.sortIndex;
return 0 !== diff ? diff : a.id - b.id;
}
function advanceTimers(currentTime) {
for (var timer = peek(timerQueue); null !== timer; ) {
if (null === timer.callback) pop(timerQueue);
else if (timer.startTime <= currentTime)
pop(timerQueue),
(timer.sortIndex = timer.expirationTime),
push(taskQueue, timer);
else break;
timer = peek(timerQueue);
}
}
function handleTimeout(currentTime) {
isHostTimeoutScheduled = !1;
advanceTimers(currentTime);
if (!isHostCallbackScheduled)
if (null !== peek(taskQueue))
(isHostCallbackScheduled = !0),
isMessageLoopRunning ||
((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline());
else {
var firstTimer = peek(timerQueue);
null !== firstTimer &&
requestHostTimeout(
handleTimeout,
firstTimer.startTime - currentTime
);
}
}
function unstable_scheduleCallback$1(priorityLevel, callback, options) {
var currentTime = getCurrentTime();
"object" === typeof options && null !== options
? ((options = options.delay),
(options =
"number" === typeof options && 0 < options
? currentTime + options
: currentTime))
: (options = currentTime);
switch (priorityLevel) {
case 1:
var timeout = -1;
break;
case 2:
timeout = 250;
break;
case 5:
timeout = 1073741823;
break;
case 4:
timeout = 1e4;
break;
default:
timeout = 5e3;
}
timeout = options + timeout;
priorityLevel = {
id: taskIdCounter++,
callback: callback,
priorityLevel: priorityLevel,
startTime: options,
expirationTime: timeout,
sortIndex: -1
};
options > currentTime
? ((priorityLevel.sortIndex = options),
push(timerQueue, priorityLevel),
null === peek(taskQueue) &&
priorityLevel === peek(timerQueue) &&
(isHostTimeoutScheduled
? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))
: (isHostTimeoutScheduled = !0),
requestHostTimeout(handleTimeout, options - currentTime)))
: ((priorityLevel.sortIndex = timeout),
push(taskQueue, priorityLevel),
isHostCallbackScheduled ||
isPerformingWork ||
((isHostCallbackScheduled = !0),
isMessageLoopRunning ||
((isMessageLoopRunning = !0),
schedulePerformWorkUntilDeadline())));
return priorityLevel;
}
function unstable_cancelCallback$1(task) {
task.callback = null;
}
function unstable_getCurrentPriorityLevel$1() {
return currentPriorityLevel;
}
function shouldYieldToHost() {
return needsPaint
? !0
: getCurrentTime() - startTime < frameInterval
? !1
: !0;
}
function requestPaint() {
needsPaint = !0;
}
function requestHostTimeout(callback, ms) {
taskTimeoutID = localSetTimeout(function () {
callback(getCurrentTime());
}, ms);
}
function throwNotImplemented() {
throw Error("Not implemented.");
}
if (
"object" === typeof performance &&
"function" === typeof performance.now
) {
var localPerformance = performance;
var getCurrentTime = function () {
return localPerformance.now();
};
} else {
var localDate = Date,
initialTime = localDate.now();
getCurrentTime = function () {
return localDate.now() - initialTime;
};
}
var taskQueue = [],
timerQueue = [],
taskIdCounter = 1,
currentTask = null,
currentPriorityLevel = 3,
isPerformingWork = !1,
isHostCallbackScheduled = !1,
isHostTimeoutScheduled = !1,
needsPaint = !1,
localSetTimeout = "function" === typeof setTimeout ? setTimeout : null,
localClearTimeout =
"function" === typeof clearTimeout ? clearTimeout : null,
localSetImmediate =
"undefined" !== typeof setImmediate ? setImmediate : null,
isMessageLoopRunning = !1,
taskTimeoutID = -1,
frameInterval = 5,
startTime = -1;
if ("function" === typeof localSetImmediate)
var schedulePerformWorkUntilDeadline = function () {
localSetImmediate(performWorkUntilDeadline);
};
else if ("undefined" !== typeof MessageChannel) {
var channel = new MessageChannel(),
port = channel.port2;
channel.port1.onmessage = performWorkUntilDeadline;
schedulePerformWorkUntilDeadline = function () {
port.postMessage(null);
};
} else
schedulePerformWorkUntilDeadline = function () {
localSetTimeout(performWorkUntilDeadline, 0);
};
channel =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_UserBlockingPriority
: 2;
var unstable_NormalPriority =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_NormalPriority
: 3,
unstable_LowPriority =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_LowPriority
: 4,
unstable_ImmediatePriority =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_ImmediatePriority
: 1,
unstable_scheduleCallback =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_scheduleCallback
: unstable_scheduleCallback$1,
unstable_cancelCallback =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_cancelCallback
: unstable_cancelCallback$1,
unstable_getCurrentPriorityLevel =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_getCurrentPriorityLevel
: unstable_getCurrentPriorityLevel$1,
unstable_shouldYield =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_shouldYield
: shouldYieldToHost,
unstable_requestPaint =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_requestPaint
: requestPaint,
unstable_now =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_now
: getCurrentTime;
exports.unstable_IdlePriority =
"undefined" !== typeof nativeRuntimeScheduler
? nativeRuntimeScheduler.unstable_IdlePriority
: 5;
exports.unstable_ImmediatePriority = unstable_ImmediatePriority;
exports.unstable_LowPriority = unstable_LowPriority;
exports.unstable_NormalPriority = unstable_NormalPriority;
exports.unstable_Profiling = null;
exports.unstable_UserBlockingPriority = channel;
exports.unstable_cancelCallback = unstable_cancelCallback;
exports.unstable_forceFrameRate = throwNotImplemented;
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
exports.unstable_next = throwNotImplemented;
exports.unstable_now = unstable_now;
exports.unstable_requestPaint = unstable_requestPaint;
exports.unstable_runWithPriority = throwNotImplemented;
exports.unstable_scheduleCallback = unstable_scheduleCallback;
exports.unstable_shouldYield = unstable_shouldYield;
exports.unstable_wrapCallback = throwNotImplemented;
})();
@@ -0,0 +1,424 @@
export default `flf2a$ 4 4 10 63 13 0 24511 0
Author: Marcin \`stforek\` Glinski
Date: 2003/6/15 20:02:23
Version: 1.0
-------------------------------------------------
* 2003-06-15 Changed: CDPQRSY6%@
Added: $/=\\|_{}
* 2003-06-09 Added: A-Z 0-9 !@%^&*()-+[]()\`'":;~?<>
---------------------------------------------------
This font has been created using JavE's FIGlet font
export assistant. [http://www.jave.de]
$ #
$ #
$ #
$ ##
_ #
/ \\ #
\\_/ #
(_) ##
___ #
|// #
#
##
##
#
#
##
||_ #
/'__/ #
\`._\`. #
\\_||/ ##
_ _ #
[// | #
/ / #
|_//] ##
__, #
(_ /_ #
/\`X\\/ |#
\`\\_/\\| |##
_ #
\`.\\ #
#
##
_ #
/ | #
( ( #
\\_| ##
_ #
| \\ #
) ) #
|_/ ##
#
//\\ #
\`\\//' #
##
_ #
_| |_ #
|_ _| #
|_| ##
#
#
_, #
[_/ ##
#
__ #
|__| #
##
#
#
__ #
\\/ ##
_ #
/ | #
/ / #
|_/ ##
__ #
/ \\ #
| // | #
\\__/ ##
__ #
/ | #
\`7 | #
|_| ##
___ #
(_ | #
/ / #
|___| ##
__ #
|__\`. #
|_ | #
|__.' ##
_ _ #
| || | #
\`._ _| #
|_| ##
___ #
| __| #
\`._\`. #
!__.' ##
___ #
/ __| #
| ,_ \\ #
\\___/ ##
___ #
|_ | #
/ / #
|_/ ##
___ #
/ _ \\ #
) _ ( #
\\___/ ##
___ #
/ _ \\ #
\\__ / #
/_/ ##
_ #
\\| #
\\| #
##
_ #
\\| #
_] #
##
__ #
/ / #
< < #
\`\\_\\ ##
____ #
)___/ #
/___( #
##
__ #
\\ \\ #
> > #
/_/ ##
____ #
\\_ | #
/_( #
(_) ##
_ #
/.-.\\ #
( \\_(l_,#
\`---'\` ##
__ #
/ \\ #
| /\\ | #
|_||_| ##
__ #
| \\ #
| -< #
|__/ ##
___ #
/ _/ #
| \\__ #
\\__/ ##
__ #
| _\\ #
| v | #
|__/ ##
___ #
| __| #
| _| #
|___| ##
___ #
| __| #
| _| #
|_| ##
__ #
/ _] #
| [/\\ #
\\__/ ##
_ _ #
| || | #
| >< | #
|_||_| ##
_ #
| | #
| | #
|_| ##
__ #
|_ \\ #
_\\ | #
/___| ##
_ __ #
| |/ / #
| < #
|_|\\_\\ ##
_ #
| | #
| |_ #
|___| ##
__ __ #
| V | #
| \\_/ | #
|_| |_| ##
__ _ #
| \\| | #
| | ' | #
|_|\\__| ##
__ #
/__\\ #
| \\/ | #
\\__/ ##
___ #
| _,\\ #
| v_/ #
|_| ##
__ #
/__\\ #
| \\/ | #
\\_V_\\ ##
___ #
| _ \\ #
| v / #
|_|_\\ ##
__ #
/' _/ #
\`._\`. #
|___/ ##
_____ #
|_ _| #
| | #
|_| ##
_ _ #
| || | #
| \\/ | #
\\__/ ##
_ _ #
| \\ / | #
\`\\ V /' #
\\_/ ##
_ _ #
| | | | #
| 'V' | #
!_/ \\_! ##
__ __ #
\\ \\_/ / #
> , < #
/_/ \\_\\ ##
__ __#
\\ \`v' /#
\`. .' #
!_! ##
___ #
|_ | #
/ / #
|___| ##
___ #
| __| #
| |_ #
|___| ##
_ #
| \\ #
\\ \\ #
\\_| ##
___ #
|_ | #
_| | #
|___| ##
/\\ #
|/\\| #
#
##
#
#
____ #
|____| ##
\`#
#
#
##
__ #
/ \\ #
| /\\ | #
|_||_| ##
__ #
| \\ #
| -< #
|__/ ##
___ #
/ _/ #
| \\__ #
\\__/ ##
__ #
| _\\ #
| v | #
|__/ ##
___ #
| __| #
| _| #
|___| ##
___ #
| __| #
| _| #
|_| ##
__ #
/ _] #
| [/\\ #
\\__/ ##
_ _ #
| || | #
| >< | #
|_||_| ##
_ #
| | #
| | #
|_| ##
__ #
|_ \\ #
_\\ | #
/___| ##
_ __ #
| |/ / #
| < #
|_|\\_\\ ##
_ #
| | #
| |_ #
|___| ##
__ __ #
| V | #
| \\_/ | #
|_| |_| ##
__ _ #
| \\| | #
| | ' | #
|_|\\__| ##
__ #
/__\\ #
| \\/ | #
\\__/ ##
___ #
| _,\\ #
| v_/ #
|_| ##
__ #
/__\\ #
| \\/ | #
\\_V_\\ ##
___ #
| _ \\ #
| v / #
|_|_\\ ##
__ #
/' _/ #
\`._\`. #
|___/ ##
_____ #
|_ _| #
| | #
|_| ##
_ _ #
| || | #
| \\/ | #
\\__/ ##
_ _ #
| \\ / | #
\`\\ V /' #
\\_/ ##
_ _ #
| | | | #
| 'V' | #
!_/ \\_! ##
__ __ #
\\ \\_/ / #
> , < #
/_/ \\_\\ ##
__ __#
\\ \`v' /#
\`. .' #
!_! ##
___ #
|_ | #
/ / #
|___| ##
_ #
/ | #
{ { #
\\_| ##
_ #
| | #
| | #
|_| ##
_ #
| \\ #
} } #
|_/ ##
_ #
./ \\_/| #
|/\`\\_/ #
##
__ #
/ \\ #
| /\\ | #
|_||_| ##
__ #
/__\\ #
| \\/ | #
\\__/ ##
_ _ #
| || | #
| \\/ | #
\\__/ ##
__ #
/ \\ #
| /\\ | #
|_||_| ##
__ #
/__\\ #
| \\/ | #
\\__/ ##
_ _ #
| || | #
| \\/ | #
\\__/ ##
ß#
#
#
##
`
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_3O","2":"_q _aH _L","194":"_aC _hC _HE"},D:{"1":"_3P _zK","2":"_IC","66":"8B"},E:{"1":"_uC","2":"_BH"},F:{"1":"_FM","2":"_rR","66":"_hD"},G:{"1":"_7B","2":"_XE"},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":"_hB","2":"_rC"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","194":"LE"}},B:2,C:"CSS Containment",D:true};
@@ -0,0 +1,326 @@
export default `tlf2a 3 3 8 -1 18 0 0 0
===============================================================================
This is emboss.tlf, or “Emboss”, by Sam Hocevar <sam@hocevar.net>. It was
created on September 30th, 2006.
This font is free software. It comes without any warranty, to the extent
permitted by applicable law. You can redistribute it and/or modify it under
the terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
details.
Missing characters: # $ % , ; < >
To create emboss2.tlf, use the following command:
$ sed '/@@/,$y/═║╔╗╚╝/═║╔╗╚╝/' < emboss.tlf > emboss2.tlf
This font is part of TOIlet’s official distribution. More information
on the TOIlet website at http://caca.zoy.org/wiki/toilet
===============================================================================
@
@
@@
║!
╝!
╝!!
╝╝"
"
""
@
@
#@@
@
@
$@@
@
@
%@@
╔╝║ &
║═╔╝&
══╝ &&
╝'
'
''
╝(
║ (
╝((
═ )
║)
═ ))
╝ ╝*
═╔╝*
╝ ╝**
║ +
═╔╝+
╝ ++
@
@
,@@
-
═╝-
--
.
.
╝..
╝/
╝ /
╝ //
╔═║0
║╝║0
══╝00
═║ 1
║ 1
══╝11
══║2
╔═╝2
══╝22
══║3
══║3
══╝33
║ ║4
══║4
╝44
╔═╝5
══║5
══╝55
╔═╝6
╔═║6
══╝66
╔═║7
║7
╝77
╔═║8
╔═║8
══╝88
╔═║9
══║9
══╝99
:
╝:
╝::
@
@
;@@
@
@
<@@
=
══╝=
══╝==
@
@
>@@
╔═║?
╝?
╝ ??
╔═║@
║╝╝@
══╝@@
╔═║A
╔═║A
╝ ╝AA
╔═ B
╔═║B
══ BB
╔═╝C
║ C
══╝CC
╔═ D
║ ║D
══ DD
╔═╝E
╔═╝E
══╝EE
╔═╝F
╔═╝F
╝ FF
╔═╝G
║ ║G
══╝GG
║ ║H
╔═║H
╝ ╝HH
╝I
║I
╝II
╝J
║J
═╝JJ
║ ║K
╔╝ K
╝ ╝KK
║ L
║ L
══╝LL
╔╔ M
║║║M
╝╝╝MM
╔═ N
║ ║N
╝ ╝NN
╔═║O
║ ║O
══╝OO
╔═║p
╔═╝P
╝ PP
╔═║ Q
║ ║ Q
═══╝QQ
╔═║R
╔╔╝R
╝ ╝RR
╔═╝S
══║S
══╝SS
═╔╝T
║ T
╝ TT
║ ║U
║ ║U
══╝UU
║ ║V
║ ║V
╝ VV
║║║W
║║║W
══╝WW
║ ║X
╝ X
╝ ╝XX
║ ║Y
═╔╝Y
╝ YY
══║Z
╔╝ Z
══╝ZZ
╔╝[
║ [
═╝[[
╝ \\
╝ \\
╝\\\\
═║]
║]
═╝]]
╝ ^
╝ ╝^
^^
_
_
══╝__
╝ \`
╝\`
\`\`
╔═║a
╔═║a
╝ ╝aa
╔═ b
╔═║b
══ bb
╔═╝c
║ c
══╝cc
╔═ d
║ ║d
══ dd
╔═╝e
╔═╝e
══╝ee
╔═╝f
╔═╝f
╝ ff
╔═╝g
║ ║g
══╝gg
║ ║h
╔═║h
╝ ╝hh
╝i
║i
╝ii
╝j
║j
═╝jj
║ ║k
╔╝ k
╝ ╝kk
║ l
║ l
══╝ll
╔╔ m
║║║m
╝╝╝mm
╔═ n
║ ║n
╝ ╝nn
╔═║o
║ ║o
══╝oo
╔═║p
╔═╝p
╝ pp
╔═║ q
║ ║ q
═══╝qq
╔═║r
╔╔╝r
╝ ╝rr
╔═╝s
══║s
══╝ss
═╔╝t
║ t
╝ tt
║ ║u
║ ║u
══╝uu
║ ║v
║ ║v
╝ vv
║║║w
║║║w
══╝ww
║ ║x
╝ x
╝ ╝xx
║ ║y
═╔╝y
╝ yy
══║z
╔╝ z
══╝zz
╔╝{
═║ {
═╝{{
║|
║|
╝||
═║ }
╔╝}
═╝ }}
╝ ╝~
╝ ╝ ~
~~
╔═║╔═╝Ä
╔═║╔═╝Ä
╝ ╝══╝ÄÄ
╔═║╔═╝Ö
║ ║╔═╝Ö
══╝══╝ÖÖ
║ ║╔═╝Ü
║ ║╔═╝Ü
══╝══╝ÜÜ
╔═║╔═╝ä
╔═║╔═╝ä
╝ ╝══╝ää
╔═║╔═╝ö
║ ║╔═╝ö
══╝══╝öö
║ ║╔═╝ü
║ ║╔═╝ü
══╝══╝üü
╔═╝╔═╝ß
══║══║ß
══╝══╝ßß
`
@@ -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 AlignEndVertical = createLucideIcon("AlignEndVertical", [
["rect", { width: "16", height: "6", x: "2", y: "4", rx: "2", key: "10wcwx" }],
["rect", { width: "9", height: "6", x: "9", y: "14", rx: "2", key: "4p5bwg" }],
["path", { d: "M22 22V2", key: "12ipfv" }]
]);
export { AlignEndVertical as default };
//# sourceMappingURL=align-end-vertical.js.map
@@ -0,0 +1,48 @@
"use client";
import { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion } from 'motion-dom';
import { warnOnce } from 'motion-utils';
import { useState } from 'react';
/**
* A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.
*
* This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing
* `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.
*
* It will actively respond to changes and re-render your components with the latest setting.
*
* ```jsx
* export function Sidebar({ isOpen }) {
* const shouldReduceMotion = useReducedMotion()
* const closedX = shouldReduceMotion ? 0 : "-100%"
*
* return (
* <motion.div animate={{
* opacity: isOpen ? 1 : 0,
* x: isOpen ? 0 : closedX
* }} />
* )
* }
* ```
*
* @return boolean
*
* @public
*/
function useReducedMotion() {
/**
* Lazy initialisation of prefersReducedMotion
*/
!hasReducedMotionListener.current && initPrefersReducedMotion();
const [shouldReduceMotion] = useState(prefersReducedMotion.current);
if (process.env.NODE_ENV !== "production") {
warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled");
}
/**
* TODO See if people miss automatically updating shouldReduceMotion setting
*/
return shouldReduceMotion;
}
export { useReducedMotion };
//# sourceMappingURL=use-reduced-motion.mjs.map
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getKeys = void 0;
const eslint_visitor_keys_1 = require("eslint-visitor-keys");
exports.getKeys = eslint_visitor_keys_1.getKeys;
@@ -0,0 +1,16 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2017_full = void 0;
const dom_1 = require("./dom");
const dom_iterable_1 = require("./dom.iterable");
const es2017_1 = require("./es2017");
const scripthost_1 = require("./scripthost");
const webworker_importscripts_1 = require("./webworker.importscripts");
exports.es2017_full = {
libs: [es2017_1.es2017, dom_1.dom, webworker_importscripts_1.webworker_importscripts, scripthost_1.scripthost, dom_iterable_1.dom_iterable],
variables: [],
};
@@ -0,0 +1 @@
{"version":3,"file":"curly-braces.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,2 @@
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
module.exports = require("./data/overlapping-plugins.json");
@@ -0,0 +1,69 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = literalTemplate;
var _options = require("./options.js");
var _parse = require("./parse.js");
var _populate = require("./populate.js");
function literalTemplate(formatter, tpl, opts) {
const {
metadata,
names
} = buildLiteralData(formatter, tpl, opts);
return arg => {
const defaultReplacements = {};
arg.forEach((replacement, i) => {
defaultReplacements[names[i]] = replacement;
});
return arg => {
const replacements = (0, _options.normalizeReplacements)(arg);
if (replacements) {
Object.keys(replacements).forEach(key => {
if (hasOwnProperty.call(defaultReplacements, key)) {
throw new Error("Unexpected replacement overlap.");
}
});
}
return formatter.unwrap((0, _populate.default)(metadata, replacements ? Object.assign(replacements, defaultReplacements) : defaultReplacements));
};
};
}
function buildLiteralData(formatter, tpl, opts) {
let prefix = "BABEL_TPL$";
const raw = tpl.join("");
do {
prefix = "$$" + prefix;
} while (raw.includes(prefix));
const {
names,
code
} = buildTemplateCode(tpl, prefix);
const metadata = (0, _parse.default)(formatter, formatter.code(code), {
parser: opts.parser,
placeholderWhitelist: new Set(names.concat(opts.placeholderWhitelist ? Array.from(opts.placeholderWhitelist) : [])),
placeholderPattern: opts.placeholderPattern,
preserveComments: opts.preserveComments,
syntacticPlaceholders: opts.syntacticPlaceholders
});
return {
metadata,
names
};
}
function buildTemplateCode(tpl, prefix) {
const names = [];
let code = tpl[0];
for (let i = 1; i < tpl.length; i++) {
const value = `${prefix}${i - 1}`;
names.push(value);
code += value + tpl[i];
}
return {
names,
code
};
}
//# sourceMappingURL=literal.js.map
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Pen = createLucideIcon("Pen", [
[
"path",
{
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
key: "1a8usu"
}
]
]);
export { Pen as default };
//# sourceMappingURL=pen.js.map
@@ -0,0 +1,7 @@
import { isLength } from "./isLength.mjs";
function isArrayLike(value) {
return value != null && isLength(value.length) && typeof value !== "function";
}
export {
isArrayLike
};
@@ -0,0 +1,342 @@
"use client";
// src/dialog.tsx
import * as React from "react";
import { composeEventHandlers } from "@radix-ui/primitive";
import { useComposedRefs } from "@radix-ui/react-compose-refs";
import { createContext, createContextScope } from "@radix-ui/react-context";
import { useId } from "@radix-ui/react-id";
import { useControllableState } from "@radix-ui/react-use-controllable-state";
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
import { FocusScope } from "@radix-ui/react-focus-scope";
import { Portal as PortalPrimitive } from "@radix-ui/react-portal";
import { Presence } from "@radix-ui/react-presence";
import { Primitive } from "@radix-ui/react-primitive";
import { useFocusGuards } from "@radix-ui/react-focus-guards";
import { RemoveScroll } from "react-remove-scroll";
import { hideOthers } from "aria-hidden";
import { createSlot } from "@radix-ui/react-slot";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
var DIALOG_NAME = "Dialog";
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
var Dialog = (props) => {
const {
__scopeDialog,
children,
open: openProp,
defaultOpen,
onOpenChange,
modal = true
} = props;
const triggerRef = React.useRef(null);
const contentRef = React.useRef(null);
const [open, setOpen] = useControllableState({
prop: openProp,
defaultProp: defaultOpen ?? false,
onChange: onOpenChange,
caller: DIALOG_NAME
});
return /* @__PURE__ */ jsx(
DialogProvider,
{
scope: __scopeDialog,
triggerRef,
contentRef,
contentId: useId(),
titleId: useId(),
descriptionId: useId(),
open,
onOpenChange: setOpen,
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
modal,
children
}
);
};
Dialog.displayName = DIALOG_NAME;
var TRIGGER_NAME = "DialogTrigger";
var DialogTrigger = React.forwardRef(
(props, forwardedRef) => {
const { __scopeDialog, ...triggerProps } = props;
const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
return /* @__PURE__ */ jsx(
Primitive.button,
{
type: "button",
"aria-haspopup": "dialog",
"aria-expanded": context.open,
"aria-controls": context.contentId,
"data-state": getState(context.open),
...triggerProps,
ref: composedTriggerRef,
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
}
);
}
);
DialogTrigger.displayName = TRIGGER_NAME;
var PORTAL_NAME = "DialogPortal";
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
forceMount: void 0
});
var DialogPortal = (props) => {
const { __scopeDialog, forceMount, children, container } = props;
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });
};
DialogPortal.displayName = PORTAL_NAME;
var OVERLAY_NAME = "DialogOverlay";
var DialogOverlay = React.forwardRef(
(props, forwardedRef) => {
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
}
);
DialogOverlay.displayName = OVERLAY_NAME;
var Slot = createSlot("DialogOverlay.RemoveScroll");
var DialogOverlayImpl = React.forwardRef(
(props, forwardedRef) => {
const { __scopeDialog, ...overlayProps } = props;
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
return (
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
// ie. when `Overlay` and `Content` are siblings
/* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(
Primitive.div,
{
"data-state": getState(context.open),
...overlayProps,
ref: forwardedRef,
style: { pointerEvents: "auto", ...overlayProps.style }
}
) })
);
}
);
var CONTENT_NAME = "DialogContent";
var DialogContent = React.forwardRef(
(props, forwardedRef) => {
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
const { forceMount = portalContext.forceMount, ...contentProps } = props;
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
}
);
DialogContent.displayName = CONTENT_NAME;
var DialogContentModal = React.forwardRef(
(props, forwardedRef) => {
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
const contentRef = React.useRef(null);
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
React.useEffect(() => {
const content = contentRef.current;
if (content) return hideOthers(content);
}, []);
return /* @__PURE__ */ jsx(
DialogContentImpl,
{
...props,
ref: composedRefs,
trapFocus: context.open,
disableOutsidePointerEvents: true,
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
event.preventDefault();
context.triggerRef.current?.focus();
}),
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
const originalEvent = event.detail.originalEvent;
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
if (isRightClick) event.preventDefault();
}),
onFocusOutside: composeEventHandlers(
props.onFocusOutside,
(event) => event.preventDefault()
)
}
);
}
);
var DialogContentNonModal = React.forwardRef(
(props, forwardedRef) => {
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
const hasInteractedOutsideRef = React.useRef(false);
const hasPointerDownOutsideRef = React.useRef(false);
return /* @__PURE__ */ jsx(
DialogContentImpl,
{
...props,
ref: forwardedRef,
trapFocus: false,
disableOutsidePointerEvents: false,
onCloseAutoFocus: (event) => {
props.onCloseAutoFocus?.(event);
if (!event.defaultPrevented) {
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
event.preventDefault();
}
hasInteractedOutsideRef.current = false;
hasPointerDownOutsideRef.current = false;
},
onInteractOutside: (event) => {
props.onInteractOutside?.(event);
if (!event.defaultPrevented) {
hasInteractedOutsideRef.current = true;
if (event.detail.originalEvent.type === "pointerdown") {
hasPointerDownOutsideRef.current = true;
}
}
const target = event.target;
const targetIsTrigger = context.triggerRef.current?.contains(target);
if (targetIsTrigger) event.preventDefault();
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
event.preventDefault();
}
}
}
);
}
);
var DialogContentImpl = React.forwardRef(
(props, forwardedRef) => {
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
const contentRef = React.useRef(null);
const composedRefs = useComposedRefs(forwardedRef, contentRef);
useFocusGuards();
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(
FocusScope,
{
asChild: true,
loop: true,
trapped: trapFocus,
onMountAutoFocus: onOpenAutoFocus,
onUnmountAutoFocus: onCloseAutoFocus,
children: /* @__PURE__ */ jsx(
DismissableLayer,
{
role: "dialog",
id: context.contentId,
"aria-describedby": context.descriptionId,
"aria-labelledby": context.titleId,
"data-state": getState(context.open),
...contentProps,
ref: composedRefs,
onDismiss: () => context.onOpenChange(false)
}
)
}
),
/* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),
/* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
] })
] });
}
);
var TITLE_NAME = "DialogTitle";
var DialogTitle = React.forwardRef(
(props, forwardedRef) => {
const { __scopeDialog, ...titleProps } = props;
const context = useDialogContext(TITLE_NAME, __scopeDialog);
return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
}
);
DialogTitle.displayName = TITLE_NAME;
var DESCRIPTION_NAME = "DialogDescription";
var DialogDescription = React.forwardRef(
(props, forwardedRef) => {
const { __scopeDialog, ...descriptionProps } = props;
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
}
);
DialogDescription.displayName = DESCRIPTION_NAME;
var CLOSE_NAME = "DialogClose";
var DialogClose = React.forwardRef(
(props, forwardedRef) => {
const { __scopeDialog, ...closeProps } = props;
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
return /* @__PURE__ */ jsx(
Primitive.button,
{
type: "button",
...closeProps,
ref: forwardedRef,
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
}
);
}
);
DialogClose.displayName = CLOSE_NAME;
function getState(open) {
return open ? "open" : "closed";
}
var TITLE_WARNING_NAME = "DialogTitleWarning";
var [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {
contentName: CONTENT_NAME,
titleName: TITLE_NAME,
docsSlug: "dialog"
});
var TitleWarning = ({ titleId }) => {
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
React.useEffect(() => {
if (titleId) {
const hasTitle = document.getElementById(titleId);
if (!hasTitle) console.error(MESSAGE);
}
}, [MESSAGE, titleId]);
return null;
};
var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
var DescriptionWarning = ({ contentRef, descriptionId }) => {
const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
React.useEffect(() => {
const describedById = contentRef.current?.getAttribute("aria-describedby");
if (descriptionId && describedById) {
const hasDescription = document.getElementById(descriptionId);
if (!hasDescription) console.warn(MESSAGE);
}
}, [MESSAGE, contentRef, descriptionId]);
return null;
};
var Root = Dialog;
var Trigger = DialogTrigger;
var Portal = DialogPortal;
var Overlay = DialogOverlay;
var Content = DialogContent;
var Title = DialogTitle;
var Description = DialogDescription;
var Close = DialogClose;
export {
Close,
Content,
Description,
Dialog,
DialogClose,
DialogContent,
DialogDescription,
DialogOverlay,
DialogPortal,
DialogTitle,
DialogTrigger,
Overlay,
Portal,
Root,
Title,
Trigger,
WarningProvider,
createDialogScope
};
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,547 @@
flf2a$ 3 2 7 0 8
This font is (c) Michel Eftimakis 1995 -- Version 1.1 -- 15 feb 1995
____________________________________________________________ /`____
| Michel Eftimakis | "Ascii-Artist" '\/ |
| Michel.Eftimakis@ustc.vlsi.com | Boo)- (00) ||
| Tel : (33) 92 96 27 19 | (_`'_) ||
|__ Fax : (33) 92 96 27 01 _________|____ FRANCE ___________ _!!_ ____||
|_____________________________________________________________________|
$$@
$$@
$$@@
[]@
()@
@@
,,@
@
@@
@
=||=@
@@
|@
S@
|@@
o/@
/o@
@@
@
&@
@@
,@
$@
@@
$@
/$@
`$@@
$ @
$\@
$'@@
@
*@
@@
@
+@
@@
@
,@
@@
@
-@
@@
@
.@
@@
/@
/ @
@@
@
0@
@@
@
1@
@@
@
2@
@@
@
3@
@@
@
4@
@@
@
5@
@@
@
6@
@@
@
7@
@@
@
8@
@@
@
9@
@@
@
:@
@@
@
;@
@@
/@
\@
@@
@
=@
@@
\@
/@
@@
@
?@
@@
_ @
(a)@
@@
_ @
//\@
@@
_ @
[|}@
@@
_@
((@
@@
_ @
[|)@
@@
__@
[|-@
`-@@
__@
[|-@
@@
__ @
(|_;@
@@
@
[]-|@
@@
()@
[]@
@@
()@
||@
[_|@@
@
[]/@
`@@
|| @
L_]@
@@
_ _ @
//\/\@
@@
_ @
[|\|@
@@
_ @
(()@
@@
_ @
||)@
L| @@
_ @
(()@
`@@
_ @
[|)@
`@@
@
((@
''@@
____@
L| @
@@
@
|U|@
`-'@@
_ _@
\\/@
@@
_ _ _@
\\/\/@
@@
@
\\/@
''`@@
_ _@
\\/@
'' @@
__ @
//_@
@@
_$@
| $@
|_$@@
\ @
\@
@@
$_ @
$ |@
$_|@@
^@
$@
@@
@
$$@
==@@
.@
$@
@@
@
a@
@@
@
b@
@@
@
c@
@@
@
d@
@@
@
e@
@@
@
f@
@@
@
g@
@@
@
h@
@@
@
i@
@@
@
j@
@@
@
k@
@@
@
l@
@@
@
m@
@@
@
n@
@@
@
o@
@@
@
p@
@@
@
q@
@@
@
r@
@@
@
s@
@@
@
t@
@@
@
u@
@@
@
v@
@@
@
w@
@@
@
x@
@@
@
y@
@@
@
z@
@@
@
{@
@@
|@
|@
|@@
@
}@
@@
@
~@
@@
..@
//\@
@@
..@
(()@
@@
..@
|U|@
`-'@@
..@
a @
@@
..@
o @
@@
..@
u @
@@
_ @
||}@
L| @@
160
$@
$@
$@@
161
()@
||@
L|@@
168
..@
$$@
@@
183
o@
$@
@@
192
` @
//\@
@@
193
' @
//\@
@@
194
^ @
//\@
@@
195
~ @
//\@
@@
196
..@
//\@
@@
197
o @
//\@
@@
198
____@
//\|-@
`-@@
199
@
((@
'@@
200
`_@
||-@
`-@@
201
'_@
||-@
`-@@
202
^_@
||-@
`-@@
203
..@
||-@
`-@@
204
` @
L|@
@@
205
'@
L|@
@@
206
^ @
L|@
@@
207
..@
L|@
@@
209
_~ @
[|\|@
@@
210
` @
(()@
@@
211
' @
(()@
@@
212
^ @
(()@
@@
213
~ @
(()@
@@
214
..@
(()@
@@
217
` @
|U|@
`-'@@
218
' @
|U|@
`-'@@
219
^ @
|U|@
`-'@@
220
..@
|U|@
`-'@@
223
_ @
||}@
L| @@
224
-@
a@
@@
225
,@
a@
@@
226
^@
a@
@@
227
~@
a@
@@
228
..@
a @
@@
229
.@
a@
@@
231
@
c@
'@@
232
-@
e@
@@
233
,@
e@
@@
234
^@
e@
@@
235
..@
e @
@@
236
-@
i@
@@
237
,@
i@
@@
238
^@
i@
@@
239
..@
i @
@@
241
~@
n@
@@
242
-@
o@
@@
243
,@
o@
@@
244
^@
o@
@@
245
~@
o@
@@
246
..@
o @
@@
249
-@
u@
@@
250
,@
u@
@@
251
^@
u@
@@
252
..@
u @
@@
253
,@
y@
@@
255
..@
y @
@@
@@ -0,0 +1 @@
{"version":3,"file":"git-commit.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"cfWorkerProvider-doTkZbTr.d.cts","names":[],"sources":["../../core-internal/src/validators/cfWorkerProvider.ts"],"sourcesContent":[],"mappings":";;;;;;;KAkBY,mBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgCC,2BAAA,YAAuC;;;;;;;;;;;;;;;YAcQ;;;;;;;;;;;;;;;;0BAuBhC,iBAAiB,oBAAoB"}
@@ -0,0 +1,406 @@
//#region src/index.ts
var stateIndexKey = "__TSR_index";
var popStateEvent = "popstate";
var beforeUnloadEvent = "beforeunload";
function createHistory(opts) {
let location = opts.getLocation();
const subscribers = /* @__PURE__ */ new Set();
const notify = (action) => {
location = opts.getLocation();
subscribers.forEach((subscriber) => subscriber({
location,
action
}));
};
const handleIndexChange = (action) => {
if (opts.notifyOnIndexChange ?? true) notify(action);
else location = opts.getLocation();
};
const tryNavigation = async ({ task, navigateOpts, ...actionInfo }) => {
if (navigateOpts?.ignoreBlocker ?? false) {
task();
return;
}
const blockers = opts.getBlockers?.() ?? [];
const isPushOrReplace = actionInfo.type === "PUSH" || actionInfo.type === "REPLACE";
if (typeof document !== "undefined" && blockers.length && isPushOrReplace) for (const blocker of blockers) {
const nextLocation = parseHref(actionInfo.path, actionInfo.state);
if (await blocker.blockerFn({
currentLocation: location,
nextLocation,
action: actionInfo.type
})) {
opts.onBlocked?.();
return;
}
}
task();
};
return {
get location() {
return location;
},
get length() {
return opts.getLength();
},
subscribers,
subscribe: (cb) => {
subscribers.add(cb);
return () => {
subscribers.delete(cb);
};
},
push: (path, state, navigateOpts) => {
const currentIndex = location.state[stateIndexKey];
state = assignKeyAndIndex(currentIndex + 1, state);
tryNavigation({
task: () => {
opts.pushState(path, state);
notify({ type: "PUSH" });
},
navigateOpts,
type: "PUSH",
path,
state
});
},
replace: (path, state, navigateOpts) => {
const currentIndex = location.state[stateIndexKey];
state = assignKeyAndIndex(currentIndex, state);
tryNavigation({
task: () => {
opts.replaceState(path, state);
notify({ type: "REPLACE" });
},
navigateOpts,
type: "REPLACE",
path,
state
});
},
go: (index, navigateOpts) => {
tryNavigation({
task: () => {
opts.go(index);
handleIndexChange({
type: "GO",
index
});
},
navigateOpts,
type: "GO"
});
},
back: (navigateOpts) => {
tryNavigation({
task: () => {
opts.back(navigateOpts?.ignoreBlocker ?? false);
handleIndexChange({ type: "BACK" });
},
navigateOpts,
type: "BACK"
});
},
forward: (navigateOpts) => {
tryNavigation({
task: () => {
opts.forward(navigateOpts?.ignoreBlocker ?? false);
handleIndexChange({ type: "FORWARD" });
},
navigateOpts,
type: "FORWARD"
});
},
canGoBack: () => location.state[stateIndexKey] !== 0,
createHref: (str) => opts.createHref(str),
block: (blocker) => {
if (!opts.setBlockers) return () => {};
const blockers = opts.getBlockers?.() ?? [];
opts.setBlockers([...blockers, blocker]);
return () => {
const blockers = opts.getBlockers?.() ?? [];
opts.setBlockers?.(blockers.filter((b) => b !== blocker));
};
},
flush: () => opts.flush?.(),
destroy: () => opts.destroy?.(),
notify
};
}
function assignKeyAndIndex(index, state) {
if (!state) state = {};
const key = createRandomKey();
return {
...state,
key,
__TSR_key: key,
[stateIndexKey]: index
};
}
/**
* Creates a history object that can be used to interact with the browser's
* navigation. This is a lightweight API wrapping the browser's native methods.
* It is designed to work with TanStack Router, but could be used as a standalone API as well.
* IMPORTANT: This API implements history throttling via a microtask to prevent
* excessive calls to the history API. In some browsers, calling history.pushState or
* history.replaceState in quick succession can cause the browser to ignore subsequent
* calls. This API smooths out those differences and ensures that your application
* state will *eventually* match the browser state. In most cases, this is not a problem,
* but if you need to ensure that the browser state is up to date, you can use the
* `history.flush` method to immediately flush all pending state changes to the browser URL.
* @param opts
* @param opts.getHref A function that returns the current href (path + search + hash)
* @param opts.createHref A function that takes a path and returns a href (path + search + hash)
* @returns A history instance
*/
function createBrowserHistory(opts) {
const win = opts?.window ?? (typeof document !== "undefined" ? window : void 0);
const originalPushState = win.history.pushState;
const originalReplaceState = win.history.replaceState;
let blockers = [];
const _getBlockers = () => blockers;
const _setBlockers = (newBlockers) => blockers = newBlockers;
const createHref = opts?.createHref ?? ((path) => path);
const parseLocation = opts?.parseLocation ?? (() => parseHref(`${win.location.pathname}${win.location.search}${win.location.hash}`, win.history.state));
if (!win.history.state?.__TSR_key && !win.history.state?.key) {
const addedKey = createRandomKey();
win.history.replaceState({
[stateIndexKey]: 0,
key: addedKey,
__TSR_key: addedKey
}, "");
}
let currentLocation = parseLocation();
let rollbackLocation;
let nextPopIsGo = false;
let ignoreNextPop = false;
let skipBlockerNextPop = false;
let ignoreNextBeforeUnload = false;
const getLocation = () => currentLocation;
let next;
let scheduled;
const flush = () => {
if (!next) return;
history._ignoreSubscribers = true;
(next.isPush ? win.history.pushState : win.history.replaceState)(next.state, "", next.href);
history._ignoreSubscribers = false;
next = void 0;
scheduled = void 0;
rollbackLocation = void 0;
};
const queueHistoryAction = (type, destHref, state) => {
const href = createHref(destHref);
if (!scheduled) rollbackLocation = currentLocation;
currentLocation = parseHref(destHref, state);
next = {
href,
state,
isPush: next?.isPush || type === "push"
};
if (!scheduled) scheduled = Promise.resolve().then(() => flush());
};
const onPushPop = (type) => {
currentLocation = parseLocation();
history.notify({ type });
};
const onPushPopEvent = async () => {
if (ignoreNextPop) {
ignoreNextPop = false;
return;
}
const nextLocation = parseLocation();
const delta = nextLocation.state[stateIndexKey] - currentLocation.state[stateIndexKey];
const isForward = delta === 1;
const isBack = delta === -1;
const isGo = !isForward && !isBack || nextPopIsGo;
nextPopIsGo = false;
const action = isGo ? "GO" : isBack ? "BACK" : "FORWARD";
const notify = isGo ? {
type: "GO",
index: delta
} : { type: isBack ? "BACK" : "FORWARD" };
if (skipBlockerNextPop) skipBlockerNextPop = false;
else {
const blockers = _getBlockers();
if (typeof document !== "undefined" && blockers.length) {
for (const blocker of blockers) if (await blocker.blockerFn({
currentLocation,
nextLocation,
action
})) {
ignoreNextPop = true;
win.history.go(1);
history.notify(notify);
return;
}
}
}
currentLocation = parseLocation();
history.notify(notify);
};
const onBeforeUnload = (e) => {
if (ignoreNextBeforeUnload) {
ignoreNextBeforeUnload = false;
return;
}
let shouldBlock = false;
const blockers = _getBlockers();
if (typeof document !== "undefined" && blockers.length) for (const blocker of blockers) {
const shouldHaveBeforeUnload = blocker.enableBeforeUnload ?? true;
if (shouldHaveBeforeUnload === true) {
shouldBlock = true;
break;
}
if (typeof shouldHaveBeforeUnload === "function" && shouldHaveBeforeUnload() === true) {
shouldBlock = true;
break;
}
}
if (shouldBlock) {
e.preventDefault();
return e.returnValue = "";
}
};
const history = createHistory({
getLocation,
getLength: () => win.history.length,
pushState: (href, state) => queueHistoryAction("push", href, state),
replaceState: (href, state) => queueHistoryAction("replace", href, state),
back: (ignoreBlocker) => {
if (ignoreBlocker) skipBlockerNextPop = true;
ignoreNextBeforeUnload = true;
return win.history.back();
},
forward: (ignoreBlocker) => {
if (ignoreBlocker) skipBlockerNextPop = true;
ignoreNextBeforeUnload = true;
win.history.forward();
},
go: (n) => {
nextPopIsGo = true;
win.history.go(n);
},
createHref: (href) => createHref(href),
flush,
destroy: () => {
win.history.pushState = originalPushState;
win.history.replaceState = originalReplaceState;
win.removeEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });
win.removeEventListener(popStateEvent, onPushPopEvent);
},
onBlocked: () => {
if (rollbackLocation && currentLocation !== rollbackLocation) currentLocation = rollbackLocation;
},
getBlockers: _getBlockers,
setBlockers: _setBlockers,
notifyOnIndexChange: false
});
win.addEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });
win.addEventListener(popStateEvent, onPushPopEvent);
win.history.pushState = function(...args) {
const res = originalPushState.apply(win.history, args);
if (!history._ignoreSubscribers) onPushPop("PUSH");
return res;
};
win.history.replaceState = function(...args) {
const res = originalReplaceState.apply(win.history, args);
if (!history._ignoreSubscribers) onPushPop("REPLACE");
return res;
};
return history;
}
/**
* Create a hash-based history implementation.
* Useful for static hosts or environments without server URL rewriting.
* @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types
*/
function createHashHistory(opts) {
const win = opts?.window ?? (typeof document !== "undefined" ? window : void 0);
return createBrowserHistory({
window: win,
parseLocation: () => {
const hashSplit = win.location.hash.split("#").slice(1);
const pathPart = hashSplit[0] ?? "/";
const searchPart = win.location.search;
const hashEntries = hashSplit.slice(1);
return parseHref(`${pathPart}${searchPart}${hashEntries.length === 0 ? "" : `#${hashEntries.join("#")}`}`, win.history.state);
},
createHref: (href) => `${win.location.pathname}${win.location.search}#${href}`
});
}
/**
* Create an in-memory history implementation.
* Ideal for server rendering, tests, and non-DOM environments.
* @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types
*/
function createMemoryHistory(opts = { initialEntries: ["/"] }) {
const entries = opts.initialEntries;
let index = opts.initialIndex ? Math.min(Math.max(opts.initialIndex, 0), entries.length - 1) : entries.length - 1;
const states = entries.map((_entry, index) => assignKeyAndIndex(index, void 0));
const getLocation = () => parseHref(entries[index], states[index]);
let blockers = [];
const _getBlockers = () => blockers;
const _setBlockers = (newBlockers) => blockers = newBlockers;
return createHistory({
getLocation,
getLength: () => entries.length,
pushState: (path, state) => {
if (index < entries.length - 1) {
entries.splice(index + 1);
states.splice(index + 1);
}
states.push(state);
entries.push(path);
index = Math.max(entries.length - 1, 0);
},
replaceState: (path, state) => {
states[index] = state;
entries[index] = path;
},
back: () => {
index = Math.max(index - 1, 0);
},
forward: () => {
index = Math.min(index + 1, entries.length - 1);
},
go: (n) => {
index = Math.min(Math.max(index + n, 0), entries.length - 1);
},
createHref: (path) => path,
getBlockers: _getBlockers,
setBlockers: _setBlockers
});
}
/**
* Sanitize a path to prevent open redirect vulnerabilities.
* Removes control characters and collapses leading double slashes.
*/
function sanitizePath(path) {
let sanitized = path.replace(/[\x00-\x1f\x7f]/g, "");
if (sanitized.startsWith("//")) sanitized = "/" + sanitized.replace(/^\/+/, "");
return sanitized;
}
function parseHref(href, state) {
const sanitizedHref = sanitizePath(href);
const hashIndex = sanitizedHref.indexOf("#");
const searchIndex = sanitizedHref.indexOf("?");
const addedKey = createRandomKey();
return {
href: sanitizedHref,
pathname: sanitizedHref.substring(0, hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : sanitizedHref.length),
hash: hashIndex > -1 ? sanitizedHref.substring(hashIndex) : "",
search: searchIndex > -1 ? sanitizedHref.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : "",
state: state || {
[stateIndexKey]: 0,
key: addedKey,
__TSR_key: addedKey
}
};
}
function createRandomKey() {
return (Math.random() + 1).toString(36).substring(7);
}
//#endregion
export { createBrowserHistory, createHashHistory, createHistory, createMemoryHistory, parseHref };
//# sourceMappingURL=index.js.map
@@ -0,0 +1,406 @@
import { computePosition, arrow as arrow$2, autoPlacement as autoPlacement$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1 } from '@floating-ui/dom';
export { autoUpdate, computePosition, detectOverflow, getOverflowAncestors, platform } from '@floating-ui/dom';
import * as React from 'react';
import { useLayoutEffect } from 'react';
import * as ReactDOM from 'react-dom';
var isClient = typeof document !== 'undefined';
var noop = function noop() {};
var index = isClient ? useLayoutEffect : noop;
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
// functions
function deepEqual(a, b) {
if (a === b) {
return true;
}
if (typeof a !== typeof b) {
return false;
}
if (typeof a === 'function' && a.toString() === b.toString()) {
return true;
}
let length;
let i;
let keys;
if (a && b && typeof a === 'object') {
if (Array.isArray(a)) {
length = a.length;
if (length !== b.length) return false;
for (i = length; i-- !== 0;) {
if (!deepEqual(a[i], b[i])) {
return false;
}
}
return true;
}
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) {
return false;
}
for (i = length; i-- !== 0;) {
if (!{}.hasOwnProperty.call(b, keys[i])) {
return false;
}
}
for (i = length; i-- !== 0;) {
const key = keys[i];
if (key === '_owner' && a.$$typeof) {
continue;
}
if (!deepEqual(a[key], b[key])) {
return false;
}
}
return true;
}
return a !== a && b !== b;
}
function getDPR(element) {
if (typeof window === 'undefined') {
return 1;
}
const win = element.ownerDocument.defaultView || window;
return win.devicePixelRatio || 1;
}
function roundByDPR(element, value) {
const dpr = getDPR(element);
return Math.round(value * dpr) / dpr;
}
function useLatestRef(value) {
const ref = React.useRef(value);
index(() => {
ref.current = value;
});
return ref;
}
/**
* Provides data to position a floating element.
* @see https://floating-ui.com/docs/useFloating
*/
function useFloating(options) {
if (options === void 0) {
options = {};
}
const {
placement = 'bottom',
strategy = 'absolute',
middleware = [],
platform,
elements: {
reference: externalReference,
floating: externalFloating
} = {},
transform = true,
whileElementsMounted,
open
} = options;
const [data, setData] = React.useState({
x: 0,
y: 0,
strategy,
placement,
middlewareData: {},
isPositioned: false
});
const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);
if (!deepEqual(latestMiddleware, middleware)) {
setLatestMiddleware(middleware);
}
const [_reference, _setReference] = React.useState(null);
const [_floating, _setFloating] = React.useState(null);
const setReference = React.useCallback(node => {
if (node !== referenceRef.current) {
referenceRef.current = node;
_setReference(node);
}
}, []);
const setFloating = React.useCallback(node => {
if (node !== floatingRef.current) {
floatingRef.current = node;
_setFloating(node);
}
}, []);
const referenceEl = externalReference || _reference;
const floatingEl = externalFloating || _floating;
const referenceRef = React.useRef(null);
const floatingRef = React.useRef(null);
const dataRef = React.useRef(data);
const hasWhileElementsMounted = whileElementsMounted != null;
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
const platformRef = useLatestRef(platform);
const openRef = useLatestRef(open);
const update = React.useCallback(() => {
if (!referenceRef.current || !floatingRef.current) {
return;
}
const config = {
placement,
strategy,
middleware: latestMiddleware
};
if (platformRef.current) {
config.platform = platformRef.current;
}
computePosition(referenceRef.current, floatingRef.current, config).then(data => {
const fullData = {
...data,
// The floating element's position may be recomputed while it's closed
// but still mounted (such as when transitioning out). To ensure
// `isPositioned` will be `false` initially on the next open, avoid
// setting it to `true` when `open === false` (must be specified).
isPositioned: openRef.current !== false
};
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
dataRef.current = fullData;
ReactDOM.flushSync(() => {
setData(fullData);
});
}
});
}, [latestMiddleware, placement, strategy, platformRef, openRef]);
index(() => {
if (open === false && dataRef.current.isPositioned) {
dataRef.current.isPositioned = false;
setData(data => ({
...data,
isPositioned: false
}));
}
}, [open]);
const isMountedRef = React.useRef(false);
index(() => {
isMountedRef.current = true;
return () => {
isMountedRef.current = false;
};
}, []);
index(() => {
if (referenceEl) referenceRef.current = referenceEl;
if (floatingEl) floatingRef.current = floatingEl;
if (referenceEl && floatingEl) {
if (whileElementsMountedRef.current) {
return whileElementsMountedRef.current(referenceEl, floatingEl, update);
}
update();
}
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
const refs = React.useMemo(() => ({
reference: referenceRef,
floating: floatingRef,
setReference,
setFloating
}), [setReference, setFloating]);
const elements = React.useMemo(() => ({
reference: referenceEl,
floating: floatingEl
}), [referenceEl, floatingEl]);
const floatingStyles = React.useMemo(() => {
const initialStyles = {
position: strategy,
left: 0,
top: 0
};
if (!elements.floating) {
return initialStyles;
}
const x = roundByDPR(elements.floating, data.x);
const y = roundByDPR(elements.floating, data.y);
if (transform) {
return {
...initialStyles,
transform: "translate(" + x + "px, " + y + "px)",
...(getDPR(elements.floating) >= 1.5 && {
willChange: 'transform'
})
};
}
return {
position: strategy,
left: x,
top: y
};
}, [strategy, transform, elements.floating, data.x, data.y]);
return React.useMemo(() => ({
...data,
update,
refs,
elements,
floatingStyles
}), [data, update, refs, elements, floatingStyles]);
}
/**
* Provides data to position an inner element of the floating element so that it
* appears centered to the reference element.
* This wraps the core `arrow` middleware to allow React refs as the element.
* @see https://floating-ui.com/docs/arrow
*/
const arrow$1 = options => {
function isRef(value) {
return {}.hasOwnProperty.call(value, 'current');
}
return {
name: 'arrow',
options,
fn(state) {
const {
element,
padding
} = typeof options === 'function' ? options(state) : options;
if (element && isRef(element)) {
if (element.current != null) {
return arrow$2({
element: element.current,
padding
}).fn(state);
}
return {};
}
if (element) {
return arrow$2({
element,
padding
}).fn(state);
}
return {};
}
};
};
/**
* Modifies the placement by translating the floating element along the
* specified axes.
* A number (shorthand for `mainAxis` or distance), or an axes configuration
* object may be passed.
* @see https://floating-ui.com/docs/offset
*/
const offset = (options, deps) => {
const result = offset$1(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
/**
* Optimizes the visibility of the floating element by shifting it in order to
* keep it in view when it will overflow the clipping boundary.
* @see https://floating-ui.com/docs/shift
*/
const shift = (options, deps) => {
const result = shift$1(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
/**
* Built-in `limiter` that will stop `shift()` at a certain point.
*/
const limitShift = (options, deps) => {
const result = limitShift$1(options);
return {
fn: result.fn,
options: [options, deps]
};
};
/**
* Optimizes the visibility of the floating element by flipping the `placement`
* in order to keep it in view when the preferred placement(s) will overflow the
* clipping boundary. Alternative to `autoPlacement`.
* @see https://floating-ui.com/docs/flip
*/
const flip = (options, deps) => {
const result = flip$1(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
/**
* Provides data that allows you to change the size of the floating element —
* for instance, prevent it from overflowing the clipping boundary or match the
* width of the reference element.
* @see https://floating-ui.com/docs/size
*/
const size = (options, deps) => {
const result = size$1(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
/**
* Optimizes the visibility of the floating element by choosing the placement
* that has the most space available automatically, without needing to specify a
* preferred placement. Alternative to `flip`.
* @see https://floating-ui.com/docs/autoPlacement
*/
const autoPlacement = (options, deps) => {
const result = autoPlacement$1(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
/**
* Provides data to hide the floating element in applicable situations, such as
* when it is not in the same clipping context as the reference element.
* @see https://floating-ui.com/docs/hide
*/
const hide = (options, deps) => {
const result = hide$1(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
/**
* Provides improved positioning for inline reference elements that can span
* over multiple lines, such as hyperlinks or range selections.
* @see https://floating-ui.com/docs/inline
*/
const inline = (options, deps) => {
const result = inline$1(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
/**
* Provides data to position an inner element of the floating element so that it
* appears centered to the reference element.
* This wraps the core `arrow` middleware to allow React refs as the element.
* @see https://floating-ui.com/docs/arrow
*/
const arrow = (options, deps) => {
const result = arrow$1(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
export { arrow, autoPlacement, flip, hide, inline, limitShift, offset, shift, size, useFloating };
@@ -0,0 +1,145 @@
import Option from "./Option.ts";
export const removeBrackets = (v: string) => v.replace(/[<[].+/, '').trim();
export const findAllBrackets = (v: string) => {
const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g;
const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g;
const res = [];
const parse = (match: string[]) => {
let variadic = false;
let value = match[1];
if (value.startsWith('...')) {
value = value.slice(3);
variadic = true;
}
return {
required: match[0].startsWith('<'),
value,
variadic
};
};
let angledMatch;
while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v)) {
res.push(parse(angledMatch));
}
let squareMatch;
while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v)) {
res.push(parse(squareMatch));
}
return res;
};
interface MriOptions {
alias: {
[k: string]: string[];
};
boolean: string[];
}
export const getMriOptions = (options: Option[]) => {
const result: MriOptions = {
alias: {},
boolean: []
};
for (const [index, option] of options.entries()) {
// We do not set default values in mri options
// Since its type (typeof) will be used to cast parsed arguments.
// Which mean `--foo foo` will be parsed as `{foo: true}` if we have `{default:{foo: true}}`
// Set alias
if (option.names.length > 1) {
result.alias[option.names[0]] = option.names.slice(1);
} // Set boolean
if (option.isBoolean) {
if (option.negated) {
// For negated option
// We only set it to `boolean` type when there's no string-type option with the same name
const hasStringTypeOption = options.some((o, i) => {
return i !== index && o.names.some(name => option.names.includes(name)) && typeof o.required === 'boolean';
});
if (!hasStringTypeOption) {
result.boolean.push(option.names[0]);
}
} else {
result.boolean.push(option.names[0]);
}
}
}
return result;
};
export const findLongest = (arr: string[]) => {
return arr.sort((a, b) => {
return a.length > b.length ? -1 : 1;
})[0];
};
export const padRight = (str: string, length: number) => {
return str.length >= length ? str : `${str}${' '.repeat(length - str.length)}`;
};
export const camelcase = (input: string) => {
return input.replace(/([a-z])-([a-z])/g, (_, p1, p2) => {
return p1 + p2.toUpperCase();
});
};
export const setDotProp = (obj: {
[k: string]: any;
}, keys: string[], val: any) => {
let i = 0;
let length = keys.length;
let t = obj;
let x;
for (; i < length; ++i) {
x = t[keys[i]];
t = t[keys[i]] = i === length - 1 ? val : x != null ? x : !!~keys[i + 1].indexOf('.') || !(+keys[i + 1] > -1) ? {} : [];
}
};
export const setByType = (obj: {
[k: string]: any;
}, transforms: {
[k: string]: any;
}) => {
for (const key of Object.keys(transforms)) {
const transform = transforms[key];
if (transform.shouldTransform) {
obj[key] = Array.prototype.concat.call([], obj[key]);
if (typeof transform.transformFunction === 'function') {
obj[key] = obj[key].map(transform.transformFunction);
}
}
}
};
export const getFileName = (input: string) => {
const m = /([^\\\/]+)$/.exec(input);
return m ? m[1] : '';
};
export const camelcaseOptionName = (name: string) => {
// Camelcase the option name
// Don't camelcase anything after the dot `.`
return name.split('.').map((v, i) => {
return i === 0 ? camelcase(v) : v;
}).join('.');
};
export class CACError extends Error {
constructor(message: string) {
super(message);
this.name = this.constructor.name;
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = new Error(message).stack;
}
}
}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","2":"FD","8":"L","132":"_RJ"},B:{"1":"_J"},C:{"1":"_tC","2":"_g"},D:{"1":"_Q"},E:{"1":"_vG","2":"MD"},F:{"1":"_oB","2":"F"},G:{"1":"_M"},H:{"1":"1D"},I:{"1":"_P"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:2,C:"CSS3 selectors",D:true};
@@ -0,0 +1 @@
var l=Object.defineProperty;var i=(n,r)=>l(n,"name",{value:r,configurable:!0});import{r as a}from"./get-pipe-path-BHW2eJdv.mjs";import{constants as f}from"node:os";import{isMainThread as d}from"node:worker_threads";import{c as u}from"./client-BQVF1NaW.mjs";import"./suppress-warnings.mjs";import"module";import"node:path";import"./temporary-directory-CwHp0_NW.mjs";import"node:net";const m=i((n,r)=>{const o=new Map;for(const e of n){const t=i(s=>{r(s),process.listenerCount(e)===0&&process.exit(128+f.signals[e])},"hiddenHandler");process.on(e,t),o.set(e,t)}const{listenerCount:c,listeners:p}=process;process.listenerCount=function(e){let t=Reflect.apply(c,this,arguments);return n.includes(e)&&(t-=1),t},process.listeners=function(e){const t=Reflect.apply(p,this,arguments);return n.includes(e)?t.filter(s=>s!==o.get(e)):t}},"bindHiddenSignalsHandler");d&&(a("./cjs/index.cjs"),(async()=>{const n=await u;n&&m(["SIGINT","SIGTERM"],r=>{n({type:"signal",signal:r})})})());
@@ -0,0 +1,11 @@
# Rolldown
> Fast Rust-based bundler for JavaScript with Rollup-compatible API
- ⚡️ Lightning Fast Performance
- 🔌 Rollup-Compatible APIs
- ⏩ esbuild Feature Parity
Rolldown is primarily designed to serve as the underlying bundler in [Vite](https://vite.dev/), with the goal to replace esbuild and Rollup with one unified build tool. Although designed for Vite, Rolldown is also fully capable of being used as a standalone, general-purpose bundler. It can serve as a drop-in replacement for Rollup in most cases, and can also be used as an esbuild alternative when better chunking control is needed.
[Read the Docs to Learn More](https://rolldown.rs).
@@ -0,0 +1,20 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference lib="es5" />
/// <reference lib="dom" />
/// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" />
@@ -0,0 +1,472 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference lib="es2018.intl" />
declare namespace Intl {
/**
* A string that is a valid [Unicode BCP 47 Locale Identifier](https://unicode.org/reports/tr35/#Unicode_locale_identifier).
*
* For example: "fa", "es-MX", "zh-Hant-TW".
*
* See [MDN - Intl - locales argument](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
*/
type UnicodeBCP47LocaleIdentifier = string;
/**
* Unit to use in the relative time internationalized message.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/format#Parameters).
*/
type RelativeTimeFormatUnit =
| "year"
| "years"
| "quarter"
| "quarters"
| "month"
| "months"
| "week"
| "weeks"
| "day"
| "days"
| "hour"
| "hours"
| "minute"
| "minutes"
| "second"
| "seconds";
/**
* Value of the `unit` property in objects returned by
* `Intl.RelativeTimeFormat.prototype.formatToParts()`. `formatToParts` and
* `format` methods accept either singular or plural unit names as input,
* but `formatToParts` only outputs singular (e.g. "day") not plural (e.g.
* "days").
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts).
*/
type RelativeTimeFormatUnitSingular =
| "year"
| "quarter"
| "month"
| "week"
| "day"
| "hour"
| "minute"
| "second";
/**
* The locale matching algorithm to use.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).
*/
type RelativeTimeFormatLocaleMatcher = "lookup" | "best fit";
/**
* The format of output message.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters).
*/
type RelativeTimeFormatNumeric = "always" | "auto";
/**
* The length of the internationalized message.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters).
*/
type RelativeTimeFormatStyle = "long" | "short" | "narrow";
/**
* The locale or locales to use
*
* See [MDN - Intl - locales argument](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
*/
type LocalesArgument = UnicodeBCP47LocaleIdentifier | Locale | readonly (UnicodeBCP47LocaleIdentifier | Locale)[] | undefined;
/**
* An object with some or all of properties of `options` parameter
* of `Intl.RelativeTimeFormat` constructor.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters).
*/
interface RelativeTimeFormatOptions {
/** The locale matching algorithm to use. For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation). */
localeMatcher?: RelativeTimeFormatLocaleMatcher;
/** The format of output message. */
numeric?: RelativeTimeFormatNumeric;
/** The length of the internationalized message. */
style?: RelativeTimeFormatStyle;
}
/**
* An object with properties reflecting the locale
* and formatting options computed during initialization
* of the `Intl.RelativeTimeFormat` object
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions#Description).
*/
interface ResolvedRelativeTimeFormatOptions {
locale: UnicodeBCP47LocaleIdentifier;
style: RelativeTimeFormatStyle;
numeric: RelativeTimeFormatNumeric;
numberingSystem: string;
}
/**
* An object representing the relative time format in parts
* that can be used for custom locale-aware formatting.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts).
*/
type RelativeTimeFormatPart =
| {
type: "literal";
value: string;
}
| {
type: Exclude<NumberFormatPartTypes, "literal">;
value: string;
unit: RelativeTimeFormatUnitSingular;
};
interface RelativeTimeFormat {
/**
* Formats a value and a unit according to the locale
* and formatting options of the given
* [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat)
* object.
*
* While this method automatically provides the correct plural forms,
* the grammatical form is otherwise as neutral as possible.
*
* It is the caller's responsibility to handle cut-off logic
* such as deciding between displaying "in 7 days" or "in 1 week".
* This API does not support relative dates involving compound units.
* e.g "in 5 days and 4 hours".
*
* @param value - Numeric value to use in the internationalized relative time message
*
* @param unit - [Unit](https://tc39.es/ecma402/#sec-singularrelativetimeunit) to use in the relative time internationalized message.
*
* @throws `RangeError` if `unit` was given something other than `unit` possible values
*
* @returns {string} Internationalized relative time message as string
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/format).
*/
format(value: number, unit: RelativeTimeFormatUnit): string;
/**
* Returns an array of objects representing the relative time format in parts that can be used for custom locale-aware formatting.
*
* @param value - Numeric value to use in the internationalized relative time message
*
* @param unit - [Unit](https://tc39.es/ecma402/#sec-singularrelativetimeunit) to use in the relative time internationalized message.
*
* @throws `RangeError` if `unit` was given something other than `unit` possible values
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts).
*/
formatToParts(value: number, unit: RelativeTimeFormatUnit): RelativeTimeFormatPart[];
/**
* Provides access to the locale and options computed during initialization of this `Intl.RelativeTimeFormat` object.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions).
*/
resolvedOptions(): ResolvedRelativeTimeFormatOptions;
}
/**
* The [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat)
* object is a constructor for objects that enable language-sensitive relative time formatting.
*
* [Compatibility](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat#Browser_compatibility).
*/
const RelativeTimeFormat: {
/**
* Creates [Intl.RelativeTimeFormat](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat) objects
*
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
* For the general form and interpretation of the locales argument,
* see the [`Intl` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
*
* @param options - An [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters)
* with some or all of options of `RelativeTimeFormatOptions`.
*
* @returns [Intl.RelativeTimeFormat](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat) object.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat).
*/
new (
locales?: LocalesArgument,
options?: RelativeTimeFormatOptions,
): RelativeTimeFormat;
/**
* Returns an array containing those of the provided locales
* that are supported in date and time formatting
* without having to fall back to the runtime's default locale.
*
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
* For the general form and interpretation of the locales argument,
* see the [`Intl` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
*
* @param options - An [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters)
* with some or all of options of the formatting.
*
* @returns An array containing those of the provided locales
* that are supported in date and time formatting
* without having to fall back to the runtime's default locale.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf).
*/
supportedLocalesOf(
locales?: LocalesArgument,
options?: RelativeTimeFormatOptions,
): UnicodeBCP47LocaleIdentifier[];
};
interface NumberFormatOptionsStyleRegistry {
unit: never;
}
interface NumberFormatOptionsCurrencyDisplayRegistry {
narrowSymbol: never;
}
interface NumberFormatOptionsSignDisplayRegistry {
auto: never;
never: never;
always: never;
exceptZero: never;
}
type NumberFormatOptionsSignDisplay = keyof NumberFormatOptionsSignDisplayRegistry;
interface NumberFormatOptions {
numberingSystem?: string | undefined;
compactDisplay?: "short" | "long" | undefined;
notation?: "standard" | "scientific" | "engineering" | "compact" | undefined;
signDisplay?: NumberFormatOptionsSignDisplay | undefined;
unit?: string | undefined;
unitDisplay?: "short" | "long" | "narrow" | undefined;
currencySign?: "standard" | "accounting" | undefined;
}
interface ResolvedNumberFormatOptions {
compactDisplay?: "short" | "long";
notation: "standard" | "scientific" | "engineering" | "compact";
signDisplay: NumberFormatOptionsSignDisplay;
unit?: string;
unitDisplay?: "short" | "long" | "narrow";
currencySign?: "standard" | "accounting";
}
interface NumberFormatPartTypeRegistry {
compact: never;
exponentInteger: never;
exponentMinusSign: never;
exponentSeparator: never;
unit: never;
unknown: never;
}
interface DateTimeFormatOptions {
calendar?: string | undefined;
dayPeriod?: "narrow" | "short" | "long" | undefined;
numberingSystem?: string | undefined;
dateStyle?: "full" | "long" | "medium" | "short" | undefined;
timeStyle?: "full" | "long" | "medium" | "short" | undefined;
hourCycle?: "h11" | "h12" | "h23" | "h24" | undefined;
}
type LocaleHourCycleKey = "h12" | "h23" | "h11" | "h24";
type LocaleCollationCaseFirst = "upper" | "lower" | "false";
interface LocaleOptions {
/** A string containing the language, and the script and region if available. */
baseName?: string;
/** The part of the Locale that indicates the locale's calendar era. */
calendar?: string;
/** Flag that defines whether case is taken into account for the locale's collation rules. */
caseFirst?: LocaleCollationCaseFirst;
/** The collation type used for sorting */
collation?: string;
/** The time keeping format convention used by the locale. */
hourCycle?: LocaleHourCycleKey;
/** The primary language subtag associated with the locale. */
language?: string;
/** The numeral system used by the locale. */
numberingSystem?: string;
/** Flag that defines whether the locale has special collation handling for numeric characters. */
numeric?: boolean;
/** The region of the world (usually a country) associated with the locale. Possible values are region codes as defined by ISO 3166-1. */
region?: string;
/** The script used for writing the particular language used in the locale. Possible values are script codes as defined by ISO 15924. */
script?: string;
}
interface Locale extends LocaleOptions {
/** A string containing the language, and the script and region if available. */
baseName: string;
/** The primary language subtag associated with the locale. */
language: string;
/** Gets the most likely values for the language, script, and region of the locale based on existing values. */
maximize(): Locale;
/** Attempts to remove information about the locale that would be added by calling `Locale.maximize()`. */
minimize(): Locale;
/** Returns the locale's full locale identifier string. */
toString(): UnicodeBCP47LocaleIdentifier;
}
/**
* Constructor creates [Intl.Locale](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale)
* objects
*
* @param tag - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646).
* For the general form and interpretation of the locales argument,
* see the [`Intl` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
*
* @param options - An [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/Locale#Parameters) with some or all of options of the locale.
*
* @returns [Intl.Locale](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) object.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale).
*/
const Locale: {
new (tag: UnicodeBCP47LocaleIdentifier | Locale, options?: LocaleOptions): Locale;
};
type DisplayNamesFallback =
| "code"
| "none";
type DisplayNamesType =
| "language"
| "region"
| "script"
| "calendar"
| "dateTimeField"
| "currency";
type DisplayNamesLanguageDisplay =
| "dialect"
| "standard";
interface DisplayNamesOptions {
localeMatcher?: RelativeTimeFormatLocaleMatcher;
style?: RelativeTimeFormatStyle;
type: DisplayNamesType;
languageDisplay?: DisplayNamesLanguageDisplay;
fallback?: DisplayNamesFallback;
}
interface ResolvedDisplayNamesOptions {
locale: UnicodeBCP47LocaleIdentifier;
style: RelativeTimeFormatStyle;
type: DisplayNamesType;
fallback: DisplayNamesFallback;
languageDisplay?: DisplayNamesLanguageDisplay;
}
interface DisplayNames {
/**
* Receives a code and returns a string based on the locale and options provided when instantiating
* [`Intl.DisplayNames()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames)
*
* @param code The `code` to provide depends on the `type` passed to display name during creation:
* - If the type is `"region"`, code should be either an [ISO-3166 two letters region code](https://www.iso.org/iso-3166-country-codes.html),
* or a [three digits UN M49 Geographic Regions](https://unstats.un.org/unsd/methodology/m49/).
* - If the type is `"script"`, code should be an [ISO-15924 four letters script code](https://unicode.org/iso15924/iso15924-codes.html).
* - If the type is `"language"`, code should be a `languageCode` ["-" `scriptCode`] ["-" `regionCode` ] *("-" `variant` )
* subsequence of the unicode_language_id grammar in [UTS 35's Unicode Language and Locale Identifiers grammar](https://unicode.org/reports/tr35/#Unicode_language_identifier).
* `languageCode` is either a two letters ISO 639-1 language code or a three letters ISO 639-2 language code.
* - If the type is `"currency"`, code should be a [3-letter ISO 4217 currency code](https://www.iso.org/iso-4217-currency-codes.html).
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/of).
*/
of(code: string): string | undefined;
/**
* Returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current
* [`Intl/DisplayNames`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames) object.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/resolvedOptions).
*/
resolvedOptions(): ResolvedDisplayNamesOptions;
}
/**
* The [`Intl.DisplayNames()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames)
* object enables the consistent translation of language, region and script display names.
*
* [Compatibility](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames#browser_compatibility).
*/
const DisplayNames: {
prototype: DisplayNames;
/**
* @param locales A string with a BCP 47 language tag, or an array of such strings.
* For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)
* page.
*
* @param options An object for setting up a display name.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames).
*/
new (locales: LocalesArgument, options: DisplayNamesOptions): DisplayNames;
/**
* Returns an array containing those of the provided locales that are supported in display names without having to fall back to the runtime's default locale.
*
* @param locales A string with a BCP 47 language tag, or an array of such strings.
* For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)
* page.
*
* @param options An object with a locale matcher.
*
* @returns An array of strings representing a subset of the given locale tags that are supported in display names without having to fall back to the runtime's default locale.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
*/
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
};
interface CollatorConstructor {
new (locales?: LocalesArgument, options?: CollatorOptions): Collator;
(locales?: LocalesArgument, options?: CollatorOptions): Collator;
supportedLocalesOf(locales: LocalesArgument, options?: CollatorOptions): string[];
}
interface DateTimeFormatConstructor {
new (locales?: LocalesArgument, options?: DateTimeFormatOptions): DateTimeFormat;
(locales?: LocalesArgument, options?: DateTimeFormatOptions): DateTimeFormat;
supportedLocalesOf(locales: LocalesArgument, options?: DateTimeFormatOptions): string[];
}
interface NumberFormatConstructor {
new (locales?: LocalesArgument, options?: NumberFormatOptions): NumberFormat;
(locales?: LocalesArgument, options?: NumberFormatOptions): NumberFormat;
supportedLocalesOf(locales: LocalesArgument, options?: NumberFormatOptions): string[];
}
interface PluralRulesConstructor {
new (locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules;
(locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules;
supportedLocalesOf(locales: LocalesArgument, options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
}
}
@@ -0,0 +1,77 @@
import { f as createRule, g as import_ast_utils } from "../utils.js";
var arrow_spacing_default = createRule({
name: "arrow-spacing",
meta: {
type: "layout",
docs: { description: "Enforce consistent spacing before and after the arrow in arrow functions" },
fixable: "whitespace",
schema: [{
type: "object",
properties: {
before: { type: "boolean" },
after: { type: "boolean" }
},
additionalProperties: false
}],
defaultOptions: [{
before: true,
after: true
}],
messages: {
expectedBefore: "Missing space before =>.",
unexpectedBefore: "Unexpected space before =>.",
expectedAfter: "Missing space after =>.",
unexpectedAfter: "Unexpected space after =>."
}
},
create(context, [option]) {
const sourceCode = context.sourceCode;
function getArrow(node) {
if (node.type === "ArrowFunctionExpression") return sourceCode.getTokenBefore(node.body, import_ast_utils.isArrowToken);
else return sourceCode.getFirstToken(node.returnType, import_ast_utils.isArrowToken);
}
function spaces(node) {
const arrowToken = getArrow(node);
const beforeToken = sourceCode.getTokenBefore(arrowToken, { includeComments: true });
const isSpacedBefore = sourceCode.isSpaceBetween(beforeToken, arrowToken);
if (option.before) {
if (!isSpacedBefore) context.report({
node: beforeToken,
messageId: "expectedBefore",
fix(fixer) {
return fixer.insertTextBefore(arrowToken, " ");
}
});
} else if (isSpacedBefore) context.report({
node: beforeToken,
messageId: "unexpectedBefore",
fix(fixer) {
return fixer.removeRange([beforeToken.range[1], arrowToken.range[0]]);
}
});
const afterToken = sourceCode.getTokenAfter(arrowToken, { includeComments: true });
const isSpacedAfter = sourceCode.isSpaceBetween(arrowToken, afterToken);
if (option.after) {
if (!isSpacedAfter) context.report({
node: afterToken,
messageId: "expectedAfter",
fix(fixer) {
return fixer.insertTextAfter(arrowToken, " ");
}
});
} else if (isSpacedAfter) context.report({
node: afterToken,
messageId: "unexpectedAfter",
fix(fixer) {
return fixer.removeRange([arrowToken.range[1], afterToken.range[0]]);
}
});
}
return {
ArrowFunctionExpression: spaces,
TSFunctionType: spaces,
TSConstructorType: spaces
};
}
});
export { arrow_spacing_default as t };
@@ -0,0 +1,103 @@
/**
* License for programmatically and manually incorporated
* documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
*
* Copyright Node.js contributors. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
// NOTE: These definitions support Node.js and TypeScript 5.2 through 5.6.
// Reference required TypeScript libraries:
/// <reference lib="es2020" />
/// <reference lib="esnext.disposable" />
// TypeScript library polyfills required for TypeScript <=5.6:
/// <reference path="./compatibility/float16array.d.ts" />
// Iterator definitions required for compatibility with TypeScript <5.6:
/// <reference path="../compatibility/iterators.d.ts" />
// Definitions for Node.js modules specific to TypeScript <=5.6:
/// <reference path="./globals.typedarray.d.ts" />
/// <reference path="./buffer.buffer.d.ts" />
// Definitions for Node.js modules that are not specific to any version of TypeScript:
/// <reference path="../globals.d.ts" />
/// <reference path="../web-globals/abortcontroller.d.ts" />
/// <reference path="../web-globals/crypto.d.ts" />
/// <reference path="../web-globals/domexception.d.ts" />
/// <reference path="../web-globals/events.d.ts" />
/// <reference path="../web-globals/fetch.d.ts" />
/// <reference path="../web-globals/navigator.d.ts" />
/// <reference path="../web-globals/storage.d.ts" />
/// <reference path="../web-globals/streams.d.ts" />
/// <reference path="../assert.d.ts" />
/// <reference path="../assert/strict.d.ts" />
/// <reference path="../async_hooks.d.ts" />
/// <reference path="../buffer.d.ts" />
/// <reference path="../child_process.d.ts" />
/// <reference path="../cluster.d.ts" />
/// <reference path="../console.d.ts" />
/// <reference path="../constants.d.ts" />
/// <reference path="../crypto.d.ts" />
/// <reference path="../dgram.d.ts" />
/// <reference path="../diagnostics_channel.d.ts" />
/// <reference path="../dns.d.ts" />
/// <reference path="../dns/promises.d.ts" />
/// <reference path="../domain.d.ts" />
/// <reference path="../events.d.ts" />
/// <reference path="../fs.d.ts" />
/// <reference path="../fs/promises.d.ts" />
/// <reference path="../http.d.ts" />
/// <reference path="../http2.d.ts" />
/// <reference path="../https.d.ts" />
/// <reference path="../inspector.d.ts" />
/// <reference path="../inspector.generated.d.ts" />
/// <reference path="../module.d.ts" />
/// <reference path="../net.d.ts" />
/// <reference path="../os.d.ts" />
/// <reference path="../path.d.ts" />
/// <reference path="../perf_hooks.d.ts" />
/// <reference path="../process.d.ts" />
/// <reference path="../punycode.d.ts" />
/// <reference path="../querystring.d.ts" />
/// <reference path="../readline.d.ts" />
/// <reference path="../readline/promises.d.ts" />
/// <reference path="../repl.d.ts" />
/// <reference path="../sea.d.ts" />
/// <reference path="../sqlite.d.ts" />
/// <reference path="../stream.d.ts" />
/// <reference path="../stream/promises.d.ts" />
/// <reference path="../stream/consumers.d.ts" />
/// <reference path="../stream/web.d.ts" />
/// <reference path="../string_decoder.d.ts" />
/// <reference path="../test.d.ts" />
/// <reference path="../timers.d.ts" />
/// <reference path="../timers/promises.d.ts" />
/// <reference path="../tls.d.ts" />
/// <reference path="../trace_events.d.ts" />
/// <reference path="../tty.d.ts" />
/// <reference path="../url.d.ts" />
/// <reference path="../util.d.ts" />
/// <reference path="../v8.d.ts" />
/// <reference path="../vm.d.ts" />
/// <reference path="../wasi.d.ts" />
/// <reference path="../worker_threads.d.ts" />
/// <reference path="../zlib.d.ts" />
@@ -0,0 +1 @@
module.exports={C:{"120":0.08387,"121":0.1898,"154":0.00883,"155":0.00883,"156":0.27367,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 157 158 159 160 3.5 3.6"},D:{"103":0.4723,"104":0.15008,"105":0.18097,"106":0.15008,"107":0.11476,"108":0.23394,"109":0.1589,"110":0.20746,"111":0.16773,"112":0.12359,"114":0.00883,"116":0.30898,"117":0.13242,"118":0.60472,"119":0.14125,"120":0.37519,"124":0.20746,"126":0.03973,"131":0.33105,"133":0.46347,"134":0.08387,"135":0.09269,"136":0.07504,"137":0.08387,"138":0.09269,"139":0.08387,"140":0.12359,"141":0.09269,"142":0.40609,"144":0.09269,"145":0.24277,"146":0.04855,"148":0.38402,"149":0.54734,"150":1.96864,"151":4.22861,"152":7.24337,"153":3.13835,"154":0.30015,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 113 115 121 122 123 125 127 128 129 130 132 143 147 155 156 157"},F:{"101":0.02648,"122":0.00883,"134":0.50761,"135":0.1898,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 123 124 125 126 127 131 132 133 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00883,"119":0.07504,"120":0.07504,"144":0.00883,"145":0.00883,"146":0.01766,"147":0.07504,"148":0.03973,"150":0.16773,"151":0.32222,"152":2.59985,"153":2.3659,"154":0.6312,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 149"},E:{"27":0.29132,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.5 16.0 16.2 17.0 17.3 18.0 18.1 18.2 18.4 26.1 27.1 27.2 TP","15.4":0.00883,"15.6":0.03973,"16.1":0.00883,"16.3":0.04855,"16.4":0.00883,"16.5":0.01766,"16.6":0.45023,"17.1":0.89604,"17.2":0.00883,"17.4":0.07504,"17.5":0.32222,"17.6":2.37473,"18.3":0.04855,"18.5-18.7":0.03973,"26.0":0.01766,"26.2":0.06621,"26.3":0.05738,"26.4":0.06621,"26.5":0.33988,"26.6":2.1761},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00283,"5.0-5.1":0.00283,"6.0-6.1":0,"7.0-7.1":0.00565,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.02827,"11.0-11.2":0.00283,"11.3-11.4":0.00565,"12.0-12.1":0,"12.2-12.5":0.07349,"13.0-13.1":0,"13.2":0.01413,"13.3":0,"13.4-13.7":0.00283,"14.0-14.4":0.01131,"14.5-14.8":0.01696,"15.0-15.1":0.01696,"15.2-15.3":0.01131,"15.4":0.01413,"15.5":0.01696,"15.6-15.8":0.36745,"16.0":0.02827,"16.1":0.05088,"16.2":0.02827,"16.3":0.06218,"16.4":0.01413,"16.5":0.02261,"16.6-16.7":0.51161,"17.0":0.01979,"17.1":0.02827,"17.2":0.02827,"17.3":0.0424,"17.4":0.05936,"17.5":0.11589,"17.6-17.7":0.29962,"18.0":0.06218,"18.1":0.12437,"18.2":0.16959,"18.3":0.29396,"18.4":0.18373,"18.5-18.7":3.79608,"26.0":0.18373,"26.1":0.18655,"26.2":0.48617,"26.3":0.52574,"26.4":0.38441,"26.5":2.575,"26.6":15.88814,"27.0":1.21825,"27.1":0,"27.2":0.03109},P:{"22":0.00972,"23":0.00972,"24":0.01943,"25":0.40813,"26":0.02915,"28":0.11661,"29":0.0583,"30":3.11926,_:"4 20 21 27 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.07774},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.05027,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":26.72309},R:{_:"0"},M:{"0":0.37978},Q:{"14.9":0.01676},O:{_:"0"},H:{all:0}};
@@ -0,0 +1,90 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
import { util } from "../helpers/util.js";
const promSchema = z.promise(
z.object({
name: z.string(),
age: z.number(),
})
);
test("promise inference", () => {
type promSchemaType = z.infer<typeof promSchema>;
util.assertEqual<promSchemaType, Promise<{ name: string; age: number }>>(true);
});
test("promise parsing success", async () => {
const pr = promSchema.parse(Promise.resolve({ name: "Bobby", age: 10 }));
expect(pr).toBeInstanceOf(Promise);
const result = await pr;
expect(typeof result).toBe("object");
expect(typeof result.age).toBe("number");
expect(typeof result.name).toBe("string");
});
test("promise parsing success 2", () => {
const fakePromise = {
then() {
return this;
},
catch() {
return this;
},
};
promSchema.parse(fakePromise);
});
test("promise parsing fail", async () => {
const bad = promSchema.parse(Promise.resolve({ name: "Bobby", age: "10" }));
// return await expect(bad).resolves.toBe({ name: 'Bobby', age: '10' });
return await expect(bad).rejects.toBeInstanceOf(z.ZodError);
// done();
});
test("promise parsing fail 2", async () => {
const failPromise = promSchema.parse(Promise.resolve({ name: "Bobby", age: "10" }));
await expect(failPromise).rejects.toBeInstanceOf(z.ZodError);
// done();/z
});
test("promise parsing fail", () => {
const bad = () => promSchema.parse({ then: () => {}, catch: {} });
expect(bad).toThrow();
});
// test('sync promise parsing', () => {
// expect(() => z.promise(z.string()).parse(Promise.resolve('asfd'))).toThrow();
// });
const asyncFunction = z.function(z.tuple([]), promSchema);
test("async function pass", async () => {
const validatedFunction = asyncFunction.implement(async () => {
return { name: "jimmy", age: 14 };
});
await expect(validatedFunction()).resolves.toEqual({
name: "jimmy",
age: 14,
});
});
test("async function fail", async () => {
const validatedFunction = asyncFunction.implement(() => {
return Promise.resolve("asdf" as any);
});
await expect(validatedFunction()).rejects.toBeInstanceOf(z.ZodError);
});
test("async promise parsing", () => {
const res = z.promise(z.number()).parseAsync(Promise.resolve(12));
expect(res).toBeInstanceOf(Promise);
});
test("resolves", () => {
const foo = z.literal("foo");
const res = z.promise(foo);
expect(res.unwrap()).toEqual(foo);
});
@@ -0,0 +1 @@
{"version":3,"file":"observe.mjs","sources":["../../../src/scroll/observe.ts"],"sourcesContent":["import { ProgressTimeline } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\ntype Update = (progress: number) => void\n\nexport function observeTimeline(update: Update, timeline: ProgressTimeline) {\n let prevProgress: number\n\n const onFrame = () => {\n const { currentTime } = timeline\n const percentage = currentTime === null ? 0 : currentTime.value\n const progress = percentage / 100\n\n if (prevProgress !== progress) {\n update(progress)\n }\n\n prevProgress = progress\n }\n\n frame.preUpdate(onFrame, true)\n\n return () => cancelFrame(onFrame)\n}\n"],"names":[],"mappings":";;AAKM,SAAU,eAAe,CAAC,MAAc,EAAE,QAA0B,EAAA;AACtE,IAAA,IAAI,YAAoB;IAExB,MAAM,OAAO,GAAG,MAAK;AACjB,QAAA,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ;AAChC,QAAA,MAAM,UAAU,GAAG,WAAW,KAAK,IAAI,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK;AAC/D,QAAA,MAAM,QAAQ,GAAG,UAAU,GAAG,GAAG;AAEjC,QAAA,IAAI,YAAY,KAAK,QAAQ,EAAE;YAC3B,MAAM,CAAC,QAAQ,CAAC;QACpB;QAEA,YAAY,GAAG,QAAQ;AAC3B,IAAA,CAAC;AAED,IAAA,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC;AAE9B,IAAA,OAAO,MAAM,WAAW,CAAC,OAAO,CAAC;AACrC;;;;"}
@@ -0,0 +1,722 @@
flf2a$ 7 6 20 -1 7
fatty.flf by Mike Rosulek. 1/12/95
Based on Bravo TrueType Font.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $##
d8b $#
!Y88!$#
Y8Y $#
8 $#
e $#
"8" $#
$##
8 8$#
Y P$#
$#
$#
$#
$#
$##
dP dP$#
____dP__dP_$#
dP dP $#
__dP__dP___$#
dP dP $#
dP dP $#
$##
,d88~/\$#
8888/ $#
`Y88b $#
`Y88b,$#
/8888$#
\/_88P'$#
$##
,8~\ /$#
"8_// $#
/ $#
/ $#
/,8~\$#
/ "8_/$#
$##
,d8P\ $#
888b | $#
`Y88X $#
/Y88b/ $#
| `Y88b $#
\_/Y88b$#
$##
d88b$#
Y88P$#
__/ $#
$#
$#
$#
$##
,8P~$#
88 $#
88 $#
88 $#
88 $#
88 $#
"8b_$##
~Y8,$#
88$#
88$#
88$#
88$#
88$#
_d8"$##
, 8 ,$#
"8" $#
e" "e$#
$#
$#
$#
$##
$#
888 $#
__888__$#
888 $#
888 $#
$#
$##
$#
$#
$#
$#
d88b$#
Y88P$#
__/ $##
$#
$#
____$#
$#
$#
$#
$##
$#
$#
$#
$#
d88b$#
Y88P$#
$##
/$#
/ $#
/ $#
/ $#
/ $#
/ $#
/ $##
,88~~\ $#
d888 \ $#
88888 |$#
88888 |$#
Y888 / $#
`88__/ $#
$##
,d$#
,d888$#
888$#
888$#
888$#
888$#
$##
/~~88b$#
| 888$#
` d88P$#
d88P $#
d88P $#
d88P___$#
$##
_-~88e $#
888b$#
__888"$#
888e$#
888P$#
~-_88" $#
$##
d8 $#
d88 $#
d888 $#
/ 888 $#
/__888__$#
888 $#
$##
/~~~~~~$#
/ $#
`-~~88e $#
/ 888b$#
| 888P$#
\__88" $#
$##
e88~-_ $#
d888 $#
8888~~\ $#
8888 |$#
Y888 |$#
"88__/ $#
$##
[~~~~d88P$#
d88P $#
d88P $#
d88P $#
d88P $#
d88P $#
$##
d8~~\ $#
C88b |$#
Y88b/ $#
/Y88b $#
| Y88D$#
\__8P $#
$##
/~~88e $#
| 888b$#
| 8888$#
\__8888$#
888P$#
~-_88" $#
$##
$#
d88b$#
Y88P$#
$#
d88b$#
Y88P$#
$##
$#
d88b$#
Y88P$#
$#
d88b$#
Y88P$#
__/ $##
_-$#
_-~ $#
< $#
~-_ $#
~-$#
$#
$##
$#
______$#
$#
______$#
$#
$#
$##
-_ $#
~-_ $#
>$#
_-~ $#
-~ $#
$#
$##
_-~88e$#
/ 88"$#
` 8P $#
` $#
d88b $#
Y88P $#
$##
__---__ $#
/ \ $#
| dP~dP |$#
| dP_d8b_/ $#
\______ $#
$#
$##
e $#
d8b $#
/Y88b $#
/ Y88b $#
/____Y88b $#
/ Y88b$#
$##
888~~\ $#
888 |$#
888 _/ $#
888 \ $#
888 |$#
888__/ $#
$##
e88~-_ $#
d888 \$#
8888 $#
8888 $#
Y888 /$#
"88_-~ $#
$##
888~-_ $#
888 \ $#
888 |$#
888 |$#
888 / $#
888_-~ $#
$##
888~~ $#
888___$#
888 $#
888 $#
888 $#
888___$#
$##
888~~ $#
888___$#
888 $#
888 $#
888 $#
888 $#
$##
e88~~\ $#
d888 $#
8888 __ $#
8888 |$#
Y888 |$#
"88__/ $#
$##
888 |$#
888___|$#
888 |$#
888 |$#
888 |$#
888 |$#
$##
888$#
888$#
888$#
888$#
888$#
888$#
$##
888$#
888$#
888$#
888$#
| 88P$#
\__8" $#
$##
888 / $#
888 / $#
888/\ $#
888 \ $#
888 \ $#
888 \$#
$##
888 $#
888 $#
888 $#
888 $#
888 $#
888____$#
$##
e e $#
d8b d8b $#
d888bdY88b $#
/ Y88Y Y888b $#
/ YY Y888b $#
/ Y888b$#
$##
888b |$#
|Y88b |$#
| Y88b |$#
| Y88b |$#
| Y88b|$#
| Y888$#
$##
,88~-_ $#
d888 \ $#
88888 |$#
88888 |$#
Y888 / $#
`88_-~ $#
$##
888~-_ $#
888 \ $#
888 |$#
888 / $#
888_-~ $#
888 $#
$##
,88~-_ $#
d888 \ $#
88888 |$#
88888 |$#
Y888 \ / $#
`88__X $#
\ $##
888~-_ $#
888 \ $#
888 |$#
888 / $#
888_-~ $#
888 ~-_ $#
$##
,d88~~\$#
8888 $#
`Y88b $#
`Y88b,$#
8888$#
\__88P'$#
$##
~~~888~~~$#
888 $#
888 $#
888 $#
888 $#
888 $#
$##
888 |$#
888 |$#
888 |$#
888 |$#
Y88 |$#
"8__/ $#
$##
Y88b /$#
Y88b / $#
Y88b / $#
Y888/ $#
Y8/ $#
Y $#
$##
Y88b /$#
Y88b / $#
Y88b e / $#
Y88bd8b/ $#
Y88Y8Y $#
Y Y $#
$##
Y88b /$#
Y88b / $#
Y88b/ $#
/Y88b $#
/ Y88b $#
/ Y88b$#
$##
Y88b /$#
Y88b / $#
Y88b/ $#
Y8Y $#
Y $#
/ $#
$##
~~~~d88P$#
d88P $#
d88P $#
d88P $#
d88P $#
d88P____ $#
$##
88~~$#
88 $#
88 $#
88 $#
88 $#
88 $#
88__$##
\ $#
\ $#
\ $#
\ $#
\ $#
\$#
$##
~~88$#
88$#
88$#
88$#
88$#
88$#
__88$##
/\ $#
/ \$#
$#
$#
$#
$#
$##
$#
$#
$#
$#
$#
$#
----$##
Y8b $#
Y8b$#
$#
$#
$#
$#
$##
$#
/~~~8e $#
88b$#
e88~-888$#
C888 888$#
"88_-888$#
$##
888 $#
888-~88e $#
888 888b$#
888 8888$#
888 888P$#
888-_88" $#
$##
$#
e88~~\$#
d888 $#
8888 $#
Y888 $#
"88__/$#
$##
888$#
e88~\888$#
d888 888$#
8888 888$#
Y888 888$#
"88_/888$#
$##
$#
e88~~8e $#
d888 88b$#
8888__888$#
Y888 ,$#
"88___/ $#
$##
88~\$#
_888__$#
888 $#
888 $#
888 $#
888 $#
$##
/$#
e88~88e$#
888 888$#
"88_88"$#
/ $#
Cb $#
Y8""8D$##
888 $#
888-~88e$#
888 888$#
888 888$#
888 888$#
888 888$#
$##
,e,$#
" $#
888$#
888$#
888$#
888$#
$##
,e,$#
" $#
888$#
888$#
888$#
88P$#
\_8" $##
888 _ $#
888 e~ ~ $#
888d8b $#
888Y88b $#
888 Y88b $#
888 Y88b$#
$##
888$#
888$#
888$#
888$#
888$#
888$#
$##
$#
888-~88e-~88e$#
888 888 888$#
888 888 888$#
888 888 888$#
888 888 888$#
$##
$#
888-~88e$#
888 888$#
888 888$#
888 888$#
888 888$#
$##
$#
e88~-_ $#
d888 i$#
8888 |$#
Y888 '$#
"88_-~ $#
$##
$#
888-~88e $#
888 888b$#
888 8888$#
888 888P$#
888-_88" $#
888 $##
$#
e88~-888$#
d888 888$#
8888 888$#
Y888 888$#
"88_-888$#
888$##
$#
888-~\$#
888 $#
888 $#
888 $#
888 $#
$##
$#
d88~\$#
C888 $#
Y88b $#
888D$#
\_88P $#
$##
d8 $#
_d88__$#
888 $#
888 $#
888 $#
"88_/$#
$##
$#
888 888$#
888 888$#
888 888$#
888 888$#
"88_-888$#
$##
$#
Y88b /$#
Y88b / $#
Y88b/ $#
Y8/ $#
Y $#
$##
$#
Y88b e /$#
Y88b d8b / $#
Y888/Y88b/ $#
Y8/ Y8/ $#
Y Y $#
$##
$#
Y88b / $#
Y88b/ $#
Y88b $#
/Y88b $#
/ Y88b$#
$##
$#
Y88b /$#
Y888/ $#
Y8/ $#
Y $#
/ $#
_/ $##
$#
~~~d88P$#
d88P $#
d88P $#
d88P $#
d88P___ $#
$##
e8~~$#
88 $#
8P $#
<K $#
8b $#
88 $#
"8__$##
|$#
|$#
|$#
|$#
|$#
|$#
|$##
~~8e $#
88 $#
Y8 $#
D>$#
d8 $#
88 $#
__8" $##
$#
$#
$#
/~\_/$#
$#
$#
$##
e e e $#
"8" d8b "8"$#
/Y88b $#
/ Y88b $#
/____Y88b $#
/ Y88b$#
$##
e ,88~-_ e $#
"8"d888 \"8"$#
88888 | $#
88888 | $#
Y888 / $#
`88_-~ $#
$##
e 888 | e $#
"8"888 |"8"$#
888 | $#
888 | $#
Y88 | $#
"8__/ $#
$##
e e $#
"8"/~~~8e"8"$#
88b $#
e88~-888 $#
C888 888 $#
"88_-888 $#
$##
e e $#
"8"e88~-_"8"$#
d888 i $#
8888 | $#
Y888 ' $#
"88_-~ $#
$##
e e $#
"8"888 888"8"$#
888 888 $#
888 888 $#
888 888 $#
"88_-888 $#
$##
#
#
#
#
#
#
##
@@ -0,0 +1,271 @@
var test = require('tape');
var forEach = require('for-each');
var inspect = require('../');
test('bad indent options', function (t) {
forEach([
undefined,
true,
false,
-1,
1.2,
Infinity,
-Infinity,
NaN
], function (indent) {
t['throws'](
function () { inspect('', { indent: indent }); },
TypeError,
inspect(indent) + ' is invalid'
);
});
t.end();
});
test('simple object with indent', function (t) {
t.plan(2);
var obj = { a: 1, b: 2 };
var expectedSpaces = [
'{',
' a: 1,',
' b: 2',
'}'
].join('\n');
var expectedTabs = [
'{',
' a: 1,',
' b: 2',
'}'
].join('\n');
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
});
test('two deep object with indent', function (t) {
t.plan(2);
var obj = { a: 1, b: { c: 3, d: 4 } };
var expectedSpaces = [
'{',
' a: 1,',
' b: {',
' c: 3,',
' d: 4',
' }',
'}'
].join('\n');
var expectedTabs = [
'{',
' a: 1,',
' b: {',
' c: 3,',
' d: 4',
' }',
'}'
].join('\n');
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
});
test('simple array with all single line elements', function (t) {
t.plan(2);
var obj = [1, 2, 3, 'asdf\nsdf'];
var expected = '[ 1, 2, 3, \'asdf\\nsdf\' ]';
t.equal(inspect(obj, { indent: 2 }), expected, 'two');
t.equal(inspect(obj, { indent: '\t' }), expected, 'tabs');
});
test('array with complex elements', function (t) {
t.plan(2);
var obj = [1, { a: 1, b: { c: 1 } }, 'asdf\nsdf'];
var expectedSpaces = [
'[',
' 1,',
' {',
' a: 1,',
' b: {',
' c: 1',
' }',
' },',
' \'asdf\\nsdf\'',
']'
].join('\n');
var expectedTabs = [
'[',
' 1,',
' {',
' a: 1,',
' b: {',
' c: 1',
' }',
' },',
' \'asdf\\nsdf\'',
']'
].join('\n');
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
});
test('values', function (t) {
t.plan(2);
var obj = [{}, [], { 'a-b': 5 }];
var expectedSpaces = [
'[',
' {},',
' [],',
' {',
' \'a-b\': 5',
' }',
']'
].join('\n');
var expectedTabs = [
'[',
' {},',
' [],',
' {',
' \'a-b\': 5',
' }',
']'
].join('\n');
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
});
test('Map', { skip: typeof Map !== 'function' }, function (t) {
var map = new Map();
map.set({ a: 1 }, ['b']);
map.set(3, NaN);
var expectedStringSpaces = [
'Map (2) {',
' { a: 1 } => [ \'b\' ],',
' 3 => NaN',
'}'
].join('\n');
var expectedStringTabs = [
'Map (2) {',
' { a: 1 } => [ \'b\' ],',
' 3 => NaN',
'}'
].join('\n');
var expectedStringTabsDoubleQuotes = [
'Map (2) {',
' { a: 1 } => [ "b" ],',
' 3 => NaN',
'}'
].join('\n');
t.equal(
inspect(map, { indent: 2 }),
expectedStringSpaces,
'Map keys are not indented (two)'
);
t.equal(
inspect(map, { indent: '\t' }),
expectedStringTabs,
'Map keys are not indented (tabs)'
);
t.equal(
inspect(map, { indent: '\t', quoteStyle: 'double' }),
expectedStringTabsDoubleQuotes,
'Map keys are not indented (tabs + double quotes)'
);
t.equal(inspect(new Map(), { indent: 2 }), 'Map (0) {}', 'empty Map should show as empty (two)');
t.equal(inspect(new Map(), { indent: '\t' }), 'Map (0) {}', 'empty Map should show as empty (tabs)');
var nestedMap = new Map();
nestedMap.set(nestedMap, map);
var expectedNestedSpaces = [
'Map (1) {',
' [Circular] => Map (2) {',
' { a: 1 } => [ \'b\' ],',
' 3 => NaN',
' }',
'}'
].join('\n');
var expectedNestedTabs = [
'Map (1) {',
' [Circular] => Map (2) {',
' { a: 1 } => [ \'b\' ],',
' 3 => NaN',
' }',
'}'
].join('\n');
t.equal(inspect(nestedMap, { indent: 2 }), expectedNestedSpaces, 'Map containing a Map should work (two)');
t.equal(inspect(nestedMap, { indent: '\t' }), expectedNestedTabs, 'Map containing a Map should work (tabs)');
t.end();
});
test('Set', { skip: typeof Set !== 'function' }, function (t) {
var set = new Set();
set.add({ a: 1 });
set.add(['b']);
var expectedStringSpaces = [
'Set (2) {',
' {',
' a: 1',
' },',
' [ \'b\' ]',
'}'
].join('\n');
var expectedStringTabs = [
'Set (2) {',
' {',
' a: 1',
' },',
' [ \'b\' ]',
'}'
].join('\n');
t.equal(inspect(set, { indent: 2 }), expectedStringSpaces, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (two)');
t.equal(inspect(set, { indent: '\t' }), expectedStringTabs, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (tabs)');
t.equal(inspect(new Set(), { indent: 2 }), 'Set (0) {}', 'empty Set should show as empty (two)');
t.equal(inspect(new Set(), { indent: '\t' }), 'Set (0) {}', 'empty Set should show as empty (tabs)');
var nestedSet = new Set();
nestedSet.add(set);
nestedSet.add(nestedSet);
var expectedNestedSpaces = [
'Set (2) {',
' Set (2) {',
' {',
' a: 1',
' },',
' [ \'b\' ]',
' },',
' [Circular]',
'}'
].join('\n');
var expectedNestedTabs = [
'Set (2) {',
' Set (2) {',
' {',
' a: 1',
' },',
' [ \'b\' ]',
' },',
' [Circular]',
'}'
].join('\n');
t.equal(inspect(nestedSet, { indent: 2 }), expectedNestedSpaces, 'Set containing a Set should work (two)');
t.equal(inspect(nestedSet, { indent: '\t' }), expectedNestedTabs, 'Set containing a Set should work (tabs)');
t.end();
});
@@ -0,0 +1,681 @@
"use strict";
var _TRAILING_WILD_CARD_R;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
// A simple implementation of make-array
function makeArray(subject) {
return Array.isArray(subject) ? subject : [subject];
}
var UNDEFINED = undefined;
var EMPTY = '';
var SPACE = ' ';
var ESCAPE = '\\';
var REGEX_TEST_BLANK_LINE = /^\s+$/;
var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
var REGEX_SPLITALL_CRLF = /\r?\n/g;
// Invalid:
// - /foo,
// - ./foo,
// - ../foo,
// - .
// - ..
// Valid:
// - .foo
var REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/;
var REGEX_TEST_TRAILING_SLASH = /\/$/;
var SLASH = '/';
// Do not use ternary expression here, since "istanbul ignore next" is buggy
var TMP_KEY_IGNORE = 'node-ignore';
/* istanbul ignore else */
if (typeof Symbol !== 'undefined') {
TMP_KEY_IGNORE = Symbol["for"]('node-ignore');
}
var KEY_IGNORE = TMP_KEY_IGNORE;
var define = function define(object, key, value) {
Object.defineProperty(object, key, {
value: value
});
return value;
};
var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
var RETURN_FALSE = function RETURN_FALSE() {
return false;
};
// Sanitize the range of a regular expression
// The cases are complicated, see test cases for details
var sanitizeRange = function sanitizeRange(range) {
return range.replace(REGEX_REGEXP_RANGE, function (match, from, to) {
return from.charCodeAt(0) <= to.charCodeAt(0) ? match
// Invalid range (out of order) which is ok for gitignore rules but
// fatal for JavaScript regular expression, so eliminate it.
: EMPTY;
});
};
// See fixtures #59
var cleanRangeBackSlash = function cleanRangeBackSlash(slashes) {
var length = slashes.length;
return slashes.slice(0, length - length % 2);
};
// > If the pattern ends with a slash,
// > it is removed for the purpose of the following description,
// > but it would only find a match with a directory.
// > In other words, foo/ will match a directory foo and paths underneath it,
// > but will not match a regular file or a symbolic link foo
// > (this is consistent with the way how pathspec works in general in Git).
// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`'
// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call
// you could use option `mark: true` with `glob`
// '`foo/`' should not continue with the '`..`'
var REPLACERS = [[
// Remove BOM
// TODO:
// Other similar zero-width characters?
/^\uFEFF/, function () {
return EMPTY;
}],
// > Trailing spaces are ignored unless they are quoted with backslash ("\")
[
// (a\ ) -> (a )
// (a ) -> (a)
// (a ) -> (a)
// (a \ ) -> (a )
/((?:\\\\)*?)(\\?\s+)$/, function (_, m1, m2) {
return m1 + (m2.indexOf('\\') === 0 ? SPACE : EMPTY);
}],
// Replace (\ ) with ' '
// (\ ) -> ' '
// (\\ ) -> '\\ '
// (\\\ ) -> '\\ '
[/(\\+?)\s/g, function (_, m1) {
var length = m1.length;
return m1.slice(0, length - length % 2) + SPACE;
}],
// Escape metacharacters
// which is written down by users but means special for regular expressions.
// > There are 12 characters with special meanings:
// > - the backslash \,
// > - the caret ^,
// > - the dollar sign $,
// > - the period or dot .,
// > - the vertical bar or pipe symbol |,
// > - the question mark ?,
// > - the asterisk or star *,
// > - the plus sign +,
// > - the opening parenthesis (,
// > - the closing parenthesis ),
// > - and the opening square bracket [,
// > - the opening curly brace {,
// > These special characters are often called "metacharacters".
[/[\\$.|*+(){^]/g, function (match) {
return "\\".concat(match);
}], [
// > a question mark (?) matches a single character
/(?!\\)\?/g, function () {
return '[^/]';
}],
// leading slash
[
// > A leading slash matches the beginning of the pathname.
// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
// A leading slash matches the beginning of the pathname
/^\//, function () {
return '^';
}],
// replace special metacharacter slash after the leading slash
[/\//g, function () {
return '\\/';
}], [
// > A leading "**" followed by a slash means match in all directories.
// > For example, "**/foo" matches file or directory "foo" anywhere,
// > the same as pattern "foo".
// > "**/foo/bar" matches file or directory "bar" anywhere that is directly
// > under directory "foo".
// Notice that the '*'s have been replaced as '\\*'
/^\^*\\\*\\\*\\\//,
// '**/foo' <-> 'foo'
function () {
return '^(?:.*\\/)?';
}],
// starting
[
// there will be no leading '/'
// (which has been replaced by section "leading slash")
// If starts with '**', adding a '^' to the regular expression also works
/^(?=[^^])/, function startingReplacer() {
// If has a slash `/` at the beginning or middle
return !/\/(?!$)/.test(this)
// > Prior to 2.22.1
// > If the pattern does not contain a slash /,
// > Git treats it as a shell glob pattern
// Actually, if there is only a trailing slash,
// git also treats it as a shell glob pattern
// After 2.22.1 (compatible but clearer)
// > If there is a separator at the beginning or middle (or both)
// > of the pattern, then the pattern is relative to the directory
// > level of the particular .gitignore file itself.
// > Otherwise the pattern may also match at any level below
// > the .gitignore level.
? '(?:^|\\/)'
// > Otherwise, Git treats the pattern as a shell glob suitable for
// > consumption by fnmatch(3)
: '^';
}],
// two globstars
[
// Use lookahead assertions so that we could match more than one `'/**'`
/\\\/\\\*\\\*(?=\\\/|$)/g,
// Zero, one or several directories
// should not use '*', or it will be replaced by the next replacer
// Check if it is not the last `'/**'`
function (_, index, str) {
return index + 6 < str.length
// case: /**/
// > A slash followed by two consecutive asterisks then a slash matches
// > zero or more directories.
// > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.
// '/**/'
? '(?:\\/[^\\/]+)*'
// case: /**
// > A trailing `"/**"` matches everything inside.
// #21: everything inside but it should not include the current folder
: '\\/.+';
}],
// normal intermediate wildcards
[
// Never replace escaped '*'
// ignore rule '\*' will match the path '*'
// 'abc.*/' -> go
// 'abc.*' -> skip this rule,
// coz trailing single wildcard will be handed by [trailing wildcard]
/(^|[^\\]+)(\\\*)+(?=.+)/g,
// '*.js' matches '.js'
// '*.js' doesn't match 'abc'
function (_, p1, p2) {
// 1.
// > An asterisk "*" matches anything except a slash.
// 2.
// > Other consecutive asterisks are considered regular asterisks
// > and will match according to the previous rules.
var unescaped = p2.replace(/\\\*/g, '[^\\/]*');
return p1 + unescaped;
}], [
// unescape, revert step 3 except for back slash
// For example, if a user escape a '\\*',
// after step 3, the result will be '\\\\\\*'
/\\\\\\(?=[$.|*+(){^])/g, function () {
return ESCAPE;
}], [
// '\\\\' -> '\\'
/\\\\/g, function () {
return ESCAPE;
}], [
// > The range notation, e.g. [a-zA-Z],
// > can be used to match one of the characters in a range.
// `\` is escaped by step 3
/(\\)?\[([^\]/]*?)(\\*)($|\])/g, function (match, leadEscape, range, endEscape, close) {
return leadEscape === ESCAPE
// '\\[bar]' -> '\\\\[bar\\]'
? "\\[".concat(range).concat(cleanRangeBackSlash(endEscape)).concat(close) : close === ']' ? endEscape.length % 2 === 0
// A normal case, and it is a range notation
// '[bar]'
// '[bar\\\\]'
? "[".concat(sanitizeRange(range)).concat(endEscape, "]") // Invalid range notaton
// '[bar\\]' -> '[bar\\\\]'
: '[]' : '[]';
}],
// ending
[
// 'js' will not match 'js.'
// 'ab' will not match 'abc'
/(?:[^*])$/,
// WTF!
// https://git-scm.com/docs/gitignore
// changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
// which re-fixes #24, #38
// > If there is a separator at the end of the pattern then the pattern
// > will only match directories, otherwise the pattern can match both
// > files and directories.
// 'js*' will not match 'a.js'
// 'js/' will not match 'a.js'
// 'js' will match 'a.js' and 'a.js/'
function (match) {
return /\/$/.test(match)
// foo/ will not match 'foo'
? "".concat(match, "$") // foo matches 'foo' and 'foo/'
: "".concat(match, "(?=$|\\/$)");
}]];
var REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\\\*$/;
var MODE_IGNORE = 'regex';
var MODE_CHECK_IGNORE = 'checkRegex';
var UNDERSCORE = '_';
var TRAILING_WILD_CARD_REPLACERS = (_TRAILING_WILD_CARD_R = {}, _defineProperty(_TRAILING_WILD_CARD_R, MODE_IGNORE, function (_, p1) {
var prefix = p1
// '\^':
// '/*' does not match EMPTY
// '/*' does not match everything
// '\\\/':
// 'abc/*' does not match 'abc/'
? "".concat(p1, "[^/]+") // 'a*' matches 'a'
// 'a*' matches 'aa'
: '[^/]*';
return "".concat(prefix, "(?=$|\\/$)");
}), _defineProperty(_TRAILING_WILD_CARD_R, MODE_CHECK_IGNORE, function (_, p1) {
// When doing `git check-ignore`
var prefix = p1
// '\\\/':
// 'abc/*' DOES match 'abc/' !
? "".concat(p1, "[^/]*") // 'a*' matches 'a'
// 'a*' matches 'aa'
: '[^/]*';
return "".concat(prefix, "(?=$|\\/$)");
}), _TRAILING_WILD_CARD_R);
// @param {pattern}
var makeRegexPrefix = function makeRegexPrefix(pattern) {
return REPLACERS.reduce(function (prev, _ref) {
var _ref2 = _slicedToArray(_ref, 2),
matcher = _ref2[0],
replacer = _ref2[1];
return prev.replace(matcher, replacer.bind(pattern));
}, pattern);
};
var isString = function isString(subject) {
return typeof subject === 'string';
};
// > A blank line matches no files, so it can serve as a separator for readability.
var checkPattern = function checkPattern(pattern) {
return pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)
// > A line starting with # serves as a comment.
&& pattern.indexOf('#') !== 0;
};
var splitPattern = function splitPattern(pattern) {
return pattern.split(REGEX_SPLITALL_CRLF).filter(Boolean);
};
var IgnoreRule = /*#__PURE__*/function () {
function IgnoreRule(pattern, mark, body, ignoreCase, negative, prefix) {
_classCallCheck(this, IgnoreRule);
this.pattern = pattern;
this.mark = mark;
this.negative = negative;
define(this, 'body', body);
define(this, 'ignoreCase', ignoreCase);
define(this, 'regexPrefix', prefix);
}
_createClass(IgnoreRule, [{
key: "regex",
get: function get() {
var key = UNDERSCORE + MODE_IGNORE;
if (this[key]) {
return this[key];
}
return this._make(MODE_IGNORE, key);
}
}, {
key: "checkRegex",
get: function get() {
var key = UNDERSCORE + MODE_CHECK_IGNORE;
if (this[key]) {
return this[key];
}
return this._make(MODE_CHECK_IGNORE, key);
}
}, {
key: "_make",
value: function _make(mode, key) {
var str = this.regexPrefix.replace(REGEX_REPLACE_TRAILING_WILDCARD,
// It does not need to bind pattern
TRAILING_WILD_CARD_REPLACERS[mode]);
var regex = this.ignoreCase ? new RegExp(str, 'i') : new RegExp(str);
return define(this, key, regex);
}
}]);
return IgnoreRule;
}();
var createRule = function createRule(_ref3, ignoreCase) {
var pattern = _ref3.pattern,
mark = _ref3.mark;
var negative = false;
var body = pattern;
// > An optional prefix "!" which negates the pattern;
if (body.indexOf('!') === 0) {
negative = true;
body = body.substr(1);
}
body = body
// > Put a backslash ("\") in front of the first "!" for patterns that
// > begin with a literal "!", for example, `"\!important!.txt"`.
.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!')
// > Put a backslash ("\") in front of the first hash for patterns that
// > begin with a hash.
.replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#');
var regexPrefix = makeRegexPrefix(body);
return new IgnoreRule(pattern, mark, body, ignoreCase, negative, regexPrefix);
};
var RuleManager = /*#__PURE__*/function () {
function RuleManager(ignoreCase) {
_classCallCheck(this, RuleManager);
this._ignoreCase = ignoreCase;
this._rules = [];
}
_createClass(RuleManager, [{
key: "_add",
value: function _add(pattern) {
// #32
if (pattern && pattern[KEY_IGNORE]) {
this._rules = this._rules.concat(pattern._rules._rules);
this._added = true;
return;
}
if (isString(pattern)) {
pattern = {
pattern: pattern
};
}
if (checkPattern(pattern.pattern)) {
var rule = createRule(pattern, this._ignoreCase);
this._added = true;
this._rules.push(rule);
}
}
// @param {Array<string> | string | Ignore} pattern
}, {
key: "add",
value: function add(pattern) {
this._added = false;
makeArray(isString(pattern) ? splitPattern(pattern) : pattern).forEach(this._add, this);
return this._added;
}
// Test one single path without recursively checking parent directories
//
// - checkUnignored `boolean` whether should check if the path is unignored,
// setting `checkUnignored` to `false` could reduce additional
// path matching.
// - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
// @returns {TestResult} true if a file is ignored
}, {
key: "test",
value: function test(path, checkUnignored, mode) {
var ignored = false;
var unignored = false;
var matchedRule;
this._rules.forEach(function (rule) {
var negative = rule.negative;
// | ignored : unignored
// -------- | ---------------------------------------
// negative | 0:0 | 0:1 | 1:0 | 1:1
// -------- | ------- | ------- | ------- | --------
// 0 | TEST | TEST | SKIP | X
// 1 | TESTIF | SKIP | TEST | X
// - SKIP: always skip
// - TEST: always test
// - TESTIF: only test if checkUnignored
// - X: that never happen
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
return;
}
var matched = rule[mode].test(path);
if (!matched) {
return;
}
ignored = !negative;
unignored = negative;
matchedRule = negative ? UNDEFINED : rule;
});
var ret = {
ignored: ignored,
unignored: unignored
};
if (matchedRule) {
ret.rule = matchedRule;
}
return ret;
}
}]);
return RuleManager;
}();
var throwError = function throwError(message, Ctor) {
throw new Ctor(message);
};
var checkPath = function checkPath(path, originalPath, doThrow) {
if (!isString(path)) {
return doThrow("path must be a string, but got `".concat(originalPath, "`"), TypeError);
}
// We don't know if we should ignore EMPTY, so throw
if (!path) {
return doThrow("path must not be empty", TypeError);
}
// Check if it is a relative path
if (checkPath.isNotRelative(path)) {
var r = '`path.relative()`d';
return doThrow("path should be a ".concat(r, " string, but got \"").concat(originalPath, "\""), RangeError);
}
return true;
};
var isNotRelative = function isNotRelative(path) {
return REGEX_TEST_INVALID_PATH.test(path);
};
checkPath.isNotRelative = isNotRelative;
// On windows, the following function will be replaced
/* istanbul ignore next */
checkPath.convert = function (p) {
return p;
};
var Ignore = /*#__PURE__*/function () {
function Ignore() {
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref4$ignorecase = _ref4.ignorecase,
ignorecase = _ref4$ignorecase === void 0 ? true : _ref4$ignorecase,
_ref4$ignoreCase = _ref4.ignoreCase,
ignoreCase = _ref4$ignoreCase === void 0 ? ignorecase : _ref4$ignoreCase,
_ref4$allowRelativePa = _ref4.allowRelativePaths,
allowRelativePaths = _ref4$allowRelativePa === void 0 ? false : _ref4$allowRelativePa;
_classCallCheck(this, Ignore);
define(this, KEY_IGNORE, true);
this._rules = new RuleManager(ignoreCase);
this._strictPathCheck = !allowRelativePaths;
this._initCache();
}
_createClass(Ignore, [{
key: "_initCache",
value: function _initCache() {
// A cache for the result of `.ignores()`
this._ignoreCache = Object.create(null);
// A cache for the result of `.test()`
this._testCache = Object.create(null);
}
}, {
key: "add",
value: function add(pattern) {
if (this._rules.add(pattern)) {
// Some rules have just added to the ignore,
// making the behavior changed,
// so we need to re-initialize the result cache
this._initCache();
}
return this;
}
// legacy
}, {
key: "addPattern",
value: function addPattern(pattern) {
return this.add(pattern);
}
// @returns {TestResult}
}, {
key: "_test",
value: function _test(originalPath, cache, checkUnignored, slices) {
var path = originalPath
// Supports nullable path
&& checkPath.convert(originalPath);
checkPath(path, originalPath, this._strictPathCheck ? throwError : RETURN_FALSE);
return this._t(path, cache, checkUnignored, slices);
}
}, {
key: "checkIgnore",
value: function checkIgnore(path) {
// If the path doest not end with a slash, `.ignores()` is much equivalent
// to `git check-ignore`
if (!REGEX_TEST_TRAILING_SLASH.test(path)) {
return this.test(path);
}
var slices = path.split(SLASH).filter(Boolean);
slices.pop();
if (slices.length) {
var parent = this._t(slices.join(SLASH) + SLASH, this._testCache, true, slices);
if (parent.ignored) {
return parent;
}
}
return this._rules.test(path, false, MODE_CHECK_IGNORE);
}
}, {
key: "_t",
value: function _t(
// The path to be tested
path,
// The cache for the result of a certain checking
cache,
// Whether should check if the path is unignored
checkUnignored,
// The path slices
slices) {
if (path in cache) {
return cache[path];
}
if (!slices) {
// path/to/a.js
// ['path', 'to', 'a.js']
slices = path.split(SLASH).filter(Boolean);
}
slices.pop();
// If the path has no parent directory, just test it
if (!slices.length) {
return cache[path] = this._rules.test(path, checkUnignored, MODE_IGNORE);
}
var parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices);
// If the path contains a parent directory, check the parent first
return cache[path] = parent.ignored
// > It is not possible to re-include a file if a parent directory of
// > that file is excluded.
? parent : this._rules.test(path, checkUnignored, MODE_IGNORE);
}
}, {
key: "ignores",
value: function ignores(path) {
return this._test(path, this._ignoreCache, false).ignored;
}
}, {
key: "createFilter",
value: function createFilter() {
var _this = this;
return function (path) {
return !_this.ignores(path);
};
}
}, {
key: "filter",
value: function filter(paths) {
return makeArray(paths).filter(this.createFilter());
}
// @returns {TestResult}
}, {
key: "test",
value: function test(path) {
return this._test(path, this._testCache, true);
}
}]);
return Ignore;
}();
var factory = function factory(options) {
return new Ignore(options);
};
var isPathValid = function isPathValid(path) {
return checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
};
/* istanbul ignore next */
var setupWindows = function setupWindows() {
/* eslint no-control-regex: "off" */
var makePosix = function makePosix(str) {
return /^\\\\\?\\/.test(str) || /[\0-\x1F"<>\|]+/.test(str) ? str : str.replace(/\\/g, '/');
};
checkPath.convert = makePosix;
// 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/'
// 'd:\\foo'
var REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
checkPath.isNotRelative = function (path) {
return REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
};
};
// Windows
// --------------------------------------------------------------
/* istanbul ignore next */
if (
// Detect `process` so that it can run in browsers.
typeof process !== 'undefined' && process.platform === 'win32') {
setupWindows();
}
// COMMONJS_EXPORTS ////////////////////////////////////////////////////////////
module.exports = factory;
// Although it is an anti-pattern,
// it is still widely misused by a lot of libraries in github
// Ref: https://github.com/search?q=ignore.default%28%29&type=code
factory["default"] = factory;
module.exports.isPathValid = isPathValid;
// For testing purposes
define(module.exports, Symbol["for"]('setupWindows'), setupWindows);
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './square-split-vertical.js';
//# sourceMappingURL=split-square-vertical.js.map
@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.transformFile = transformFile;
exports.transformFileAsync = transformFileAsync;
exports.transformFileSync = transformFileSync;
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
var _index = require("./config/index.js");
var _index2 = require("./transformation/index.js");
var fs = require("./gensync-utils/fs.js");
({});
const transformFileRunner = _gensync()(function* (filename, opts) {
const options = Object.assign({}, opts, {
filename
});
const config = yield* (0, _index.default)(options);
if (config === null) return null;
const code = yield* fs.readFile(filename, "utf8");
return yield* (0, _index2.run)(config, code);
});
function transformFile(...args) {
transformFileRunner.errback(...args);
}
function transformFileSync(...args) {
return transformFileRunner.sync(...args);
}
function transformFileAsync(...args) {
return transformFileRunner.async(...args);
}
0 && 0;
//# sourceMappingURL=transform-file.js.map
@@ -0,0 +1,20 @@
/**
* @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 CalendarX2 = createLucideIcon("CalendarX2", [
["path", { d: "M8 2v4", key: "1cmpym" }],
["path", { d: "M16 2v4", key: "4m81vk" }],
["path", { d: "M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8", key: "3spt84" }],
["path", { d: "M3 10h18", key: "8toen8" }],
["path", { d: "m17 22 5-5", key: "1k6ppv" }],
["path", { d: "m17 17 5 5", key: "p7ous7" }]
]);
export { CalendarX2 as default };
//# sourceMappingURL=calendar-x-2.js.map
@@ -0,0 +1,117 @@
/**
* **The version of the punycode module bundled in Node.js is being deprecated. **In a future major version of Node.js this module will be removed. Users
* currently depending on the `punycode` module should switch to using the
* userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL
* encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`.
*
* The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It
* can be accessed using:
*
* ```js
* import punycode from 'node:punycode';
* ```
*
* [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is
* primarily intended for use in Internationalized Domain Names. Because host
* names in URLs are limited to ASCII characters only, Domain Names that contain
* non-ASCII characters must be converted into ASCII using the Punycode scheme.
* For instance, the Japanese character that translates into the English word, `'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent
* to `'example.com'`) is represented by Punycode as the ASCII string `'xn--fsq.com'`.
*
* The `punycode` module provides a simple implementation of the Punycode standard.
*
* The `punycode` module is a third-party dependency used by Node.js and
* made available to developers as a convenience. Fixes or other modifications to
* the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project.
* @deprecated Since v7.0.0 - Deprecated
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/punycode.js)
*/
declare module "punycode" {
/**
* The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only
* characters to the equivalent string of Unicode codepoints.
*
* ```js
* punycode.decode('maana-pta'); // 'mañana'
* punycode.decode('--dqo34k'); // '☃-⌘'
* ```
* @since v0.5.1
*/
function decode(string: string): string;
/**
* The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters.
*
* ```js
* punycode.encode('mañana'); // 'maana-pta'
* punycode.encode('☃-⌘'); // '--dqo34k'
* ```
* @since v0.5.1
*/
function encode(string: string): string;
/**
* The `punycode.toUnicode()` method converts a string representing a domain name
* containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be
* converted.
*
* ```js
* // decode domain names
* punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com'
* punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com'
* punycode.toUnicode('example.com'); // 'example.com'
* ```
* @since v0.6.1
*/
function toUnicode(domain: string): string;
/**
* The `punycode.toASCII()` method converts a Unicode string representing an
* Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the
* domain name will be converted. Calling `punycode.toASCII()` on a string that
* already only contains ASCII characters will have no effect.
*
* ```js
* // encode domain names
* punycode.toASCII('mañana.com'); // 'xn--maana-pta.com'
* punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com'
* punycode.toASCII('example.com'); // 'example.com'
* ```
* @since v0.6.1
*/
function toASCII(domain: string): string;
/**
* @deprecated since v7.0.0
* The version of the punycode module bundled in Node.js is being deprecated.
* In a future major version of Node.js this module will be removed.
* Users currently depending on the punycode module should switch to using
* the userland-provided Punycode.js module instead.
*/
const ucs2: ucs2;
interface ucs2 {
/**
* @deprecated since v7.0.0
* The version of the punycode module bundled in Node.js is being deprecated.
* In a future major version of Node.js this module will be removed.
* Users currently depending on the punycode module should switch to using
* the userland-provided Punycode.js module instead.
*/
decode(string: string): number[];
/**
* @deprecated since v7.0.0
* The version of the punycode module bundled in Node.js is being deprecated.
* In a future major version of Node.js this module will be removed.
* Users currently depending on the punycode module should switch to using
* the userland-provided Punycode.js module instead.
*/
encode(codePoints: readonly number[]): string;
}
/**
* @deprecated since v7.0.0
* The version of the punycode module bundled in Node.js is being deprecated.
* In a future major version of Node.js this module will be removed.
* Users currently depending on the punycode module should switch to using
* the userland-provided Punycode.js module instead.
*/
const version: string;
}
declare module "node:punycode" {
export * from "punycode";
}
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2025_iterator: LibDefinition;
@@ -0,0 +1,416 @@
# router
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][ci-image]][ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Simple middleware-style router
## Installation
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```bash
$ npm install router
```
## API
```js
var finalhandler = require('finalhandler')
var http = require('http')
var Router = require('router')
var router = Router()
router.get('/', function (req, res) {
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end('Hello World!')
})
var server = http.createServer(function (req, res) {
router(req, res, finalhandler(req, res))
})
server.listen(3000)
```
This module is currently an extracted version from the Express project,
but with the main change being it can be used with a plain `http.createServer`
object or other web frameworks by removing Express-specific API calls.
## Router(options)
Options
- `strict` - When `false` trailing slashes are optional (default: `false`)
- `caseSensitive` - When `true` the routing will be case sensitive. (default: `false`)
- `mergeParams` - When `true` any `req.params` passed to the router will be
merged into the router's `req.params`. (default: `false`) ([example](#example-using-mergeparams))
Returns a function with the signature `router(req, res, callback)` where
`callback([err])` must be provided to handle errors and fall-through from
not handling requests.
### router.use([path], ...middleware)
Use the given [middleware function](#middleware) for all http methods on the
given `path`, defaulting to the root path.
`router` does not automatically see `use` as a handler. As such, it will not
consider it one for handling `OPTIONS` requests.
* Note: If a `path` is specified, that `path` is stripped from the start of
`req.url`.
<!-- eslint-disable no-undef -->
```js
router.use(function (req, res, next) {
// do your things
// continue to the next middleware
// the request will stall if this is not called
next()
// note: you should NOT call `next` if you have begun writing to the response
})
```
[Middleware](#middleware) can themselves use `next('router')` at any time to
exit the current router instance completely, invoking the top-level callback.
### router\[method](path, ...[middleware], handler)
The [http methods](https://github.com/jshttp/methods/blob/master/index.js) provide
the routing functionality in `router`.
Method middleware and handlers follow usual [middleware](#middleware) behavior,
except they will only be called when the method and path match the request.
<!-- eslint-disable no-undef -->
```js
// handle a `GET` request
router.get('/', function (req, res) {
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end('Hello World!')
})
```
[Middleware](#middleware) given before the handler have one additional trick,
they may invoke `next('route')`. Calling `next('route')` bypasses the remaining
middleware and the handler mounted for this route, passing the request to the
next route suitable for handling this request.
Route handlers and middleware can themselves use `next('router')` at any time
to exit the current router instance completely, invoking the top-level callback.
### router.param(name, param_middleware)
Maps the specified path parameter `name` to a specialized param-capturing middleware.
This function positions the middleware in the same stack as `.use`.
The function can optionally return a `Promise` object. If a `Promise` object
is returned from the function, the router will attach an `onRejected` callback
using `.then`. If the promise is rejected, `next` will be called with the
rejected value, or an error if the value is falsy.
Parameter mapping is used to provide pre-conditions to routes
which use normalized placeholders. For example a _:user_id_ parameter
could automatically load a user's information from the database without
any additional code:
<!-- eslint-disable no-undef -->
```js
router.param('user_id', function (req, res, next, id) {
User.find(id, function (err, user) {
if (err) {
return next(err)
} else if (!user) {
return next(new Error('failed to load user'))
}
req.user = user
// continue processing the request
next()
})
})
```
### router.route(path)
Creates an instance of a single `Route` for the given `path`.
(See `Router.Route` below)
Routes can be used to handle http `methods` with their own, optional middleware.
Using `router.route(path)` is a recommended approach to avoiding duplicate
route naming and thus typo errors.
<!-- eslint-disable no-undef, no-unused-vars -->
```js
var api = router.route('/api/')
```
## Router.Route(path)
Represents a single route as an instance that can be used to handle http
`methods` with it's own, optional middleware.
### route\[method](handler)
These are functions which you can directly call on a route to register a new
`handler` for the `method` on the route.
<!-- eslint-disable no-undef -->
```js
// handle a `GET` request
var status = router.route('/status')
status.get(function (req, res) {
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end('All Systems Green!')
})
```
### route.all(handler)
Adds a handler for all HTTP methods to this route.
The handler can behave like middleware and call `next` to continue processing
rather than responding.
<!-- eslint-disable no-undef -->
```js
router.route('/')
.all(function (req, res, next) {
next()
})
.all(checkSomething)
.get(function (req, res) {
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end('Hello World!')
})
```
## Middleware
Middleware (and method handlers) are functions that follow specific function
parameters and have defined behavior when used with `router`. The most common
format is with three parameters - "req", "res" and "next".
- `req` - This is a [HTTP incoming message](https://nodejs.org/api/http.html#http_http_incomingmessage) instance.
- `res` - This is a [HTTP server response](https://nodejs.org/api/http.html#http_class_http_serverresponse) instance.
- `next` - Calling this function that tells `router` to proceed to the next matching middleware or method handler. It accepts an error as the first argument.
The function can optionally return a `Promise` object. If a `Promise` object
is returned from the function, the router will attach an `onRejected` callback
using `.then`. If the promise is rejected, `next` will be called with the
rejected value, or an error if the value is falsy.
Middleware and method handlers can also be defined with four arguments. When
the function has four parameters defined, the first argument is an error and
subsequent arguments remain, becoming - "err", "req", "res", "next". These
functions are "error handling middleware", and can be used for handling
errors that occurred in previous handlers (E.g. from calling `next(err)`).
This is most used when you want to define arbitrary rendering of errors.
<!-- eslint-disable no-undef -->
```js
router.get('/error_route', function (req, res, next) {
return next(new Error('Bad Request'))
})
router.use(function (err, req, res, next) {
res.end(err.message) //= > "Bad Request"
})
```
Error handling middleware will **only** be invoked when an error was given. As
long as the error is in the pipeline, normal middleware and handlers will be
bypassed - only error handling middleware will be invoked with an error.
## Examples
```js
// import our modules
var http = require('http')
var Router = require('router')
var finalhandler = require('finalhandler')
var compression = require('compression')
var bodyParser = require('body-parser')
// store our message to display
var message = 'Hello World!'
// initialize the router & server and add a final callback.
var router = Router()
var server = http.createServer(function onRequest (req, res) {
router(req, res, finalhandler(req, res))
})
// use some middleware and compress all outgoing responses
router.use(compression())
// handle `GET` requests to `/message`
router.get('/message', function (req, res) {
res.statusCode = 200
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end(message + '\n')
})
// create and mount a new router for our API
var api = Router()
router.use('/api/', api)
// add a body parsing middleware to our API
api.use(bodyParser.json())
// handle `PATCH` requests to `/api/set-message`
api.patch('/set-message', function (req, res) {
if (req.body.value) {
message = req.body.value
res.statusCode = 200
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end(message + '\n')
} else {
res.statusCode = 400
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end('Invalid API Syntax\n')
}
})
// make our http server listen to connections
server.listen(8080)
```
You can get the message by running this command in your terminal,
or navigating to `127.0.0.1:8080` in a web browser.
```bash
curl http://127.0.0.1:8080
```
You can set the message by sending it a `PATCH` request via this command:
```bash
curl http://127.0.0.1:8080/api/set-message -X PATCH -H "Content-Type: application/json" -d '{"value":"Cats!"}'
```
### Example using mergeParams
```js
var http = require('http')
var Router = require('router')
var finalhandler = require('finalhandler')
// this example is about the mergeParams option
var opts = { mergeParams: true }
// make a router with out special options
var router = Router(opts)
var server = http.createServer(function onRequest (req, res) {
// set something to be passed into the router
req.params = { type: 'kitten' }
router(req, res, finalhandler(req, res))
})
router.get('/', function (req, res) {
res.statusCode = 200
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
// with respond with the the params that were passed in
res.end(req.params.type + '\n')
})
// make another router with our options
var handler = Router(opts)
// mount our new router to a route that accepts a param
router.use('/:path', handler)
handler.get('/', function (req, res) {
res.statusCode = 200
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
// will respond with the param of the router's parent route
res.end(req.params.path + '\n')
})
// make our http server listen to connections
server.listen(8080)
```
Now you can get the type, or what path you are requesting:
```bash
curl http://127.0.0.1:8080
> kitten
curl http://127.0.0.1:8080/such_path
> such_path
```
### Example of advanced `.route()` usage
This example shows how to implement routes where there is a custom
handler to execute when the path matched, but no methods matched.
Without any special handling, this would be treated as just a
generic non-match by `router` (which typically results in a 404),
but with a custom handler, a `405 Method Not Allowed` can be sent.
```js
var http = require('http')
var finalhandler = require('finalhandler')
var Router = require('router')
// create the router and server
var router = new Router()
var server = http.createServer(function onRequest (req, res) {
router(req, res, finalhandler(req, res))
})
// register a route and add all methods
router.route('/pet/:id')
.get(function (req, res) {
// this is GET /pet/:id
res.setHeader('Content-Type', 'application/json')
res.end(JSON.stringify({ name: 'tobi' }))
})
.delete(function (req, res) {
// this is DELETE /pet/:id
res.end()
})
.all(function (req, res) {
// this is called for all other methods not
// defined above for /pet/:id
res.statusCode = 405
res.end()
})
// make our http server listen to connections
server.listen(8080)
```
## License
[MIT](LICENSE)
[ci-image]: https://badgen.net/github/checks/pillarjs/router/master?label=ci
[ci-url]: https://github.com/pillarjs/router/actions/workflows/ci.yml
[npm-image]: https://img.shields.io/npm/v/router.svg
[npm-url]: https://npmjs.org/package/router
[node-version-image]: https://img.shields.io/node/v/router.svg
[node-version-url]: http://nodejs.org/download/
[coveralls-image]: https://img.shields.io/coveralls/pillarjs/router/master.svg
[coveralls-url]: https://coveralls.io/r/pillarjs/router?branch=master
[downloads-image]: https://img.shields.io/npm/dm/router.svg
[downloads-url]: https://npmjs.org/package/router
@@ -0,0 +1,27 @@
'use strict'
let Container = require('./container')
let list = require('./list')
class Rule extends Container {
get selectors() {
return list.comma(this.selector)
}
set selectors(values) {
let match = this.selector ? this.selector.match(/,\s*/) : null
let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen')
this.selector = values.join(sep)
}
constructor(defaults) {
super(defaults)
this.type = 'rule'
if (!this.nodes) this.nodes = []
}
}
module.exports = Rule
Rule.default = Rule
Container.registerRule(Rule)
@@ -0,0 +1,17 @@
export function assertCryptoKey(key) {
if (!isCryptoKey(key)) {
throw new Error('CryptoKey instance expected');
}
}
export const isCryptoKey = (key) => {
if (key?.[Symbol.toStringTag] === 'CryptoKey')
return true;
try {
return key instanceof CryptoKey;
}
catch {
return false;
}
};
export const isKeyObject = (key) => key?.[Symbol.toStringTag] === 'KeyObject';
export const isKeyLike = (key) => isCryptoKey(key) || isKeyObject(key);
@@ -0,0 +1,363 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = applyDecs2203;
function applyDecs2203Factory() {
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
return function addInitializer(initializer) {
assertNotFinished(decoratorFinishedRef, "addInitializer");
assertCallable(initializer, "An initializer");
initializers.push(initializer);
};
}
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
var kindStr;
switch (kind) {
case 1:
kindStr = "accessor";
break;
case 2:
kindStr = "method";
break;
case 3:
kindStr = "getter";
break;
case 4:
kindStr = "setter";
break;
default:
kindStr = "field";
}
var ctx = {
kind: kindStr,
name: isPrivate ? "#" + name : name,
static: isStatic,
private: isPrivate
};
var decoratorFinishedRef = {
v: false
};
if (kind !== 0) {
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
}
var get, set;
if (kind === 0) {
if (isPrivate) {
get = desc.get;
set = desc.set;
} else {
get = function () {
return this[name];
};
set = function (v) {
this[name] = v;
};
}
} else if (kind === 2) {
get = function () {
return desc.value;
};
} else {
if (kind === 1 || kind === 3) {
get = function () {
return desc.get.call(this);
};
}
if (kind === 1 || kind === 4) {
set = function (v) {
desc.set.call(this, v);
};
}
}
ctx.access = get && set ? {
get: get,
set: set
} : get ? {
get: get
} : {
set: set
};
try {
return dec(value, ctx);
} finally {
decoratorFinishedRef.v = true;
}
}
function assertNotFinished(decoratorFinishedRef, fnName) {
if (decoratorFinishedRef.v) {
throw new Error("attempted to call " + fnName + " after decoration was finished");
}
}
function assertCallable(fn, hint) {
if (typeof fn !== "function") {
throw new TypeError(hint + " must be a function");
}
}
function assertValidReturnValue(kind, value) {
var type = typeof value;
if (kind === 1) {
if (type !== "object" || value === null) {
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
}
if (value.get !== undefined) {
assertCallable(value.get, "accessor.get");
}
if (value.set !== undefined) {
assertCallable(value.set, "accessor.set");
}
if (value.init !== undefined) {
assertCallable(value.init, "accessor.init");
}
} else if (type !== "function") {
var hint;
if (kind === 0) {
hint = "field";
} else if (kind === 10) {
hint = "class";
} else {
hint = "method";
}
throw new TypeError(hint + " decorators must return a function or void 0");
}
}
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
var decs = decInfo[0];
var desc, init, value;
if (isPrivate) {
if (kind === 0 || kind === 1) {
desc = {
get: decInfo[3],
set: decInfo[4]
};
} else if (kind === 3) {
desc = {
get: decInfo[3]
};
} else if (kind === 4) {
desc = {
set: decInfo[3]
};
} else {
desc = {
value: decInfo[3]
};
}
} else if (kind !== 0) {
desc = Object.getOwnPropertyDescriptor(base, name);
}
if (kind === 1) {
value = {
get: desc.get,
set: desc.set
};
} else if (kind === 2) {
value = desc.value;
} else if (kind === 3) {
value = desc.get;
} else if (kind === 4) {
value = desc.set;
}
var newValue, get, set;
if (typeof decs === "function") {
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value);
if (newValue !== void 0) {
assertValidReturnValue(kind, newValue);
if (kind === 0) {
init = newValue;
} else if (kind === 1) {
init = newValue.init;
get = newValue.get || value.get;
set = newValue.set || value.set;
value = {
get: get,
set: set
};
} else {
value = newValue;
}
}
} else {
for (var i = decs.length - 1; i >= 0; i--) {
var dec = decs[i];
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value);
if (newValue !== void 0) {
assertValidReturnValue(kind, newValue);
var newInit;
if (kind === 0) {
newInit = newValue;
} else if (kind === 1) {
newInit = newValue.init;
get = newValue.get || value.get;
set = newValue.set || value.set;
value = {
get: get,
set: set
};
} else {
value = newValue;
}
if (newInit !== void 0) {
if (init === void 0) {
init = newInit;
} else if (typeof init === "function") {
init = [init, newInit];
} else {
init.push(newInit);
}
}
}
}
}
if (kind === 0 || kind === 1) {
if (init === void 0) {
init = function (instance, init) {
return init;
};
} else if (typeof init !== "function") {
var ownInitializers = init;
init = function (instance, init) {
var value = init;
for (var i = 0; i < ownInitializers.length; i++) {
value = ownInitializers[i].call(instance, value);
}
return value;
};
} else {
var originalInitializer = init;
init = function (instance, init) {
return originalInitializer.call(instance, init);
};
}
ret.push(init);
}
if (kind !== 0) {
if (kind === 1) {
desc.get = value.get;
desc.set = value.set;
} else if (kind === 2) {
desc.value = value;
} else if (kind === 3) {
desc.get = value;
} else if (kind === 4) {
desc.set = value;
}
if (isPrivate) {
if (kind === 1) {
ret.push(function (instance, args) {
return value.get.call(instance, args);
});
ret.push(function (instance, args) {
return value.set.call(instance, args);
});
} else if (kind === 2) {
ret.push(value);
} else {
ret.push(function (instance, args) {
return value.call(instance, args);
});
}
} else {
Object.defineProperty(base, name, desc);
}
}
}
function applyMemberDecs(ret, Class, decInfos) {
var protoInitializers;
var staticInitializers;
var existingProtoNonFields = new Map();
var existingStaticNonFields = new Map();
for (var i = 0; i < decInfos.length; i++) {
var decInfo = decInfos[i];
if (!Array.isArray(decInfo)) continue;
var kind = decInfo[1];
var name = decInfo[2];
var isPrivate = decInfo.length > 3;
var isStatic = kind >= 5;
var base;
var initializers;
if (isStatic) {
base = Class;
kind = kind - 5;
if (kind !== 0) {
staticInitializers = staticInitializers || [];
initializers = staticInitializers;
}
} else {
base = Class.prototype;
if (kind !== 0) {
protoInitializers = protoInitializers || [];
initializers = protoInitializers;
}
}
if (kind !== 0 && !isPrivate) {
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
var existingKind = existingNonFields.get(name) || 0;
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
} else if (!existingKind && kind > 2) {
existingNonFields.set(name, kind);
} else {
existingNonFields.set(name, true);
}
}
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
}
pushInitializers(ret, protoInitializers);
pushInitializers(ret, staticInitializers);
}
function pushInitializers(ret, initializers) {
if (initializers) {
ret.push(function (instance) {
for (var i = 0; i < initializers.length; i++) {
initializers[i].call(instance);
}
return instance;
});
}
}
function applyClassDecs(ret, targetClass, classDecs) {
if (classDecs.length > 0) {
var initializers = [];
var newClass = targetClass;
var name = targetClass.name;
for (var i = classDecs.length - 1; i >= 0; i--) {
var decoratorFinishedRef = {
v: false
};
try {
var nextNewClass = classDecs[i](newClass, {
kind: "class",
name: name,
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
});
} finally {
decoratorFinishedRef.v = true;
}
if (nextNewClass !== undefined) {
assertValidReturnValue(10, nextNewClass);
newClass = nextNewClass;
}
}
ret.push(newClass, function () {
for (var i = 0; i < initializers.length; i++) {
initializers[i].call(newClass);
}
});
}
}
return function applyDecs2203Impl(targetClass, memberDecs, classDecs) {
var ret = [];
applyMemberDecs(ret, targetClass, memberDecs);
applyClassDecs(ret, targetClass, classDecs);
return ret;
};
}
var applyDecs2203Impl;
function applyDecs2203(targetClass, memberDecs, classDecs) {
applyDecs2203Impl = applyDecs2203Impl || applyDecs2203Factory();
return applyDecs2203Impl(targetClass, memberDecs, classDecs);
}
//# sourceMappingURL=applyDecs2203.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_9C","2":"_aB"},C:{"2":"_yJ","4609":"_rD","4674":"hC","5698":"GC","7490":"_hE _JH EC","7746":"FC gC","8705":"_RN _WC"},D:{"1":"_GK","2":"_JJ","4097":"LC","4290":"_GD","6148":"_DD"},E:{"1":"_dE","2":"_qB","4609":"_7Q","8193":"_CC RD SD"},F:{"1":"_8L","2":"_j _sK _O","4097":"AC","6148":"_jI _jE"},G:{"1":"_TE","2":"_XB","4097":"_GG pD"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"4097":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"2":"_pC","4097":"_yB"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","2":"LE"}},B:5,C:"Variable fonts",D:true};
@@ -0,0 +1,164 @@
/*! *****************************************************************************
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.
***************************************************************************** */
declare namespace Intl {
interface DateTimeFormatPartTypesRegistry {
fractionalSecond: any;
}
interface DateTimeFormatOptions {
formatMatcher?: "basic" | "best fit" | "best fit" | undefined;
dateStyle?: "full" | "long" | "medium" | "short" | undefined;
timeStyle?: "full" | "long" | "medium" | "short" | undefined;
dayPeriod?: "narrow" | "short" | "long" | undefined;
fractionalSecondDigits?: 1 | 2 | 3 | undefined;
}
interface DateTimeRangeFormatPart extends DateTimeFormatPart {
source: "startRange" | "endRange" | "shared";
}
interface DateTimeFormat {
formatRange(startDate: Date | number | bigint, endDate: Date | number | bigint): string;
formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeRangeFormatPart[];
}
interface ResolvedDateTimeFormatOptions {
formatMatcher?: "basic" | "best fit" | "best fit";
dateStyle?: "full" | "long" | "medium" | "short";
timeStyle?: "full" | "long" | "medium" | "short";
hourCycle?: "h11" | "h12" | "h23" | "h24";
dayPeriod?: "narrow" | "short" | "long";
fractionalSecondDigits?: 1 | 2 | 3;
}
/**
* The locale matching algorithm to use.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
type ListFormatLocaleMatcher = "lookup" | "best fit";
/**
* The format of output message.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
type ListFormatType = "conjunction" | "disjunction" | "unit";
/**
* The length of the formatted message.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
type ListFormatStyle = "long" | "short" | "narrow";
/**
* An object with some or all properties of the `Intl.ListFormat` constructor `options` parameter.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
interface ListFormatOptions {
/** The locale matching algorithm to use. For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation). */
localeMatcher?: ListFormatLocaleMatcher | undefined;
/** The format of output message. */
type?: ListFormatType | undefined;
/** The length of the internationalized message. */
style?: ListFormatStyle | undefined;
}
interface ResolvedListFormatOptions {
locale: string;
style: ListFormatStyle;
type: ListFormatType;
}
interface ListFormat {
/**
* Returns a string with a language-specific representation of the list.
*
* @param list - An iterable object, such as an [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array).
*
* @throws `TypeError` if `list` includes something other than the possible values.
*
* @returns {string} A language-specific formatted string representing the elements of the list.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/format).
*/
format(list: Iterable<string>): string;
/**
* Returns an Array of objects representing the different components that can be used to format a list of values in a locale-aware fashion.
*
* @param list - An iterable object, such as an [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array), to be formatted according to a locale.
*
* @throws `TypeError` if `list` includes something other than the possible values.
*
* @returns {{ type: "element" | "literal", value: string; }[]} An Array of components which contains the formatted parts from the list.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts).
*/
formatToParts(list: Iterable<string>): { type: "element" | "literal"; value: string; }[];
/**
* Returns a new object with properties reflecting the locale and style
* formatting options computed during the construction of the current
* `Intl.ListFormat` object.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/resolvedOptions).
*/
resolvedOptions(): ResolvedListFormatOptions;
}
const ListFormat: {
prototype: ListFormat;
/**
* Creates [Intl.ListFormat](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat) objects that
* enable language-sensitive list formatting.
*
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
* For the general form and interpretation of the `locales` argument,
* see the [`Intl` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
*
* @param options - An [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters)
* with some or all options of `ListFormatOptions`.
*
* @returns [Intl.ListFormatOptions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat) object.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat).
*/
new (locales?: LocalesArgument, options?: ListFormatOptions): ListFormat;
/**
* Returns an array containing those of the provided locales that are
* supported in list formatting without having to fall back to the runtime's default locale.
*
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
* For the general form and interpretation of the `locales` argument,
* see the [`Intl` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
*
* @param options - An [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/supportedLocalesOf#parameters).
* with some or all possible options.
*
* @returns An array of strings representing a subset of the given locale tags that are supported in list
* formatting without having to fall back to the runtime's default locale.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/supportedLocalesOf).
*/
supportedLocalesOf(locales: LocalesArgument, options?: Pick<ListFormatOptions, "localeMatcher">): UnicodeBCP47LocaleIdentifier[];
};
}
@@ -0,0 +1 @@
{"version":3,"file":"useCanGoBack.js","names":[],"sources":["../../src/useCanGoBack.ts"],"sourcesContent":["import { useStore } from '@tanstack/react-store'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\n\nexport function useCanGoBack() {\n const router = useRouter()\n\n if (isServer ?? router.isServer) {\n return router.stores.location.get().state.__TSR_index !== 0\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static\n return useStore(\n router.stores.location,\n (location) => location.state.__TSR_index !== 0,\n )\n}\n"],"mappings":";;;;AAIA,SAAgB,eAAe;CAC7B,MAAM,SAAS,WAAW;AAE1B,KAAI,YAAY,OAAO,SACrB,QAAO,OAAO,OAAO,SAAS,KAAK,CAAC,MAAM,gBAAgB;AAI5D,QAAO,SACL,OAAO,OAAO,WACb,aAAa,SAAS,MAAM,gBAAgB,EAC9C"}
@@ -0,0 +1 @@
{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../src/encode.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD;AACD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAExD"}
@@ -0,0 +1,38 @@
/**
* touch.ts 12.6.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/
/**
* Detect touch support - Windows Surface devices and other touch devices
* should we use this instead ? (what we had for always showing resize handles)
* /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
*/
export declare const isTouch: boolean;
export declare class DDTouch {
/** set to true while we are handling touch dragging, to prevent accepting browser real mouse events (trusted:true) vs our simulated ones (trusted:false) */
static touchHandled: boolean;
static pointerLeaveTimeout: number;
}
/**
* Handle the touchstart events
* @param {Object} e The widget element's touchstart event
*/
export declare function touchstart(e: TouchEvent): void;
/**
* Handle the touchmove events
* @param {Object} e The document's touchmove event
*/
export declare function touchmove(e: TouchEvent): void;
/**
* Handle the touchend events
* @param {Object} e The document's touchend event
*/
export declare function touchend(e: TouchEvent): void;
/**
* Note we don't get touchenter/touchleave (which are deprecated)
* see https://stackoverflow.com/questions/27908339/js-touch-equivalent-for-mouseenter
* so instead of PointerEvent to still get enter/leave and send the matching mouse event.
*/
export declare function pointerdown(e: PointerEvent): void;
export declare function pointerenter(e: PointerEvent): void;
export declare function pointerleave(e: PointerEvent): void;
@@ -0,0 +1,51 @@
[
"AggregateError",
"Array",
"ArrayBuffer",
"Atomics",
"BigInt",
"BigInt64Array",
"BigUint64Array",
"Boolean",
"DataView",
"Date",
"Error",
"EvalError",
"FinalizationRegistry",
"Float16Array",
"Float32Array",
"Float64Array",
"Function",
"Infinity",
"Int16Array",
"Int32Array",
"Int8Array",
"Intl",
"Iterator",
"JSON",
"Map",
"Math",
"NaN",
"Number",
"Object",
"Promise",
"Proxy",
"RangeError",
"ReferenceError",
"Reflect",
"RegExp",
"Set",
"SharedArrayBuffer",
"String",
"Symbol",
"SyntaxError",
"TypeError",
"Uint16Array",
"Uint32Array",
"Uint8Array",
"Uint8ClampedArray",
"URIError",
"WeakMap",
"WeakRef",
"WeakSet"
]
@@ -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).Motion={})}(this,function(t){"use strict";function e(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let n=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n=(t,e,n)=>{if(!t)throw new Error(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n))});const i=t=>t,s=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},o=t=>1e3*t,a=t=>t/1e3;function r(t,e){return n=t,Array.isArray(n)&&"number"!=typeof n[0]?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t;var n}const l=(t,e,n)=>t+(e-t)*n,u=2e4;function h(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(function(t){let e=0,n=t.next(e);for(;!n.done&&e<u;)e+=50,n=t.next(e);return e>=u?1/0:e}(i),u);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:a(s)}}function c(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const o=s(0,e,i);t.push(l(n,1,o))}}function f(t){const e=[0];return c(e,t.length-1),e}const d=t=>null!==t;class m{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}function p(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const g=t=>t.startsWith("--");const y={};function A(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>y[e]??n()}const T=A(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),b=A(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),v=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,k={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:v([0,.65,.55,1]),circOut:v([.55,0,1,.45]),backIn:v([.31,.01,.66,-.59]),backOut:v([.33,1.53,.69,.99])};function S(t,e){return t?"function"==typeof t?b()?((t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`})(t,e):"ease-out":(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?v(t):Array.isArray(t)?t.map(t=>S(t,e)||k.easeOut):k[t]:void 0}function E(t){return"function"==typeof t&&"applyToOptions"in t}class w extends m{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:i,keyframes:s,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:r,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=a,this.options=t,n("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return E(t)&&b()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:r="easeOut",times:l}={},u){const h={[e]:n};l&&(h.offset=l);const c=S(r,s);Array.isArray(c)&&(h.easing=c);const f={delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(h,f)}(e,i,s,u,o),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=function(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(d),a=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return a&&void 0!==i?i:o[a]}(s,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(t),function(t,e,n){g(e)?t.style.setProperty(e,n):t.style[e]=n}(e,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return a(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+a(t)}get time(){return a(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=o(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return thLine truncated
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CornerDownRight = createLucideIcon("CornerDownRight", [
["polyline", { points: "15 10 20 15 15 20", key: "1q7qjw" }],
["path", { d: "M4 4v7a4 4 0 0 0 4 4h12", key: "z08zvw" }]
]);
export { CornerDownRight as default };
//# sourceMappingURL=corner-down-right.js.map
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const NotebookText = createLucideIcon("NotebookText", [
["path", { d: "M2 6h4", key: "aawbzj" }],
["path", { d: "M2 10h4", key: "l0bgd4" }],
["path", { d: "M2 14h4", key: "1gsvsf" }],
["path", { d: "M2 18h4", key: "1bu2t1" }],
["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", key: "1nb95v" }],
["path", { d: "M9.5 8h5", key: "11mslq" }],
["path", { d: "M9.5 12H16", key: "ktog6x" }],
["path", { d: "M9.5 16H14", key: "p1seyn" }]
]);
export { NotebookText as default };
//# sourceMappingURL=notebook-text.js.map
@@ -0,0 +1 @@
{"version":3,"file":"tags.js","sources":["../../../src/icons/tags.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Tags\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTUgNSA2LjMgNi4zYTIuNCAyLjQgMCAwIDEgMCAzLjRMMTcgMTkiIC8+CiAgPHBhdGggZD0iTTkuNTg2IDUuNTg2QTIgMiAwIDAgMCA4LjE3MiA1SDNhMSAxIDAgMCAwLTEgMXY1LjE3MmEyIDIgMCAwIDAgLjU4NiAxLjQxNEw4LjI5IDE4LjI5YTIuNDI2IDIuNDI2IDAgMCAwIDMuNDIgMGwzLjU4LTMuNThhMi40MjYgMi40MjYgMCAwIDAgMC0zLjQyeiIgLz4KICA8Y2lyY2xlIGN4PSI2LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSJjdXJyZW50Q29sb3IiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/tags\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 Tags = createLucideIcon('Tags', [\n ['path', { d: 'm15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19', key: '1cbfv1' }],\n [\n 'path',\n {\n d: 'M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z',\n key: '135mg7',\n },\n ],\n ['circle', { cx: '6.5', cy: '9.5', r: '.5', fill: 'currentColor', key: '5pm5xn' }],\n]);\n\nexport default Tags;\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,CAA2C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxE,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAE,CAAA,CAAA,CAAA,EAAI,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,9 @@
export interface Options {
allowAsThisParameter?: boolean;
allowInGenericTypeArguments?: boolean | [string, ...string[]];
}
export type MessageIds = 'invalidVoidForGeneric' | 'invalidVoidNotReturn' | 'invalidVoidNotReturnOrGeneric' | 'invalidVoidNotReturnOrThisParam' | 'invalidVoidNotReturnOrThisParamOrGeneric' | 'invalidVoidUnionConstituent';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, [Options], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -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 BookType = createLucideIcon("BookType", [
["path", { d: "M10 13h4", key: "ytezjc" }],
["path", { d: "M12 6v7", key: "1f6ttz" }],
["path", { d: "M16 8V6H8v2", key: "x8j6u4" }],
[
"path",
{
d: "M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",
key: "k3hazp"
}
]
]);
export { BookType as default };
//# sourceMappingURL=book-type.js.map
@@ -0,0 +1 @@
{"version":3,"names":["TaggedTemplateExpression","node","print","tag","typeParameters","quasi","TemplateElement","Error","_printTemplate","substitutions","quasis","partRaw","i","length","value","raw","token","tokenMap","findMatching","_catchUpTo","loc","start","TemplateLiteral","call","expressions"],"sources":["../../src/generators/template-literals.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport type * as t from \"@babel/types\";\n\nexport function TaggedTemplateExpression(\n this: Printer,\n node: t.TaggedTemplateExpression,\n) {\n this.print(node.tag);\n if (process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n this.print(node.typeArguments);\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n this.print(node.typeParameters);\n }\n this.print(node.quasi);\n}\n\nexport function TemplateElement(this: Printer) {\n throw new Error(\"TemplateElement printing is handled in TemplateLiteral\");\n}\n\nexport type TemplateLiteralBase = t.Node & {\n quasis: t.TemplateElement[];\n};\n\nexport function _printTemplate<T extends t.Node>(\n this: Printer,\n node: TemplateLiteralBase,\n substitutions: T[],\n) {\n const quasis = node.quasis;\n let partRaw = \"`\";\n for (let i = 0; i < quasis.length - 1; i++) {\n partRaw += quasis[i].value.raw;\n this.token(partRaw + \"${\", true);\n this.print(substitutions[i]);\n partRaw = \"}\";\n\n // In Babel 7 we have individual tokens for ${ and }, so the automatic\n // catchup logic does not work. Manually look for those tokens.\n if (!process.env.BABEL_8_BREAKING && this.tokenMap) {\n const token = this.tokenMap.findMatching(node, \"}\", i);\n if (token) this._catchUpTo(token.loc.start);\n }\n }\n partRaw += quasis[quasis.length - 1].value.raw;\n this.token(partRaw + \"`\", true);\n}\n\nexport function TemplateLiteral(this: Printer, node: t.TemplateLiteral) {\n _printTemplate.call(this, node, node.expressions);\n}\n"],"mappings":";;;;;;;;;AAGO,SAASA,wBAAwBA,CAEtCC,IAAgC,EAChC;EACA,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,GAAG,CAAC;EAMlB,IAAI,CAACD,KAAK,CAACD,IAAI,CAACG,cAAc,CAAC;EAEjC,IAAI,CAACF,KAAK,CAACD,IAAI,CAACI,KAAK,CAAC;AACxB;AAEO,SAASC,eAAeA,CAAA,EAAgB;EAC7C,MAAM,IAAIC,KAAK,CAAC,wDAAwD,CAAC;AAC3E;AAMO,SAASC,cAAcA,CAE5BP,IAAyB,EACzBQ,aAAkB,EAClB;EACA,MAAMC,MAAM,GAAGT,IAAI,CAACS,MAAM;EAC1B,IAAIC,OAAO,GAAG,GAAG;EACjB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,CAACG,MAAM,GAAG,CAAC,EAAED,CAAC,EAAE,EAAE;IAC1CD,OAAO,IAAID,MAAM,CAACE,CAAC,CAAC,CAACE,KAAK,CAACC,GAAG;IAC9B,IAAI,CAACC,KAAK,CAACL,OAAO,GAAG,IAAI,EAAE,IAAI,CAAC;IAChC,IAAI,CAACT,KAAK,CAACO,aAAa,CAACG,CAAC,CAAC,CAAC;IAC5BD,OAAO,GAAG,GAAG;IAIb,IAAqC,IAAI,CAACM,QAAQ,EAAE;MAClD,MAAMD,KAAK,GAAG,IAAI,CAACC,QAAQ,CAACC,YAAY,CAACjB,IAAI,EAAE,GAAG,EAAEW,CAAC,CAAC;MACtD,IAAII,KAAK,EAAE,IAAI,CAACG,UAAU,CAACH,KAAK,CAACI,GAAG,CAACC,KAAK,CAAC;IAC7C;EACF;EACAV,OAAO,IAAID,MAAM,CAACA,MAAM,CAACG,MAAM,GAAG,CAAC,CAAC,CAACC,KAAK,CAACC,GAAG;EAC9C,IAAI,CAACC,KAAK,CAACL,OAAO,GAAG,GAAG,EAAE,IAAI,CAAC;AACjC;AAEO,SAASW,eAAeA,CAAgBrB,IAAuB,EAAE;EACtEO,cAAc,CAACe,IAAI,CAAC,IAAI,EAAEtB,IAAI,EAAEA,IAAI,CAACuB,WAAW,CAAC;AACnD","ignoreList":[]}
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/index.ts", "../src/select.tsx"],
"sourcesContent": ["'use client';\nexport {\n createSelectScope,\n //\n Select,\n SelectTrigger,\n SelectValue,\n SelectIcon,\n SelectPortal,\n SelectContent,\n SelectViewport,\n SelectGroup,\n SelectLabel,\n SelectItem,\n SelectItemText,\n SelectItemIndicator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n SelectSeparator,\n SelectArrow,\n //\n Root,\n Trigger,\n Value,\n Icon,\n Portal,\n Content,\n Viewport,\n Group,\n Label,\n Item,\n ItemText,\n ItemIndicator,\n ScrollUpButton,\n ScrollDownButton,\n Separator,\n Arrow,\n} from './select';\nexport type {\n SelectProps,\n SelectTriggerProps,\n SelectValueProps,\n SelectIconProps,\n SelectPortalProps,\n SelectContentProps,\n SelectViewportProps,\n SelectGroupProps,\n SelectLabelProps,\n SelectItemProps,\n SelectItemTextProps,\n SelectItemIndicatorProps,\n SelectScrollUpButtonProps,\n SelectScrollDownButtonProps,\n SelectSeparatorProps,\n SelectArrowProps,\n} from './select';\n", "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { clamp } from '@radix-ui/number';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { createSlot } from '@radix-ui/react-slot';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { VISUALLY_HIDDEN_STYLES } from '@radix-ui/react-visually-hidden';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\nconst OPEN_KEYS = [' ', 'Enter', 'ArrowUp', 'ArrowDown'];\nconst SELECTION_KEYS = [' ', 'Enter'];\n\n/* -------------------------------------------------------------------------------------------------\n * Select\n * -----------------------------------------------------------------------------------------------*/\n\nconst SELECT_NAME = 'Select';\n\ntype ItemData = { value: string; disabled: boolean; textValue: string };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n SelectItemElement,\n ItemData\n>(SELECT_NAME);\n\ntype ScopedProps<P> = P & { __scopeSelect?: Scope };\nconst [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [\n createCollectionScope,\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\n\ntype SelectContextValue = {\n trigger: SelectTriggerElement | null;\n onTriggerChange(node: SelectTriggerElement | null): void;\n valueNode: SelectValueElement | null;\n onValueNodeChange(node: SelectValueElement): void;\n valueNodeHasChildren: boolean;\n onValueNodeHasChildrenChange(hasChildren: boolean): void;\n contentId: string;\n value: string | undefined;\n onValueChange(value: string): void;\n open: boolean;\n required?: boolean;\n onOpenChange(open: boolean): void;\n dir: SelectProps['dir'];\n triggerPointerDownPosRef: React.MutableRefObject<{ x: number; y: number } | null>;\n disabled?: boolean;\n};\n\nconst [SelectProvider, useSelectContext] = createSelectContext<SelectContextValue>(SELECT_NAME);\n\ntype NativeOption = React.ReactElement<React.ComponentProps<'option'>>;\n\ntype SelectNativeOptionsContextValue = {\n onNativeOptionAdd(option: NativeOption): void;\n onNativeOptionRemove(option: NativeOption): void;\n};\nconst [SelectNativeOptionsProvider, useSelectNativeOptionsContext] =\n createSelectContext<SelectNativeOptionsContextValue>(SELECT_NAME);\n\ninterface ControlledClearableSelectProps {\n value: string | undefined;\n defaultValue?: never;\n onValueChange: (value: string | undefined) => void;\n}\n\ninterface ControlledUnclearableSelectProps {\n value: string;\n defaultValue?: never;\n onValueChange: (value: string) => void;\n}\n\ninterface UncontrolledSelectProps {\n value?: never;\n defaultValue?: string;\n onValueChange?: {\n (value: string): void;\n (value: string | undefined): void;\n };\n}\n\ntype SelectControlProps =\n | ControlledClearableSelectProps\n | ControlledUnclearableSelectProps\n | UncontrollLine truncated
"mappings": "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 truncated
"names": ["Arrow", "Content", "Root", "PortalPrimitive", "handleScroll", "canScrollUp", "canScrollDown", "Root", "Content", "Arrow"]
}
@@ -0,0 +1,15 @@
/**
* @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 ArrowBigLeft = createLucideIcon("ArrowBigLeft", [
["path", { d: "M18 15h-6v4l-7-7 7-7v4h6v6z", key: "lbrdak" }]
]);
export { ArrowBigLeft as default };
//# sourceMappingURL=arrow-big-left.js.map
@@ -0,0 +1,120 @@
# thenify
[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Dependency Status][david-image]][david-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
Promisify a callback-based function using [`any-promise`](https://github.com/kevinbeaty/any-promise).
- Preserves function names
- Uses a native promise implementation if available and tries to fall back to a promise implementation such as `bluebird`
- Converts multiple arguments from the callback into an `Array`, also support change the behavior by `options.multiArgs`
- Resulting function never deoptimizes
- Supports both callback and promise style
An added benefit is that `throw`n errors in that async function will be caught by the promise!
## API
### fn = thenify(fn, options)
Promisifies a function.
### Options
`options` are optional.
- `options.withCallback` - support both callback and promise style, default to `false`.
- `options.multiArgs` - change the behavior when callback have multiple arguments. default to `true`.
- `true` - converts multiple arguments to an array
- `false`- always use the first argument
- `Array` - converts multiple arguments to an object with keys provided in `options.multiArgs`
- Turn async functions into promises
```js
var thenify = require('thenify');
var somethingAsync = thenify(function somethingAsync(a, b, c, callback) {
callback(null, a, b, c);
});
```
- Backward compatible with callback
```js
var thenify = require('thenify');
var somethingAsync = thenify(function somethingAsync(a, b, c, callback) {
callback(null, a, b, c);
}, { withCallback: true });
// somethingAsync(a, b, c).then(onFulfilled).catch(onRejected);
// somethingAsync(a, b, c, function () {});
```
or use `thenify.withCallback()`
```js
var thenify = require('thenify').withCallback;
var somethingAsync = thenify(function somethingAsync(a, b, c, callback) {
callback(null, a, b, c);
});
// somethingAsync(a, b, c).then(onFulfilled).catch(onRejected);
// somethingAsync(a, b, c, function () {});
```
- Always return the first argument in callback
```js
var thenify = require('thenify');
var promise = thenify(function (callback) {
callback(null, 1, 2, 3);
}, { multiArgs: false });
// promise().then(function onFulfilled(value) {
// assert.equal(value, 1);
// });
```
- Converts callback arguments to an object
```js
var thenify = require('thenify');
var promise = thenify(function (callback) {
callback(null, 1, 2, 3);
}, { multiArgs: [ 'one', 'tow', 'three' ] });
// promise().then(function onFulfilled(value) {
// assert.deepEqual(value, {
// one: 1,
// tow: 2,
// three: 3
// });
// });
```
[gitter-image]: https://badges.gitter.im/thenables/thenify.png
[gitter-url]: https://gitter.im/thenables/thenify
[npm-image]: https://img.shields.io/npm/v/thenify.svg?style=flat-square
[npm-url]: https://npmjs.org/package/thenify
[github-tag]: http://img.shields.io/github/tag/thenables/thenify.svg?style=flat-square
[github-url]: https://github.com/thenables/thenify/tags
[travis-image]: https://img.shields.io/travis/thenables/thenify.svg?style=flat-square
[travis-url]: https://travis-ci.org/thenables/thenify
[coveralls-image]: https://img.shields.io/coveralls/thenables/thenify.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/thenables/thenify
[david-image]: http://img.shields.io/david/thenables/thenify.svg?style=flat-square
[david-url]: https://david-dm.org/thenables/thenify
[license-image]: http://img.shields.io/npm/l/thenify.svg?style=flat-square
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/thenify.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/thenify