fix(products): fix breadcrumbs and product filtering (backport from main)
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions

View File

@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.441.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 CornerDownLeft = createLucideIcon("CornerDownLeft", [
["polyline", { points: "9 10 4 15 9 20", key: "r3jprv" }],
["path", { d: "M20 4v7a4 4 0 0 1-4 4H4", key: "6o5b7l" }]
]);
export { CornerDownLeft as default };
//# sourceMappingURL=corner-down-left.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"badge-percent.js","sources":["../../../src/icons/badge-percent.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BadgePercent\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMy44NSA4LjYyYTQgNCAwIDAgMSA0Ljc4LTQuNzcgNCA0IDAgMCAxIDYuNzQgMCA0IDQgMCAwIDEgNC43OCA0Ljc4IDQgNCAwIDAgMSAwIDYuNzQgNCA0IDAgMCAxLTQuNzcgNC43OCA0IDQgMCAwIDEtNi43NSAwIDQgNCAwIDAgMS00Ljc4LTQuNzcgNCA0IDAgMCAxIDAtNi43NloiIC8+CiAgPHBhdGggZD0ibTE1IDktNiA2IiAvPgogIDxwYXRoIGQ9Ik05IDloLjAxIiAvPgogIDxwYXRoIGQ9Ik0xNSAxNWguMDEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/badge-percent\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 BadgePercent = createLucideIcon('BadgePercent', [\n [\n 'path',\n {\n d: 'M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z',\n key: '3c2336',\n },\n ],\n ['path', { d: 'm15 9-6 6', key: '1uzhvr' }],\n ['path', { d: 'M9 9h.01', key: '1q5me6' }],\n ['path', { d: 'M15 15h.01', key: 'lqbp3k' }],\n]);\n\nexport default BadgePercent;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CACpD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"react-select.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}

View File

@@ -0,0 +1,69 @@
import { useContext, useId, useEffect, useCallback } from 'react';
import { PresenceContext } from '../../context/PresenceContext.mjs';
/**
* When a component is the child of `AnimatePresence`, it can use `usePresence`
* to access information about whether it's still present in the React tree.
*
* ```jsx
* import { usePresence } from "framer-motion"
*
* export const Component = () => {
* const [isPresent, safeToRemove] = usePresence()
*
* useEffect(() => {
* !isPresent && setTimeout(safeToRemove, 1000)
* }, [isPresent])
*
* return <div />
* }
* ```
*
* If `isPresent` is `false`, it means that a component has been removed the tree, but
* `AnimatePresence` won't really remove it until `safeToRemove` has been called.
*
* @public
*/
function usePresence(subscribe = true) {
const context = useContext(PresenceContext);
if (context === null)
return [true, null];
const { isPresent, onExitComplete, register } = context;
// It's safe to call the following hooks conditionally (after an early return) because the context will always
// either be null or non-null for the lifespan of the component.
const id = useId();
useEffect(() => {
if (subscribe)
register(id);
}, [subscribe]);
const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);
return !isPresent && onExitComplete ? [false, safeToRemove] : [true];
}
/**
* Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.
* There is no `safeToRemove` function.
*
* ```jsx
* import { useIsPresent } from "framer-motion"
*
* export const Component = () => {
* const isPresent = useIsPresent()
*
* useEffect(() => {
* !isPresent && console.log("I've been removed!")
* }, [isPresent])
*
* return <div />
* }
* ```
*
* @public
*/
function useIsPresent() {
return isPresent(useContext(PresenceContext));
}
function isPresent(context) {
return context === null ? true : context.isPresent;
}
export { isPresent, useIsPresent, usePresence };

View File

@@ -0,0 +1 @@
{"version":3,"file":"isPlainObject.d.ts","sourceRoot":"","sources":["../../src/utilities/isPlainObject.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAQ7C"}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"A B","2":"K D E F zC"},B:{"1":"0 1 2 3 4 5 6 7 8 C L M G N O P Q H R S T U V W X Y Z 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 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I"},C:{"1":"0 1 2 3 4 5 6 7 8 HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z 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 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","2":"0C VC J bB K D E F A B C L M G N 4C 5C","4":"9 O P cB AB BB CB DB EB FB GB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z 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 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"J"},E:{"1":"bB K D E F A B C L M G 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J 6C bC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z 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","2":"F B C JD KD LD MD PC xC ND QC"},G:{"1":"E OD yC PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"bC"},H:{"2":"mD"},I:{"1":"VC J I oD pD qD yC rD sD","2":"nD"},J:{"1":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"1":"A B"},O:{"1":"RC"},P:{"1":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:1,C:"sandbox attribute for iframes",D:true};

View File

@@ -0,0 +1,16 @@
import resolveUri from '@jridgewell/resolve-uri';
import stripFilename from './strip-filename';
type Resolve = (source: string | null) => string;
export default function resolver(
mapUrl: string | null | undefined,
sourceRoot: string | undefined,
): Resolve {
const from = stripFilename(mapUrl);
// The sourceRoot is always treated as a directory, if it's not empty.
// https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327
// https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401
const prefix = sourceRoot ? sourceRoot + '/' : '';
return (source) => resolveUri(prefix + (source || ''), from);
}

View File

@@ -0,0 +1,30 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = scrollbarSize;
var _canUseDOM = _interopRequireDefault(require("./canUseDOM"));
var size;
function scrollbarSize(recalc) {
if (!size && size !== 0 || recalc) {
if (_canUseDOM.default) {
var scrollDiv = document.createElement('div');
scrollDiv.style.position = 'absolute';
scrollDiv.style.top = '-9999px';
scrollDiv.style.width = '50px';
scrollDiv.style.height = '50px';
scrollDiv.style.overflow = 'scroll';
document.body.appendChild(scrollDiv);
size = scrollDiv.offsetWidth - scrollDiv.clientWidth;
document.body.removeChild(scrollDiv);
}
}
return size;
}
module.exports = exports["default"];

View File

@@ -0,0 +1,47 @@
import type { SQLiteDatabase, SQLiteRunResult, SQLiteStatement } from 'expo-sqlite';
import { entityKind } from "../entity.js";
import type { Logger } from "../logger.js";
import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.js";
import { type Query } from "../sql/sql.js";
import type { SQLiteSyncDialect } from "../sqlite-core/dialect.js";
import { SQLiteTransaction } from "../sqlite-core/index.js";
import type { SelectedFieldsOrdered } from "../sqlite-core/query-builders/select.types.js";
import { type PreparedQueryConfig as PreparedQueryConfigBase, type SQLiteExecuteMethod, SQLitePreparedQuery, SQLiteSession, type SQLiteTransactionConfig } from "../sqlite-core/session.js";
export interface ExpoSQLiteSessionOptions {
logger?: Logger;
}
type PreparedQueryConfig = Omit<PreparedQueryConfigBase, 'statement' | 'run'>;
export declare class ExpoSQLiteSession<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends SQLiteSession<'sync', SQLiteRunResult, TFullSchema, TSchema> {
private client;
private schema;
static readonly [entityKind]: string;
private logger;
constructor(client: SQLiteDatabase, dialect: SQLiteSyncDialect, schema: RelationalSchemaConfig<TSchema> | undefined, options?: ExpoSQLiteSessionOptions);
prepareQuery<T extends Omit<PreparedQueryConfig, 'run'>>(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => unknown): ExpoSQLitePreparedQuery<T>;
transaction<T>(transaction: (tx: ExpoSQLiteTransaction<TFullSchema, TSchema>) => T, config?: SQLiteTransactionConfig): T;
}
export declare class ExpoSQLiteTransaction<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends SQLiteTransaction<'sync', SQLiteRunResult, TFullSchema, TSchema> {
static readonly [entityKind]: string;
transaction<T>(transaction: (tx: ExpoSQLiteTransaction<TFullSchema, TSchema>) => T): T;
}
export declare class ExpoSQLitePreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends SQLitePreparedQuery<{
type: 'sync';
run: SQLiteRunResult;
all: T['all'];
get: T['get'];
values: T['values'];
execute: T['execute'];
}> {
private stmt;
private logger;
private fields;
private _isResponseInArrayMode;
private customResultMapper?;
static readonly [entityKind]: string;
constructor(stmt: SQLiteStatement, query: Query, logger: Logger, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, _isResponseInArrayMode: boolean, customResultMapper?: ((rows: unknown[][]) => unknown) | undefined);
run(placeholderValues?: Record<string, unknown>): SQLiteRunResult;
all(placeholderValues?: Record<string, unknown>): T['all'];
get(placeholderValues?: Record<string, unknown>): T['get'];
values(placeholderValues?: Record<string, unknown>): T['values'];
}
export {};

View File

@@ -0,0 +1,117 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const stacktrace = require('./stacktrace.js');
const worldwide = require('./worldwide.js');
let parsedStackResults;
let lastSentryKeysCount;
let lastNativeKeysCount;
let cachedFilenameDebugIds;
/**
* Returns a map of filenames to debug identifiers.
* Supports both proprietary _sentryDebugIds and native _debugIds (e.g., from Vercel) formats.
*/
function getFilenameToDebugIdMap(stackParser) {
const sentryDebugIdMap = worldwide.GLOBAL_OBJ._sentryDebugIds;
const nativeDebugIdMap = worldwide.GLOBAL_OBJ._debugIds;
if (!sentryDebugIdMap && !nativeDebugIdMap) {
return {};
}
const sentryDebugIdKeys = sentryDebugIdMap ? Object.keys(sentryDebugIdMap) : [];
const nativeDebugIdKeys = nativeDebugIdMap ? Object.keys(nativeDebugIdMap) : [];
// If the count of registered globals hasn't changed since the last call, we
// can just return the cached result.
if (
cachedFilenameDebugIds &&
sentryDebugIdKeys.length === lastSentryKeysCount &&
nativeDebugIdKeys.length === lastNativeKeysCount
) {
return cachedFilenameDebugIds;
}
lastSentryKeysCount = sentryDebugIdKeys.length;
lastNativeKeysCount = nativeDebugIdKeys.length;
// Build a map of filename -> debug_id from both sources
cachedFilenameDebugIds = {};
if (!parsedStackResults) {
parsedStackResults = {};
}
const processDebugIds = (debugIdKeys, debugIdMap) => {
for (const key of debugIdKeys) {
const debugId = debugIdMap[key];
const result = parsedStackResults?.[key];
if (result && cachedFilenameDebugIds && debugId) {
// Use cached filename but update with current debug ID
cachedFilenameDebugIds[result[0]] = debugId;
// Update cached result with new debug ID
if (parsedStackResults) {
parsedStackResults[key] = [result[0], debugId];
}
} else if (debugId) {
const parsedStack = stackParser(key);
for (let i = parsedStack.length - 1; i >= 0; i--) {
const stackFrame = parsedStack[i];
const filename = stackFrame?.filename;
if (filename && cachedFilenameDebugIds && parsedStackResults) {
cachedFilenameDebugIds[filename] = debugId;
parsedStackResults[key] = [filename, debugId];
break;
}
}
}
}
};
if (sentryDebugIdMap) {
processDebugIds(sentryDebugIdKeys, sentryDebugIdMap);
}
// Native _debugIds will override _sentryDebugIds if same file
if (nativeDebugIdMap) {
processDebugIds(nativeDebugIdKeys, nativeDebugIdMap);
}
return cachedFilenameDebugIds;
}
/**
* Returns a list of debug images for the given resources.
*/
function getDebugImagesForResources(
stackParser,
resource_paths,
) {
const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser);
if (!filenameDebugIdMap) {
return [];
}
const images = [];
for (const path of resource_paths) {
const normalizedPath = stacktrace.normalizeStackTracePath(path);
if (normalizedPath && filenameDebugIdMap[normalizedPath]) {
images.push({
type: 'sourcemap',
code_file: path,
debug_id: filenameDebugIdMap[normalizedPath],
});
}
}
return images;
}
exports.getDebugImagesForResources = getDebugImagesForResources;
exports.getFilenameToDebugIdMap = getFilenameToDebugIdMap;
//# sourceMappingURL=debug-ids.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"eventprocessor.d.ts","sourceRoot":"","sources":["../../../src/types-hoist/eventprocessor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC;IAC1E,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}

View File

@@ -0,0 +1,30 @@
import { numericPatterns } from "../constants.js";
import { Parser } from "../Parser.js";
import { parseNDigits, parseNumericPattern } from "../utils.js";
export class SecondParser extends Parser {
priority = 50;
parse(dateString, token, match) {
switch (token) {
case "s":
return parseNumericPattern(numericPatterns.second, dateString);
case "so":
return match.ordinalNumber(dateString, { unit: "second" });
default:
return parseNDigits(token.length, dateString);
}
}
validate(_date, value) {
return value >= 0 && value <= 59;
}
set(date, _flags, value) {
date.setSeconds(value, 0);
return date;
}
incompatibleTokens = ["t", "T"];
}

View File

@@ -0,0 +1,36 @@
import * as React from "./";
export { Fragment } from "./";
export namespace JSX {
type ElementType = React.JSX.ElementType;
interface Element extends React.JSX.Element {}
interface ElementClass extends React.JSX.ElementClass {}
interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {}
interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
}
/**
* Create a React element.
*
* You should not use this function directly. Use JSX and a transpiler instead.
*/
export function jsx(
type: React.ElementType,
props: unknown,
key?: React.Key,
): React.ReactElement;
/**
* Create a React element.
*
* You should not use this function directly. Use JSX and a transpiler instead.
*/
export function jsxs(
type: React.ElementType,
props: unknown,
key?: React.Key,
): React.ReactElement;

View File

@@ -0,0 +1,4 @@
export declare const extractID: <IDType extends number | string>(objectOrID: {
id: IDType;
} | IDType) => IDType;
//# sourceMappingURL=extractID.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ProxyLogger.js","sourceRoot":"","sources":["../../src/ProxyLogger.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,6CAA2C;AAK3C,MAAa,WAAW;IAItB,YACU,SAA0B,EAClB,IAAY,EACZ,OAA4B,EAC5B,OAAmC;QAH3C,cAAS,GAAT,SAAS,CAAiB;QAClB,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAqB;QAC5B,YAAO,GAAP,OAAO,CAA4B;IAClD,CAAC;IAEJ;;;;OAIG;IACH,IAAI,CAAC,SAAoB;QACvB,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACK,UAAU;QAChB,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,OAAO,IAAI,CAAC,SAAS,CAAC;SACvB;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAC9C,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,OAAO,CACb,CAAC;QACF,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,wBAAW,CAAC;SACpB;QACD,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;QACxB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AAvCD,kCAuCC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { NOOP_LOGGER } from './NoopLogger';\nimport { Logger } from './types/Logger';\nimport { LoggerOptions } from './types/LoggerOptions';\nimport { LogRecord } from './types/LogRecord';\n\nexport class ProxyLogger implements Logger {\n // When a real implementation is provided, this will be it\n private _delegate?: Logger;\n\n constructor(\n private _provider: LoggerDelegator,\n public readonly name: string,\n public readonly version?: string | undefined,\n public readonly options?: LoggerOptions | undefined\n ) {}\n\n /**\n * Emit a log record. This method should only be used by log appenders.\n *\n * @param logRecord\n */\n emit(logRecord: LogRecord): void {\n this._getLogger().emit(logRecord);\n }\n\n /**\n * Try to get a logger from the proxy logger provider.\n * If the proxy logger provider has no delegate, return a noop logger.\n */\n private _getLogger() {\n if (this._delegate) {\n return this._delegate;\n }\n const logger = this._provider._getDelegateLogger(\n this.name,\n this.version,\n this.options\n );\n if (!logger) {\n return NOOP_LOGGER;\n }\n this._delegate = logger;\n return this._delegate;\n }\n}\n\nexport interface LoggerDelegator {\n _getDelegateLogger(\n name: string,\n version?: string,\n options?: LoggerOptions\n ): Logger | undefined;\n}\n"]}

View File

@@ -0,0 +1 @@
module.exports={C:{"128":0.1289,"136":0.01031,"140":0.03094,"145":1.40243,"146":1.09823,_:"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 120 121 122 123 124 125 126 127 129 130 131 132 133 134 135 137 138 139 141 142 143 144 147 148 149 3.5 3.6"},D:{"56":0.16499,"109":0.41248,"114":0.02062,"122":0.01031,"125":0.0464,"130":0.03094,"133":0.02062,"134":0.01031,"136":0.01031,"137":0.01031,"138":0.01031,"140":0.37123,"141":0.93839,"142":3.37718,"143":8.18773,_:"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 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 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119 120 121 123 124 126 127 128 129 131 132 135 139 144 145 146"},F:{"124":0.1753,"125":0.18562,_:"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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"128":0.03094,"139":0.01031,"142":0.45888,"143":1.71179,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 129 130 131 132 133 134 135 136 137 138 140 141"},E:{_:"0 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 15.4 16.0 26.3","14.1":0.02062,"15.1":0.06703,"15.2-15.3":0.04125,"15.5":0.03094,"15.6":0.86105,"16.1":0.20624,"16.2":0.3042,"16.3":0.15468,"16.4":0.26296,"16.5":0.19593,"16.6":3.0472,"17.0":0.01031,"17.1":2.66565,"17.2":0.32483,"17.3":0.06703,"17.4":1.15494,"17.5":1.01058,"17.6":12.59611,"18.0":0.03094,"18.1":0.03094,"18.2":0.0464,"18.3":0.65481,"18.4":0.10828,"18.5-18.6":0.70637,"26.0":0.07734,"26.1":1.18588,"26.2":0.48982},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00644,"5.0-5.1":0,"6.0-6.1":0.01288,"7.0-7.1":0.00966,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.02576,"10.0-10.2":0.00322,"10.3":0.04508,"11.0-11.2":0.55389,"11.3-11.4":0.0161,"12.0-12.1":0.01288,"12.2-12.5":0.14491,"13.0-13.1":0.00322,"13.2":0.02254,"13.3":0.00644,"13.4-13.7":0.02254,"14.0-14.4":0.04508,"14.5-14.8":0.0483,"15.0-15.1":0.05152,"15.2-15.3":0.03864,"15.4":0.04186,"15.5":0.04508,"15.6-15.8":0.6988,"16.0":0.08051,"16.1":0.15457,"16.2":0.08051,"16.3":0.14491,"16.4":0.03542,"16.5":0.06119,"16.6-16.7":0.90812,"17.0":0.05152,"17.1":0.08373,"17.2":0.06119,"17.3":0.09339,"17.4":0.15779,"17.5":0.30915,"17.6-17.7":0.7149,"18.0":0.16101,"18.1":0.33491,"18.2":0.17712,"18.3":0.57643,"18.4":0.29627,"18.5-18.7":21.27324,"26.0":0.41542,"26.1":3.45537,"26.2":0.65694,"26.3":0.02898},P:{"28":0.05406,"29":0.55144,_:"4 20 21 22 23 24 25 26 27 5.0-5.4 6.2-6.4 7.2-7.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"},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},A:{_:"6 7 8 9 10 11 5.5"},K:{"0":0,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{_:"0"},H:{"0":0},L:{"0":14.61397},R:{_:"0"},M:{"0":0.03391}};

View File

@@ -0,0 +1,414 @@
/**
* @license React
* scheduler-unstable_mock.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 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), (scheduledCallback = flushWork);
else {
var firstTimer = peek(timerQueue);
null !== firstTimer &&
((currentTime = firstTimer.startTime - currentTime),
(scheduledTimeout = handleTimeout),
(timeoutTime = currentMockTime + currentTime));
}
}
function flushWork(hasTimeRemaining, initialTime) {
isHostCallbackScheduled = !1;
isHostTimeoutScheduled &&
((isHostTimeoutScheduled = !1),
(scheduledTimeout = null),
(timeoutTime = -1));
isPerformingWork = !0;
var previousPriorityLevel = currentPriorityLevel;
try {
a: {
advanceTimers(initialTime);
for (
currentTask = peek(taskQueue);
null !== currentTask &&
(!(currentTask.expirationTime > initialTime) ||
(hasTimeRemaining && !shouldYieldToHost()));
) {
var callback = currentTask.callback;
if ("function" === typeof callback) {
currentTask.callback = null;
currentPriorityLevel = currentTask.priorityLevel;
var continuationCallback = callback(
currentTask.expirationTime <= initialTime
);
initialTime = currentMockTime;
if ("function" === typeof continuationCallback) {
if (
((currentTask.callback = continuationCallback),
advanceTimers(initialTime),
shouldYieldForPaint)
) {
var JSCompiler_inline_result = (needsPaint = !0);
break a;
}
} else
currentTask === peek(taskQueue) && pop(taskQueue),
advanceTimers(initialTime);
} else pop(taskQueue);
currentTask = peek(taskQueue);
}
if (null !== currentTask) JSCompiler_inline_result = !0;
else {
var firstTimer = peek(timerQueue);
if (null !== firstTimer) {
var ms = firstTimer.startTime - initialTime;
scheduledTimeout = handleTimeout;
timeoutTime = currentMockTime + ms;
}
JSCompiler_inline_result = !1;
}
}
return JSCompiler_inline_result;
} finally {
(currentTask = null),
(currentPriorityLevel = previousPriorityLevel),
(isPerformingWork = !1);
}
}
function shouldYieldToHost() {
return (0 === expectedNumberOfYields && null === yieldedValues) ||
(-1 !== expectedNumberOfYields &&
null !== yieldedValues &&
yieldedValues.length >= expectedNumberOfYields) ||
(shouldYieldForPaint && needsPaint)
? (didStop = !0)
: !1;
}
function unstable_flushAllWithoutAsserting() {
if (isFlushing) throw Error("Already flushing work.");
if (null !== scheduledCallback) {
var cb = scheduledCallback;
isFlushing = !0;
try {
var hasMoreWork = !0;
do hasMoreWork = cb(!0, currentMockTime);
while (hasMoreWork);
hasMoreWork || (scheduledCallback = null);
return !0;
} finally {
isFlushing = !1;
}
} else return !1;
}
var taskQueue = [],
timerQueue = [],
taskIdCounter = 1,
currentTask = null,
currentPriorityLevel = 3,
isPerformingWork = !1,
isHostCallbackScheduled = !1,
isHostTimeoutScheduled = !1,
currentMockTime = 0,
scheduledCallback = null,
scheduledTimeout = null,
timeoutTime = -1,
yieldedValues = null,
expectedNumberOfYields = -1,
didStop = !1,
isFlushing = !1,
needsPaint = !1,
shouldYieldForPaint = !1,
disableYieldValue = !1;
exports.log = function (value) {
"disabledLog" === console.log.name ||
disableYieldValue ||
(null === yieldedValues
? (yieldedValues = [value])
: yieldedValues.push(value));
};
exports.reset = function () {
if (isFlushing) throw Error("Cannot reset while already flushing work.");
currentMockTime = 0;
scheduledTimeout = scheduledCallback = null;
timeoutTime = -1;
yieldedValues = null;
expectedNumberOfYields = -1;
needsPaint = isFlushing = didStop = !1;
};
exports.unstable_IdlePriority = 5;
exports.unstable_ImmediatePriority = 1;
exports.unstable_LowPriority = 4;
exports.unstable_NormalPriority = 3;
exports.unstable_Profiling = null;
exports.unstable_UserBlockingPriority = 2;
exports.unstable_advanceTime = function (ms) {
"disabledLog" === console.log.name ||
disableYieldValue ||
((currentMockTime += ms),
null !== scheduledTimeout &&
timeoutTime <= currentMockTime &&
(scheduledTimeout(currentMockTime),
(timeoutTime = -1),
(scheduledTimeout = null)));
};
exports.unstable_cancelCallback = function (task) {
task.callback = null;
};
exports.unstable_clearLog = function () {
if (null === yieldedValues) return [];
var values = yieldedValues;
yieldedValues = null;
return values;
};
exports.unstable_flushAll = function () {
if (null !== yieldedValues)
throw Error(
"Log is not empty. Assert on the log of yielded values before flushing additional work."
);
unstable_flushAllWithoutAsserting();
if (null !== yieldedValues)
throw Error(
"While flushing work, something yielded a value. Use an assertion helper to assert on the log of yielded values, e.g. expect(Scheduler).toFlushAndYield([...])"
);
};
exports.unstable_flushAllWithoutAsserting =
unstable_flushAllWithoutAsserting;
exports.unstable_flushExpired = function () {
if (isFlushing) throw Error("Already flushing work.");
if (null !== scheduledCallback) {
isFlushing = !0;
try {
scheduledCallback(!1, currentMockTime) || (scheduledCallback = null);
} finally {
isFlushing = !1;
}
}
};
exports.unstable_flushNumberOfYields = function (count) {
if (isFlushing) throw Error("Already flushing work.");
if (null !== scheduledCallback) {
var cb = scheduledCallback;
expectedNumberOfYields = count;
isFlushing = !0;
try {
count = !0;
do count = cb(!0, currentMockTime);
while (count && !didStop);
count || (scheduledCallback = null);
} finally {
(expectedNumberOfYields = -1), (isFlushing = didStop = !1);
}
}
};
exports.unstable_flushUntilNextPaint = function () {
if (isFlushing) throw Error("Already flushing work.");
if (null !== scheduledCallback) {
var cb = scheduledCallback;
shouldYieldForPaint = !0;
needsPaint = !1;
isFlushing = !0;
try {
var hasMoreWork = !0;
do hasMoreWork = cb(!0, currentMockTime);
while (hasMoreWork && !didStop);
hasMoreWork || (scheduledCallback = null);
} finally {
isFlushing = didStop = shouldYieldForPaint = !1;
}
}
return !1;
};
exports.unstable_forceFrameRate = function () {};
exports.unstable_getCurrentPriorityLevel = function () {
return currentPriorityLevel;
};
exports.unstable_hasPendingWork = function () {
return null !== scheduledCallback;
};
exports.unstable_next = function (eventHandler) {
switch (currentPriorityLevel) {
case 1:
case 2:
case 3:
var priorityLevel = 3;
break;
default:
priorityLevel = currentPriorityLevel;
}
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = priorityLevel;
try {
return eventHandler();
} finally {
currentPriorityLevel = previousPriorityLevel;
}
};
exports.unstable_now = function () {
return currentMockTime;
};
exports.unstable_requestPaint = function () {
needsPaint = !0;
};
exports.unstable_runWithPriority = function (priorityLevel, eventHandler) {
switch (priorityLevel) {
case 1:
case 2:
case 3:
case 4:
case 5:
break;
default:
priorityLevel = 3;
}
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = priorityLevel;
try {
return eventHandler();
} finally {
currentPriorityLevel = previousPriorityLevel;
}
};
exports.unstable_scheduleCallback = function (
priorityLevel,
callback,
options
) {
var currentTime = currentMockTime;
"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
? ((scheduledTimeout = null), (timeoutTime = -1))
: (isHostTimeoutScheduled = !0),
(scheduledTimeout = handleTimeout),
(timeoutTime = currentMockTime + (options - currentTime))))
: ((priorityLevel.sortIndex = timeout),
push(taskQueue, priorityLevel),
isHostCallbackScheduled ||
isPerformingWork ||
((isHostCallbackScheduled = !0), (scheduledCallback = flushWork)));
return priorityLevel;
};
exports.unstable_setDisableYieldValue = function (newValue) {
disableYieldValue = newValue;
};
exports.unstable_shouldYield = shouldYieldToHost;
exports.unstable_wrapCallback = function (callback) {
var parentPriorityLevel = currentPriorityLevel;
return function () {
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = parentPriorityLevel;
try {
return callback.apply(this, arguments);
} finally {
currentPriorityLevel = previousPriorityLevel;
}
};
};
})();

View File

@@ -0,0 +1,340 @@
/**
* @license React
* react-dom.react-server.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 noop() {}
function getCrossOriginStringAs(as, input) {
if ("font" === as) return "";
if ("string" === typeof input)
return "use-credentials" === input ? input : "";
}
function getValueDescriptorExpectingObjectForWarning(thing) {
return null === thing
? "`null`"
: void 0 === thing
? "`undefined`"
: "" === thing
? "an empty string"
: 'something with type "' + typeof thing + '"';
}
function getValueDescriptorExpectingEnumForWarning(thing) {
return null === thing
? "`null`"
: void 0 === thing
? "`undefined`"
: "" === thing
? "an empty string"
: "string" === typeof thing
? JSON.stringify(thing)
: "number" === typeof thing
? "`" + thing + "`"
: 'something with type "' + typeof thing + '"';
}
var React = require("react"),
Internals = {
d: {
f: noop,
r: function () {
throw Error(
"Invalid form element. requestFormReset must be passed a form that was rendered by React."
);
},
D: noop,
C: noop,
L: noop,
m: noop,
X: noop,
S: noop,
M: noop
},
p: 0,
findDOMNode: null
};
if (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)
throw Error(
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
);
("function" === typeof Map &&
null != Map.prototype &&
"function" === typeof Map.prototype.forEach &&
"function" === typeof Set &&
null != Set.prototype &&
"function" === typeof Set.prototype.clear &&
"function" === typeof Set.prototype.forEach) ||
console.error(
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
);
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
Internals;
exports.preconnect = function (href, options) {
"string" === typeof href && href
? null != options && "object" !== typeof options
? console.error(
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
getValueDescriptorExpectingEnumForWarning(options)
)
: null != options &&
"string" !== typeof options.crossOrigin &&
console.error(
"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
getValueDescriptorExpectingObjectForWarning(options.crossOrigin)
)
: console.error(
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
getValueDescriptorExpectingObjectForWarning(href)
);
"string" === typeof href &&
(options
? ((options = options.crossOrigin),
(options =
"string" === typeof options
? "use-credentials" === options
? options
: ""
: void 0))
: (options = null),
Internals.d.C(href, options));
};
exports.prefetchDNS = function (href) {
if ("string" !== typeof href || !href)
console.error(
"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
getValueDescriptorExpectingObjectForWarning(href)
);
else if (1 < arguments.length) {
var options = arguments[1];
"object" === typeof options && options.hasOwnProperty("crossOrigin")
? console.error(
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
getValueDescriptorExpectingEnumForWarning(options)
)
: console.error(
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
getValueDescriptorExpectingEnumForWarning(options)
);
}
"string" === typeof href && Internals.d.D(href);
};
exports.preinit = function (href, options) {
"string" === typeof href && href
? null == options || "object" !== typeof options
? console.error(
"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
getValueDescriptorExpectingEnumForWarning(options)
)
: "style" !== options.as &&
"script" !== options.as &&
console.error(
'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
getValueDescriptorExpectingEnumForWarning(options.as)
)
: console.error(
"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
getValueDescriptorExpectingObjectForWarning(href)
);
if (
"string" === typeof href &&
options &&
"string" === typeof options.as
) {
var as = options.as,
crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),
integrity =
"string" === typeof options.integrity ? options.integrity : void 0,
fetchPriority =
"string" === typeof options.fetchPriority
? options.fetchPriority
: void 0;
"style" === as
? Internals.d.S(
href,
"string" === typeof options.precedence
? options.precedence
: void 0,
{
crossOrigin: crossOrigin,
integrity: integrity,
fetchPriority: fetchPriority
}
)
: "script" === as &&
Internals.d.X(href, {
crossOrigin: crossOrigin,
integrity: integrity,
fetchPriority: fetchPriority,
nonce: "string" === typeof options.nonce ? options.nonce : void 0
});
}
};
exports.preinitModule = function (href, options) {
var encountered = "";
("string" === typeof href && href) ||
(encountered +=
" The `href` argument encountered was " +
getValueDescriptorExpectingObjectForWarning(href) +
".");
void 0 !== options && "object" !== typeof options
? (encountered +=
" The `options` argument encountered was " +
getValueDescriptorExpectingObjectForWarning(options) +
".")
: options &&
"as" in options &&
"script" !== options.as &&
(encountered +=
" The `as` option encountered was " +
getValueDescriptorExpectingEnumForWarning(options.as) +
".");
if (encountered)
console.error(
"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
encountered
);
else
switch (
((encountered =
options && "string" === typeof options.as ? options.as : "script"),
encountered)
) {
case "script":
break;
default:
(encountered =
getValueDescriptorExpectingEnumForWarning(encountered)),
console.error(
'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
encountered,
href
);
}
if ("string" === typeof href)
if ("object" === typeof options && null !== options) {
if (null == options.as || "script" === options.as)
(encountered = getCrossOriginStringAs(
options.as,
options.crossOrigin
)),
Internals.d.M(href, {
crossOrigin: encountered,
integrity:
"string" === typeof options.integrity
? options.integrity
: void 0,
nonce:
"string" === typeof options.nonce ? options.nonce : void 0
});
} else null == options && Internals.d.M(href);
};
exports.preload = function (href, options) {
var encountered = "";
("string" === typeof href && href) ||
(encountered +=
" The `href` argument encountered was " +
getValueDescriptorExpectingObjectForWarning(href) +
".");
null == options || "object" !== typeof options
? (encountered +=
" The `options` argument encountered was " +
getValueDescriptorExpectingObjectForWarning(options) +
".")
: ("string" === typeof options.as && options.as) ||
(encountered +=
" The `as` option encountered was " +
getValueDescriptorExpectingObjectForWarning(options.as) +
".");
encountered &&
console.error(
'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
encountered
);
if (
"string" === typeof href &&
"object" === typeof options &&
null !== options &&
"string" === typeof options.as
) {
encountered = options.as;
var crossOrigin = getCrossOriginStringAs(
encountered,
options.crossOrigin
);
Internals.d.L(href, encountered, {
crossOrigin: crossOrigin,
integrity:
"string" === typeof options.integrity ? options.integrity : void 0,
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
type: "string" === typeof options.type ? options.type : void 0,
fetchPriority:
"string" === typeof options.fetchPriority
? options.fetchPriority
: void 0,
referrerPolicy:
"string" === typeof options.referrerPolicy
? options.referrerPolicy
: void 0,
imageSrcSet:
"string" === typeof options.imageSrcSet
? options.imageSrcSet
: void 0,
imageSizes:
"string" === typeof options.imageSizes
? options.imageSizes
: void 0,
media: "string" === typeof options.media ? options.media : void 0
});
}
};
exports.preloadModule = function (href, options) {
var encountered = "";
("string" === typeof href && href) ||
(encountered +=
" The `href` argument encountered was " +
getValueDescriptorExpectingObjectForWarning(href) +
".");
void 0 !== options && "object" !== typeof options
? (encountered +=
" The `options` argument encountered was " +
getValueDescriptorExpectingObjectForWarning(options) +
".")
: options &&
"as" in options &&
"string" !== typeof options.as &&
(encountered +=
" The `as` option encountered was " +
getValueDescriptorExpectingObjectForWarning(options.as) +
".");
encountered &&
console.error(
'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
encountered
);
"string" === typeof href &&
(options
? ((encountered = getCrossOriginStringAs(
options.as,
options.crossOrigin
)),
Internals.d.m(href, {
as:
"string" === typeof options.as && "script" !== options.as
? options.as
: void 0,
crossOrigin: encountered,
integrity:
"string" === typeof options.integrity
? options.integrity
: void 0
}))
: Internals.d.m(href));
};
exports.version = "19.2.4";
})();

View File

@@ -0,0 +1,4 @@
export declare const eachDayOfInterval: import("./types.js").FPFn1<
Date[],
import("../fp.js").Interval<Date>
>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"reportPageLoaded.js","sources":["../../../../../src/tracing/reportPageLoaded.ts"],"sourcesContent":["import type { Client } from '@sentry/core';\nimport { getClient } from '@sentry/core';\n\n/**\n * Manually report the end of the page load, resulting in the SDK ending the pageload span.\n * This only works if {@link BrowserTracingOptions.enableReportPageLoaded} is set to `true`.\n * Otherwise, the pageload span will end itself based on the {@link BrowserTracingOptions.finalTimeout},\n * {@link BrowserTracingOptions.idleTimeout} and {@link BrowserTracingOptions.childSpanTimeout}.\n *\n * @param client - The client to use. If not provided, the global client will be used.\n */\nexport function reportPageLoaded(client: Client | undefined = getClient()): void {\n client?.emit('endPageloadSpan');\n}\n"],"names":[],"mappings":";;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,MAAM,GAAuB,SAAS,EAAE,EAAQ;AACjF,EAAE,MAAM,EAAE,IAAI,CAAC,iBAAiB,CAAC;AACjC;;;;"}

View File

@@ -0,0 +1,42 @@
Prism.languages.ini = {
/**
* The component mimics the behavior of the Win32 API parser.
*
* @see {@link https://github.com/PrismJS/prism/issues/2775#issuecomment-787477723}
*/
'comment': {
pattern: /(^[ \f\t\v]*)[#;][^\n\r]*/m,
lookbehind: true
},
'section': {
pattern: /(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,
lookbehind: true,
inside: {
'section-name': {
pattern: /(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,
lookbehind: true,
alias: 'selector'
},
'punctuation': /\[|\]/
}
},
'key': {
pattern: /(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,
lookbehind: true,
alias: 'attr-name'
},
'value': {
pattern: /(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,
lookbehind: true,
alias: 'attr-value',
inside: {
'inner-value': {
pattern: /^("|').+(?=\1$)/,
lookbehind: true
}
}
},
'punctuation': /=/
};

View File

@@ -0,0 +1,589 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const { Tracer } = require("chrome-trace-event");
const {
CSS_MODULES,
JAVASCRIPT_MODULES,
JSON_MODULE_TYPE,
WEBASSEMBLY_MODULES
} = require("../ModuleTypeConstants");
const createSchemaValidation = require("../util/create-schema-validation");
const { dirname, mkdirpSync } = require("../util/fs");
/** @typedef {import("inspector").Session} Session */
/** @typedef {import("tapable").FullTap} FullTap */
/** @typedef {import("../../declarations/plugins/debug/ProfilingPlugin").ProfilingPluginOptions} ProfilingPluginOptions */
/** @typedef {import("../Compilation")} Compilation */
/** @typedef {import("../Compiler")} Compiler */
/** @typedef {import("../NormalModuleFactory")} NormalModuleFactory */
/** @typedef {import("../ResolverFactory")} ResolverFactory */
/** @typedef {import("../util/fs").IntermediateFileSystem} IntermediateFileSystem */
/**
* @template T, R
* @typedef {import("tapable").Hook<T, R>} Hook
*/
/**
* @template T
* @typedef {import("../util/deprecation").FakeHook<T>} FakeHook
*/
/**
* @template T
* @typedef {import("tapable").HookMap<T>} HookMap
*/
/**
* @template T, R
* @typedef {import("tapable").HookInterceptor<T, R>} HookInterceptor
*/
const validate = createSchemaValidation(
require("../../schemas/plugins/debug/ProfilingPlugin.check"),
() => require("../../schemas/plugins/debug/ProfilingPlugin.json"),
{
name: "Profiling Plugin",
baseDataPath: "options"
}
);
/** @typedef {{ Session: typeof import("inspector").Session }} Inspector */
/** @type {Inspector | undefined} */
let inspector;
try {
// eslint-disable-next-line n/no-unsupported-features/node-builtins
inspector = require("inspector");
} catch (_err) {
// eslint-disable-next-line no-console
console.log("Unable to CPU profile in < node 8.0");
}
class Profiler {
/**
* @param {Inspector} inspector inspector
*/
constructor(inspector) {
/** @type {undefined | Session} */
this.session = undefined;
this.inspector = inspector;
this._startTime = 0;
}
hasSession() {
return this.session !== undefined;
}
startProfiling() {
if (this.inspector === undefined) {
return Promise.resolve();
}
try {
this.session = new /** @type {Inspector} */ (inspector).Session();
/** @type {Session} */
(this.session).connect();
} catch (_) {
this.session = undefined;
return Promise.resolve();
}
const hrtime = process.hrtime();
this._startTime = hrtime[0] * 1000000 + Math.round(hrtime[1] / 1000);
return Promise.all([
this.sendCommand("Profiler.setSamplingInterval", {
interval: 100
}),
this.sendCommand("Profiler.enable"),
this.sendCommand("Profiler.start")
]);
}
/**
* @param {string} method method name
* @param {EXPECTED_OBJECT=} params params
* @returns {Promise<EXPECTED_ANY | void>} Promise for the result
*/
sendCommand(method, params) {
if (this.hasSession()) {
return new Promise((res, rej) => {
/** @type {Session} */
(this.session).post(method, params, (err, params) => {
if (err !== null) {
rej(err);
} else {
res(params);
}
});
});
}
return Promise.resolve();
}
destroy() {
if (this.hasSession()) {
/** @type {Session} */
(this.session).disconnect();
}
return Promise.resolve();
}
/**
* @returns {Promise<{ profile: { startTime: number, endTime: number } }>} profile result
*/
stopProfiling() {
return this.sendCommand("Profiler.stop").then(({ profile }) => {
const hrtime = process.hrtime();
const endTime = hrtime[0] * 1000000 + Math.round(hrtime[1] / 1000);
// Avoid coverage problems due indirect changes
/* istanbul ignore next */
if (profile.startTime < this._startTime || profile.endTime > endTime) {
// In some cases timestamps mismatch and we need to adjust them
// Both process.hrtime and the inspector timestamps claim to be relative
// to a unknown point in time. But they do not guarantee that this is the
// same point in time.
const duration = profile.endTime - profile.startTime;
const ownDuration = endTime - this._startTime;
const untracked = Math.max(0, ownDuration - duration);
profile.startTime = this._startTime + untracked / 2;
profile.endTime = endTime - untracked / 2;
}
return { profile };
});
}
}
/**
* an object that wraps Tracer and Profiler with a counter
* @typedef {object} Trace
* @property {Tracer} trace instance of Tracer
* @property {number} counter Counter
* @property {Profiler} profiler instance of Profiler
* @property {(callback: (err?: null | Error) => void) => void} end the end function
*/
/**
* @param {IntermediateFileSystem} fs filesystem used for output
* @param {string} outputPath The location where to write the log.
* @returns {Trace} The trace object
*/
const createTrace = (fs, outputPath) => {
const trace = new Tracer();
const profiler = new Profiler(/** @type {Inspector} */ (inspector));
if (/\/|\\/.test(outputPath)) {
const dirPath = dirname(fs, outputPath);
mkdirpSync(fs, dirPath);
}
const fsStream = fs.createWriteStream(outputPath);
let counter = 0;
trace.pipe(fsStream);
// These are critical events that need to be inserted so that tools like
// chrome dev tools can load the profile.
trace.instantEvent({
name: "TracingStartedInPage",
id: ++counter,
cat: ["disabled-by-default-devtools.timeline"],
args: {
data: {
sessionId: "-1",
page: "0xfff",
frames: [
{
frame: "0xfff",
url: "webpack",
name: ""
}
]
}
}
});
trace.instantEvent({
name: "TracingStartedInBrowser",
id: ++counter,
cat: ["disabled-by-default-devtools.timeline"],
args: {
data: {
sessionId: "-1"
}
}
});
return {
trace,
counter,
profiler,
end: (callback) => {
trace.push("]");
// Wait until the write stream finishes.
fsStream.on("close", () => {
callback();
});
// Tear down the readable trace stream.
trace.push(null);
}
};
};
const PLUGIN_NAME = "ProfilingPlugin";
class ProfilingPlugin {
/**
* @param {ProfilingPluginOptions=} options options object
*/
constructor(options = {}) {
validate(options);
this.outputPath = options.outputPath || "events.json";
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
const tracer = createTrace(
/** @type {IntermediateFileSystem} */
(compiler.intermediateFileSystem),
this.outputPath
);
tracer.profiler.startProfiling();
// Compiler Hooks
for (const hookName of Object.keys(compiler.hooks)) {
const hook =
compiler.hooks[/** @type {keyof Compiler["hooks"]} */ (hookName)];
if (hook) {
hook.intercept(makeInterceptorFor("Compiler", tracer)(hookName));
}
}
for (const hookName of Object.keys(compiler.resolverFactory.hooks)) {
const hook =
compiler.resolverFactory.hooks[
/** @type {keyof ResolverFactory["hooks"]} */
(hookName)
];
if (hook) {
hook.intercept(
/** @type {EXPECTED_ANY} */
(makeInterceptorFor("Resolver", tracer)(hookName))
);
}
}
compiler.hooks.compilation.tap(
PLUGIN_NAME,
(compilation, { normalModuleFactory, contextModuleFactory }) => {
interceptAllHooksFor(compilation, tracer, "Compilation");
interceptAllHooksFor(
normalModuleFactory,
tracer,
"Normal Module Factory"
);
interceptAllHooksFor(
contextModuleFactory,
tracer,
"Context Module Factory"
);
interceptAllParserHooks(normalModuleFactory, tracer);
interceptAllGeneratorHooks(normalModuleFactory, tracer);
interceptAllJavascriptModulesPluginHooks(compilation, tracer);
interceptAllCssModulesPluginHooks(compilation, tracer);
}
);
// We need to write out the CPU profile when we are all done.
compiler.hooks.done.tapAsync(
{
name: PLUGIN_NAME,
stage: Infinity
},
(stats, callback) => {
if (compiler.watchMode) return callback();
tracer.profiler.stopProfiling().then((parsedResults) => {
if (parsedResults === undefined) {
tracer.profiler.destroy();
tracer.end(callback);
return;
}
const cpuStartTime = parsedResults.profile.startTime;
const cpuEndTime = parsedResults.profile.endTime;
tracer.trace.completeEvent({
name: "TaskQueueManager::ProcessTaskFromWorkQueue",
id: ++tracer.counter,
cat: ["toplevel"],
ts: cpuStartTime,
args: {
// eslint-disable-next-line camelcase
src_file: "../../ipc/ipc_moji_bootstrap.cc",
// eslint-disable-next-line camelcase
src_func: "Accept"
}
});
tracer.trace.completeEvent({
name: "EvaluateScript",
id: ++tracer.counter,
cat: ["devtools.timeline"],
ts: cpuStartTime,
dur: cpuEndTime - cpuStartTime,
args: {
data: {
url: "webpack",
lineNumber: 1,
columnNumber: 1,
frame: "0xFFF"
}
}
});
tracer.trace.instantEvent({
name: "CpuProfile",
id: ++tracer.counter,
cat: ["disabled-by-default-devtools.timeline"],
ts: cpuEndTime,
args: {
data: {
cpuProfile: parsedResults.profile
}
}
});
tracer.profiler.destroy();
tracer.end(callback);
});
}
);
}
}
/** @typedef {Record<string, Hook<EXPECTED_ANY, EXPECTED_ANY> | FakeHook<EXPECTED_ANY> | HookMap<EXPECTED_ANY>>} Hooks */
/**
* @param {EXPECTED_OBJECT & { hooks?: Hooks }} instance instance
* @param {Trace} tracer tracer
* @param {string} logLabel log label
*/
const interceptAllHooksFor = (instance, tracer, logLabel) => {
if (Reflect.has(instance, "hooks")) {
const hooks = /** @type {Hooks} */ (instance.hooks);
for (const hookName of Object.keys(hooks)) {
const hook = hooks[hookName];
if (hook && !hook._fakeHook) {
hook.intercept(makeInterceptorFor(logLabel, tracer)(hookName));
}
}
}
};
/**
* @param {NormalModuleFactory} moduleFactory normal module factory
* @param {Trace} tracer tracer
*/
const interceptAllParserHooks = (moduleFactory, tracer) => {
const moduleTypes = [
...JAVASCRIPT_MODULES,
JSON_MODULE_TYPE,
...WEBASSEMBLY_MODULES,
...CSS_MODULES
];
for (const moduleType of moduleTypes) {
moduleFactory.hooks.parser
.for(moduleType)
.tap(PLUGIN_NAME, (parser, _parserOpts) => {
interceptAllHooksFor(parser, tracer, "Parser");
});
}
};
/**
* @param {NormalModuleFactory} moduleFactory normal module factory
* @param {Trace} tracer tracer
*/
const interceptAllGeneratorHooks = (moduleFactory, tracer) => {
const moduleTypes = [
...JAVASCRIPT_MODULES,
JSON_MODULE_TYPE,
...WEBASSEMBLY_MODULES,
...CSS_MODULES
];
for (const moduleType of moduleTypes) {
moduleFactory.hooks.generator
.for(moduleType)
.tap(PLUGIN_NAME, (parser, _parserOpts) => {
interceptAllHooksFor(parser, tracer, "Generator");
});
}
};
/**
* @param {Compilation} compilation compilation
* @param {Trace} tracer tracer
*/
const interceptAllJavascriptModulesPluginHooks = (compilation, tracer) => {
interceptAllHooksFor(
{
hooks:
require("../javascript/JavascriptModulesPlugin").getCompilationHooks(
compilation
)
},
tracer,
"JavascriptModulesPlugin"
);
};
/**
* @param {Compilation} compilation compilation
* @param {Trace} tracer tracer
*/
const interceptAllCssModulesPluginHooks = (compilation, tracer) => {
interceptAllHooksFor(
{
hooks: require("../css/CssModulesPlugin").getCompilationHooks(compilation)
},
tracer,
"CssModulesPlugin"
);
};
/** @typedef {(...args: EXPECTED_ANY[]) => EXPECTED_ANY | Promise<(...args: EXPECTED_ANY[]) => EXPECTED_ANY>} PluginFunction */
/**
* @template T
* @param {string} instance instance
* @param {Trace} tracer tracer
* @returns {(hookName: string) => HookInterceptor<EXPECTED_ANY, EXPECTED_ANY>} interceptor
*/
const makeInterceptorFor = (instance, tracer) => (hookName) => ({
/**
* @param {FullTap} tapInfo tap info
* @returns {FullTap} modified full tap
*/
register: (tapInfo) => {
const { name, type, fn: internalFn } = tapInfo;
const newFn =
// Don't tap our own hooks to ensure stream can close cleanly
name === PLUGIN_NAME
? internalFn
: makeNewProfiledTapFn(hookName, tracer, {
name,
type,
fn: /** @type {PluginFunction} */ (internalFn)
});
return { ...tapInfo, fn: newFn };
}
});
/**
* @param {string} hookName Name of the hook to profile.
* @param {Trace} tracer The trace object.
* @param {object} options Options for the profiled fn.
* @param {string} options.name Plugin name
* @param {"sync" | "async" | "promise"} options.type Plugin type (sync | async | promise)
* @param {PluginFunction} options.fn Plugin function
* @returns {PluginFunction} Chainable hooked function.
*/
const makeNewProfiledTapFn = (hookName, tracer, { name, type, fn }) => {
const defaultCategory = ["blink.user_timing"];
switch (type) {
case "promise":
return (...args) => {
const id = ++tracer.counter;
tracer.trace.begin({
name,
id,
cat: defaultCategory
});
const promise =
/** @type {Promise<(...args: EXPECTED_ANY[]) => EXPECTED_ANY>} */
(fn(...args));
return promise.then((r) => {
tracer.trace.end({
name,
id,
cat: defaultCategory
});
return r;
});
};
case "async":
return (...args) => {
const id = ++tracer.counter;
tracer.trace.begin({
name,
id,
cat: defaultCategory
});
const callback = args.pop();
fn(
...args,
/**
* @param {...EXPECTED_ANY[]} r result
*/
(...r) => {
tracer.trace.end({
name,
id,
cat: defaultCategory
});
callback(...r);
}
);
};
case "sync":
return (...args) => {
const id = ++tracer.counter;
// Do not instrument ourself due to the CPU
// profile needing to be the last event in the trace.
if (name === PLUGIN_NAME) {
return fn(...args);
}
tracer.trace.begin({
name,
id,
cat: defaultCategory
});
/** @type {PluginFunction} */
let r;
try {
r = fn(...args);
} catch (err) {
tracer.trace.end({
name,
id,
cat: defaultCategory
});
throw err;
}
tracer.trace.end({
name,
id,
cat: defaultCategory
});
return r;
};
default:
return fn;
}
};
module.exports = ProfilingPlugin;
module.exports.Profiler = Profiler;

View File

@@ -0,0 +1,306 @@
import Pointer, { nullSymbol } from "./pointer.js";
import type { JSONParserError, MissingPointerError, ParserError, ResolverError } from "./util/errors.js";
import { InvalidPointerError, isHandledError, normalizeError } from "./util/errors.js";
import { safePointerToPath, stripHash, getHash } from "./util/url.js";
import type $Refs from "./refs.js";
import type { ParserOptions } from "./options.js";
import type { JSONSchema } from "./types";
export type $RefError = JSONParserError | ResolverError | ParserError | MissingPointerError;
/**
* This class represents a single JSON reference and its resolved value.
*
* @class
*/
class $Ref<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>> {
/**
* The file path or URL of the referenced file.
* This path is relative to the path of the main JSON schema file.
*
* This path does NOT contain document fragments (JSON pointers). It always references an ENTIRE file.
* Use methods such as {@link $Ref#get}, {@link $Ref#resolve}, and {@link $Ref#exists} to get
* specific JSON pointers within the file.
*
* @type {string}
*/
path: undefined | string;
/**
* The resolved value of the JSON reference.
* Can be any JSON type, not just objects. Unknown file types are represented as Buffers (byte arrays).
*
* @type {?*}
*/
value: any;
/**
* The {@link $Refs} object that contains this {@link $Ref} object.
*
* @type {$Refs}
*/
$refs: $Refs<S, O>;
/**
* Indicates the type of {@link $Ref#path} (e.g. "file", "http", etc.)
*/
pathType: string | unknown;
/**
* List of all errors. Undefined if no errors.
*/
errors: Array<$RefError> = [];
constructor($refs: $Refs<S, O>) {
this.$refs = $refs;
}
/**
* Pushes an error to errors array.
*
* @param err - The error to be pushed
* @returns
*/
addError(err: $RefError) {
if (this.errors === undefined) {
this.errors = [];
}
const existingErrors = this.errors.map(({ footprint }: any) => footprint);
// the path has been almost certainly set at this point,
// but just in case something went wrong, normalizeError injects path if necessary
// moreover, certain errors might point at the same spot, so filter them out to reduce noise
if ("errors" in err && Array.isArray(err.errors)) {
this.errors.push(
...err.errors.map(normalizeError).filter(({ footprint }: any) => !existingErrors.includes(footprint)),
);
} else if (!("footprint" in err) || !existingErrors.includes(err.footprint)) {
this.errors.push(normalizeError(err));
}
}
/**
* Determines whether the given JSON reference exists within this {@link $Ref#value}.
*
* @param path - The full path being resolved, optionally with a JSON pointer in the hash
* @param options
* @returns
*/
exists(path: string, options?: O) {
try {
this.resolve(path, options);
return true;
} catch {
return false;
}
}
/**
* Resolves the given JSON reference within this {@link $Ref#value} and returns the resolved value.
*
* @param path - The full path being resolved, optionally with a JSON pointer in the hash
* @param options
* @returns - Returns the resolved value
*/
get(path: string, options?: O) {
return this.resolve(path, options)?.value;
}
/**
* Resolves the given JSON reference within this {@link $Ref#value}.
*
* @param path - The full path being resolved, optionally with a JSON pointer in the hash
* @param options
* @param friendlyPath - The original user-specified path (used for error messages)
* @param pathFromRoot - The path of `obj` from the schema root
* @returns
*/
resolve(path: string, options?: O, friendlyPath?: string, pathFromRoot?: string) {
const pointer = new Pointer<S, O>(this, path, friendlyPath);
try {
const resolved = pointer.resolve(this.value, options, pathFromRoot);
if (resolved.value === nullSymbol) {
resolved.value = null;
}
return resolved;
} catch (err: any) {
if (!options || !options.continueOnError || !isHandledError(err)) {
throw err;
}
if (err.path === null) {
err.path = safePointerToPath(getHash(pathFromRoot));
}
if (err instanceof InvalidPointerError) {
err.source = decodeURI(stripHash(pathFromRoot));
}
this.addError(err);
return null;
}
}
/**
* Sets the value of a nested property within this {@link $Ref#value}.
* If the property, or any of its parents don't exist, they will be created.
*
* @param path - The full path of the property to set, optionally with a JSON pointer in the hash
* @param value - The value to assign
*/
set(path: string, value: any) {
const pointer = new Pointer(this, path);
this.value = pointer.set(this.value, value);
if (this.value === nullSymbol) {
this.value = null;
}
}
/**
* Determines whether the given value is a JSON reference.
*
* @param value - The value to inspect
* @returns
*/
static is$Ref(value: unknown): value is { $ref: string; length?: number } {
return (
Boolean(value) &&
typeof value === "object" &&
value !== null &&
"$ref" in value &&
typeof value.$ref === "string" &&
value.$ref.length > 0
);
}
/**
* Determines whether the given value is an external JSON reference.
*
* @param value - The value to inspect
* @returns
*/
static isExternal$Ref(value: unknown): boolean {
return $Ref.is$Ref(value) && value.$ref![0] !== "#";
}
/**
* Determines whether the given value is a JSON reference, and whether it is allowed by the options.
* For example, if it references an external file, then options.resolve.external must be true.
*
* @param value - The value to inspect
* @param options
* @returns
*/
static isAllowed$Ref<S extends object = JSONSchema>(value: unknown, options?: ParserOptions<S>) {
if (this.is$Ref(value)) {
if (value.$ref.substring(0, 2) === "#/" || value.$ref === "#") {
// It's a JSON Pointer reference, which is always allowed
return true;
} else if (value.$ref[0] !== "#" && (!options || options.resolve?.external)) {
// It's an external reference, which is allowed by the options
return true;
}
}
return undefined;
}
/**
* Determines whether the given value is a JSON reference that "extends" its resolved value.
* That is, it has extra properties (in addition to "$ref"), so rather than simply pointing to
* an existing value, this $ref actually creates a NEW value that is a shallow copy of the resolved
* value, plus the extra properties.
*
* @example: {
person: {
properties: {
firstName: { type: string }
lastName: { type: string }
}
}
employee: {
properties: {
$ref: #/person/properties
salary: { type: number }
}
}
}
* In this example, "employee" is an extended $ref, since it extends "person" with an additional
* property (salary). The result is a NEW value that looks like this:
*
* {
* properties: {
* firstName: { type: string }
* lastName: { type: string }
* salary: { type: number }
* }
* }
*
* @param value - The value to inspect
* @returns
*/
static isExtended$Ref(value: unknown) {
return $Ref.is$Ref(value) && Object.keys(value).length > 1;
}
/**
* Returns the resolved value of a JSON Reference.
* If necessary, the resolved value is merged with the JSON Reference to create a new object
*
* @example: {
person: {
properties: {
firstName: { type: string }
lastName: { type: string }
}
}
employee: {
properties: {
$ref: #/person/properties
salary: { type: number }
}
}
} When "person" and "employee" are merged, you end up with the following object:
*
* {
* properties: {
* firstName: { type: string }
* lastName: { type: string }
* salary: { type: number }
* }
* }
*
* @param $ref - The JSON reference object (the one with the "$ref" property)
* @param resolvedValue - The resolved value, which can be any type
* @returns - Returns the dereferenced value
*/
static dereference<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
$ref: $Ref<S, O>,
resolvedValue: S,
): S {
if (resolvedValue && typeof resolvedValue === "object" && $Ref.isExtended$Ref($ref)) {
const merged = {};
for (const key of Object.keys($ref)) {
if (key !== "$ref") {
// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
merged[key] = $ref[key];
}
}
for (const key of Object.keys(resolvedValue)) {
if (!(key in merged)) {
// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
merged[key] = resolvedValue[key];
}
}
return merged as S;
} else {
// Completely replace the original reference with the resolved value
return resolvedValue;
}
}
}
export default $Ref;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","React","CheckboxInput","SelectAllStatus","useSelection","useTranslation","baseClass","SelectAll","$","selectAll","toggleAll","i18n","t0","t1","Symbol","for","t2","_jsx","None","t","checked","AllInPage","AllAvailable","className","join","id","name","onToggle","partialChecked","Some"],"sources":["../../../src/elements/SelectAll/index.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\n\nimport { CheckboxInput } from '../../fields/Checkbox/Input.js'\nimport { SelectAllStatus, useSelection } from '../../providers/Selection/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport './index.scss'\n\nconst baseClass = 'select-all'\n\nexport const SelectAll: React.FC = () => {\n const { selectAll, toggleAll } = useSelection()\n const { i18n } = useTranslation()\n\n return (\n <CheckboxInput\n aria-label={\n selectAll === SelectAllStatus.None\n ? i18n.t('general:selectAllRows')\n : i18n.t('general:deselectAllRows')\n }\n checked={\n selectAll === SelectAllStatus.AllInPage || selectAll === SelectAllStatus.AllAvailable\n }\n className={[baseClass, `${baseClass}__checkbox`].join(' ')}\n id=\"select-all\"\n name=\"select-all\"\n onToggle={() => toggleAll()}\n partialChecked={selectAll === SelectAllStatus.Some}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAEA,OAAOC,KAAA,MAAW;AAElB,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,EAAEC,YAAY,QAAQ;AAC9C,SAASC,cAAc,QAAQ;AAC/B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,SAAA,GAAsBA,CAAA;EAAA,MAAAC,CAAA,GAAAR,EAAA;EACjC;IAAAS,SAAA;IAAAC;EAAA,IAAiCN,YAAA;EACjC;IAAAO;EAAA,IAAiBN,cAAA;EAAA,IAAAO,EAAA;EAAA,IAAAJ,CAAA,QAAAG,IAAA,IAAAH,CAAA,QAAAC,SAAA,IAAAD,CAAA,QAAAE,SAAA;IAAA,IAAAG,EAAA;IAAA,IAAAL,CAAA,QAAAM,MAAA,CAAAC,GAAA;MAYFF,EAAA,IAAAP,SAAA,EAAY,GAAAA,SAAA,YAAwB;MAACE,CAAA,MAAAK,EAAA;IAAA;MAAAA,EAAA,GAAAL,CAAA;IAAA;IAAA,IAAAQ,EAAA;IAAA,IAAAR,CAAA,QAAAE,SAAA;MAGtCM,EAAA,GAAAA,CAAA,KAAMN,SAAA;MAAAF,CAAA,MAAAE,SAAA;MAAAF,CAAA,MAAAQ,EAAA;IAAA;MAAAA,EAAA,GAAAR,CAAA;IAAA;IAZlBI,EAAA,GAAAK,IAAA,CAAAf,aAAA;MAAA,cAEIO,SAAA,KAAAN,eAAA,CAAAe,IAAkC,GAC9BP,IAAA,CAAAQ,CAAA,CAAO,2BACPR,IAAA,CAAAQ,CAAA,CAAO;MAAAC,OAAA,EAGXX,SAAA,KAAAN,eAAA,CAAAkB,SAAuC,IAAIZ,SAAA,KAAAN,eAAA,CAAAmB,YAA0C;MAAAC,SAAA,EAE5EV,EAAqC,CAAAW,IAAA,CAAM;MAAAC,EAAA,EACnD;MAAAC,IAAA,EACE;MAAAC,QAAA,EACKX,EAAM;MAAAY,cAAA,EACAnB,SAAA,KAAAN,eAAA,CAAA0B;IAAkC,C;;;;;;;;SAbpDjB,E;CAgBJ","ignoreList":[]}

View File

@@ -0,0 +1,61 @@
{
"name": "fast-deep-equal",
"version": "3.1.3",
"description": "Fast deep equal",
"main": "index.js",
"scripts": {
"eslint": "eslint *.js benchmark/*.js spec/*.js",
"build": "node build",
"benchmark": "npm i && npm run build && cd ./benchmark && npm i && node ./",
"test-spec": "mocha spec/*.spec.js -R spec",
"test-cov": "nyc npm run test-spec",
"test-ts": "tsc --target ES5 --noImplicitAny index.d.ts",
"test": "npm run build && npm run eslint && npm run test-ts && npm run test-cov",
"prepublish": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/epoberezkin/fast-deep-equal.git"
},
"keywords": [
"fast",
"equal",
"deep-equal"
],
"author": "Evgeny Poberezkin",
"license": "MIT",
"bugs": {
"url": "https://github.com/epoberezkin/fast-deep-equal/issues"
},
"homepage": "https://github.com/epoberezkin/fast-deep-equal#readme",
"devDependencies": {
"coveralls": "^3.1.0",
"dot": "^1.1.2",
"eslint": "^7.2.0",
"mocha": "^7.2.0",
"nyc": "^15.1.0",
"pre-commit": "^1.2.2",
"react": "^16.12.0",
"react-test-renderer": "^16.12.0",
"sinon": "^9.0.2",
"typescript": "^3.9.5"
},
"nyc": {
"exclude": [
"**/spec/**",
"node_modules"
],
"reporter": [
"lcov",
"text-summary"
]
},
"files": [
"index.js",
"index.d.ts",
"react.js",
"react.d.ts",
"es6/"
],
"types": "index.d.ts"
}

View File

@@ -0,0 +1,5 @@
export declare const getVisibilityWatcher: () => {
readonly firstHiddenTime: number;
onHidden(cb: () => void): void;
};
//# sourceMappingURL=getVisibilityWatcher.d.ts.map

View File

@@ -0,0 +1,80 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const path = require("path");
const DirectoryWatcher = require("./DirectoryWatcher");
/** @typedef {import("./index").EventMap} EventMap */
/** @typedef {import("./DirectoryWatcher").DirectoryWatcherOptions} DirectoryWatcherOptions */
/** @typedef {import("./DirectoryWatcher").DirectoryWatcherEvents} DirectoryWatcherEvents */
/** @typedef {import("./DirectoryWatcher").FileWatcherEvents} FileWatcherEvents */
/**
* @template {EventMap} T
* @typedef {import("./DirectoryWatcher").Watcher<T>} Watcher
*/
class WatcherManager {
/**
* @param {DirectoryWatcherOptions=} options options
*/
constructor(options = {}) {
this.options = options;
/** @type {Map<string, DirectoryWatcher>} */
this.directoryWatchers = new Map();
}
/**
* @param {string} directory a directory
* @returns {DirectoryWatcher} a directory watcher
*/
getDirectoryWatcher(directory) {
const watcher = this.directoryWatchers.get(directory);
if (watcher === undefined) {
const newWatcher = new DirectoryWatcher(this, directory, this.options);
this.directoryWatchers.set(directory, newWatcher);
newWatcher.on("closed", () => {
this.directoryWatchers.delete(directory);
});
return newWatcher;
}
return watcher;
}
/**
* @param {string} file file
* @param {number=} startTime start time
* @returns {Watcher<FileWatcherEvents> | null} watcher or null if file has no directory
*/
watchFile(file, startTime) {
const directory = path.dirname(file);
if (directory === file) return null;
return this.getDirectoryWatcher(directory).watch(file, startTime);
}
/**
* @param {string} directory directory
* @param {number=} startTime start time
* @returns {Watcher<DirectoryWatcherEvents>} watcher
*/
watchDirectory(directory, startTime) {
return this.getDirectoryWatcher(directory).watch(directory, startTime);
}
}
const watcherManagers = new WeakMap();
/**
* @param {DirectoryWatcherOptions} options options
* @returns {WatcherManager} the watcher manager
*/
module.exports = (options) => {
const watcherManager = watcherManagers.get(options);
if (watcherManager !== undefined) return watcherManager;
const newWatcherManager = new WatcherManager(options);
watcherManagers.set(options, newWatcherManager);
return newWatcherManager;
};
module.exports.WatcherManager = WatcherManager;

View File

@@ -0,0 +1,21 @@
import { status as httpStatus } from 'http-status';
import { getRequestGlobal } from '../../utilities/getRequestEntity.js';
import { headersWithCors } from '../../utilities/headersWithCors.js';
import { docAccessOperation } from '../operations/docAccess.js';
export const docAccessHandler = async (req)=>{
const globalConfig = getRequestGlobal(req);
const result = await docAccessOperation({
data: req.data,
globalConfig,
req
});
return Response.json(result, {
headers: headersWithCors({
headers: new Headers(),
req
}),
status: httpStatus.OK
});
};
//# sourceMappingURL=docAccess.js.map

View File

@@ -0,0 +1 @@
export declare function isKeyboardEvent(event: Event | undefined | null): event is KeyboardEvent;

View File

@@ -0,0 +1,71 @@
import fs from 'fs';
import path from 'path';
import { dynamicImport } from '../../utilities/dynamicImport.js';
/**
* Get predefined migration 'up', 'down' and 'imports'.
*
* Supports two import methods:
* 1. @payloadcms/db-* packages: Loads from adapter's predefinedMigrations folder directly (no package.json export needed)
* Example: `--file @payloadcms/db-mongodb/relationships-v2-v3`
* 2. Any other package/path: Uses dynamic import via package.json exports or absolute file paths
* Example: `--file @payloadcms/plugin-seo/someMigration` or `--file /absolute/path/to/migration.ts`
*/ export const getPredefinedMigration = async ({ dirname, file, migrationName: migrationNameArg, payload })=>{
const importPath = file ?? migrationNameArg;
// Path 1: @payloadcms/db-* adapters - load directly from predefinedMigrations folder
// These don't need package.json exports; files are resolved relative to adapter's dirname
if (importPath?.startsWith('@payloadcms/db-')) {
const migrationName = importPath.split('/').slice(2).join('/');
let cleanPath = path.join(dirname, `./predefinedMigrations/${migrationName}`);
if (fs.existsSync(`${cleanPath}.mjs`)) {
cleanPath = `${cleanPath}.mjs`;
} else if (fs.existsSync(`${cleanPath}.js`)) {
cleanPath = `${cleanPath}.js`;
} else if (fs.existsSync(`${cleanPath}.ts`)) {
// Support .ts in development when running from source
cleanPath = `${cleanPath}.ts`;
} else {
payload.logger.error({
msg: `Canned migration ${migrationName} not found.`
});
process.exit(1);
}
cleanPath = cleanPath.replaceAll('\\', '/');
try {
const { downSQL, dynamic, imports, upSQL } = await dynamicImport(cleanPath);
return {
downSQL,
dynamic,
imports,
upSQL
};
} catch (err) {
payload.logger.error({
err,
msg: `Error loading predefined migration ${migrationName}`
});
process.exit(1);
}
} else if (importPath) {
// Path 2: Any other package or file path - use dynamic import
// Supports: package.json exports (e.g. @payloadcms/plugin-seo/migration) or absolute file paths
try {
const { downSQL, dynamic, imports, upSQL } = await dynamicImport(importPath);
return {
downSQL,
dynamic,
imports,
upSQL
};
} catch (_err) {
if (importPath?.includes('/')) {
// We can assume that the intent was to import a file, thus we throw an error.
throw new Error(`Error importing migration file from ${importPath}`);
}
// Silently fail. If the migration cannot be imported, it will be created as a blank migration and the import path will be used as the migration name.
return {};
}
}
return {};
};
//# sourceMappingURL=getPredefinedMigration.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/op-sqlite/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,8BAAc,wBAAd;AACA,8BAAc,yBADd;","names":[]}

View File

@@ -0,0 +1,25 @@
/**
* @license lucide-react v0.441.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 TableRowsSplit = createLucideIcon("TableRowsSplit", [
["path", { d: "M14 10h2", key: "1lstlu" }],
["path", { d: "M15 22v-8", key: "1fwwgm" }],
["path", { d: "M15 2v4", key: "1044rn" }],
["path", { d: "M2 10h2", key: "1r8dkt" }],
["path", { d: "M20 10h2", key: "1ug425" }],
["path", { d: "M3 19h18", key: "awlh7x" }],
["path", { d: "M3 22v-6a2 2 135 0 1 2-2h14a2 2 45 0 1 2 2v6", key: "ibqhof" }],
["path", { d: "M3 2v2a2 2 45 0 0 2 2h14a2 2 135 0 0 2-2V2", key: "1uenja" }],
["path", { d: "M8 10h2", key: "66od0" }],
["path", { d: "M9 22v-8", key: "fmnu31" }],
["path", { d: "M9 2v4", key: "j1yeou" }]
]);
export { TableRowsSplit as default };
//# sourceMappingURL=table-rows-split.js.map

View File

@@ -0,0 +1 @@
exports._default = require("./emotion-cache.cjs.js").default;

View File

@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './panel-left-dashed.js';
//# sourceMappingURL=panel-left-inactive.js.map

View File

@@ -0,0 +1,25 @@
"use strict";
function _class_apply_descriptor_destructure(receiver, descriptor) {
if (descriptor.set) {
if (!("__destrObj" in descriptor)) {
descriptor.__destrObj = {
set value(v) {
descriptor.set.call(receiver, v);
}
};
}
return descriptor.__destrObj;
} else {
if (!descriptor.writable) {
// This should only throw in strict mode, but class bodies are
// always strict and private fields can only be used inside
// class bodies.
throw new TypeError("attempted to set read only private field");
}
return descriptor;
}
}
exports._ = _class_apply_descriptor_destructure;

View File

@@ -0,0 +1,284 @@
This documentation refers to v10. Go to [9.1.1 tag](https://github.com/DominicTobias/react-image-crop/tree/9.1.1) for v9 docs.
# React Image Crop
An image cropping tool for React with no dependencies.
[![React Image Crop on NPM](https://img.shields.io/npm/v/react-image-crop.svg)](https://www.npmjs.com/package/react-image-crop)
[CodeSandbox Demo](https://codesandbox.io/s/react-image-crop-demo-with-react-hooks-y831o)
![ReactCrop GIF](https://raw.githubusercontent.com/DominicTobias/react-image-crop/master/crop-demo.gif)
## Table of Contents
1. [Features](#features)
2. [Installation](#installation)
3. [Usage](#usage)
4. [Example](#example)
5. [CDN](#cdn)
6. [Props](#props)
7. [FAQ](#faq)
1. [How can I generate a crop preview in the browser?](#how-can-i-generate-a-crop-preview-in-the-browser)
2. [How to correct image EXIF orientation/rotation?](#how-to-correct-image-exif-orientationrotation)
3. [How to filter, rotate and annotate?](#how-to-filter-rotate-and-annotate)
4. [How can I center the crop?](#how-can-i-center-the-crop)
8. [Contributing / Developing](#contributing--developing)
## Features
- Responsive (you can use pixels or percentages).
- Touch enabled.
- Free-form or fixed aspect crops.
- Fully keyboard accessible (a11y).
- No dependencies/small footprint (5KB gzip).
- Min/max crop size.
- Crop anything, not just images.
If React Crop doesn't cover your requirements then take a look at [Pintura](https://pqina.nl/pintura/?aff=xw0RQ). It features cropping, rotating, filtering, annotation, and lots more.
[Learn more about Pintura here](https://pqina.nl/pintura/?aff=xw0RQ)
## Installation
```
npm i react-image-crop --save
yarn add react-image-crop
pnpm add react-image-crop
```
This library works with all modern browsers. It does not work with IE.
## Usage
Include the main js module:
```js
import ReactCrop from 'react-image-crop'
```
Include either `dist/ReactCrop.css` or `ReactCrop.scss`.
```js
import 'react-image-crop/dist/ReactCrop.css'
// or scss:
import 'react-image-crop/src/ReactCrop.scss'
```
## Example
```tsx
import ReactCrop, { type Crop } from 'react-image-crop'
function CropDemo({ src }) {
const [crop, setCrop] = useState<Crop>()
return (
<ReactCrop crop={crop} onChange={c => setCrop(c)}>
<img src={src} />
</ReactCrop>
)
}
```
See the [sandbox demo](https://codesandbox.io/s/react-image-crop-demo-with-react-hooks-y831o) for a more complete example.
## CDN
```html
<link href="https://unpkg.com/react-image-crop/dist/ReactCrop.css" rel="stylesheet" />
<script src="https://unpkg.com/react-image-crop/dist/index.umd.cjs"></script>
```
Note when importing the script globally using a `<script>` tag access the component with `ReactCrop.Component`.
## Props
**`onChange: (crop: PixelCrop, percentCrop: PercentCrop) => void`**
A callback which happens for every change of the crop (i.e. many times as you are dragging/resizing). Passes the current crop state object.
Note you _must_ implement this callback and update your crop state, otherwise nothing will change!
```tsx
<ReactCrop crop={crop} onChange={(crop, percentCrop) => setCrop(crop)} />
```
`crop` and `percentCrop` are interchangeable. `crop` uses pixels and `percentCrop` uses percentages to position and size itself. Percent crops are resistant to image/media resizing.
**`crop?: Crop`**
Starting with no crop:
```tsx
const [crop, setCrop] = useState<Crop>()
<ReactCrop crop={crop} onChange={c => setCrop(c)}>
<img src={src} />
</ReactCrop>
```
Starting with a preselected crop:
```tsx
const [crop, setCrop] = useState<Crop>({
unit: '%', // Can be 'px' or '%'
x: 25,
y: 25,
width: 50,
height: 50
})
<ReactCrop crop={crop} onChange={c => setCrop(c)}>
<img src={src} />
</ReactCrop>
```
⚠️ You must ensure the crop is in bounds and correct to the aspect ratio if manually setting. Aspect ratios can be tricky when using %. You can make use of `centerCrop` and `makeAspectCrop` helpers. See [How can I center the crop?](#how-can-i-center-the-crop) or the [CodeSanbox Demo](https://codesandbox.io/s/react-image-crop-demo-with-react-hooks-y831o) for examples.
**`aspect?: number`**
The aspect ratio of the crop, e.g. `1` for a square or `16 / 9` for landscape. Omit/pass undefined for a free-form crop.
**`minWidth?: number`**
A minimum crop width, in pixels.
**`minHeight?: number`**
A minimum crop height, in pixels.
**`maxWidth?: number`**
A maximum crop width, in pixels.
**`maxHeight?: number`**
A maximum crop height, in pixels.
**`keepSelection?: boolean`**
If true is passed then selection can't be disabled if the user clicks outside the selection area.
**`disabled?: boolean`**
If true then the user cannot resize or draw a new crop. A class of `ReactCrop--disabled` is also added to the container for user styling.
**`locked?: boolean`**
If true then the user cannot create or resize a crop, but can still drag the existing crop around. A class of `ReactCrop--locked` is also added to the container for user styling.
**`className?: string`**
A string of classes to add to the main `ReactCrop` element.
**`style?: React.CSSProperties`**
Inline styles object to be passed to the image wrapper element.
**`onComplete?: (crop: PixelCrop, percentCrop: PercentCrop) => void`**
A callback which happens after a resize, drag, or nudge. Passes the current crop state object.
`percentCrop` is the crop as a percentage. A typical use case for it would be to save it so that the user's crop can be restored regardless of the size of the image (for example saving it on desktop, and then using it on a mobile where the image is smaller).
**`onDragStart?: (e: PointerEvent) => void`**
A callback which happens when a user starts dragging or resizing. It is convenient to manipulate elements outside this component.
**`onDragEnd?: (e: PointerEvent) => void`**
A callback which happens when a user releases the cursor or touch after dragging or resizing.
**`renderSelectionAddon?: (state: ReactCropState) => React.ReactNode`**
Render a custom element inside the crop selection.
**`ruleOfThirds?: boolean`**
Show [rule of thirds](https://en.wikipedia.org/wiki/Rule_of_thirds) lines in the cropped area. Defaults to `false`.
**`circularCrop?: boolean`**
Show the crop area as a circle. If your `aspect` is not `1` (a square) then the circle will be warped into an oval shape. Defaults to `false`.
## FAQ
### How can I generate a crop preview in the browser?
This isn't part of the library but there is an example over here [CodeSandbox Demo](https://codesandbox.io/s/react-image-crop-demo-with-react-hooks-y831o).
### How to correct image EXIF orientation/rotation?
You might find that some images are rotated incorrectly. Unfortunately this is a browser wide issue not related to this library. You need to fix your image before passing it in.
You can use the following library to load images, which will correct the rotation for you: https://github.com/blueimp/JavaScript-Load-Image/
You can read an issue on this subject here: https://github.com/DominicTobias/react-image-crop/issues/181
If you're looking for a complete out of the box image editor which already handles EXIF rotation then consider using [Pintura](https://pqina.nl/pintura/?aff=xw0RQ).
<h3>How to filter, rotate and annotate?</h3>
This library is deliberately lightweight and minimal for you to build features on top of. If you wish to perform more advanced image editing out of the box then consider using [Pintura](https://pqina.nl/pintura/?aff=xw0RQ).
![Pintura Demo](https://raw.githubusercontent.com/DominicTobias/react-image-crop/master/doka-demo.gif)
### How can I center the crop?
The easiest way is to use the percentage unit:
```js
crop: {
unit: '%',
width: 50,
height: 50,
x: 25,
y: 25
}
```
Centering an aspect ratio crop is trickier especially when dealing with `%`. However two helper functions are provided:
1. Listen to the load event of your media to get its size:
```jsx
<ReactCrop crop={crop} aspect={16 / 9}>
<img src={src} onLoad={onImageLoad} />
</ReactCrop>
```
2. Use `makeAspectCrop` to create your desired aspect and then `centerCrop` to center it:
```js
function onImageLoad(e) {
const { naturalWidth: width, naturalHeight: height } = e.currentTarget
const crop = centerCrop(
makeAspectCrop(
{
// You don't need to pass a complete crop into
// makeAspectCrop or centerCrop.
unit: '%',
width: 90,
},
16 / 9,
width,
height
),
width,
height
)
setCrop(crop)
}
```
Also remember to set your crop using the percentCrop on changes:
```js
const onCropChange = (crop, percentCrop) => setCrop(percentCrop)
```
## Contributing / Developing
To develop run `pnpm install && pnpm dev` and open the localhost server in your browser. Update code and it will reload. When you're ready open a pull request.

View File

@@ -0,0 +1,55 @@
{
"name": "@schummar/icu-type-parser",
"repository": "schummar/schummar-translate",
"version": "1.21.5",
"description": "TypeScript powered ICU message parser.",
"keywords": [
"typescript",
"i18n",
"localization",
"icu",
"message",
"parser",
"type checking",
"autocomplete",
"IntelliSense"
],
"type": "module",
"sideEffects": false,
"author": {
"name": "Marco Schumacher",
"email": "marco@schumacher.dev"
},
"contributors": [
{
"name": "Marco Schumacher",
"email": "marco@schumacher.dev"
}
],
"license": "MIT",
"exports": {
".": {
"types": "./dist/index.d.ts"
}
},
"typesVersions": {
".": {
"*": [
"dist/index.d.ts"
]
}
},
"types": "dist/index.d.ts",
"scripts": {
"build": "tsup",
"publint": "publint",
"prepublishOnly": "runp build",
"release": "release-it --ci -c ../../.release-it-package.ts"
},
"publishConfig": {
"access": "public"
},
"files": [
"dist"
]
}

View File

@@ -0,0 +1,4 @@
function _objectDestructuringEmpty(t) {
if (null == t) throw new TypeError("Cannot destructure " + t);
}
export { _objectDestructuringEmpty as default };

View File

@@ -0,0 +1,11 @@
const formatRelativeLocale = {
lastWeek: "'पिछले' eeee p",
yesterday: "'कल' p",
today: "'आज' p",
tomorrow: "'कल' p",
nextWeek: "eeee 'को' p",
other: "P",
};
export const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A zC","548":"B"},B:{"1":"0 1 2 3 4 5 6 7 8 Q H R S T U V W X Y Z 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 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I","516":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z 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 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","2":"0C VC J bB K D E F 4C 5C","676":"9 A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB","1700":"uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B"},D:{"1":"0 1 2 3 4 5 6 7 8 GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z 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 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"J bB K D E F A B C L M","676":"G N O P cB","804":"9 AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC"},E:{"1":"iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J bB 6C bC","548":"eC RC ED SC fC gC hC","676":"7C","804":"K D E F A B C L M G 8C 9C AD cC PC QC BD CD DD dC"},F:{"1":"0 1 2 3 4 5 6 7 8 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z 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 QC","2":"F B C JD KD LD MD PC xC ND","804":"9 G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B"},G:{"2":"E bC OD yC PD QD RD SD TD UD VD WD XD YD","2052":"ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC"},H:{"2":"mD"},I:{"2":"VC J I nD oD pD qD yC rD sD"},J:{"2":"D","292":"A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"2":"A","548":"B"},O:{"1":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB cC yD zD 0D 1D 2D SC TC UC 3D","804":"J tD uD vD wD xD"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:1,C:"Fullscreen API",D:true};

View File

@@ -0,0 +1,142 @@
{
"name": "uuid",
"version": "10.0.0",
"description": "RFC9562 UUIDs",
"funding": [
"https://github.com/sponsors/broofa",
"https://github.com/sponsors/ctavan"
],
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"keywords": [
"uuid",
"guid",
"rfc4122",
"rfc9562"
],
"license": "MIT",
"bin": {
"uuid": "dist/bin/uuid"
},
"sideEffects": false,
"main": "./dist/index.js",
"exports": {
".": {
"node": {
"module": "./dist/esm-node/index.js",
"require": "./dist/index.js",
"import": "./wrapper.mjs"
},
"browser": {
"import": "./dist/esm-browser/index.js",
"require": "./dist/commonjs-browser/index.js"
},
"default": "./dist/esm-browser/index.js"
},
"./package.json": "./package.json"
},
"module": "./dist/esm-node/index.js",
"browser": {
"./dist/esm-node/index.js": "./dist/esm-browser/index.js",
"./dist/md5.js": "./dist/md5-browser.js",
"./dist/native.js": "./dist/native-browser.js",
"./dist/rng.js": "./dist/rng-browser.js",
"./dist/sha1.js": "./dist/sha1-browser.js"
},
"files": [
"CHANGELOG.md",
"CONTRIBUTING.md",
"LICENSE.md",
"README.md",
"dist",
"wrapper.mjs"
],
"devDependencies": {
"@babel/cli": "7.24.6",
"@babel/core": "7.24.6",
"@babel/eslint-parser": "7.24.6",
"@babel/plugin-syntax-import-attributes": "7.24.6",
"@babel/preset-env": "7.24.6",
"@commitlint/cli": "19.3.0",
"@commitlint/config-conventional": "19.2.2",
"@wdio/browserstack-service": "7.16.10",
"@wdio/cli": "7.16.10",
"@wdio/jasmine-framework": "7.16.6",
"@wdio/local-runner": "7.16.10",
"@wdio/spec-reporter": "7.16.9",
"@wdio/static-server-service": "7.16.6",
"bundlewatch": "0.3.3",
"eslint": "9.4.0",
"eslint-plugin-prettier": "5.1.3",
"globals": "15.3.0",
"husky": "9.0.11",
"jest": "29.7.0",
"lint-staged": "15.2.5",
"neostandard": "0.5.1",
"npm-run-all": "4.1.5",
"optional-dev-dependency": "2.0.1",
"prettier": "3.3.0",
"random-seed": "0.3.0",
"runmd": "1.3.9",
"standard-version": "9.5.0"
},
"optionalDevDependencies": {
"@wdio/browserstack-service": "7.16.10",
"@wdio/cli": "7.16.10",
"@wdio/jasmine-framework": "7.16.6",
"@wdio/local-runner": "7.16.10",
"@wdio/spec-reporter": "7.16.9",
"@wdio/static-server-service": "7.16.6"
},
"scripts": {
"examples:browser:webpack:build": "cd examples/browser-webpack && npm install && npm run build",
"examples:browser:rollup:build": "cd examples/browser-rollup && npm install && npm run build",
"examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test",
"examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test",
"examples:node:jest:test": "cd examples/node-jest && npm install && npm test",
"prepare": "husky install",
"lint": "npm run eslint:check && npm run prettier:check",
"eslint:check": "eslint src/ test/ examples/ *.js",
"eslint:fix": "eslint --fix src/ test/ examples/ *.js",
"pretest": "npm run build",
"test": "BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/",
"test:matching": "BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/ -t",
"pretest:browser": "optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**",
"test:browser": "wdio run ./wdio.conf.js",
"pretest:node": "npm run build",
"test:node": "npm-run-all --parallel examples:node:**",
"test:pack": "./scripts/testpack.sh",
"pretest:benchmark": "npm run build",
"test:benchmark": "cd examples/benchmark && HUSKY=0 npm install && npm test",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
"bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json",
"md": "runmd --watch --output=README.md README_js.md",
"docs": "npm run build && npx runmd --output=README.md README_js.md",
"docs:diff": "npm run docs && git diff --quiet README.md",
"build": "./scripts/build.sh",
"prepack": "npm run build",
"release": "standard-version --no-verify"
},
"repository": {
"type": "git",
"url": "git+https://github.com/uuidjs/uuid.git"
},
"lint-staged": {
"*": [
"prettier --no-error-on-unmatched-pattern --write"
],
"*.{js,jsx}": [
"eslint --no-error-on-unmatched-pattern --fix"
]
},
"standard-version": {
"scripts": {
"postchangelog": "prettier --write CHANGELOG.md"
}
},
"packageManager": "npm@10.8.1+sha256.b8807aebb9656758e2872fa6e7c564b506aa2faa9297439a478d471d2fe32483"
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"arrow-up-from-dot.js","sources":["../../../src/icons/arrow-up-from-dot.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowUpFromDot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNSA5IDctNyA3IDciIC8+CiAgPHBhdGggZD0iTTEyIDE2VjIiIC8+CiAgPGNpcmNsZSBjeD0iMTIiIGN5PSIyMSIgcj0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-up-from-dot\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ArrowUpFromDot = createLucideIcon('ArrowUpFromDot', [\n ['path', { d: 'm5 9 7-7 7 7', key: '1hw5ic' }],\n ['path', { d: 'M12 16V2', key: 'ywoabb' }],\n ['circle', { cx: '12', cy: '21', r: '1', key: 'o0uj5v' }],\n]);\n\nexport default ArrowUpFromDot;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzC,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AAC1D,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,48 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const debugBuild = require('../debug-build.js');
const semanticAttributes = require('../semanticAttributes.js');
const debugLogger = require('../utils/debug-logger.js');
const spanUtils = require('../utils/spanUtils.js');
/**
* Adds a measurement to the active transaction on the current global scope. You can optionally pass in a different span
* as the 4th parameter.
*/
function setMeasurement(name, value, unit, activeSpan = spanUtils.getActiveSpan()) {
const rootSpan = activeSpan && spanUtils.getRootSpan(activeSpan);
if (rootSpan) {
debugBuild.DEBUG_BUILD && debugLogger.debug.log(`[Measurement] Setting measurement on root span: ${name} = ${value} ${unit}`);
rootSpan.addEvent(name, {
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: value,
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit ,
});
}
}
/**
* Convert timed events to measurements.
*/
function timedEventsToMeasurements(events) {
if (!events || events.length === 0) {
return undefined;
}
const measurements = {};
events.forEach(event => {
const attributes = event.attributes || {};
const unit = attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT] ;
const value = attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE] ;
if (typeof unit === 'string' && typeof value === 'number') {
measurements[event.name] = { value, unit };
}
});
return measurements;
}
exports.setMeasurement = setMeasurement;
exports.timedEventsToMeasurements = timedEventsToMeasurements;
//# sourceMappingURL=measurement.js.map

View File

@@ -0,0 +1 @@
module.exports={C:{"102":0.00808,"115":0.00808,"132":0.04038,"142":0.14941,"144":0.09287,"145":0.06461,"146":0.10903,_:"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 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 133 134 135 136 137 138 139 140 141 143 147 148 149 3.5 3.6"},D:{"69":0.00808,"93":0.0323,"97":0.0323,"98":0.04038,"108":0.01615,"109":0.39572,"111":0.00808,"115":0.02423,"116":0.00808,"125":0.01615,"126":0.10095,"127":0.0323,"128":0.0323,"131":0.05653,"132":0.04038,"134":0.01615,"135":0.0323,"136":0.00808,"137":0.15748,"138":2.657,"139":0.00808,"140":0.17363,"141":0.47245,"142":7.39762,"143":8.31424,"144":0.00808,"145":0.02423,_:"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 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 94 95 96 99 100 101 102 103 104 105 106 107 110 112 113 114 117 118 119 120 121 122 123 124 129 130 133 146"},F:{"92":0.00808,"124":0.25036,"125":0.07268,_:"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 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 120 121 122 123 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"122":0.00808,"128":0.00808,"131":0.00808,"132":0.04038,"135":0.04038,"137":0.01615,"138":0.15748,"139":0.02423,"140":0.05653,"141":0.00808,"142":2.45107,"143":3.57767,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 123 124 125 126 127 129 130 133 134 136"},E:{_:"0 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 15.1 15.2-15.3 15.4 16.0 16.2 16.4 17.0 17.1 17.2 17.3 18.2 18.3 18.4 26.3","14.1":0.01615,"15.5":0.12518,"15.6":0.04846,"16.1":0.0323,"16.3":0.00808,"16.5":0.02423,"16.6":0.01615,"17.4":0.00808,"17.5":2.11995,"17.6":0.04846,"18.0":0.00808,"18.1":0.0323,"18.5-18.6":0.06461,"26.0":0.0323,"26.1":0.15748,"26.2":0.0848},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00162,"5.0-5.1":0,"6.0-6.1":0.00325,"7.0-7.1":0.00243,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00649,"10.0-10.2":0.00081,"10.3":0.01136,"11.0-11.2":0.13957,"11.3-11.4":0.00406,"12.0-12.1":0.00325,"12.2-12.5":0.03651,"13.0-13.1":0.00081,"13.2":0.00568,"13.3":0.00162,"13.4-13.7":0.00568,"14.0-14.4":0.01136,"14.5-14.8":0.01217,"15.0-15.1":0.01298,"15.2-15.3":0.00974,"15.4":0.01055,"15.5":0.01136,"15.6-15.8":0.17608,"16.0":0.02029,"16.1":0.03895,"16.2":0.02029,"16.3":0.03651,"16.4":0.00893,"16.5":0.01542,"16.6-16.7":0.22882,"17.0":0.01298,"17.1":0.0211,"17.2":0.01542,"17.3":0.02353,"17.4":0.03976,"17.5":0.0779,"17.6-17.7":0.18014,"18.0":0.04057,"18.1":0.08439,"18.2":0.04463,"18.3":0.14525,"18.4":0.07465,"18.5-18.7":5.36029,"26.0":0.10467,"26.1":0.87066,"26.2":0.16553,"26.3":0.0073},P:{"4":0.01026,"20":0.02053,"21":0.10264,"22":0.12317,"24":0.49269,"25":1.37543,"26":0.20529,"27":0.93406,"28":1.31384,"29":2.83297,_:"23 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 14.0 17.0 18.0 19.0","5.0-5.4":0.01026,"7.2-7.4":0.16423,"13.0":0.15397,"15.0":0.03079,"16.0":0.01026},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},A:{_:"6 7 8 9 10 11 5.5"},K:{"0":1.37126,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{"14.9":0.09539},O:{_:"0"},H:{"0":0},L:{"0":49.37865},R:{_:"0"},M:{"0":0.67967}};

View File

@@ -0,0 +1,21 @@
import { ExportResult } from '@opentelemetry/core';
import { ReadableSpan } from './ReadableSpan';
/**
* An interface that allows different tracing services to export recorded data
* for sampled spans in their own format.
*
* To export data this MUST be register to the Tracer SDK using a optional
* config.
*/
export interface SpanExporter {
/**
* Called to export sampled {@link ReadableSpan}s.
* @param spans the list of sampled Spans to be exported.
*/
export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): void;
/** Stops the exporter. */
shutdown(): Promise<void>;
/** Immediately export all spans */
forceFlush?(): Promise<void>;
}
//# sourceMappingURL=SpanExporter.d.ts.map

View File

@@ -0,0 +1,64 @@
import { AsyncContextStack } from './asyncContext/stackStrategy';
import { AsyncContextStrategy } from './asyncContext/types';
import { Client } from './client';
import { Scope } from './scope';
import { SerializedLog } from './types-hoist/log';
import { SerializedMetric } from './types-hoist/metric';
/**
* An object that contains globally accessible properties and maintains a scope stack.
* @hidden
*/
export interface Carrier {
__SENTRY__?: VersionedCarrier;
}
type VersionedCarrier = {
version?: string;
} & Record<Exclude<string, 'version'>, SentryCarrier>;
export interface SentryCarrier {
acs?: AsyncContextStrategy;
stack?: AsyncContextStack;
globalScope?: Scope;
defaultIsolationScope?: Scope;
defaultCurrentScope?: Scope;
loggerSettings?: {
enabled: boolean;
};
/**
* A map of Sentry clients to their log buffers.
* This is used to store logs that are sent to Sentry.
*/
clientToLogBufferMap?: WeakMap<Client, Array<SerializedLog>>;
/**
* A map of Sentry clients to their metric buffers.
* This is used to store metrics that are sent to Sentry.
*/
clientToMetricBufferMap?: WeakMap<Client, Array<SerializedMetric>>;
/** Overwrites TextEncoder used in `@sentry/core`, need for `react-native@0.73` and older */
encodePolyfill?: (input: string) => Uint8Array;
/** Overwrites TextDecoder used in `@sentry/core`, need for `react-native@0.73` and older */
decodePolyfill?: (input: Uint8Array) => string;
}
/**
* Returns the global shim registry.
*
* FIXME: This function is problematic, because despite always returning a valid Carrier,
* it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check
* at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.
**/
export declare function getMainCarrier(): Carrier;
/** Will either get the existing sentry carrier, or create a new one. */
export declare function getSentryCarrier(carrier: Carrier): SentryCarrier;
/**
* Returns a global singleton contained in the global `__SENTRY__[]` object.
*
* If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory
* function and added to the `__SENTRY__` object.
*
* @param name name of the global singleton on __SENTRY__
* @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`
* @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value
* @returns the singleton
*/
export declare function getGlobalSingleton<Prop extends keyof SentryCarrier>(name: Prop, creator: () => NonNullable<SentryCarrier[Prop]>, obj?: import("./utils/worldwide").InternalGlobal): NonNullable<SentryCarrier[Prop]>;
export {};
//# sourceMappingURL=carrier.d.ts.map

View File

@@ -0,0 +1,4 @@
import type { DefaultTranslationsObject, Language } from '../types.js';
export declare const azTranslations: DefaultTranslationsObject;
export declare const az: Language;
//# sourceMappingURL=az.d.ts.map

View File

@@ -0,0 +1,510 @@
function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}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(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}(function (_window$dateFns) {var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/id/_lib/formatDistance.mjs
var formatDistanceLocale = {
lessThanXSeconds: {
one: "kurang dari 1 detik",
other: "kurang dari {{count}} detik"
},
xSeconds: {
one: "1 detik",
other: "{{count}} detik"
},
halfAMinute: "setengah menit",
lessThanXMinutes: {
one: "kurang dari 1 menit",
other: "kurang dari {{count}} menit"
},
xMinutes: {
one: "1 menit",
other: "{{count}} menit"
},
aboutXHours: {
one: "sekitar 1 jam",
other: "sekitar {{count}} jam"
},
xHours: {
one: "1 jam",
other: "{{count}} jam"
},
xDays: {
one: "1 hari",
other: "{{count}} hari"
},
aboutXWeeks: {
one: "sekitar 1 minggu",
other: "sekitar {{count}} minggu"
},
xWeeks: {
one: "1 minggu",
other: "{{count}} minggu"
},
aboutXMonths: {
one: "sekitar 1 bulan",
other: "sekitar {{count}} bulan"
},
xMonths: {
one: "1 bulan",
other: "{{count}} bulan"
},
aboutXYears: {
one: "sekitar 1 tahun",
other: "sekitar {{count}} tahun"
},
xYears: {
one: "1 tahun",
other: "{{count}} tahun"
},
overXYears: {
one: "lebih dari 1 tahun",
other: "lebih dari {{count}} tahun"
},
almostXYears: {
one: "hampir 1 tahun",
other: "hampir {{count}} tahun"
}
};
var formatDistance = function formatDistance(token, count, options) {
var result;
var tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", count.toString());
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "dalam waktu " + result;
} else {
return result + " yang lalu";
}
}
return result;
};
// lib/locale/_lib/buildFormatLongFn.mjs
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/id/_lib/formatLong.mjs
var dateFormats = {
full: "EEEE, d MMMM yyyy",
long: "d MMMM yyyy",
medium: "d MMM yyyy",
short: "d/M/yyyy"
};
var timeFormats = {
full: "HH.mm.ss",
long: "HH.mm.ss",
medium: "HH.mm",
short: "HH.mm"
};
var dateTimeFormats = {
full: "{{date}} 'pukul' {{time}}",
long: "{{date}} 'pukul' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/id/_lib/formatRelative.mjs
var formatRelativeLocale = {
lastWeek: "eeee 'lalu pukul' p",
yesterday: "'Kemarin pukul' p",
today: "'Hari ini pukul' p",
tomorrow: "'Besok pukul' p",
nextWeek: "eeee 'pukul' p",
other: "P"
};
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
// lib/locale/_lib/buildLocalizeFn.mjs
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/id/_lib/localize.mjs
var eraValues = {
narrow: ["SM", "M"],
abbreviated: ["SM", "M"],
wide: ["Sebelum Masehi", "Masehi"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["K1", "K2", "K3", "K4"],
wide: ["Kuartal ke-1", "Kuartal ke-2", "Kuartal ke-3", "Kuartal ke-4"]
};
var monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mar",
"Apr",
"Mei",
"Jun",
"Jul",
"Agt",
"Sep",
"Okt",
"Nov",
"Des"],
wide: [
"Januari",
"Februari",
"Maret",
"April",
"Mei",
"Juni",
"Juli",
"Agustus",
"September",
"Oktober",
"November",
"Desember"]
};
var dayValues = {
narrow: ["M", "S", "S", "R", "K", "J", "S"],
short: ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"],
abbreviated: ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"],
wide: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"]
};
var dayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "tengah malam",
noon: "tengah hari",
morning: "pagi",
afternoon: "siang",
evening: "sore",
night: "malam"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "tengah malam",
noon: "tengah hari",
morning: "pagi",
afternoon: "siang",
evening: "sore",
night: "malam"
},
wide: {
am: "AM",
pm: "PM",
midnight: "tengah malam",
noon: "tengah hari",
morning: "pagi",
afternoon: "siang",
evening: "sore",
night: "malam"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "tengah malam",
noon: "tengah hari",
morning: "pagi",
afternoon: "siang",
evening: "sore",
night: "malam"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "tengah malam",
noon: "tengah hari",
morning: "pagi",
afternoon: "siang",
evening: "sore",
night: "malam"
},
wide: {
am: "AM",
pm: "PM",
midnight: "tengah malam",
noon: "tengah hari",
morning: "pagi",
afternoon: "siang",
evening: "sore",
night: "malam"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
var number = Number(dirtyNumber);
return "ke-" + number;
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/_lib/buildMatchFn.mjs
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
var findKey = function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
};
var findIndex = function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
};
// lib/locale/_lib/buildMatchPatternFn.mjs
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/id/_lib/match.mjs
var matchOrdinalNumberPattern = /^ke-(\d+)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(sm|m)/i,
abbreviated: /^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,
wide: /^(sebelum masehi|sebelum era umum|masehi|era umum)/i
};
var parseEraPatterns = {
any: [/^s/i, /^(m|e)/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^K-?\s[1234]/i,
wide: /^Kuartal ke-?\s?[1234]/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,
wide: /^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i
};
var parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i],
any: [
/^ja/i,
/^f/i,
/^ma/i,
/^ap/i,
/^me/i,
/^jun/i,
/^jul/i,
/^ag/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i]
};
var matchDayPatterns = {
narrow: /^[srkjm]/i,
short: /^(min|sen|sel|rab|kam|jum|sab)/i,
abbreviated: /^(min|sen|sel|rab|kam|jum|sab)/i,
wide: /^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i
};
var parseDayPatterns = {
narrow: [/^m/i, /^s/i, /^s/i, /^r/i, /^k/i, /^j/i, /^s/i],
any: [/^m/i, /^sen/i, /^sel/i, /^r/i, /^k/i, /^j/i, /^sa/i]
};
var matchDayPeriodPatterns = {
narrow: /^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,
any: /^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i
};
var parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^pm/i,
midnight: /^tengah m/i,
noon: /^tengah h/i,
morning: /pagi/i,
afternoon: /siang/i,
evening: /sore/i,
night: /malam/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value, 10);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/id.mjs
var id = {
code: "id",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 1
}
};
// lib/locale/id/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
id: id }) });
//# debugId=4A2B30C9AFE027EA64756e2164756e21
})();
//# sourceMappingURL=cdn.js.map

View File

@@ -0,0 +1,29 @@
import { getTranslation } from '@payloadcms/translations';
import { generateMetadata } from '../../utilities/meta.js';
/**
* @todo Remove the `MetaConfig` type assertions. They are currently required because of how the `Metadata` type from `next` consumes the `URL` type.
*/
export const generateAPIViewMetadata = async ({
collectionConfig,
config,
globalConfig,
i18n
}) => {
const entityLabel = collectionConfig ? getTranslation(collectionConfig.labels.singular, i18n) : globalConfig ? getTranslation(globalConfig.label, i18n) : '';
return Promise.resolve(generateMetadata({
...(config.admin.meta || {}),
description: `API - ${entityLabel}`,
keywords: 'API',
serverURL: config.serverURL,
title: `API - ${entityLabel}`,
...(collectionConfig ? {
...(collectionConfig?.admin.meta || {}),
...(collectionConfig?.admin?.components?.views?.edit?.api?.meta || {})
} : {}),
...(globalConfig ? {
...(globalConfig?.admin.meta || {}),
...(globalConfig?.admin?.components?.views?.edit?.api?.meta || {})
} : {})
}));
};
//# sourceMappingURL=metadata.js.map

View File

@@ -0,0 +1,145 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("../../declarations/WebpackOptions").WasmLoadingType} WasmLoadingType */
/** @typedef {import("../Compiler")} Compiler */
/** @typedef {Set<WasmLoadingType>} WasmLoadingTypes */
/** @type {WeakMap<Compiler, Set<WasmLoadingType>>} */
const enabledTypes = new WeakMap();
/**
* @param {Compiler} compiler compiler instance
* @returns {WasmLoadingTypes} enabled types
*/
const getEnabledTypes = (compiler) => {
let set = enabledTypes.get(compiler);
if (set === undefined) {
/** @type {WasmLoadingTypes} */
set = new Set();
enabledTypes.set(compiler, set);
}
return set;
};
class EnableWasmLoadingPlugin {
/**
* @param {WasmLoadingType} type library type that should be available
*/
constructor(type) {
this.type = type;
}
/**
* @param {Compiler} compiler the compiler instance
* @param {WasmLoadingType} type type of library
* @returns {void}
*/
static setEnabled(compiler, type) {
getEnabledTypes(compiler).add(type);
}
/**
* @param {Compiler} compiler the compiler instance
* @param {WasmLoadingType} type type of library
* @returns {void}
*/
static checkEnabled(compiler, type) {
if (!getEnabledTypes(compiler).has(type)) {
throw new Error(
`Library type "${type}" is not enabled. ` +
"EnableWasmLoadingPlugin need to be used to enable this type of wasm loading. " +
'This usually happens through the "output.enabledWasmLoadingTypes" option. ' +
'If you are using a function as entry which sets "wasmLoading", you need to add all potential library types to "output.enabledWasmLoadingTypes". ' +
`These types are enabled: ${[...getEnabledTypes(compiler)].join(", ")}`
);
}
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
const { type } = this;
// Only enable once
const enabled = getEnabledTypes(compiler);
if (enabled.has(type)) return;
enabled.add(type);
if (typeof type === "string") {
switch (type) {
case "fetch": {
if (compiler.options.experiments.syncWebAssembly) {
const FetchCompileWasmPlugin = require("../web/FetchCompileWasmPlugin");
new FetchCompileWasmPlugin({
mangleImports: compiler.options.optimization.mangleWasmImports
}).apply(compiler);
}
if (compiler.options.experiments.asyncWebAssembly) {
const FetchCompileAsyncWasmPlugin = require("../web/FetchCompileAsyncWasmPlugin");
new FetchCompileAsyncWasmPlugin().apply(compiler);
}
break;
}
case "async-node": {
if (compiler.options.experiments.syncWebAssembly) {
const ReadFileCompileWasmPlugin = require("../node/ReadFileCompileWasmPlugin");
new ReadFileCompileWasmPlugin({
mangleImports: compiler.options.optimization.mangleWasmImports,
import:
compiler.options.output.module &&
compiler.options.output.environment.dynamicImport
}).apply(compiler);
}
if (compiler.options.experiments.asyncWebAssembly) {
const ReadFileCompileAsyncWasmPlugin = require("../node/ReadFileCompileAsyncWasmPlugin");
new ReadFileCompileAsyncWasmPlugin({
import:
compiler.options.output.module &&
compiler.options.output.environment.dynamicImport
}).apply(compiler);
}
break;
}
case "universal": {
if (compiler.options.experiments.syncWebAssembly) {
throw new Error(
"Universal wasm loading type is only supported by asynchronous web assembly."
);
}
if (compiler.options.experiments.asyncWebAssembly) {
const UniversalCompileAsyncWasmPlugin = require("../wasm-async/UniversalCompileAsyncWasmPlugin");
new UniversalCompileAsyncWasmPlugin().apply(compiler);
}
break;
}
default:
throw new Error(`Unsupported wasm loading type ${type}.
Plugins which provide custom wasm loading types must call EnableWasmLoadingPlugin.setEnabled(compiler, type) to disable this error.`);
}
} else {
// TODO support plugin instances here
// apply them to the compiler
}
}
}
module.exports = EnableWasmLoadingPlugin;

View File

@@ -0,0 +1 @@
{"version":3,"file":"DrawerContent.d.ts","sourceRoot":"","sources":["../../../src/elements/UnpublishMany/DrawerContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAMpC,OAAO,KAAsB,MAAM,OAAO,CAAA;AAG1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAUpD,KAAK,+BAA+B,GAAG;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GAAG,kBAAkB,CAAA;AAEtB,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,+BAA+B,qBA4JhF"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/headersWithCors.ts"],"sourcesContent":["import type { PayloadRequest } from '../types/index.js'\n\ntype CorsArgs = {\n headers: Headers\n req: Partial<PayloadRequest>\n}\nexport const headersWithCors = ({ headers, req }: CorsArgs): Headers => {\n const cors = req?.payload?.config.cors\n const requestOrigin = req?.headers?.get('Origin')\n\n if (cors) {\n const defaultAllowedHeaders = [\n 'Origin',\n 'X-Requested-With',\n 'Content-Type',\n 'Accept',\n 'Authorization',\n 'Content-Encoding',\n 'x-apollo-tracing',\n 'X-Payload-HTTP-Method-Override',\n ]\n\n // Only set default CORS headers if they haven't been set by custom handler\n if (!headers.has('Access-Control-Allow-Methods')) {\n headers.set('Access-Control-Allow-Methods', 'PUT, PATCH, POST, GET, DELETE, OPTIONS')\n }\n\n if (!headers.has('Access-Control-Allow-Headers')) {\n if (typeof cors === 'object' && 'headers' in cors) {\n headers.set(\n 'Access-Control-Allow-Headers',\n [...defaultAllowedHeaders, ...cors.headers].filter(Boolean).join(', '),\n )\n } else {\n headers.set('Access-Control-Allow-Headers', defaultAllowedHeaders.join(', '))\n }\n }\n\n if (!headers.has('Access-Control-Allow-Origin')) {\n if (cors === '*' || (typeof cors === 'object' && 'origins' in cors && cors.origins === '*')) {\n headers.set('Access-Control-Allow-Origin', '*')\n } else if (\n (Array.isArray(cors) && cors.indexOf(requestOrigin!) > -1) ||\n (!Array.isArray(cors) &&\n typeof cors === 'object' &&\n 'origins' in cors &&\n cors.origins.indexOf(requestOrigin!) > -1)\n ) {\n headers.set('Access-Control-Allow-Credentials', 'true')\n headers.set('Access-Control-Allow-Origin', requestOrigin!)\n }\n }\n }\n\n return headers\n}\n"],"names":["headersWithCors","headers","req","cors","payload","config","requestOrigin","get","defaultAllowedHeaders","has","set","filter","Boolean","join","origins","Array","isArray","indexOf"],"mappings":"AAMA,OAAO,MAAMA,kBAAkB,CAAC,EAAEC,OAAO,EAAEC,GAAG,EAAY;IACxD,MAAMC,OAAOD,KAAKE,SAASC,OAAOF;IAClC,MAAMG,gBAAgBJ,KAAKD,SAASM,IAAI;IAExC,IAAIJ,MAAM;QACR,MAAMK,wBAAwB;YAC5B;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QAED,2EAA2E;QAC3E,IAAI,CAACP,QAAQQ,GAAG,CAAC,iCAAiC;YAChDR,QAAQS,GAAG,CAAC,gCAAgC;QAC9C;QAEA,IAAI,CAACT,QAAQQ,GAAG,CAAC,iCAAiC;YAChD,IAAI,OAAON,SAAS,YAAY,aAAaA,MAAM;gBACjDF,QAAQS,GAAG,CACT,gCACA;uBAAIF;uBAA0BL,KAAKF,OAAO;iBAAC,CAACU,MAAM,CAACC,SAASC,IAAI,CAAC;YAErE,OAAO;gBACLZ,QAAQS,GAAG,CAAC,gCAAgCF,sBAAsBK,IAAI,CAAC;YACzE;QACF;QAEA,IAAI,CAACZ,QAAQQ,GAAG,CAAC,gCAAgC;YAC/C,IAAIN,SAAS,OAAQ,OAAOA,SAAS,YAAY,aAAaA,QAAQA,KAAKW,OAAO,KAAK,KAAM;gBAC3Fb,QAAQS,GAAG,CAAC,+BAA+B;YAC7C,OAAO,IACL,AAACK,MAAMC,OAAO,CAACb,SAASA,KAAKc,OAAO,CAACX,iBAAkB,CAAC,KACvD,CAACS,MAAMC,OAAO,CAACb,SACd,OAAOA,SAAS,YAChB,aAAaA,QACbA,KAAKW,OAAO,CAACG,OAAO,CAACX,iBAAkB,CAAC,GAC1C;gBACAL,QAAQS,GAAG,CAAC,oCAAoC;gBAChDT,QAAQS,GAAG,CAAC,+BAA+BJ;YAC7C;QACF;IACF;IAEA,OAAOL;AACT,EAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/openfeature/integration.ts"],"sourcesContent":["/**\n * Sentry integration for capturing OpenFeature feature flag evaluations.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import * as Sentry from \"@sentry/browser\";\n * import { OpenFeature } from \"@openfeature/web-sdk\";\n *\n * Sentry.init(..., integrations: [Sentry.openFeatureIntegration()]);\n * OpenFeature.setProvider(new MyProviderOfChoice());\n * OpenFeature.addHooks(new Sentry.OpenFeatureIntegrationHook());\n * ```\n */\nimport type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core';\nimport type { EvaluationDetails, HookContext, HookHints, JsonValue, OpenFeatureHook } from './types';\n\nexport const openFeatureIntegration = defineIntegration(() => {\n return {\n name: 'OpenFeature',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * OpenFeature Hook class implementation.\n */\nexport class OpenFeatureIntegrationHook implements OpenFeatureHook {\n /**\n * Successful evaluation result.\n */\n public after(_hookContext: Readonly<HookContext<JsonValue>>, evaluationDetails: EvaluationDetails<JsonValue>): void {\n _INTERNAL_insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);\n _INTERNAL_addFeatureFlagToActiveSpan(evaluationDetails.flagKey, evaluationDetails.value);\n }\n\n /**\n * On error evaluation result.\n */\n public error(hookContext: Readonly<HookContext<JsonValue>>, _error: unknown, _hookHints?: HookHints): void {\n _INTERNAL_insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);\n _INTERNAL_addFeatureFlagToActiveSpan(hookContext.flagKey, hookContext.defaultValue);\n }\n}\n"],"names":["defineIntegration","_INTERNAL_copyFlagsFromScopeToEvent","_INTERNAL_insertFlagToScope","_INTERNAL_addFeatureFlagToActiveSpan"],"mappings":";;;;MAwBa,sBAAA,GAAyBA,sBAAiB,CAAC,MAAM;AAC9D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,aAAa;;AAEvB,IAAI,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AACzE,MAAM,OAAOC,wCAAmC,CAAC,KAAK,CAAC;AACvD,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACO,MAAM,4BAAsD;AACnE;AACA;AACA;AACA,GAAS,KAAK,CAAC,YAAY,EAAoC,iBAAiB,EAAsC;AACtH,IAAIC,gCAA2B,CAAC,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;AACnF,IAAIC,yCAAoC,CAAC,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;AAC5F,EAAE;;AAEF;AACA;AACA;AACA,GAAS,KAAK,CAAC,WAAW,EAAoC,MAAM,EAAW,UAAU,EAAoB;AAC7G,IAAID,gCAA2B,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC;AAC9E,IAAIC,yCAAoC,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC;AACvF,EAAE;AACF;;;;;"}

View File

@@ -0,0 +1,2 @@
const e=(e,t)=>()=>({path:`/operations`,params:t??{},body:JSON.stringify(e),method:`POST`}),t=(e,t)=>()=>({path:`/operations`,params:t??{},body:JSON.stringify(e),method:`POST`});exports.createOperation=t,exports.createOperations=e;
//# sourceMappingURL=operations.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/versions/migrations/localizeStatus/sql/index.ts"],"sourcesContent":["import { down } from './down.js'\nimport { up } from './up.js'\n\nexport const localizeStatus = {\n down,\n up,\n}\n\nexport type { LocalizeStatusArgs } from './up.js'\n"],"names":["down","up","localizeStatus"],"mappings":"AAAA,SAASA,IAAI,QAAQ,YAAW;AAChC,SAASC,EAAE,QAAQ,UAAS;AAE5B,OAAO,MAAMC,iBAAiB;IAC5BF;IACAC;AACF,EAAC"}

View File

@@ -0,0 +1,76 @@
/**
Node.js specific entry point.
*/
import {ReadableStream as WebReadableStream} from 'node:stream/web';
import * as strtok3 from 'strtok3';
import {FileTypeParser, reasonableDetectionSizeInBytes} from './core.js';
export class NodeFileTypeParser extends FileTypeParser {
async fromStream(stream) {
const tokenizer = await (stream instanceof WebReadableStream ? strtok3.fromWebStream(stream) : strtok3.fromStream(stream));
try {
return super.fromTokenizer(tokenizer);
} finally {
await tokenizer.close();
}
}
async fromFile(path) {
const tokenizer = await strtok3.fromFile(path);
try {
return await super.fromTokenizer(tokenizer);
} finally {
await tokenizer.close();
}
}
async toDetectionStream(readableStream, options = {}) {
const {default: stream} = await import('node:stream');
const {sampleSize = reasonableDetectionSizeInBytes} = options;
return new Promise((resolve, reject) => {
readableStream.on('error', reject);
readableStream.once('readable', () => {
(async () => {
try {
// Set up output stream
const pass = new stream.PassThrough();
const outputStream = stream.pipeline ? stream.pipeline(readableStream, pass, () => {}) : readableStream.pipe(pass);
// Read the input stream and detect the filetype
const chunk = readableStream.read(sampleSize) ?? readableStream.read() ?? new Uint8Array(0);
try {
pass.fileType = await this.fromBuffer(chunk);
} catch (error) {
if (error instanceof strtok3.EndOfStreamError) {
pass.fileType = undefined;
} else {
reject(error);
}
}
resolve(outputStream);
} catch (error) {
reject(error);
}
})();
});
});
}
}
export async function fileTypeFromFile(path, fileTypeOptions) {
return (new NodeFileTypeParser(fileTypeOptions)).fromFile(path, fileTypeOptions);
}
export async function fileTypeFromStream(stream, fileTypeOptions) {
return (new NodeFileTypeParser(fileTypeOptions)).fromStream(stream);
}
export async function fileTypeStream(readableStream, options = {}) {
return new NodeFileTypeParser().toDetectionStream(readableStream, options);
}
export {fileTypeFromTokenizer, fileTypeFromBuffer, fileTypeFromBlob, FileTypeParser, supportedMimeTypes, supportedExtensions} from './core.js';

View File

@@ -0,0 +1,10 @@
import { instrumentCron } from './cron';
import { instrumentNodeCron } from './node-cron';
import { instrumentNodeSchedule } from './node-schedule';
/** Methods to instrument cron libraries for Sentry check-ins */
export declare const cron: {
instrumentCron: typeof instrumentCron;
instrumentNodeCron: typeof instrumentNodeCron;
instrumentNodeSchedule: typeof instrumentNodeSchedule;
};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,20 @@
type AnymatchFn = (testString: string) => boolean;
type AnymatchPattern = string|RegExp|AnymatchFn;
type AnymatchMatcher = AnymatchPattern|AnymatchPattern[]
type AnymatchTester = {
(testString: string|any[], returnIndex: true): number;
(testString: string|any[]): boolean;
}
type PicomatchOptions = {dot: boolean};
declare const anymatch: {
(matchers: AnymatchMatcher): AnymatchTester;
(matchers: AnymatchMatcher, testString: null, returnIndex: true | PicomatchOptions): AnymatchTester;
(matchers: AnymatchMatcher, testString: string|any[], returnIndex: true | PicomatchOptions): number;
(matchers: AnymatchMatcher, testString: string|any[]): boolean;
}
export {AnymatchMatcher as Matcher}
export {AnymatchTester as Tester}
export default anymatch

View File

@@ -0,0 +1,150 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.cjs");
var _index2 = require("../../_lib/buildMatchPatternFn.cjs");
const matchOrdinalNumberPattern = /^(\d+)(-oji)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^p(r|o)\.?\s?(kr\.?|me)/i,
abbreviated: /^(pr\.\s?(kr\.|m\.\s?e\.)|po\s?kr\.|mūsų eroje)/i,
wide: /^(prieš Kristų|prieš mūsų erą|po Kristaus|mūsų eroje)/i,
};
const parseEraPatterns = {
wide: [/prieš/i, /(po|mūsų)/i],
any: [/^pr/i, /^(po|m)/i],
};
const matchQuarterPatterns = {
narrow: /^([1234])/i,
abbreviated: /^(I|II|III|IV)\s?ketv?\.?/i,
wide: /^(I|II|III|IV)\s?ketvirtis/i,
};
const parseQuarterPatterns = {
narrow: [/1/i, /2/i, /3/i, /4/i],
any: [/I$/i, /II$/i, /III/i, /IV/i],
};
const matchMonthPatterns = {
narrow: /^[svkbglr]/i,
abbreviated:
/^(saus\.|vas\.|kov\.|bal\.|geg\.|birž\.|liep\.|rugp\.|rugs\.|spal\.|lapkr\.|gruod\.)/i,
wide: /^(sausi(s|o)|vasari(s|o)|kov(a|o)s|balandž?i(s|o)|gegužės?|birželi(s|o)|liep(a|os)|rugpjū(t|č)i(s|o)|rugsėj(is|o)|spali(s|o)|lapkri(t|č)i(s|o)|gruodž?i(s|o))/i,
};
const parseMonthPatterns = {
narrow: [
/^s/i,
/^v/i,
/^k/i,
/^b/i,
/^g/i,
/^b/i,
/^l/i,
/^r/i,
/^r/i,
/^s/i,
/^l/i,
/^g/i,
],
any: [
/^saus/i,
/^vas/i,
/^kov/i,
/^bal/i,
/^geg/i,
/^birž/i,
/^liep/i,
/^rugp/i,
/^rugs/i,
/^spal/i,
/^lapkr/i,
/^gruod/i,
],
};
const matchDayPatterns = {
narrow: /^[spatkš]/i,
short: /^(sk|pr|an|tr|kt|pn|št)/i,
abbreviated: /^(sk|pr|an|tr|kt|pn|št)/i,
wide: /^(sekmadien(is|į)|pirmadien(is|į)|antradien(is|į)|trečiadien(is|į)|ketvirtadien(is|į)|penktadien(is|į)|šeštadien(is|į))/i,
};
const parseDayPatterns = {
narrow: [/^s/i, /^p/i, /^a/i, /^t/i, /^k/i, /^p/i, /^š/i],
wide: [/^se/i, /^pi/i, /^an/i, /^tr/i, /^ke/i, /^pe/i, /^še/i],
any: [/^sk/i, /^pr/i, /^an/i, /^tr/i, /^kt/i, /^pn/i, /^št/i],
};
const matchDayPeriodPatterns = {
narrow:
/^(pr.\s?p.|pop.|vidurnaktis|(vidurdienis|perpiet)|rytas|(diena|popietė)|vakaras|naktis)/i,
any: /^(priešpiet|popiet$|vidurnaktis|(vidurdienis|perpiet)|rytas|(diena|popietė)|vakaras|naktis)/i,
};
const parseDayPeriodPatterns = {
narrow: {
am: /^pr/i,
pm: /^pop./i,
midnight: /^vidurnaktis/i,
noon: /^(vidurdienis|perp)/i,
morning: /rytas/i,
afternoon: /(die|popietė)/i,
evening: /vakaras/i,
night: /naktis/i,
},
any: {
am: /^pr/i,
pm: /^popiet$/i,
midnight: /^vidurnaktis/i,
noon: /^(vidurdienis|perp)/i,
morning: /rytas/i,
afternoon: /(die|popietė)/i,
evening: /vakaras/i,
night: /naktis/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

@@ -0,0 +1,4 @@
export { login } from '../auth/login.js';
export { logout } from '../auth/logout.js';
export { refresh } from '../auth/refresh.js';
//# sourceMappingURL=auth.js.map

View File

@@ -0,0 +1,167 @@
/**
* 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.
*
*/
import { HashtagNode, $createHashtagNode } from '@lexical/hashtag';
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
import { useLexicalTextEntity } from '@lexical/react/useLexicalTextEntity';
import { useEffect, useCallback } from 'react';
/**
* 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.
*
*/
function getHashtagRegexStringChars() {
// Latin accented characters
// Excludes 0xd7 from the range
// (the multiplication sign, confusable with "x").
// Also excludes 0xf7, the division sign
const latinAccents = '\xc0-\xd6' + '\xd8-\xf6' + '\xf8-\xff' + '\u0100-\u024f' + '\u0253-\u0254' + '\u0256-\u0257' + '\u0259' + '\u025b' + '\u0263' + '\u0268' + '\u026f' + '\u0272' + '\u0289' + '\u028b' + '\u02bb' + '\u0300-\u036f' + '\u1e00-\u1eff';
// Cyrillic (Russian, Ukrainian, etc.)
const nonLatinChars = '\u0400-\u04ff' +
// Cyrillic
'\u0500-\u0527' +
// Cyrillic Supplement
'\u2de0-\u2dff' +
// Cyrillic Extended A
'\ua640-\ua69f' +
// Cyrillic Extended B
'\u0591-\u05bf' +
// Hebrew
'\u05c1-\u05c2' + '\u05c4-\u05c5' + '\u05c7' + '\u05d0-\u05ea' + '\u05f0-\u05f4' + '\ufb12-\ufb28' +
// Hebrew Presentation Forms
'\ufb2a-\ufb36' + '\ufb38-\ufb3c' + '\ufb3e' + '\ufb40-\ufb41' + '\ufb43-\ufb44' + '\ufb46-\ufb4f' + '\u0610-\u061a' +
// Arabic
'\u0620-\u065f' + '\u066e-\u06d3' + '\u06d5-\u06dc' + '\u06de-\u06e8' + '\u06ea-\u06ef' + '\u06fa-\u06fc' + '\u06ff' + '\u0750-\u077f' +
// Arabic Supplement
'\u08a0' +
// Arabic Extended A
'\u08a2-\u08ac' + '\u08e4-\u08fe' + '\ufb50-\ufbb1' +
// Arabic Pres. Forms A
'\ufbd3-\ufd3d' + '\ufd50-\ufd8f' + '\ufd92-\ufdc7' + '\ufdf0-\ufdfb' + '\ufe70-\ufe74' +
// Arabic Pres. Forms B
'\ufe76-\ufefc' + '\u200c-\u200c' +
// Zero-Width Non-Joiner
'\u0e01-\u0e3a' +
// Thai
'\u0e40-\u0e4e' +
// Hangul (Korean)
'\u1100-\u11ff' +
// Hangul Jamo
'\u3130-\u3185' +
// Hangul Compatibility Jamo
'\uA960-\uA97F' +
// Hangul Jamo Extended-A
'\uAC00-\uD7AF' +
// Hangul Syllables
'\uD7B0-\uD7FF' +
// Hangul Jamo Extended-B
'\uFFA1-\uFFDC'; // Half-width Hangul
const charCode = String.fromCharCode;
const cjkChars = '\u30A1-\u30FA\u30FC-\u30FE' +
// Katakana (full-width)
'\uFF66-\uFF9F' +
// Katakana (half-width)
'\uFF10-\uFF19\uFF21-\uFF3A' + '\uFF41-\uFF5A' +
// Latin (full-width)
'\u3041-\u3096\u3099-\u309E' +
// Hiragana
'\u3400-\u4DBF' +
// Kanji (CJK Extension A)
'\u4E00-\u9FFF' +
// Kanji (Unified)
// Disabled as it breaks the Regex.
// charCode(0x20000) + '-' + charCode(0x2A6DF) + // Kanji (CJK Extension B)
charCode(0x2a700) + '-' + charCode(0x2b73f) +
// Kanji (CJK Extension C)
charCode(0x2b740) + '-' + charCode(0x2b81f) +
// Kanji (CJK Extension D)
charCode(0x2f800) + '-' + charCode(0x2fa1f) + '\u3003\u3005\u303B'; // Kanji (CJK supplement)
const otherChars = latinAccents + nonLatinChars + cjkChars;
// equivalent of \p{L}
const unicodeLetters = '\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6' + '\u00F8-\u0241\u0250-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EE\u037A\u0386' + '\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03F5\u03F7-\u0481' + '\u048A-\u04CE\u04D0-\u04F9\u0500-\u050F\u0531-\u0556\u0559\u0561-\u0587' + '\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0640-\u064A\u066E-\u066F' + '\u0671-\u06D3\u06D5\u06E5-\u06E6\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710' + '\u0712-\u072F\u074D-\u076D\u0780-\u07A5\u07B1\u0904-\u0939\u093D\u0950' + '\u0958-\u0961\u097D\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0' + '\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1' + '\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33' + '\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D' + '\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD' + '\u0AD0\u0AE0-\u0AE1\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30' + '\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83' + '\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F' + '\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10' + '\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C' + '\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE' + '\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39' + '\u0D60-\u0D61\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6' + '\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E46\u0E81-\u0E82\u0E84\u0E87-\u0E88' + '\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7' + '\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6' + '\u0EDC-\u0EDD\u0F00\u0F40-\u0F47\u0F49-\u0F6A\u0F88-\u0F8B\u1000-\u1021' + '\u1023-\u1027\u1029-\u102A\u1050-\u1055\u10A0-\u10C5\u10D0-\u10FA\u10FC' + '\u1100-\u1159\u115F-\u11A2\u11A8-\u11F9\u1200-\u1248\u124A-\u124D' + '\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0' + '\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310' + '\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C' + '\u166F-\u1676\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711' + '\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7' + '\u17DC\u1820-\u1877\u1880-\u18A8\u1900-\u191C\u1950-\u196D\u1970-\u1974' + '\u1980-\u19A9\u19C1-\u19C7\u1A00-\u1A16\u1D00-\u1DBF\u1E00-\u1E9B' + '\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D' + '\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC' + '\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC' + '\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u2094\u2102\u2107' + '\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D' + '\u212F-\u2131\u2133-\u2139\u213C-\u213F\u2145-\u2149\u2C00-\u2C2E' + '\u2C30-\u2C5E\u2C80-\u2CE4\u2D00-\u2D25\u2D30-\u2D65\u2D6F\u2D80-\u2D96' + '\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6' + '\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3006\u3031-\u3035' + '\u303B-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF' + '\u3105-\u312C\u3131-\u318E\u31A0-\u31B7\u31F0-\u31FF\u3400-\u4DB5' + '\u4E00-\u9FBB\uA000-\uA48C\uA800-\uA801\uA803-\uA805\uA807-\uA80A' + '\uA80C-\uA822\uAC00-\uD7A3\uF900-\uFA2D\uFA30-\uFA6A\uFA70-\uFAD9' + '\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C' + '\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F' + '\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A' + '\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7' + '\uFFDA-\uFFDC';
// equivalent of \p{Mn}\p{Mc}
const unicodeAccents = '\u0300-\u036F\u0483-\u0486\u0591-\u05B9\u05BB-\u05BD\u05BF' + '\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u0615\u064B-\u065E\u0670' + '\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A' + '\u07A6-\u07B0\u0901-\u0903\u093C\u093E-\u094D\u0951-\u0954\u0962-\u0963' + '\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7' + '\u09E2-\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D' + '\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD' + '\u0AE2-\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D' + '\u0B56-\u0B57\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7' + '\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56' + '\u0C82-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6' + '\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D82-\u0D83' + '\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2-\u0DF3\u0E31\u0E34-\u0E3A' + '\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19' + '\u0F35\u0F37\u0F39\u0F3E-\u0F3F\u0F71-\u0F84\u0F86-\u0F87\u0F90-\u0F97' + '\u0F99-\u0FBC\u0FC6\u102C-\u1032\u1036-\u1039\u1056-\u1059\u135F' + '\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17B6-\u17D3\u17DD' + '\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8-\u19C9' + '\u1A17-\u1A1B\u1DC0-\u1DC3\u20D0-\u20DC\u20E1\u20E5-\u20EB\u302A-\u302F' + '\u3099-\u309A\uA802\uA806\uA80B\uA823-\uA827\uFB1E\uFE00-\uFE0F' + '\uFE20-\uFE23';
// equivalent of \p{Dn}
const unicodeDigits = '\u0030-\u0039\u0660-\u0669\u06F0-\u06F9\u0966-\u096F\u09E6-\u09EF' + '\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F' + '\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29' + '\u1040-\u1049\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9' + '\uFF10-\uFF19';
// An alpha char is a unicode chars excluding unicode combining marks
// but including other chars, a hashtag must start with one of these,
// it does not make sense to have a combining mark before a base character.
const alpha = unicodeLetters + otherChars;
// A numeric character is any with the number digit property, or
// underscore. These characters can be included in hashtags, but a hashtag
// cannot have only these characters.
const numeric = unicodeDigits + '_';
// Alphanumeric char is any alpha char or a unicode char with decimal
// number property \p{Nd}
const alphanumeric = alpha + unicodeAccents + numeric;
const hashChars = '#\\uFF03'; // normal '#' or full-width '#'
return {
alpha,
alphanumeric,
hashChars
};
}
function getHashtagRegexString() {
const {
alpha,
alphanumeric,
hashChars
} = getHashtagRegexStringChars();
const hashtagAlpha = '[' + alpha + ']';
const hashtagAlphanumeric = '[' + alphanumeric + ']';
const hashtagBoundary = '^|$|[^&/' + alphanumeric + ']';
const hashCharList = '[' + hashChars + ']';
// A hashtag contains characters, numbers and underscores,
// but not all numbers.
const hashtag = '(' + hashtagBoundary + ')(' + hashCharList + ')(' + hashtagAlphanumeric + '*' + hashtagAlpha + hashtagAlphanumeric + '*)';
return hashtag;
}
const REGEX = new RegExp(getHashtagRegexString(), 'i');
function HashtagPlugin() {
const [editor] = useLexicalComposerContext();
useEffect(() => {
if (!editor.hasNodes([HashtagNode])) {
throw new Error('HashtagPlugin: HashtagNode not registered on editor');
}
}, [editor]);
const $createHashtagNode_ = useCallback(textNode => {
return $createHashtagNode(textNode.getTextContent());
}, []);
const getHashtagMatch = useCallback(text => {
const matchArr = REGEX.exec(text);
if (matchArr === null) {
return null;
}
const hashtagLength = matchArr[3].length + 1;
const startOffset = matchArr.index + matchArr[1].length;
const endOffset = startOffset + hashtagLength;
return {
end: endOffset,
start: startOffset
};
}, []);
useLexicalTextEntity(getHashtagMatch, HashtagNode, $createHashtagNode_);
return null;
}
export { HashtagPlugin };

View File

@@ -0,0 +1 @@
{"version":3,"names":["Hub","getCode","getScope","addHelper","Error","buildError","node","msg","TypeError","exports","default"],"sources":["../src/hub.ts"],"sourcesContent":["import type Scope from \"./scope/index.ts\";\nimport type { Node } from \"@babel/types\";\n\nexport interface HubInterface {\n getCode(): string | void;\n getScope(): Scope | void;\n addHelper(name: string): any;\n buildError(node: Node, msg: string, Error: new (msg: string) => Error): Error;\n}\n\nexport default class Hub implements HubInterface {\n getCode() {}\n\n getScope() {}\n\n addHelper() {\n throw new Error(\"Helpers are not supported by the default hub.\");\n }\n\n buildError(\n node: Node,\n msg: string,\n Error: new (msg: string) => Error = TypeError,\n ): Error {\n return new Error(msg);\n }\n}\n"],"mappings":";;;;;;AAUe,MAAMA,GAAG,CAAyB;EAC/CC,OAAOA,CAAA,EAAG,CAAC;EAEXC,QAAQA,CAAA,EAAG,CAAC;EAEZC,SAASA,CAAA,EAAG;IACV,MAAM,IAAIC,KAAK,CAAC,+CAA+C,CAAC;EAClE;EAEAC,UAAUA,CACRC,IAAU,EACVC,GAAW,EACXH,KAAiC,GAAGI,SAAS,EACtC;IACP,OAAO,IAAIJ,KAAK,CAACG,GAAG,CAAC;EACvB;AACF;AAACE,OAAA,CAAAC,OAAA,GAAAV,GAAA","ignoreList":[]}

View File

@@ -0,0 +1,146 @@
Flexible ascii progress bar.
## Installation
```bash
$ npm install progress
```
## Usage
First we create a `ProgressBar`, giving it a format string
as well as the `total`, telling the progress bar when it will
be considered complete. After that all we need to do is `tick()` appropriately.
```javascript
var ProgressBar = require('progress');
var bar = new ProgressBar(':bar', { total: 10 });
var timer = setInterval(function () {
bar.tick();
if (bar.complete) {
console.log('\ncomplete\n');
clearInterval(timer);
}
}, 100);
```
### Options
These are keys in the options object you can pass to the progress bar along with
`total` as seen in the example above.
- `curr` current completed index
- `total` total number of ticks to complete
- `width` the displayed width of the progress bar defaulting to total
- `stream` the output stream defaulting to stderr
- `head` head character defaulting to complete character
- `complete` completion character defaulting to "="
- `incomplete` incomplete character defaulting to "-"
- `renderThrottle` minimum time between updates in milliseconds defaulting to 16
- `clear` option to clear the bar on completion defaulting to false
- `callback` optional function to call when the progress bar completes
### Tokens
These are tokens you can use in the format of your progress bar.
- `:bar` the progress bar itself
- `:current` current tick number
- `:total` total ticks
- `:elapsed` time elapsed in seconds
- `:percent` completion percentage
- `:eta` estimated completion time in seconds
- `:rate` rate of ticks per second
### Custom Tokens
You can define custom tokens by adding a `{'name': value}` object parameter to your method (`tick()`, `update()`, etc.) calls.
```javascript
var bar = new ProgressBar(':current: :token1 :token2', { total: 3 })
bar.tick({
'token1': "Hello",
'token2': "World!\n"
})
bar.tick(2, {
'token1': "Goodbye",
'token2': "World!"
})
```
The above example would result in the output below.
```
1: Hello World!
3: Goodbye World!
```
## Examples
### Download
In our download example each tick has a variable influence, so we pass the chunk
length which adjusts the progress bar appropriately relative to the total
length.
```javascript
var ProgressBar = require('progress');
var https = require('https');
var req = https.request({
host: 'download.github.com',
port: 443,
path: '/visionmedia-node-jscoverage-0d4608a.zip'
});
req.on('response', function(res){
var len = parseInt(res.headers['content-length'], 10);
console.log();
var bar = new ProgressBar(' downloading [:bar] :rate/bps :percent :etas', {
complete: '=',
incomplete: ' ',
width: 20,
total: len
});
res.on('data', function (chunk) {
bar.tick(chunk.length);
});
res.on('end', function () {
console.log('\n');
});
});
req.end();
```
The above example result in a progress bar like the one below.
```
downloading [===== ] 39/bps 29% 3.7s
```
### Interrupt
To display a message during progress bar execution, use `interrupt()`
```javascript
var ProgressBar = require('progress');
var bar = new ProgressBar(':bar :current/:total', { total: 10 });
var timer = setInterval(function () {
bar.tick();
if (bar.complete) {
clearInterval(timer);
} else if (bar.curr === 5) {
bar.interrupt('this message appears above the progress bar\ncurrent progress is ' + bar.curr + '/' + bar.total);
}
}, 1000);
```
You can see more examples in the `examples` folder.
## License
MIT

View File

@@ -0,0 +1,9 @@
import type { ReplayRecordingData } from '@sentry/core';
/**
* Prepare the recording data ready to be sent.
*/
export declare function prepareRecordingData({ recordingData, headers, }: {
recordingData: ReplayRecordingData;
headers: Record<string, unknown>;
}): ReplayRecordingData;
//# sourceMappingURL=prepareRecordingData.d.ts.map

View File

@@ -0,0 +1,34 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = collectSiblings;
var _matches = _interopRequireDefault(require("./matches"));
function collectSiblings(node, refNode, selector) {
if (refNode === void 0) {
refNode = null;
}
if (selector === void 0) {
selector = null;
}
var siblings = [];
for (; node; node = node.nextElementSibling) {
if (node !== refNode) {
if (selector && (0, _matches.default)(node, selector)) {
break;
}
siblings.push(node);
}
}
return siblings;
}
module.exports = exports["default"];

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/sanitizeInternalFields.ts"],"sourcesContent":["export const sanitizeInternalFields = <T extends Record<string, unknown>>(incomingDoc: T): T => {\n // Create a new object to hold the sanitized fields\n const newDoc: Record<string, unknown> = {}\n\n for (const key in incomingDoc) {\n const val = incomingDoc[key]\n if (key === '_id') {\n newDoc['id'] = val\n } else if (key !== '__v') {\n newDoc[key] = val\n }\n }\n\n return newDoc as T\n}\n"],"names":["sanitizeInternalFields","incomingDoc","newDoc","key","val"],"mappings":"AAAA,OAAO,MAAMA,yBAAyB,CAAoCC;IACxE,mDAAmD;IACnD,MAAMC,SAAkC,CAAC;IAEzC,IAAK,MAAMC,OAAOF,YAAa;QAC7B,MAAMG,MAAMH,WAAW,CAACE,IAAI;QAC5B,IAAIA,QAAQ,OAAO;YACjBD,MAAM,CAAC,KAAK,GAAGE;QACjB,OAAO,IAAID,QAAQ,OAAO;YACxBD,MAAM,CAACC,IAAI,GAAGC;QAChB;IACF;IAEA,OAAOF;AACT,EAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"names":["_templateLiterals","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_expressions","_statements","_classes","_methods","_modules","_types","_flow","_base","_jsx","_typescript"],"sources":["../../src/generators/index.ts"],"sourcesContent":["export * from \"./template-literals.ts\";\nexport * from \"./expressions.ts\";\nexport * from \"./statements.ts\";\nexport * from \"./classes.ts\";\nexport * from \"./methods.ts\";\nexport * from \"./modules.ts\";\nexport * from \"./types.ts\";\nexport * from \"./flow.ts\";\nexport * from \"./base.ts\";\nexport * from \"./jsx.ts\";\nexport * from \"./typescript.ts\";\n"],"mappings":";;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,iBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,iBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,iBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,YAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,YAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,YAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,YAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,WAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,WAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,WAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,WAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,QAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,QAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,QAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,QAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,QAAA,GAAAZ,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAU,QAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,QAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,QAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,QAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,QAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,QAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,QAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,MAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,MAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,MAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAM,MAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,KAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,KAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAW,KAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAO,KAAA,CAAAX,GAAA;IAAA;EAAA;AAAA;AACA,IAAAY,KAAA,GAAAhB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAc,KAAA,EAAAb,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAY,KAAA,CAAAZ,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAQ,KAAA,CAAAZ,GAAA;IAAA;EAAA;AAAA;AACA,IAAAa,IAAA,GAAAjB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAe,IAAA,EAAAd,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAa,IAAA,CAAAb,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAS,IAAA,CAAAb,GAAA;IAAA;EAAA;AAAA;AACA,IAAAc,WAAA,GAAAlB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAgB,WAAA,EAAAf,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAc,WAAA,CAAAd,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAU,WAAA,CAAAd,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}

View File

@@ -0,0 +1,39 @@
import { naturalCompare } from '../jsutils/naturalCompare.mjs';
import { Kind } from '../language/kinds.mjs';
/**
* Sort ValueNode.
*
* This function returns a sorted copy of the given ValueNode.
*
* @internal
*/
export function sortValueNode(valueNode) {
switch (valueNode.kind) {
case Kind.OBJECT:
return { ...valueNode, fields: sortFields(valueNode.fields) };
case Kind.LIST:
return { ...valueNode, values: valueNode.values.map(sortValueNode) };
case Kind.INT:
case Kind.FLOAT:
case Kind.STRING:
case Kind.BOOLEAN:
case Kind.NULL:
case Kind.ENUM:
case Kind.VARIABLE:
return valueNode;
}
}
function sortFields(fields) {
return fields
.map((fieldNode) => ({
...fieldNode,
value: sortValueNode(fieldNode.value),
}))
.sort((fieldA, fieldB) =>
naturalCompare(fieldA.name.value, fieldB.name.value),
);
}

View File

@@ -0,0 +1,299 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict';
var utils = require('@lexical/utils');
var lexical = require('lexical');
/**
* 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.
*
*/
const HISTORY_MERGE = 0;
const HISTORY_PUSH = 1;
const DISCARD_HISTORY_CANDIDATE = 2;
const OTHER = 0;
const COMPOSING_CHARACTER = 1;
const INSERT_CHARACTER_AFTER_SELECTION = 2;
const DELETE_CHARACTER_BEFORE_SELECTION = 3;
const DELETE_CHARACTER_AFTER_SELECTION = 4;
function getDirtyNodes(editorState, dirtyLeaves, dirtyElements) {
const nodeMap = editorState._nodeMap;
const nodes = [];
for (const dirtyLeafKey of dirtyLeaves) {
const dirtyLeaf = nodeMap.get(dirtyLeafKey);
if (dirtyLeaf !== undefined) {
nodes.push(dirtyLeaf);
}
}
for (const [dirtyElementKey, intentionallyMarkedAsDirty] of dirtyElements) {
if (!intentionallyMarkedAsDirty) {
continue;
}
const dirtyElement = nodeMap.get(dirtyElementKey);
if (dirtyElement !== undefined && !lexical.$isRootNode(dirtyElement)) {
nodes.push(dirtyElement);
}
}
return nodes;
}
function getChangeType(prevEditorState, nextEditorState, dirtyLeavesSet, dirtyElementsSet, isComposing) {
if (prevEditorState === null || dirtyLeavesSet.size === 0 && dirtyElementsSet.size === 0 && !isComposing) {
return OTHER;
}
const nextSelection = nextEditorState._selection;
const prevSelection = prevEditorState._selection;
if (isComposing) {
return COMPOSING_CHARACTER;
}
if (!lexical.$isRangeSelection(nextSelection) || !lexical.$isRangeSelection(prevSelection) || !prevSelection.isCollapsed() || !nextSelection.isCollapsed()) {
return OTHER;
}
const dirtyNodes = getDirtyNodes(nextEditorState, dirtyLeavesSet, dirtyElementsSet);
if (dirtyNodes.length === 0) {
return OTHER;
}
// Catching the case when inserting new text node into an element (e.g. first char in paragraph/list),
// or after existing node.
if (dirtyNodes.length > 1) {
const nextNodeMap = nextEditorState._nodeMap;
const nextAnchorNode = nextNodeMap.get(nextSelection.anchor.key);
const prevAnchorNode = nextNodeMap.get(prevSelection.anchor.key);
if (nextAnchorNode && prevAnchorNode && !prevEditorState._nodeMap.has(nextAnchorNode.__key) && lexical.$isTextNode(nextAnchorNode) && nextAnchorNode.__text.length === 1 && nextSelection.anchor.offset === 1) {
return INSERT_CHARACTER_AFTER_SELECTION;
}
return OTHER;
}
const nextDirtyNode = dirtyNodes[0];
const prevDirtyNode = prevEditorState._nodeMap.get(nextDirtyNode.__key);
if (!lexical.$isTextNode(prevDirtyNode) || !lexical.$isTextNode(nextDirtyNode) || prevDirtyNode.__mode !== nextDirtyNode.__mode) {
return OTHER;
}
const prevText = prevDirtyNode.__text;
const nextText = nextDirtyNode.__text;
if (prevText === nextText) {
return OTHER;
}
const nextAnchor = nextSelection.anchor;
const prevAnchor = prevSelection.anchor;
if (nextAnchor.key !== prevAnchor.key || nextAnchor.type !== 'text') {
return OTHER;
}
const nextAnchorOffset = nextAnchor.offset;
const prevAnchorOffset = prevAnchor.offset;
const textDiff = nextText.length - prevText.length;
if (textDiff === 1 && prevAnchorOffset === nextAnchorOffset - 1) {
return INSERT_CHARACTER_AFTER_SELECTION;
}
if (textDiff === -1 && prevAnchorOffset === nextAnchorOffset + 1) {
return DELETE_CHARACTER_BEFORE_SELECTION;
}
if (textDiff === -1 && prevAnchorOffset === nextAnchorOffset) {
return DELETE_CHARACTER_AFTER_SELECTION;
}
return OTHER;
}
function isTextNodeUnchanged(key, prevEditorState, nextEditorState) {
const prevNode = prevEditorState._nodeMap.get(key);
const nextNode = nextEditorState._nodeMap.get(key);
const prevSelection = prevEditorState._selection;
const nextSelection = nextEditorState._selection;
const isDeletingLine = lexical.$isRangeSelection(prevSelection) && lexical.$isRangeSelection(nextSelection) && prevSelection.anchor.type === 'element' && prevSelection.focus.type === 'element' && nextSelection.anchor.type === 'text' && nextSelection.focus.type === 'text';
if (!isDeletingLine && lexical.$isTextNode(prevNode) && lexical.$isTextNode(nextNode) && prevNode.__parent === nextNode.__parent) {
// This has the assumption that object key order won't change if the
// content did not change, which should normally be safe given
// the manner in which nodes and exportJSON are typically implemented.
return JSON.stringify(prevEditorState.read(() => prevNode.exportJSON())) === JSON.stringify(nextEditorState.read(() => nextNode.exportJSON()));
}
return false;
}
function createMergeActionGetter(editor, delay) {
let prevChangeTime = Date.now();
let prevChangeType = OTHER;
return (prevEditorState, nextEditorState, currentHistoryEntry, dirtyLeaves, dirtyElements, tags) => {
const changeTime = Date.now();
// If applying changes from history stack there's no need
// to run history logic again, as history entries already calculated
if (tags.has(lexical.HISTORIC_TAG)) {
prevChangeType = OTHER;
prevChangeTime = changeTime;
return DISCARD_HISTORY_CANDIDATE;
}
const changeType = getChangeType(prevEditorState, nextEditorState, dirtyLeaves, dirtyElements, editor.isComposing());
const mergeAction = (() => {
const isSameEditor = currentHistoryEntry === null || currentHistoryEntry.editor === editor;
const shouldPushHistory = tags.has(lexical.HISTORY_PUSH_TAG);
const shouldMergeHistory = !shouldPushHistory && isSameEditor && tags.has(lexical.HISTORY_MERGE_TAG);
if (shouldMergeHistory) {
return HISTORY_MERGE;
}
if (prevEditorState === null) {
return HISTORY_PUSH;
}
const selection = nextEditorState._selection;
const hasDirtyNodes = dirtyLeaves.size > 0 || dirtyElements.size > 0;
if (!hasDirtyNodes) {
if (selection !== null) {
return HISTORY_MERGE;
}
return DISCARD_HISTORY_CANDIDATE;
}
if (shouldPushHistory === false && changeType !== OTHER && changeType === prevChangeType && changeTime < prevChangeTime + delay && isSameEditor) {
return HISTORY_MERGE;
}
// A single node might have been marked as dirty, but not have changed
// due to some node transform reverting the change.
if (dirtyLeaves.size === 1) {
const dirtyLeafKey = Array.from(dirtyLeaves)[0];
if (isTextNodeUnchanged(dirtyLeafKey, prevEditorState, nextEditorState)) {
return HISTORY_MERGE;
}
}
return HISTORY_PUSH;
})();
prevChangeTime = changeTime;
prevChangeType = changeType;
return mergeAction;
};
}
function redo(editor, historyState) {
const redoStack = historyState.redoStack;
const undoStack = historyState.undoStack;
if (redoStack.length !== 0) {
const current = historyState.current;
if (current !== null) {
undoStack.push(current);
editor.dispatchCommand(lexical.CAN_UNDO_COMMAND, true);
}
const historyStateEntry = redoStack.pop();
if (redoStack.length === 0) {
editor.dispatchCommand(lexical.CAN_REDO_COMMAND, false);
}
historyState.current = historyStateEntry || null;
if (historyStateEntry) {
historyStateEntry.editor.setEditorState(historyStateEntry.editorState, {
tag: lexical.HISTORIC_TAG
});
}
}
}
function undo(editor, historyState) {
const redoStack = historyState.redoStack;
const undoStack = historyState.undoStack;
const undoStackLength = undoStack.length;
if (undoStackLength !== 0) {
const current = historyState.current;
const historyStateEntry = undoStack.pop();
if (current !== null) {
redoStack.push(current);
editor.dispatchCommand(lexical.CAN_REDO_COMMAND, true);
}
if (undoStack.length === 0) {
editor.dispatchCommand(lexical.CAN_UNDO_COMMAND, false);
}
historyState.current = historyStateEntry || null;
if (historyStateEntry) {
historyStateEntry.editor.setEditorState(historyStateEntry.editorState, {
tag: lexical.HISTORIC_TAG
});
}
}
}
function clearHistory(historyState) {
historyState.undoStack = [];
historyState.redoStack = [];
historyState.current = null;
}
/**
* Registers necessary listeners to manage undo/redo history stack and related editor commands.
* It returns `unregister` callback that cleans up all listeners and should be called on editor unmount.
* @param editor - The lexical editor.
* @param historyState - The history state, containing the current state and the undo/redo stack.
* @param delay - The time (in milliseconds) the editor should delay generating a new history stack,
* instead of merging the current changes with the current stack.
* @returns The listeners cleanup callback function.
*/
function registerHistory(editor, historyState, delay) {
const getMergeAction = createMergeActionGetter(editor, delay);
const applyChange = ({
editorState,
prevEditorState,
dirtyLeaves,
dirtyElements,
tags
}) => {
const current = historyState.current;
const redoStack = historyState.redoStack;
const undoStack = historyState.undoStack;
const currentEditorState = current === null ? null : current.editorState;
if (current !== null && editorState === currentEditorState) {
return;
}
const mergeAction = getMergeAction(prevEditorState, editorState, current, dirtyLeaves, dirtyElements, tags);
if (mergeAction === HISTORY_PUSH) {
if (redoStack.length !== 0) {
historyState.redoStack = [];
editor.dispatchCommand(lexical.CAN_REDO_COMMAND, false);
}
if (current !== null) {
undoStack.push({
...current
});
editor.dispatchCommand(lexical.CAN_UNDO_COMMAND, true);
}
} else if (mergeAction === DISCARD_HISTORY_CANDIDATE) {
return;
}
// Else we merge
historyState.current = {
editor,
editorState
};
};
const unregister = utils.mergeRegister(editor.registerCommand(lexical.UNDO_COMMAND, () => {
undo(editor, historyState);
return true;
}, lexical.COMMAND_PRIORITY_EDITOR), editor.registerCommand(lexical.REDO_COMMAND, () => {
redo(editor, historyState);
return true;
}, lexical.COMMAND_PRIORITY_EDITOR), editor.registerCommand(lexical.CLEAR_EDITOR_COMMAND, () => {
clearHistory(historyState);
return false;
}, lexical.COMMAND_PRIORITY_EDITOR), editor.registerCommand(lexical.CLEAR_HISTORY_COMMAND, () => {
clearHistory(historyState);
editor.dispatchCommand(lexical.CAN_REDO_COMMAND, false);
editor.dispatchCommand(lexical.CAN_UNDO_COMMAND, false);
return true;
}, lexical.COMMAND_PRIORITY_EDITOR), editor.registerUpdateListener(applyChange));
return unregister;
}
/**
* Creates an empty history state.
* @returns - The empty history state, as an object.
*/
function createEmptyHistoryState() {
return {
current: null,
redoStack: [],
undoStack: []
};
}
exports.createEmptyHistoryState = createEmptyHistoryState;
exports.registerHistory = registerHistory;

View File

@@ -0,0 +1,67 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = filterItems;
exports.isRequired = isRequired;
exports.targetsSupported = targetsSupported;
var _semver = require("semver");
var _utils = require("./utils.js");
const pluginsCompatData = require("@babel/compat-data/plugins");
function targetsSupported(target, support) {
const targetEnvironments = Object.keys(target);
if (targetEnvironments.length === 0) {
return false;
}
const unsupportedEnvironments = targetEnvironments.filter(environment => {
const lowestImplementedVersion = (0, _utils.getLowestImplementedVersion)(support, environment);
if (!lowestImplementedVersion) {
return true;
}
const lowestTargetedVersion = target[environment];
if ((0, _utils.isUnreleasedVersion)(lowestTargetedVersion, environment)) {
return false;
}
if ((0, _utils.isUnreleasedVersion)(lowestImplementedVersion, environment)) {
return true;
}
if (!_semver.valid(lowestTargetedVersion.toString())) {
throw new Error(`Invalid version passed for target "${environment}": "${lowestTargetedVersion}". ` + "Versions must be in semver format (major.minor.patch)");
}
return _semver.gt((0, _utils.semverify)(lowestImplementedVersion), lowestTargetedVersion.toString());
});
return unsupportedEnvironments.length === 0;
}
function isRequired(name, targets, {
compatData = pluginsCompatData,
includes,
excludes
} = {}) {
if (excludes != null && excludes.has(name)) return false;
if (includes != null && includes.has(name)) return true;
return !targetsSupported(targets, compatData[name]);
}
function filterItems(list, includes, excludes, targets, defaultIncludes, defaultExcludes, pluginSyntaxMap) {
const result = new Set();
const options = {
compatData: list,
includes,
excludes
};
for (const item in list) {
if (isRequired(item, targets, options)) {
result.add(item);
} else if (pluginSyntaxMap) {
const shippedProposalsSyntax = pluginSyntaxMap.get(item);
if (shippedProposalsSyntax) {
result.add(shippedProposalsSyntax);
}
}
}
defaultIncludes == null || defaultIncludes.forEach(item => !excludes.has(item) && result.add(item));
defaultExcludes == null || defaultExcludes.forEach(item => !includes.has(item) && result.delete(item));
return result;
}
//# sourceMappingURL=filter-items.js.map

View File

@@ -0,0 +1,320 @@
const formatDistanceLocale = {
lessThanXSeconds: {
one: {
regular: "méně než 1 sekunda",
past: "před méně než 1 sekundou",
future: "za méně než 1 sekundu",
},
few: {
regular: "méně než {{count}} sekundy",
past: "před méně než {{count}} sekundami",
future: "za méně než {{count}} sekundy",
},
many: {
regular: "méně než {{count}} sekund",
past: "před méně než {{count}} sekundami",
future: "za méně než {{count}} sekund",
},
},
xSeconds: {
one: {
regular: "1 sekunda",
past: "před 1 sekundou",
future: "za 1 sekundu",
},
few: {
regular: "{{count}} sekundy",
past: "před {{count}} sekundami",
future: "za {{count}} sekundy",
},
many: {
regular: "{{count}} sekund",
past: "před {{count}} sekundami",
future: "za {{count}} sekund",
},
},
halfAMinute: {
type: "other",
other: {
regular: "půl minuty",
past: "před půl minutou",
future: "za půl minuty",
},
},
lessThanXMinutes: {
one: {
regular: "méně než 1 minuta",
past: "před méně než 1 minutou",
future: "za méně než 1 minutu",
},
few: {
regular: "méně než {{count}} minuty",
past: "před méně než {{count}} minutami",
future: "za méně než {{count}} minuty",
},
many: {
regular: "méně než {{count}} minut",
past: "před méně než {{count}} minutami",
future: "za méně než {{count}} minut",
},
},
xMinutes: {
one: {
regular: "1 minuta",
past: "před 1 minutou",
future: "za 1 minutu",
},
few: {
regular: "{{count}} minuty",
past: "před {{count}} minutami",
future: "za {{count}} minuty",
},
many: {
regular: "{{count}} minut",
past: "před {{count}} minutami",
future: "za {{count}} minut",
},
},
aboutXHours: {
one: {
regular: "přibližně 1 hodina",
past: "přibližně před 1 hodinou",
future: "přibližně za 1 hodinu",
},
few: {
regular: "přibližně {{count}} hodiny",
past: "přibližně před {{count}} hodinami",
future: "přibližně za {{count}} hodiny",
},
many: {
regular: "přibližně {{count}} hodin",
past: "přibližně před {{count}} hodinami",
future: "přibližně za {{count}} hodin",
},
},
xHours: {
one: {
regular: "1 hodina",
past: "před 1 hodinou",
future: "za 1 hodinu",
},
few: {
regular: "{{count}} hodiny",
past: "před {{count}} hodinami",
future: "za {{count}} hodiny",
},
many: {
regular: "{{count}} hodin",
past: "před {{count}} hodinami",
future: "za {{count}} hodin",
},
},
xDays: {
one: {
regular: "1 den",
past: "před 1 dnem",
future: "za 1 den",
},
few: {
regular: "{{count}} dny",
past: "před {{count}} dny",
future: "za {{count}} dny",
},
many: {
regular: "{{count}} dní",
past: "před {{count}} dny",
future: "za {{count}} dní",
},
},
aboutXWeeks: {
one: {
regular: "přibližně 1 týden",
past: "přibližně před 1 týdnem",
future: "přibližně za 1 týden",
},
few: {
regular: "přibližně {{count}} týdny",
past: "přibližně před {{count}} týdny",
future: "přibližně za {{count}} týdny",
},
many: {
regular: "přibližně {{count}} týdnů",
past: "přibližně před {{count}} týdny",
future: "přibližně za {{count}} týdnů",
},
},
xWeeks: {
one: {
regular: "1 týden",
past: "před 1 týdnem",
future: "za 1 týden",
},
few: {
regular: "{{count}} týdny",
past: "před {{count}} týdny",
future: "za {{count}} týdny",
},
many: {
regular: "{{count}} týdnů",
past: "před {{count}} týdny",
future: "za {{count}} týdnů",
},
},
aboutXMonths: {
one: {
regular: "přibližně 1 měsíc",
past: "přibližně před 1 měsícem",
future: "přibližně za 1 měsíc",
},
few: {
regular: "přibližně {{count}} měsíce",
past: "přibližně před {{count}} měsíci",
future: "přibližně za {{count}} měsíce",
},
many: {
regular: "přibližně {{count}} měsíců",
past: "přibližně před {{count}} měsíci",
future: "přibližně za {{count}} měsíců",
},
},
xMonths: {
one: {
regular: "1 měsíc",
past: "před 1 měsícem",
future: "za 1 měsíc",
},
few: {
regular: "{{count}} měsíce",
past: "před {{count}} měsíci",
future: "za {{count}} měsíce",
},
many: {
regular: "{{count}} měsíců",
past: "před {{count}} měsíci",
future: "za {{count}} měsíců",
},
},
aboutXYears: {
one: {
regular: "přibližně 1 rok",
past: "přibližně před 1 rokem",
future: "přibližně za 1 rok",
},
few: {
regular: "přibližně {{count}} roky",
past: "přibližně před {{count}} roky",
future: "přibližně za {{count}} roky",
},
many: {
regular: "přibližně {{count}} roků",
past: "přibližně před {{count}} roky",
future: "přibližně za {{count}} roků",
},
},
xYears: {
one: {
regular: "1 rok",
past: "před 1 rokem",
future: "za 1 rok",
},
few: {
regular: "{{count}} roky",
past: "před {{count}} roky",
future: "za {{count}} roky",
},
many: {
regular: "{{count}} roků",
past: "před {{count}} roky",
future: "za {{count}} roků",
},
},
overXYears: {
one: {
regular: "více než 1 rok",
past: "před více než 1 rokem",
future: "za více než 1 rok",
},
few: {
regular: "více než {{count}} roky",
past: "před více než {{count}} roky",
future: "za více než {{count}} roky",
},
many: {
regular: "více než {{count}} roků",
past: "před více než {{count}} roky",
future: "za více než {{count}} roků",
},
},
almostXYears: {
one: {
regular: "skoro 1 rok",
past: "skoro před 1 rokem",
future: "skoro za 1 rok",
},
few: {
regular: "skoro {{count}} roky",
past: "skoro před {{count}} roky",
future: "skoro za {{count}} roky",
},
many: {
regular: "skoro {{count}} roků",
past: "skoro před {{count}} roky",
future: "skoro za {{count}} roků",
},
},
};
export const formatDistance = (token, count, options) => {
let pluralResult;
const tokenValue = formatDistanceLocale[token];
// cs pluralization
if (tokenValue.type === "other") {
pluralResult = tokenValue.other;
} else if (count === 1) {
pluralResult = tokenValue.one;
} else if (count > 1 && count < 5) {
pluralResult = tokenValue.few;
} else {
pluralResult = tokenValue.many;
}
// times
const suffixExist = options?.addSuffix === true;
const comparison = options?.comparison;
let timeResult;
if (suffixExist && comparison === -1) {
timeResult = pluralResult.past;
} else if (suffixExist && comparison === 1) {
timeResult = pluralResult.future;
} else {
timeResult = pluralResult.regular;
}
return timeResult.replace("{{count}}", String(count));
};

View File

@@ -0,0 +1,54 @@
import stripAnsi from 'strip-ansi';
import eastAsianWidth from 'eastasianwidth';
import emojiRegex from 'emoji-regex';
export default function stringWidth(string, options = {}) {
if (typeof string !== 'string' || string.length === 0) {
return 0;
}
options = {
ambiguousIsNarrow: true,
...options
};
string = stripAnsi(string);
if (string.length === 0) {
return 0;
}
string = string.replace(emojiRegex(), ' ');
const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
let width = 0;
for (const character of string) {
const codePoint = character.codePointAt(0);
// Ignore control characters
if (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {
continue;
}
// Ignore combining characters
if (codePoint >= 0x300 && codePoint <= 0x36F) {
continue;
}
const code = eastAsianWidth.eastAsianWidth(character);
switch (code) {
case 'F':
case 'W':
width += 2;
break;
case 'A':
width += ambiguousCharacterWidth;
break;
default:
width += 1;
}
}
return width;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"x-circle.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}

View File

@@ -0,0 +1 @@
Prism.languages.squirrel=Prism.languages.extend("clike",{comment:[Prism.languages.clike.comment[0],{pattern:/(^|[^\\:])(?:\/\/|#).*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^\\"'@])(?:@"(?:[^"]|"")*"(?!")|"(?:[^\\\r\n"]|\\.)*")/,lookbehind:!0,greedy:!0},"class-name":{pattern:/(\b(?:class|enum|extends|instanceof)\s+)\w+(?:\.\w+)*/,lookbehind:!0,inside:{punctuation:/\./}},keyword:/\b(?:__FILE__|__LINE__|base|break|case|catch|class|clone|const|constructor|continue|default|delete|else|enum|extends|for|foreach|function|if|in|instanceof|local|null|resume|return|static|switch|this|throw|try|typeof|while|yield)\b/,number:/\b(?:0x[0-9a-fA-F]+|\d+(?:\.(?:\d+|[eE][+-]?\d+))?)\b/,operator:/\+\+|--|<=>|<[-<]|>>>?|&&?|\|\|?|[-+*/%!=<>]=?|[~^]|::?/,punctuation:/[(){}\[\],;.]/}),Prism.languages.insertBefore("squirrel","string",{char:{pattern:/(^|[^\\"'])'(?:[^\\']|\\(?:[xuU][0-9a-fA-F]{0,8}|[\s\S]))'/,lookbehind:!0,greedy:!0}}),Prism.languages.insertBefore("squirrel","operator",{"attribute-punctuation":{pattern:/<\/|\/>/,alias:"important"},lambda:{pattern:/@(?=\()/,alias:"operator"}});

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"1":"0 1 2 3 4 5 6 7 8 Q H R S T U V W X Y Z 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 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z 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 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","2":"9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB 4C 5C","194":"oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC"},D:{"1":"0 1 2 3 4 5 6 7 8 zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z 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 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB","66":"yB"},E:{"1":"eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J bB K D E F A B C L M G 6C bC 7C 8C 9C AD cC PC QC BD CD DD dC"},F:{"1":"0 1 2 3 4 5 6 7 8 nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z 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","2":"9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB JD KD LD MD PC xC ND QC","66":"lB mB"},G:{"1":"eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"E bC OD yC PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC"},H:{"2":"mD"},I:{"1":"I","2":"VC J nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"2":"A B"},O:{"1":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D","2":"J tD"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"7D","194":"6D"}},B:2,C:"CSS Containment",D:true};

View File

@@ -0,0 +1,115 @@
import * as util from "../core/util.js";
export const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "number";
}
case "object": {
if (Array.isArray(data)) {
return "array";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const error = () => {
const Sizable = {
string: { unit: "karakter", verb: "olmalı" },
file: { unit: "bayt", verb: "olmalı" },
array: { unit: "öğe", verb: "olmalı" },
set: { unit: "öğe", verb: "olmalı" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const Nouns = {
regex: "girdi",
email: "e-posta adresi",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO tarih ve saat",
date: "ISO tarih",
time: "ISO saat",
duration: "ISO süre",
ipv4: "IPv4 adresi",
ipv6: "IPv6 adresi",
cidrv4: "IPv4 aralığı",
cidrv6: "IPv6 aralığı",
base64: "base64 ile şifrelenmiş metin",
base64url: "base64url ile şifrelenmiş metin",
json_string: "JSON dizesi",
e164: "E.164 sayısı",
jwt: "JWT",
template_literal: "Şablon dizesi",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Geçersiz değer: beklenen ${issue.expected}, alınan ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Geçersiz değer: beklenen ${util.stringifyPrimitive(issue.values[0])}`;
return `Geçersiz seçenek: aşağıdakilerden biri olmalı: ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Çok büyük: beklenen ${issue.origin ?? "değer"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "öğe"}`;
return `Çok büyük: beklenen ${issue.origin ?? "değer"} ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing)
return `Çok küçük: beklenen ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
return `Çok küçük: beklenen ${issue.origin} ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Geçersiz metin: "${_issue.prefix}" ile başlamalı`;
if (_issue.format === "ends_with")
return `Geçersiz metin: "${_issue.suffix}" ile bitmeli`;
if (_issue.format === "includes")
return `Geçersiz metin: "${_issue.includes}" içermeli`;
if (_issue.format === "regex")
return `Geçersiz metin: ${_issue.pattern} desenine uymalı`;
return `Geçersiz ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Geçersiz sayı: ${issue.divisor} ile tam bölünebilmeli`;
case "unrecognized_keys":
return `Tanınmayan anahtar${issue.keys.length > 1 ? "lar" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `${issue.origin} içinde geçersiz anahtar`;
case "invalid_union":
return "Geçersiz değer";
case "invalid_element":
return `${issue.origin} içinde geçersiz değer`;
default:
return `Geçersiz değer`;
}
};
};
export default function () {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"types.js"}

View File

@@ -0,0 +1,976 @@
/**
* Much of the Node.js core API is built around an idiomatic asynchronous
* event-driven architecture in which certain kinds of objects (called "emitters")
* emit named events that cause `Function` objects ("listeners") to be called.
*
* For instance: a `net.Server` object emits an event each time a peer
* connects to it; a `fs.ReadStream` emits an event when the file is opened;
* a `stream` emits an event whenever data is available to be read.
*
* All objects that emit events are instances of the `EventEmitter` class. These
* objects expose an `eventEmitter.on()` function that allows one or more
* functions to be attached to named events emitted by the object. Typically,
* event names are camel-cased strings but any valid JavaScript property key
* can be used.
*
* When the `EventEmitter` object emits an event, all of the functions attached
* to that specific event are called _synchronously_. Any values returned by the
* called listeners are _ignored_ and discarded.
*
* The following example shows a simple `EventEmitter` instance with a single
* listener. The `eventEmitter.on()` method is used to register listeners, while
* the `eventEmitter.emit()` method is used to trigger the event.
*
* ```js
* import { EventEmitter } from 'node:events';
*
* class MyEmitter extends EventEmitter {}
*
* const myEmitter = new MyEmitter();
* myEmitter.on('event', () => {
* console.log('an event occurred!');
* });
* myEmitter.emit('event');
* ```
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/events.js)
*/
declare module "events" {
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
interface EventEmitterOptions {
/**
* Enables automatic capturing of promise rejection.
*/
captureRejections?: boolean | undefined;
}
interface StaticEventEmitterOptions {
/**
* Can be used to cancel awaiting events.
*/
signal?: AbortSignal | undefined;
}
interface StaticEventEmitterIteratorOptions extends StaticEventEmitterOptions {
/**
* Names of events that will end the iteration.
*/
close?: string[] | undefined;
/**
* The high watermark. The emitter is paused every time the size of events being buffered is higher than it.
* Supported only on emitters implementing `pause()` and `resume()` methods.
* @default Number.MAX_SAFE_INTEGER
*/
highWaterMark?: number | undefined;
/**
* The low watermark. The emitter is resumed every time the size of events being buffered is lower than it.
* Supported only on emitters implementing `pause()` and `resume()` methods.
* @default 1
*/
lowWaterMark?: number | undefined;
}
interface EventEmitter<T extends EventMap<T> = DefaultEventMap> extends NodeJS.EventEmitter<T> {}
type EventMap<T> = Record<keyof T, any[]> | DefaultEventMap;
type DefaultEventMap = [never];
type AnyRest = [...args: any[]];
type Args<K, T> = T extends DefaultEventMap ? AnyRest : (
K extends keyof T ? T[K] : never
);
type Key<K, T> = T extends DefaultEventMap ? string | symbol : K | keyof T;
type Key2<K, T> = T extends DefaultEventMap ? string | symbol : K & keyof T;
type Listener<K, T, F> = T extends DefaultEventMap ? F : (
K extends keyof T ? (
T[K] extends unknown[] ? (...args: T[K]) => void : never
)
: never
);
type Listener1<K, T> = Listener<K, T, (...args: any[]) => void>;
type Listener2<K, T> = Listener<K, T, Function>;
/**
* The `EventEmitter` class is defined and exposed by the `node:events` module:
*
* ```js
* import { EventEmitter } from 'node:events';
* ```
*
* All `EventEmitter`s emit the event `'newListener'` when new listeners are
* added and `'removeListener'` when existing listeners are removed.
*
* It supports the following option:
* @since v0.1.26
*/
class EventEmitter<T extends EventMap<T> = DefaultEventMap> {
constructor(options?: EventEmitterOptions);
[EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: Key<K, T>, ...args: Args<K, T>): void;
/**
* Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
* event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
* The `Promise` will resolve with an array of all the arguments emitted to the
* given event.
*
* This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event
* semantics and does not listen to the `'error'` event.
*
* ```js
* import { once, EventEmitter } from 'node:events';
* import process from 'node:process';
*
* const ee = new EventEmitter();
*
* process.nextTick(() => {
* ee.emit('myevent', 42);
* });
*
* const [value] = await once(ee, 'myevent');
* console.log(value);
*
* const err = new Error('kaboom');
* process.nextTick(() => {
* ee.emit('error', err);
* });
*
* try {
* await once(ee, 'myevent');
* } catch (err) {
* console.error('error happened', err);
* }
* ```
*
* The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the
* '`error'` event itself, then it is treated as any other kind of event without
* special handling:
*
* ```js
* import { EventEmitter, once } from 'node:events';
*
* const ee = new EventEmitter();
*
* once(ee, 'error')
* .then(([err]) => console.log('ok', err.message))
* .catch((err) => console.error('error', err.message));
*
* ee.emit('error', new Error('boom'));
*
* // Prints: ok boom
* ```
*
* An `AbortSignal` can be used to cancel waiting for the event:
*
* ```js
* import { EventEmitter, once } from 'node:events';
*
* const ee = new EventEmitter();
* const ac = new AbortController();
*
* async function foo(emitter, event, signal) {
* try {
* await once(emitter, event, { signal });
* console.log('event emitted!');
* } catch (error) {
* if (error.name === 'AbortError') {
* console.error('Waiting for the event was canceled!');
* } else {
* console.error('There was an error', error.message);
* }
* }
* }
*
* foo(ee, 'foo', ac.signal);
* ac.abort(); // Abort waiting for the event
* ee.emit('foo'); // Prints: Waiting for the event was canceled!
* ```
* @since v11.13.0, v10.16.0
*/
static once(
emitter: NodeJS.EventEmitter,
eventName: string | symbol,
options?: StaticEventEmitterOptions,
): Promise<any[]>;
static once(emitter: EventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
/**
* ```js
* import { on, EventEmitter } from 'node:events';
* import process from 'node:process';
*
* const ee = new EventEmitter();
*
* // Emit later on
* process.nextTick(() => {
* ee.emit('foo', 'bar');
* ee.emit('foo', 42);
* });
*
* for await (const event of on(ee, 'foo')) {
* // The execution of this inner block is synchronous and it
* // processes one event at a time (even with await). Do not use
* // if concurrent execution is required.
* console.log(event); // prints ['bar'] [42]
* }
* // Unreachable here
* ```
*
* Returns an `AsyncIterator` that iterates `eventName` events. It will throw
* if the `EventEmitter` emits `'error'`. It removes all listeners when
* exiting the loop. The `value` returned by each iteration is an array
* composed of the emitted event arguments.
*
* An `AbortSignal` can be used to cancel waiting on events:
*
* ```js
* import { on, EventEmitter } from 'node:events';
* import process from 'node:process';
*
* const ac = new AbortController();
*
* (async () => {
* const ee = new EventEmitter();
*
* // Emit later on
* process.nextTick(() => {
* ee.emit('foo', 'bar');
* ee.emit('foo', 42);
* });
*
* for await (const event of on(ee, 'foo', { signal: ac.signal })) {
* // The execution of this inner block is synchronous and it
* // processes one event at a time (even with await). Do not use
* // if concurrent execution is required.
* console.log(event); // prints ['bar'] [42]
* }
* // Unreachable here
* })();
*
* process.nextTick(() => ac.abort());
* ```
*
* Use the `close` option to specify an array of event names that will end the iteration:
*
* ```js
* import { on, EventEmitter } from 'node:events';
* import process from 'node:process';
*
* const ee = new EventEmitter();
*
* // Emit later on
* process.nextTick(() => {
* ee.emit('foo', 'bar');
* ee.emit('foo', 42);
* ee.emit('close');
* });
*
* for await (const event of on(ee, 'foo', { close: ['close'] })) {
* console.log(event); // prints ['bar'] [42]
* }
* // the loop will exit after 'close' is emitted
* console.log('done'); // prints 'done'
* ```
* @since v13.6.0, v12.16.0
* @return An `AsyncIterator` that iterates `eventName` events emitted by the `emitter`
*/
static on(
emitter: NodeJS.EventEmitter,
eventName: string | symbol,
options?: StaticEventEmitterIteratorOptions,
): NodeJS.AsyncIterator<any[]>;
static on(
emitter: EventTarget,
eventName: string,
options?: StaticEventEmitterIteratorOptions,
): NodeJS.AsyncIterator<any[]>;
/**
* A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`.
*
* ```js
* import { EventEmitter, listenerCount } from 'node:events';
*
* const myEmitter = new EventEmitter();
* myEmitter.on('event', () => {});
* myEmitter.on('event', () => {});
* console.log(listenerCount(myEmitter, 'event'));
* // Prints: 2
* ```
* @since v0.9.12
* @deprecated Since v3.2.0 - Use `listenerCount` instead.
* @param emitter The emitter to query
* @param eventName The event name
*/
static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number;
/**
* Returns a copy of the array of listeners for the event named `eventName`.
*
* For `EventEmitter`s this behaves exactly the same as calling `.listeners` on
* the emitter.
*
* For `EventTarget`s this is the only way to get the event listeners for the
* event target. This is useful for debugging and diagnostic purposes.
*
* ```js
* import { getEventListeners, EventEmitter } from 'node:events';
*
* {
* const ee = new EventEmitter();
* const listener = () => console.log('Events are fun');
* ee.on('foo', listener);
* console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ]
* }
* {
* const et = new EventTarget();
* const listener = () => console.log('Events are fun');
* et.addEventListener('foo', listener);
* console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ]
* }
* ```
* @since v15.2.0, v14.17.0
*/
static getEventListeners(emitter: EventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
/**
* Returns the currently set max amount of listeners.
*
* For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on
* the emitter.
*
* For `EventTarget`s this is the only way to get the max event listeners for the
* event target. If the number of event handlers on a single EventTarget exceeds
* the max set, the EventTarget will print a warning.
*
* ```js
* import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events';
*
* {
* const ee = new EventEmitter();
* console.log(getMaxListeners(ee)); // 10
* setMaxListeners(11, ee);
* console.log(getMaxListeners(ee)); // 11
* }
* {
* const et = new EventTarget();
* console.log(getMaxListeners(et)); // 10
* setMaxListeners(11, et);
* console.log(getMaxListeners(et)); // 11
* }
* ```
* @since v19.9.0
*/
static getMaxListeners(emitter: EventTarget | NodeJS.EventEmitter): number;
/**
* ```js
* import { setMaxListeners, EventEmitter } from 'node:events';
*
* const target = new EventTarget();
* const emitter = new EventEmitter();
*
* setMaxListeners(5, target, emitter);
* ```
* @since v15.4.0
* @param n A non-negative number. The maximum number of listeners per `EventTarget` event.
* @param eventTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter}
* objects.
*/
static setMaxListeners(n?: number, ...eventTargets: Array<EventTarget | NodeJS.EventEmitter>): void;
/**
* Listens once to the `abort` event on the provided `signal`.
*
* Listening to the `abort` event on abort signals is unsafe and may
* lead to resource leaks since another third party with the signal can
* call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change
* this since it would violate the web standard. Additionally, the original
* API makes it easy to forget to remove listeners.
*
* This API allows safely using `AbortSignal`s in Node.js APIs by solving these
* two issues by listening to the event such that `stopImmediatePropagation` does
* not prevent the listener from running.
*
* Returns a disposable so that it may be unsubscribed from more easily.
*
* ```js
* import { addAbortListener } from 'node:events';
*
* function example(signal) {
* let disposable;
* try {
* signal.addEventListener('abort', (e) => e.stopImmediatePropagation());
* disposable = addAbortListener(signal, (e) => {
* // Do something when signal is aborted.
* });
* } finally {
* disposable?.[Symbol.dispose]();
* }
* }
* ```
* @since v20.5.0
* @return Disposable that removes the `abort` listener.
*/
static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
/**
* This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called.
*
* Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no
* regular `'error'` listener is installed.
* @since v13.6.0, v12.17.0
*/
static readonly errorMonitor: unique symbol;
/**
* Value: `Symbol.for('nodejs.rejection')`
*
* See how to write a custom `rejection handler`.
* @since v13.4.0, v12.16.0
*/
static readonly captureRejectionSymbol: unique symbol;
/**
* Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type)
*
* Change the default `captureRejections` option on all new `EventEmitter` objects.
* @since v13.4.0, v12.16.0
*/
static captureRejections: boolean;
/**
* By default, a maximum of `10` listeners can be registered for any single
* event. This limit can be changed for individual `EventEmitter` instances
* using the `emitter.setMaxListeners(n)` method. To change the default
* for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property
* can be used. If this value is not a positive number, a `RangeError` is thrown.
*
* Take caution when setting the `events.defaultMaxListeners` because the
* change affects _all_ `EventEmitter` instances, including those created before
* the change is made. However, calling `emitter.setMaxListeners(n)` still has
* precedence over `events.defaultMaxListeners`.
*
* This is not a hard limit. The `EventEmitter` instance will allow
* more listeners to be added but will output a trace warning to stderr indicating
* that a "possible EventEmitter memory leak" has been detected. For any single
* `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to
* temporarily avoid this warning:
*
* ```js
* import { EventEmitter } from 'node:events';
* const emitter = new EventEmitter();
* emitter.setMaxListeners(emitter.getMaxListeners() + 1);
* emitter.once('event', () => {
* // do stuff
* emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0));
* });
* ```
*
* The `--trace-warnings` command-line flag can be used to display the
* stack trace for such warnings.
*
* The emitted warning can be inspected with `process.on('warning')` and will
* have the additional `emitter`, `type`, and `count` properties, referring to
* the event emitter instance, the event's name and the number of attached
* listeners, respectively.
* Its `name` property is set to `'MaxListenersExceededWarning'`.
* @since v0.11.2
*/
static defaultMaxListeners: number;
}
import internal = require("node:events");
namespace EventEmitter {
// Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
export { internal as EventEmitter };
export interface Abortable {
/**
* When provided the corresponding `AbortController` can be used to cancel an asynchronous action.
*/
signal?: AbortSignal | undefined;
}
export interface EventEmitterReferencingAsyncResource extends AsyncResource {
readonly eventEmitter: EventEmitterAsyncResource;
}
export interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions {
/**
* The type of async event, this is required when instantiating `EventEmitterAsyncResource`
* directly rather than as a child class.
* @default new.target.name if instantiated as a child class.
*/
name?: string | undefined;
}
/**
* Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that
* require manual async tracking. Specifically, all events emitted by instances
* of `events.EventEmitterAsyncResource` will run within its `async context`.
*
* ```js
* import { EventEmitterAsyncResource, EventEmitter } from 'node:events';
* import { notStrictEqual, strictEqual } from 'node:assert';
* import { executionAsyncId, triggerAsyncId } from 'node:async_hooks';
*
* // Async tracking tooling will identify this as 'Q'.
* const ee1 = new EventEmitterAsyncResource({ name: 'Q' });
*
* // 'foo' listeners will run in the EventEmitters async context.
* ee1.on('foo', () => {
* strictEqual(executionAsyncId(), ee1.asyncId);
* strictEqual(triggerAsyncId(), ee1.triggerAsyncId);
* });
*
* const ee2 = new EventEmitter();
*
* // 'foo' listeners on ordinary EventEmitters that do not track async
* // context, however, run in the same async context as the emit().
* ee2.on('foo', () => {
* notStrictEqual(executionAsyncId(), ee2.asyncId);
* notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId);
* });
*
* Promise.resolve().then(() => {
* ee1.emit('foo');
* ee2.emit('foo');
* });
* ```
*
* The `EventEmitterAsyncResource` class has the same methods and takes the
* same options as `EventEmitter` and `AsyncResource` themselves.
* @since v17.4.0, v16.14.0
*/
export class EventEmitterAsyncResource extends EventEmitter {
/**
* @param options Only optional in child class.
*/
constructor(options?: EventEmitterAsyncResourceOptions);
/**
* Call all `destroy` hooks. This should only ever be called once. An error will
* be thrown if it is called more than once. This **must** be manually called. If
* the resource is left to be collected by the GC then the `destroy` hooks will
* never be called.
*/
emitDestroy(): void;
/**
* The unique `asyncId` assigned to the resource.
*/
readonly asyncId: number;
/**
* The same triggerAsyncId that is passed to the AsyncResource constructor.
*/
readonly triggerAsyncId: number;
/**
* The returned `AsyncResource` object has an additional `eventEmitter` property
* that provides a reference to this `EventEmitterAsyncResource`.
*/
readonly asyncResource: EventEmitterReferencingAsyncResource;
}
/**
* The `NodeEventTarget` is a Node.js-specific extension to `EventTarget`
* that emulates a subset of the `EventEmitter` API.
* @since v14.5.0
*/
export interface NodeEventTarget extends EventTarget {
/**
* Node.js-specific extension to the `EventTarget` class that emulates the
* equivalent `EventEmitter` API. The only difference between `addListener()` and
* `addEventListener()` is that `addListener()` will return a reference to the
* `EventTarget`.
* @since v14.5.0
*/
addListener(type: string, listener: (arg: any) => void): this;
/**
* Node.js-specific extension to the `EventTarget` class that dispatches the
* `arg` to the list of handlers for `type`.
* @since v15.2.0
* @returns `true` if event listeners registered for the `type` exist,
* otherwise `false`.
*/
emit(type: string, arg: any): boolean;
/**
* Node.js-specific extension to the `EventTarget` class that returns an array
* of event `type` names for which event listeners are registered.
* @since 14.5.0
*/
eventNames(): string[];
/**
* Node.js-specific extension to the `EventTarget` class that returns the number
* of event listeners registered for the `type`.
* @since v14.5.0
*/
listenerCount(type: string): number;
/**
* Node.js-specific extension to the `EventTarget` class that sets the number
* of max event listeners as `n`.
* @since v14.5.0
*/
setMaxListeners(n: number): void;
/**
* Node.js-specific extension to the `EventTarget` class that returns the number
* of max event listeners.
* @since v14.5.0
*/
getMaxListeners(): number;
/**
* Node.js-specific alias for `eventTarget.removeEventListener()`.
* @since v14.5.0
*/
off(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
/**
* Node.js-specific alias for `eventTarget.addEventListener()`.
* @since v14.5.0
*/
on(type: string, listener: (arg: any) => void): this;
/**
* Node.js-specific extension to the `EventTarget` class that adds a `once`
* listener for the given event `type`. This is equivalent to calling `on`
* with the `once` option set to `true`.
* @since v14.5.0
*/
once(type: string, listener: (arg: any) => void): this;
/**
* Node.js-specific extension to the `EventTarget` class. If `type` is specified,
* removes all registered listeners for `type`, otherwise removes all registered
* listeners.
* @since v14.5.0
*/
removeAllListeners(type?: string): this;
/**
* Node.js-specific extension to the `EventTarget` class that removes the
* `listener` for the given `type`. The only difference between `removeListener()`
* and `removeEventListener()` is that `removeListener()` will return a reference
* to the `EventTarget`.
* @since v14.5.0
*/
removeListener(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
}
}
global {
namespace NodeJS {
interface EventEmitter<T extends EventMap<T> = DefaultEventMap> {
[EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: Key<K, T>, ...args: Args<K, T>): void;
/**
* Alias for `emitter.on(eventName, listener)`.
* @since v0.1.26
*/
addListener<K>(eventName: Key<K, T>, listener: Listener1<K, T>): this;
/**
* Adds the `listener` function to the end of the listeners array for the event
* named `eventName`. No checks are made to see if the `listener` has already
* been added. Multiple calls passing the same combination of `eventName` and
* `listener` will result in the `listener` being added, and called, multiple times.
*
* ```js
* server.on('connection', (stream) => {
* console.log('someone connected!');
* });
* ```
*
* Returns a reference to the `EventEmitter`, so that calls can be chained.
*
* By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the
* event listener to the beginning of the listeners array.
*
* ```js
* import { EventEmitter } from 'node:events';
* const myEE = new EventEmitter();
* myEE.on('foo', () => console.log('a'));
* myEE.prependListener('foo', () => console.log('b'));
* myEE.emit('foo');
* // Prints:
* // b
* // a
* ```
* @since v0.1.101
* @param eventName The name of the event.
* @param listener The callback function
*/
on<K>(eventName: Key<K, T>, listener: Listener1<K, T>): this;
/**
* Adds a **one-time** `listener` function for the event named `eventName`. The
* next time `eventName` is triggered, this listener is removed and then invoked.
*
* ```js
* server.once('connection', (stream) => {
* console.log('Ah, we have our first user!');
* });
* ```
*
* Returns a reference to the `EventEmitter`, so that calls can be chained.
*
* By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the
* event listener to the beginning of the listeners array.
*
* ```js
* import { EventEmitter } from 'node:events';
* const myEE = new EventEmitter();
* myEE.once('foo', () => console.log('a'));
* myEE.prependOnceListener('foo', () => console.log('b'));
* myEE.emit('foo');
* // Prints:
* // b
* // a
* ```
* @since v0.3.0
* @param eventName The name of the event.
* @param listener The callback function
*/
once<K>(eventName: Key<K, T>, listener: Listener1<K, T>): this;
/**
* Removes the specified `listener` from the listener array for the event named `eventName`.
*
* ```js
* const callback = (stream) => {
* console.log('someone connected!');
* };
* server.on('connection', callback);
* // ...
* server.removeListener('connection', callback);
* ```
*
* `removeListener()` will remove, at most, one instance of a listener from the
* listener array. If any single listener has been added multiple times to the
* listener array for the specified `eventName`, then `removeListener()` must be
* called multiple times to remove each instance.
*
* Once an event is emitted, all listeners attached to it at the
* time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution
* will not remove them from`emit()` in progress. Subsequent events behave as expected.
*
* ```js
* import { EventEmitter } from 'node:events';
* class MyEmitter extends EventEmitter {}
* const myEmitter = new MyEmitter();
*
* const callbackA = () => {
* console.log('A');
* myEmitter.removeListener('event', callbackB);
* };
*
* const callbackB = () => {
* console.log('B');
* };
*
* myEmitter.on('event', callbackA);
*
* myEmitter.on('event', callbackB);
*
* // callbackA removes listener callbackB but it will still be called.
* // Internal listener array at time of emit [callbackA, callbackB]
* myEmitter.emit('event');
* // Prints:
* // A
* // B
*
* // callbackB is now removed.
* // Internal listener array [callbackA]
* myEmitter.emit('event');
* // Prints:
* // A
* ```
*
* Because listeners are managed using an internal array, calling this will
* change the position indices of any listener registered _after_ the listener
* being removed. This will not impact the order in which listeners are called,
* but it means that any copies of the listener array as returned by
* the `emitter.listeners()` method will need to be recreated.
*
* When a single function has been added as a handler multiple times for a single
* event (as in the example below), `removeListener()` will remove the most
* recently added instance. In the example the `once('ping')` listener is removed:
*
* ```js
* import { EventEmitter } from 'node:events';
* const ee = new EventEmitter();
*
* function pong() {
* console.log('pong');
* }
*
* ee.on('ping', pong);
* ee.once('ping', pong);
* ee.removeListener('ping', pong);
*
* ee.emit('ping');
* ee.emit('ping');
* ```
*
* Returns a reference to the `EventEmitter`, so that calls can be chained.
* @since v0.1.26
*/
removeListener<K>(eventName: Key<K, T>, listener: Listener1<K, T>): this;
/**
* Alias for `emitter.removeListener()`.
* @since v10.0.0
*/
off<K>(eventName: Key<K, T>, listener: Listener1<K, T>): this;
/**
* Removes all listeners, or those of the specified `eventName`.
*
* It is bad practice to remove listeners added elsewhere in the code,
* particularly when the `EventEmitter` instance was created by some other
* component or module (e.g. sockets or file streams).
*
* Returns a reference to the `EventEmitter`, so that calls can be chained.
* @since v0.1.26
*/
removeAllListeners(eventName?: Key<unknown, T>): this;
/**
* By default `EventEmitter`s will print a warning if more than `10` listeners are
* added for a particular event. This is a useful default that helps finding
* memory leaks. The `emitter.setMaxListeners()` method allows the limit to be
* modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners.
*
* Returns a reference to the `EventEmitter`, so that calls can be chained.
* @since v0.3.5
*/
setMaxListeners(n: number): this;
/**
* Returns the current max listener value for the `EventEmitter` which is either
* set by `emitter.setMaxListeners(n)` or defaults to {@link EventEmitter.defaultMaxListeners}.
* @since v1.0.0
*/
getMaxListeners(): number;
/**
* Returns a copy of the array of listeners for the event named `eventName`.
*
* ```js
* server.on('connection', (stream) => {
* console.log('someone connected!');
* });
* console.log(util.inspect(server.listeners('connection')));
* // Prints: [ [Function] ]
* ```
* @since v0.1.26
*/
listeners<K>(eventName: Key<K, T>): Array<Listener2<K, T>>;
/**
* Returns a copy of the array of listeners for the event named `eventName`,
* including any wrappers (such as those created by `.once()`).
*
* ```js
* import { EventEmitter } from 'node:events';
* const emitter = new EventEmitter();
* emitter.once('log', () => console.log('log once'));
*
* // Returns a new Array with a function `onceWrapper` which has a property
* // `listener` which contains the original listener bound above
* const listeners = emitter.rawListeners('log');
* const logFnWrapper = listeners[0];
*
* // Logs "log once" to the console and does not unbind the `once` event
* logFnWrapper.listener();
*
* // Logs "log once" to the console and removes the listener
* logFnWrapper();
*
* emitter.on('log', () => console.log('log persistently'));
* // Will return a new Array with a single function bound by `.on()` above
* const newListeners = emitter.rawListeners('log');
*
* // Logs "log persistently" twice
* newListeners[0]();
* emitter.emit('log');
* ```
* @since v9.4.0
*/
rawListeners<K>(eventName: Key<K, T>): Array<Listener2<K, T>>;
/**
* Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments
* to each.
*
* Returns `true` if the event had listeners, `false` otherwise.
*
* ```js
* import { EventEmitter } from 'node:events';
* const myEmitter = new EventEmitter();
*
* // First listener
* myEmitter.on('event', function firstListener() {
* console.log('Helloooo! first listener');
* });
* // Second listener
* myEmitter.on('event', function secondListener(arg1, arg2) {
* console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
* });
* // Third listener
* myEmitter.on('event', function thirdListener(...args) {
* const parameters = args.join(', ');
* console.log(`event with parameters ${parameters} in third listener`);
* });
*
* console.log(myEmitter.listeners('event'));
*
* myEmitter.emit('event', 1, 2, 3, 4, 5);
*
* // Prints:
* // [
* // [Function: firstListener],
* // [Function: secondListener],
* // [Function: thirdListener]
* // ]
* // Helloooo! first listener
* // event with parameters 1, 2 in second listener
* // event with parameters 1, 2, 3, 4, 5 in third listener
* ```
* @since v0.1.26
*/
emit<K>(eventName: Key<K, T>, ...args: Args<K, T>): boolean;
/**
* Returns the number of listeners listening for the event named `eventName`.
* If `listener` is provided, it will return how many times the listener is found
* in the list of the listeners of the event.
* @since v3.2.0
* @param eventName The name of the event being listened for
* @param listener The event handler function
*/
listenerCount<K>(eventName: Key<K, T>, listener?: Listener2<K, T>): number;
/**
* Adds the `listener` function to the _beginning_ of the listeners array for the
* event named `eventName`. No checks are made to see if the `listener` has
* already been added. Multiple calls passing the same combination of `eventName`
* and `listener` will result in the `listener` being added, and called, multiple times.
*
* ```js
* server.prependListener('connection', (stream) => {
* console.log('someone connected!');
* });
* ```
*
* Returns a reference to the `EventEmitter`, so that calls can be chained.
* @since v6.0.0
* @param eventName The name of the event.
* @param listener The callback function
*/
prependListener<K>(eventName: Key<K, T>, listener: Listener1<K, T>): this;
/**
* Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this
* listener is removed, and then invoked.
*
* ```js
* server.prependOnceListener('connection', (stream) => {
* console.log('Ah, we have our first user!');
* });
* ```
*
* Returns a reference to the `EventEmitter`, so that calls can be chained.
* @since v6.0.0
* @param eventName The name of the event.
* @param listener The callback function
*/
prependOnceListener<K>(eventName: Key<K, T>, listener: Listener1<K, T>): this;
/**
* Returns an array listing the events for which the emitter has registered
* listeners. The values in the array are strings or `Symbol`s.
*
* ```js
* import { EventEmitter } from 'node:events';
*
* const myEE = new EventEmitter();
* myEE.on('foo', () => {});
* myEE.on('bar', () => {});
*
* const sym = Symbol('symbol');
* myEE.on(sym, () => {});
*
* console.log(myEE.eventNames());
* // Prints: [ 'foo', 'bar', Symbol(symbol) ]
* ```
* @since v6.0.0
*/
eventNames(): Array<(string | symbol) & Key2<unknown, T>>;
}
}
}
export = EventEmitter;
}
declare module "node:events" {
import events = require("events");
export = events;
}

View File

@@ -0,0 +1,59 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.assertEnumValueName = assertEnumValueName;
exports.assertName = assertName;
var _devAssert = require('../jsutils/devAssert.js');
var _GraphQLError = require('../error/GraphQLError.js');
var _characterClasses = require('../language/characterClasses.js');
/**
* Upholds the spec rules about naming.
*/
function assertName(name) {
name != null || (0, _devAssert.devAssert)(false, 'Must provide name.');
typeof name === 'string' ||
(0, _devAssert.devAssert)(false, 'Expected name to be a string.');
if (name.length === 0) {
throw new _GraphQLError.GraphQLError(
'Expected name to be a non-empty string.',
);
}
for (let i = 1; i < name.length; ++i) {
if (!(0, _characterClasses.isNameContinue)(name.charCodeAt(i))) {
throw new _GraphQLError.GraphQLError(
`Names must only contain [_a-zA-Z0-9] but "${name}" does not.`,
);
}
}
if (!(0, _characterClasses.isNameStart)(name.charCodeAt(0))) {
throw new _GraphQLError.GraphQLError(
`Names must start with [_a-zA-Z] but "${name}" does not.`,
);
}
return name;
}
/**
* Upholds the spec rules about naming enum values.
*
* @internal
*/
function assertEnumValueName(name) {
if (name === 'true' || name === 'false' || name === 'null') {
throw new _GraphQLError.GraphQLError(
`Enum values cannot be named: ${name}`,
);
}
return assertName(name);
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"measurement.d.ts","sourceRoot":"","sources":["../../../src/tracing/measurement.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAI5D;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,gCAAkB,GAAG,IAAI,CAUrH;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,YAAY,GAAG,SAAS,CAiBxF"}

View File

@@ -0,0 +1,101 @@
/**
* 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.
*
*/
import { $isLinkNode } from '@lexical/link';
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
import { $findMatchingParent, isHTMLAnchorElement } from '@lexical/utils';
import { isDOMNode, getNearestEditorFromDOMNode, $getNearestNodeFromDOMNode, $isElementNode, $getSelection, $isRangeSelection } from 'lexical';
import { useEffect } from 'react';
/**
* 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.
*
*/
function findMatchingDOM(startNode, predicate) {
let node = startNode;
while (node != null) {
if (predicate(node)) {
return node;
}
node = node.parentNode;
}
return null;
}
function ClickableLinkPlugin({
newTab = true,
disabled = false
}) {
const [editor] = useLexicalComposerContext();
useEffect(() => {
const onClick = event => {
const target = event.target;
if (!isDOMNode(target)) {
return;
}
const nearestEditor = getNearestEditorFromDOMNode(target);
if (nearestEditor === null) {
return;
}
let url = null;
let urlTarget = null;
nearestEditor.update(() => {
const clickedNode = $getNearestNodeFromDOMNode(target);
if (clickedNode !== null) {
const maybeLinkNode = $findMatchingParent(clickedNode, $isElementNode);
if (!disabled) {
if ($isLinkNode(maybeLinkNode)) {
url = maybeLinkNode.sanitizeUrl(maybeLinkNode.getURL());
urlTarget = maybeLinkNode.getTarget();
} else {
const a = findMatchingDOM(target, isHTMLAnchorElement);
if (a !== null) {
url = a.href;
urlTarget = a.target;
}
}
}
}
});
if (url === null || url === '') {
return;
}
// Allow user to select link text without following url
const selection = editor.getEditorState().read($getSelection);
if ($isRangeSelection(selection) && !selection.isCollapsed()) {
event.preventDefault();
return;
}
const isMiddle = event.type === 'auxclick' && event.button === 1;
window.open(url, newTab || isMiddle || event.metaKey || event.ctrlKey || urlTarget === '_blank' ? '_blank' : '_self');
event.preventDefault();
};
const onMouseUp = event => {
if (event.button === 1) {
onClick(event);
}
};
return editor.registerRootListener((rootElement, prevRootElement) => {
if (prevRootElement !== null) {
prevRootElement.removeEventListener('click', onClick);
prevRootElement.removeEventListener('mouseup', onMouseUp);
}
if (rootElement !== null) {
rootElement.addEventListener('click', onClick);
rootElement.addEventListener('mouseup', onMouseUp);
}
});
}, [editor, newTab, disabled]);
return null;
}
export { ClickableLinkPlugin };

View File

@@ -0,0 +1,7 @@
import React, { ElementType, HTMLProps } from 'react';
export declare const containerBaseClass = "modal-container";
export type ModalContainerProps = HTMLProps<HTMLElement> & {
htmlElement?: ElementType;
children?: React.ReactNode;
};
export declare const ModalContainer: React.FC<ModalContainerProps>;

View File

@@ -0,0 +1,104 @@
(function (Prism) {
var comment = {
pattern: /(^[ \t]*| {2}|\t)#.*/m,
lookbehind: true,
greedy: true
};
var variable = {
pattern: /((?:^|[^\\])(?:\\{2})*)[$@&%]\{(?:[^{}\r\n]|\{[^{}\r\n]*\})*\}/,
lookbehind: true,
inside: {
'punctuation': /^[$@&%]\{|\}$/
}
};
function createSection(name, inside) {
var extendecInside = {};
extendecInside['section-header'] = {
pattern: /^ ?\*{3}.+?\*{3}/,
alias: 'keyword'
};
// copy inside tokens
for (var token in inside) {
extendecInside[token] = inside[token];
}
extendecInside['tag'] = {
pattern: /([\r\n](?: {2}|\t)[ \t]*)\[[-\w]+\]/,
lookbehind: true,
inside: {
'punctuation': /\[|\]/
}
};
extendecInside['variable'] = variable;
extendecInside['comment'] = comment;
return {
pattern: RegExp(/^ ?\*{3}[ \t]*<name>[ \t]*\*{3}(?:.|[\r\n](?!\*{3}))*/.source.replace(/<name>/g, function () { return name; }), 'im'),
alias: 'section',
inside: extendecInside
};
}
var docTag = {
pattern: /(\[Documentation\](?: {2}|\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/,
lookbehind: true,
alias: 'string'
};
var testNameLike = {
pattern: /([\r\n] ?)(?!#)(?:\S(?:[ \t]\S)*)+/,
lookbehind: true,
alias: 'function',
inside: {
'variable': variable
}
};
var testPropertyLike = {
pattern: /([\r\n](?: {2}|\t)[ \t]*)(?!\[|\.{3}|#)(?:\S(?:[ \t]\S)*)+/,
lookbehind: true,
inside: {
'variable': variable
}
};
Prism.languages['robotframework'] = {
'settings': createSection('Settings', {
'documentation': {
pattern: /([\r\n] ?Documentation(?: {2}|\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/,
lookbehind: true,
alias: 'string'
},
'property': {
pattern: /([\r\n] ?)(?!\.{3}|#)(?:\S(?:[ \t]\S)*)+/,
lookbehind: true
}
}),
'variables': createSection('Variables'),
'test-cases': createSection('Test Cases', {
'test-name': testNameLike,
'documentation': docTag,
'property': testPropertyLike
}),
'keywords': createSection('Keywords', {
'keyword-name': testNameLike,
'documentation': docTag,
'property': testPropertyLike
}),
'tasks': createSection('Tasks', {
'task-name': testNameLike,
'documentation': docTag,
'property': testPropertyLike
}),
'comment': comment
};
Prism.languages.robot = Prism.languages['robotframework'];
}(Prism));

View File

@@ -0,0 +1,9 @@
// package.json
var version = "0.44.7";
// src/version.ts
var compatibilityVersion = 10;
export {
compatibilityVersion,
version as npmVersion
};

View File

@@ -0,0 +1,40 @@
"use strict";
exports.differenceInHours = differenceInHours;
var _index = require("./_lib/getRoundingMethod.js");
var _index2 = require("./constants.js");
var _index3 = require("./differenceInMilliseconds.js");
/**
* The {@link differenceInHours} function options.
*/
/**
* @name differenceInHours
* @category Hour Helpers
* @summary Get the number of hours between the given dates.
*
* @description
* Get the number of hours between the given dates.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param dateLeft - The later date
* @param dateRight - The earlier date
* @param options - An object with options.
*
* @returns The number of hours
*
* @example
* // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?
* const result = differenceInHours(
* new Date(2014, 6, 2, 19, 0),
* new Date(2014, 6, 2, 6, 50)
* )
* //=> 12
*/
function differenceInHours(dateLeft, dateRight, options) {
const diff =
(0, _index3.differenceInMilliseconds)(dateLeft, dateRight) /
_index2.millisecondsInHour;
return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff);
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../../../src/types-hoist/vue.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAE3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IAGpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}

View File

@@ -0,0 +1,57 @@
import type { Data, DefaultDocumentIDType, FormState, Operation } from 'payload';
import type React from 'react';
import type { HTMLAttributes } from 'react';
import type { Props as DrawerProps } from '../Drawer/types.js';
import type { DocumentDrawerContextProps } from './Provider.js';
export type DocumentDrawerProps = {
readonly AfterFields?: React.ReactNode;
/**
* The slug of the collection to which the document belongs.
*/
readonly collectionSlug: string;
readonly disableActions?: boolean;
readonly drawerSlug?: string;
/**
* The ID of the document to be edited.
* When provided, will be fetched and displayed in the drawer.
* If omitted, will render the "create new" view for the given collection.
*/
readonly id?: DefaultDocumentIDType | null;
readonly initialData?: Data;
/**
* @deprecated
*/
readonly initialState?: FormState;
readonly overrideEntityVisibility?: boolean;
readonly redirectAfterCreate?: boolean;
readonly redirectAfterDelete?: boolean;
readonly redirectAfterDuplicate?: boolean;
readonly redirectAfterRestore?: boolean;
} & Pick<DocumentDrawerContextProps, 'onDelete' | 'onDuplicate' | 'onSave'> & Pick<DrawerProps, 'Header'>;
export type DocumentTogglerProps = {
readonly children?: React.ReactNode;
readonly className?: string;
readonly collectionSlug: string;
readonly disabled?: boolean;
readonly drawerSlug?: string;
readonly onClick?: () => void;
readonly operation: Operation;
} & Readonly<HTMLAttributes<HTMLButtonElement>>;
export type UseDocumentDrawerContext = {
closeDrawer: () => void;
drawerDepth: number;
drawerSlug: string;
isDrawerOpen: boolean;
openDrawer: () => void;
toggleDrawer: () => void;
};
export type UseDocumentDrawer = (args: Pick<DocumentDrawerProps, 'collectionSlug' | 'id' | 'overrideEntityVisibility'>) => [
React.FC<{
children?: React.ReactNode;
} & Omit<DocumentDrawerProps, 'collectionSlug' | 'operation'>>,
React.FC<{
children?: React.ReactNode;
} & Omit<DocumentTogglerProps, 'collectionSlug' | 'operation'>>,
UseDocumentDrawerContext
];
//# sourceMappingURL=types.d.ts.map

Some files were not shown because too many files have changed in this diff Show More