fix(products): fix breadcrumbs and product filtering (backport from main)
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
@@ -0,0 +1,35 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link lastDayOfYear} function options.
*/
export interface LastDayOfYearOptions<DateType extends Date = Date>
extends ContextOptions<DateType> {}
/**
* @name lastDayOfYear
* @category Year Helpers
* @summary Return the last day of a year for the given date.
*
* @description
* Return the last day of a year for the given date.
* The result will be in the local timezone.
*
* @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).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The last day of a year
*
* @example
* // The last day of a year for 2 September 2014 11:55:00:
* const result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00))
* //=> Wed Dec 31 2014 00:00:00
*/
export declare function lastDayOfYear<
DateType extends Date,
ResultDate extends Date = DateType,
>(
date: DateArg<DateType>,
options?: LastDayOfYearOptions<ResultDate>,
): ResultDate;
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/op-sqlite/migrator.ts"],"sourcesContent":["import { useEffect, useReducer } from 'react';\nimport type { MigrationMeta } from '~/migrator.ts';\nimport type { OPSQLiteDatabase } from './driver.ts';\n\ninterface MigrationConfig {\n\tjournal: {\n\t\tentries: { idx: number; when: number; tag: string; breakpoints: boolean }[];\n\t};\n\tmigrations: Record<string, string>;\n}\n\nasync function readMigrationFiles({ journal, migrations }: MigrationConfig): Promise<MigrationMeta[]> {\n\tconst migrationQueries: MigrationMeta[] = [];\n\n\tfor await (const journalEntry of journal.entries) {\n\t\tconst query = migrations[`m${journalEntry.idx.toString().padStart(4, '0')}`];\n\n\t\tif (!query) {\n\t\t\tthrow new Error(`Missing migration: ${journalEntry.tag}`);\n\t\t}\n\n\t\ttry {\n\t\t\tconst result = query.split('--> statement-breakpoint').map((it) => {\n\t\t\t\treturn it;\n\t\t\t});\n\n\t\t\tmigrationQueries.push({\n\t\t\t\tsql: result,\n\t\t\t\tbps: journalEntry.breakpoints,\n\t\t\t\tfolderMillis: journalEntry.when,\n\t\t\t\thash: '',\n\t\t\t});\n\t\t} catch {\n\t\t\tthrow new Error(`Failed to parse migration: ${journalEntry.tag}`);\n\t\t}\n\t}\n\n\treturn migrationQueries;\n}\n\nexport async function migrate<TSchema extends Record<string, unknown>>(\n\tdb: OPSQLiteDatabase<TSchema>,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = await readMigrationFiles(config);\n\treturn db.dialect.migrate(migrations, db.session);\n}\n\ninterface State {\n\tsuccess: boolean;\n\terror?: Error;\n}\n\ntype Action =\n\t| { type: 'migrating' }\n\t| { type: 'migrated'; payload: true }\n\t| { type: 'error'; payload: Error };\n\nexport const useMigrations = (db: OPSQLiteDatabase<any>, migrations: {\n\tjournal: {\n\t\tentries: { idx: number; when: number; tag: string; breakpoints: boolean }[];\n\t};\n\tmigrations: Record<string, string>;\n}): State => {\n\tconst initialState: State = {\n\t\tsuccess: false,\n\t\terror: undefined,\n\t};\n\n\tconst fetchReducer = (state: State, action: Action): State => {\n\t\tswitch (action.type) {\n\t\t\tcase 'migrating': {\n\t\t\t\treturn { ...initialState };\n\t\t\t}\n\t\t\tcase 'migrated': {\n\t\t\t\treturn { ...initialState, success: action.payload };\n\t\t\t}\n\t\t\tcase 'error': {\n\t\t\t\treturn { ...initialState, error: action.payload };\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\treturn state;\n\t\t\t}\n\t\t}\n\t};\n\n\tconst [state, dispatch] = useReducer(fetchReducer, initialState);\n\n\tuseEffect(() => {\n\t\tdispatch({ type: 'migrating' });\n\t\tmigrate(db, migrations).then(() => {\n\t\t\tdispatch({ type: 'migrated', payload: true });\n\t\t}).catch((error) => {\n\t\t\tdispatch({ type: 'error', payload: error as Error });\n\t\t});\n\t}, []);\n\n\treturn state;\n};\n"],"mappings":"AAAA,SAAS,WAAW,kBAAkB;AAWtC,eAAe,mBAAmB,EAAE,SAAS,WAAW,GAA8C;AACrG,QAAM,mBAAoC,CAAC;AAE3C,mBAAiB,gBAAgB,QAAQ,SAAS;AACjD,UAAM,QAAQ,WAAW,IAAI,aAAa,IAAI,SAAS,EAAE,SAAS,GAAG,GAAG,CAAC,EAAE;AAE3E,QAAI,CAAC,OAAO;AACX,YAAM,IAAI,MAAM,sBAAsB,aAAa,GAAG,EAAE;AAAA,IACzD;AAEA,QAAI;AACH,YAAM,SAAS,MAAM,MAAM,0BAA0B,EAAE,IAAI,CAAC,OAAO;AAClE,eAAO;AAAA,MACR,CAAC;AAED,uBAAiB,KAAK;AAAA,QACrB,KAAK;AAAA,QACL,KAAK,aAAa;AAAA,QAClB,cAAc,aAAa;AAAA,QAC3B,MAAM;AAAA,MACP,CAAC;AAAA,IACF,QAAQ;AACP,YAAM,IAAI,MAAM,8BAA8B,aAAa,GAAG,EAAE;AAAA,IACjE;AAAA,EACD;AAEA,SAAO;AACR;AAEA,eAAsB,QACrB,IACA,QACC;AACD,QAAM,aAAa,MAAM,mBAAmB,MAAM;AAClD,SAAO,GAAG,QAAQ,QAAQ,YAAY,GAAG,OAAO;AACjD;AAYO,MAAM,gBAAgB,CAAC,IAA2B,eAK5C;AACZ,QAAM,eAAsB;AAAA,IAC3B,SAAS;AAAA,IACT,OAAO;AAAA,EACR;AAEA,QAAM,eAAe,CAACA,QAAc,WAA0B;AAC7D,YAAQ,OAAO,MAAM;AAAA,MACpB,KAAK,aAAa;AACjB,eAAO,EAAE,GAAG,aAAa;AAAA,MAC1B;AAAA,MACA,KAAK,YAAY;AAChB,eAAO,EAAE,GAAG,cAAc,SAAS,OAAO,QAAQ;AAAA,MACnD;AAAA,MACA,KAAK,SAAS;AACb,eAAO,EAAE,GAAG,cAAc,OAAO,OAAO,QAAQ;AAAA,MACjD;AAAA,MACA,SAAS;AACR,eAAOA;AAAA,MACR;AAAA,IACD;AAAA,EACD;AAEA,QAAM,CAAC,OAAO,QAAQ,IAAI,WAAW,cAAc,YAAY;AAE/D,YAAU,MAAM;AACf,aAAS,EAAE,MAAM,YAAY,CAAC;AAC9B,YAAQ,IAAI,UAAU,EAAE,KAAK,MAAM;AAClC,eAAS,EAAE,MAAM,YAAY,SAAS,KAAK,CAAC;AAAA,IAC7C,CAAC,EAAE,MAAM,CAAC,UAAU;AACnB,eAAS,EAAE,MAAM,SAAS,SAAS,MAAe,CAAC;AAAA,IACpD,CAAC;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AACR;","names":["state"]}
@@ -0,0 +1,22 @@
/**
* @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 Fan = createLucideIcon("Fan", [
[
"path",
{
d: "M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z",
key: "484a7f"
}
],
["path", { d: "M12 12v.01", key: "u5ubse" }]
]);
export { Fan as default };
//# sourceMappingURL=fan.js.map
@@ -0,0 +1,31 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.js";
import type { ColumnBaseConfig } from "../../column.js";
import { entityKind } from "../../entity.js";
import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from "./common.js";
export type MySqlDoubleBuilderInitial<TName extends string> = MySqlDoubleBuilder<{
name: TName;
dataType: 'number';
columnType: 'MySqlDouble';
data: number;
driverParam: number | string;
enumValues: undefined;
}>;
export declare class MySqlDoubleBuilder<T extends ColumnBuilderBaseConfig<'number', 'MySqlDouble'>> extends MySqlColumnBuilderWithAutoIncrement<T, MySqlDoubleConfig> {
static readonly [entityKind]: string;
constructor(name: T['name'], config: MySqlDoubleConfig | undefined);
}
export declare class MySqlDouble<T extends ColumnBaseConfig<'number', 'MySqlDouble'>> extends MySqlColumnWithAutoIncrement<T, MySqlDoubleConfig> {
static readonly [entityKind]: string;
readonly precision: number | undefined;
readonly scale: number | undefined;
readonly unsigned: boolean | undefined;
getSQLType(): string;
}
export interface MySqlDoubleConfig {
precision?: number;
scale?: number;
unsigned?: boolean;
}
export declare function double(): MySqlDoubleBuilderInitial<''>;
export declare function double(config?: MySqlDoubleConfig): MySqlDoubleBuilderInitial<''>;
export declare function double<TName extends string>(name: TName, config?: MySqlDoubleConfig): MySqlDoubleBuilderInitial<TName>;
@@ -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 './square-arrow-out-down-left.js';
//# sourceMappingURL=arrow-down-left-from-square.js.map
@@ -0,0 +1,443 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { getTranslation } from '@payloadcms/translations';
import React, { Fragment, useCallback, useId, useMemo } from 'react';
import { toast } from 'sonner';
import { Banner } from '../../elements/Banner/index.js';
import { Button } from '../../elements/Button/index.js';
import { clipboardCopy, clipboardPaste } from '../../elements/ClipboardAction/clipboardUtilities.js';
import { ClipboardAction } from '../../elements/ClipboardAction/index.js';
import { mergeFormStateFromClipboard, reduceFormStateByPath } from '../../elements/ClipboardAction/mergeFormStateFromClipboard.js';
import { DraggableSortableItem } from '../../elements/DraggableSortable/DraggableSortableItem/index.js';
import { DraggableSortable } from '../../elements/DraggableSortable/index.js';
import { ErrorPill } from '../../elements/ErrorPill/index.js';
import { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js';
import { FieldDescription } from '../../fields/FieldDescription/index.js';
import { FieldError } from '../../fields/FieldError/index.js';
import { FieldLabel } from '../../fields/FieldLabel/index.js';
import { useForm, useFormSubmitted } from '../../forms/Form/context.js';
import { extractRowsAndCollapsedIDs, toggleAllRows } from '../../forms/Form/rowHelpers.js';
import { NullifyLocaleField } from '../../forms/NullifyField/index.js';
import { useField } from '../../forms/useField/index.js';
import { withCondition } from '../../forms/withCondition/index.js';
import { useConfig } from '../../providers/Config/index.js';
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js';
import { useLocale } from '../../providers/Locale/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { scrollToID } from '../../utilities/scrollToID.js';
import { mergeFieldStyles } from '../mergeFieldStyles.js';
import { fieldBaseClass } from '../shared/index.js';
import { ArrayRow } from './ArrayRow.js';
import './index.scss';
const baseClass = 'array-field';
export const ArrayFieldComponent = props => {
const {
field,
field: {
name,
type,
admin: {
className,
description,
isSortable = true
} = {},
fields,
label,
localized,
maxRows,
minRows: minRowsProp,
required
},
forceRender = false,
path: pathFromProps,
permissions,
readOnly,
schemaPath: schemaPathFromProps,
validate
} = props;
const schemaPath = schemaPathFromProps ?? name;
const minRows = minRowsProp ?? (required ? 1 : 0);
const {
setDocFieldPreferences
} = useDocumentInfo();
const {
addFieldRow,
dispatchFields,
getFields,
moveFieldRow,
removeFieldRow,
replaceState,
setModified
} = useForm();
const submitted = useFormSubmitted();
const {
code: locale
} = useLocale();
const {
i18n,
t
} = useTranslation();
const {
config: {
localization
}
} = useConfig();
const editingDefaultLocale = (() => {
if (localization && localization.fallback) {
const defaultLocale = localization.defaultLocale;
return locale === defaultLocale;
}
return true;
})();
// Handle labeling for Arrays, Global Arrays, and Blocks
const getLabels = p => {
if ('labels' in p && p?.labels) {
return p.labels;
}
if ('labels' in p.field && p.field.labels) {
return {
plural: p.field.labels?.plural,
singular: p.field.labels?.singular
};
}
if ('label' in p.field && p.field.label) {
return {
plural: undefined,
singular: p.field.label
};
}
return {
plural: t('general:rows'),
singular: t('general:row')
};
};
const labels = getLabels(props);
const memoizedValidate = useCallback((value, options) => {
// alternative locales can be null
if (!editingDefaultLocale && value === null) {
return true;
}
if (typeof validate === 'function') {
return validate(value, {
...options,
maxRows,
minRows,
required
});
}
}, [maxRows, minRows, required, validate, editingDefaultLocale]);
const {
customComponents: {
AfterInput,
BeforeInput,
Description,
Error,
Label
} = {},
disabled,
errorPaths,
path,
rows = [],
showError,
valid,
value: value_0
} = useField({
hasRows: true,
potentiallyStalePath: pathFromProps,
validate: memoizedValidate
});
const componentId = useId();
const scrollIdPrefix = useMemo(() => `scroll-${componentId}`, [componentId]);
const addRow = useCallback(rowIndex => {
addFieldRow({
path,
rowIndex,
schemaPath
});
setTimeout(() => {
scrollToID(`${scrollIdPrefix}-row-${rowIndex}`);
}, 0);
}, [addFieldRow, path, schemaPath, scrollIdPrefix]);
const duplicateRow = useCallback(rowIndex_0 => {
dispatchFields({
type: 'DUPLICATE_ROW',
path,
rowIndex: rowIndex_0
});
setModified(true);
setTimeout(() => {
scrollToID(`${scrollIdPrefix}-row-${rowIndex_0}`);
}, 0);
}, [dispatchFields, path, scrollIdPrefix, setModified]);
const removeRow = useCallback(rowIndex_1 => {
removeFieldRow({
path,
rowIndex: rowIndex_1
});
}, [removeFieldRow, path]);
const moveRow = useCallback((moveFromIndex, moveToIndex) => {
moveFieldRow({
moveFromIndex,
moveToIndex,
path
});
}, [path, moveFieldRow]);
const toggleCollapseAll = useCallback(collapsed => {
const {
collapsedIDs,
updatedRows
} = toggleAllRows({
collapsed,
rows
});
setDocFieldPreferences(path, {
collapsed: collapsedIDs
});
dispatchFields({
type: 'SET_ALL_ROWS_COLLAPSED',
path,
updatedRows
});
}, [dispatchFields, path, rows, setDocFieldPreferences]);
const setCollapse = useCallback((rowID, collapsed_0) => {
const {
collapsedIDs: collapsedIDs_0,
updatedRows: updatedRows_0
} = extractRowsAndCollapsedIDs({
collapsed: collapsed_0,
rowID,
rows
});
dispatchFields({
type: 'SET_ROW_COLLAPSED',
path,
updatedRows: updatedRows_0
});
setDocFieldPreferences(path, {
collapsed: collapsedIDs_0
});
}, [dispatchFields, path, rows, setDocFieldPreferences]);
const copyRow = useCallback(rowIndex_2 => {
const formState = {
...getFields()
};
const clipboardResult = clipboardCopy({
type,
fields,
getDataToCopy: () => reduceFormStateByPath({
formState,
path,
rowIndex: rowIndex_2
}),
path,
rowIndex: rowIndex_2,
t
});
if (typeof clipboardResult === 'string') {
toast.error(clipboardResult);
} else {
toast.success(t('general:copied'));
}
}, [fields, getFields, path, t, type]);
const pasteRow = useCallback(rowIndex_3 => {
const formState_0 = {
...getFields()
};
const pasteArgs = {
onPaste: dataFromClipboard => {
const newState = mergeFormStateFromClipboard({
dataFromClipboard,
formState: formState_0,
path,
rowIndex: rowIndex_3
});
replaceState(newState);
setModified(true);
},
path,
schemaFields: fields,
t
};
const clipboardResult_0 = clipboardPaste(pasteArgs);
if (typeof clipboardResult_0 === 'string') {
toast.error(clipboardResult_0);
}
}, [fields, getFields, path, replaceState, setModified, t]);
const pasteField = useCallback(dataFromClipboard_0 => {
const formState_1 = {
...getFields()
};
const newState_0 = mergeFormStateFromClipboard({
dataFromClipboard: dataFromClipboard_0,
formState: formState_1,
path
});
replaceState(newState_0);
setModified(true);
}, [getFields, path, replaceState, setModified]);
const getDataToCopy = useCallback(() => reduceFormStateByPath({
formState: {
...getFields()
},
path
}), [getFields, path]);
const hasMaxRows = maxRows && rows.length >= maxRows;
const fieldErrorCount = errorPaths.length;
const fieldHasErrors = submitted && errorPaths.length > 0;
const showRequired = (readOnly || disabled) && rows.length === 0;
const showMinRows = rows.length && rows.length < minRows || required && rows.length === 0;
const styles = useMemo(() => mergeFieldStyles(field), [field]);
return /*#__PURE__*/_jsxs("div", {
className: [fieldBaseClass, baseClass, className, fieldHasErrors ? `${baseClass}--has-error` : `${baseClass}--has-no-error`].filter(Boolean).join(' '),
id: `field-${path.replace(/\./g, '__')}`,
style: styles,
children: [showError && /*#__PURE__*/_jsx(RenderCustomComponent, {
CustomComponent: Error,
Fallback: /*#__PURE__*/_jsx(FieldError, {
path: path,
showError: showError
})
}), /*#__PURE__*/_jsxs("header", {
className: `${baseClass}__header`,
children: [/*#__PURE__*/_jsxs("div", {
className: `${baseClass}__header-wrap`,
children: [/*#__PURE__*/_jsxs("div", {
className: `${baseClass}__header-content`,
children: [/*#__PURE__*/_jsx("h3", {
className: `${baseClass}__title`,
children: /*#__PURE__*/_jsx(RenderCustomComponent, {
CustomComponent: Label,
Fallback: /*#__PURE__*/_jsx(FieldLabel, {
as: "span",
label: label,
localized: localized,
path: path,
required: required
})
})
}), fieldHasErrors && fieldErrorCount > 0 && /*#__PURE__*/_jsx(ErrorPill, {
count: fieldErrorCount,
i18n: i18n,
withMessage: true
})]
}), /*#__PURE__*/_jsxs("ul", {
className: `${baseClass}__header-actions`,
children: [rows?.length > 0 && /*#__PURE__*/_jsxs(Fragment, {
children: [/*#__PURE__*/_jsx("li", {
children: /*#__PURE__*/_jsx("button", {
className: `${baseClass}__header-action`,
onClick: () => toggleCollapseAll(true),
type: "button",
children: t('fields:collapseAll')
})
}), /*#__PURE__*/_jsx("li", {
children: /*#__PURE__*/_jsx("button", {
className: `${baseClass}__header-action`,
onClick: () => toggleCollapseAll(false),
type: "button",
children: t('fields:showAll')
})
})]
}), /*#__PURE__*/_jsx("li", {
children: /*#__PURE__*/_jsx(ClipboardAction, {
allowCopy: rows?.length > 0,
allowPaste: !readOnly,
className: `${baseClass}__header-action`,
disabled: disabled,
fields: fields,
getDataToCopy: getDataToCopy,
onPaste: pasteField,
path: path,
type: type
})
})]
})]
}), /*#__PURE__*/_jsx(RenderCustomComponent, {
CustomComponent: Description,
Fallback: /*#__PURE__*/_jsx(FieldDescription, {
description: description,
path: path
})
})]
}), /*#__PURE__*/_jsx(NullifyLocaleField, {
fieldValue: value_0,
localized: localized,
path: path,
readOnly: readOnly
}), BeforeInput, (rows?.length > 0 || !valid && (showRequired || showMinRows)) && /*#__PURE__*/_jsxs(DraggableSortable, {
className: `${baseClass}__draggable-rows`,
ids: rows.map(row => row.id),
onDragEnd: ({
moveFromIndex: moveFromIndex_0,
moveToIndex: moveToIndex_0
}) => moveRow(moveFromIndex_0, moveToIndex_0),
children: [rows.map((rowData, i) => {
const {
id: rowID_0,
isLoading
} = rowData;
const rowPath = `${path}.${i}`;
const rowErrorCount = errorPaths?.filter(errorPath => errorPath.startsWith(rowPath + '.')).length;
return /*#__PURE__*/_jsx(DraggableSortableItem, {
disabled: readOnly || disabled || !isSortable,
id: rowID_0,
children: draggableSortableItemProps => /*#__PURE__*/_jsx(ArrayRow, {
...draggableSortableItemProps,
addRow: addRow,
copyRow: copyRow,
CustomRowLabel: rows?.[i]?.customComponents?.RowLabel,
duplicateRow: duplicateRow,
errorCount: rowErrorCount,
fields: fields,
forceRender: forceRender,
hasMaxRows: hasMaxRows,
isLoading: isLoading,
isSortable: isSortable,
labels: labels,
moveRow: moveRow,
parentPath: path,
pasteRow: pasteRow,
path: rowPath,
permissions: permissions,
readOnly: readOnly || disabled,
removeRow: removeRow,
row: rowData,
rowCount: rows?.length,
rowIndex: i,
schemaPath: schemaPath,
scrollIdPrefix: scrollIdPrefix,
setCollapse: setCollapse
})
}, rowID_0);
}), !valid && /*#__PURE__*/_jsxs(React.Fragment, {
children: [showRequired && /*#__PURE__*/_jsx(Banner, {
children: t('validation:fieldHasNo', {
label: getTranslation(labels.plural, i18n)
})
}), showMinRows && /*#__PURE__*/_jsx(Banner, {
type: "error",
children: t('validation:requiresAtLeast', {
count: minRows,
label: getTranslation(minRows > 1 ? labels.plural : labels.singular, i18n) || t(minRows > 1 ? 'general:rows' : 'general:row')
})
})]
})]
}), !hasMaxRows && !readOnly && /*#__PURE__*/_jsx(Button, {
buttonStyle: "icon-label",
className: `${baseClass}__add-row`,
disabled: disabled,
icon: "plus",
iconPosition: "left",
iconStyle: "with-border",
onClick: () => {
void addRow(value_0 || 0);
},
children: t('fields:addLabel', {
label: getTranslation(labels.singular, i18n)
})
}), AfterInput]
});
};
export const ArrayField = withCondition(ArrayFieldComponent);
//# sourceMappingURL=index.js.map
@@ -0,0 +1,119 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern = /^(\d+)(-?[врмт][и])?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^((пр)?н\.?\s?е\.?)/i,
abbreviated: /^((пр)?н\.?\s?е\.?)/i,
wide: /^(пред нашата ера|нашата ера)/i,
};
const parseEraPatterns = {
any: [/^п/i, /^н/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234](-?[врт]?и?)? кв.?/i,
wide: /^[1234](-?[врт]?и?)? квартал/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchDayPatterns = {
narrow: /^[нпвсч]/i,
short: /^(не|по|вт|ср|че|пе|са)/i,
abbreviated: /^(нед|пон|вто|сре|чет|пет|саб)/i,
wide: /^(недела|понеделник|вторник|среда|четврток|петок|сабота)/i,
};
const parseDayPatterns = {
narrow: [/^н/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
any: [/^н[ед]/i, /^п[он]/i, /^вт/i, /^ср/i, /^ч[ет]/i, /^п[ет]/i, /^с[аб]/i],
};
const matchMonthPatterns = {
abbreviated: /^(јан|фев|мар|апр|мај|јун|јул|авг|сеп|окт|ноем|дек)/i,
wide: /^(јануари|февруари|март|април|мај|јуни|јули|август|септември|октомври|ноември|декември)/i,
};
const parseMonthPatterns = {
any: [
/^ја/i,
/^Ф/i,
/^мар/i,
/^ап/i,
/^мај/i,
/^јун/i,
/^јул/i,
/^ав/i,
/^се/i,
/^окт/i,
/^но/i,
/^де/i,
],
};
const matchDayPeriodPatterns = {
any: /^(претп|попл|полноќ|утро|пладне|вечер|ноќ)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /претпладне/i,
pm: /попладне/i,
midnight: /полноќ/i,
noon: /напладне/i,
morning: /наутро/i,
afternoon: /попладне/i,
evening: /навечер/i,
night: /ноќе/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",
}),
});
@@ -0,0 +1,136 @@
import { registerInstrumentations } from '@opentelemetry/instrumentation';
/** Exported only for tests. */
const INSTRUMENTED = {};
/**
* Instrument an OpenTelemetry instrumentation once.
* This will skip running instrumentation again if it was already instrumented.
*/
function generateInstrumentOnce(
name,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
creatorOrClass,
optionsCallback,
) {
if (optionsCallback) {
return _generateInstrumentOnceWithOptions(
name,
creatorOrClass ,
optionsCallback,
);
}
return _generateInstrumentOnce(name, creatorOrClass );
}
// The plain version without handling of options
// Should not be used with custom options that are mutated in the creator!
function _generateInstrumentOnce(
name,
creator,
) {
return Object.assign(
(options) => {
const instrumented = INSTRUMENTED[name] ;
if (instrumented) {
// If options are provided, ensure we update them
if (options) {
instrumented.setConfig(options);
}
return instrumented;
}
const instrumentation = creator(options);
INSTRUMENTED[name] = instrumentation;
registerInstrumentations({
instrumentations: [instrumentation],
});
return instrumentation;
},
{ id: name },
);
}
// This version handles options properly
function _generateInstrumentOnceWithOptions
(
name,
instrumentationClass,
optionsCallback,
) {
return Object.assign(
(_options) => {
const options = optionsCallback(_options);
const instrumented = INSTRUMENTED[name] ;
if (instrumented) {
// Ensure we update options
instrumented.setConfig(options);
return instrumented;
}
const instrumentation = new instrumentationClass(options) ;
INSTRUMENTED[name] = instrumentation;
registerInstrumentations({
instrumentations: [instrumentation],
});
return instrumentation;
},
{ id: name },
);
}
/**
* Ensure a given callback is called when the instrumentation is actually wrapping something.
* This can be used to ensure some logic is only called when the instrumentation is actually active.
*
* This function returns a function that can be invoked with a callback.
* This callback will either be invoked immediately
* (e.g. if the instrumentation was already wrapped, or if _wrap could not be patched),
* or once the instrumentation is actually wrapping something.
*
* Make sure to call this function right after adding the instrumentation, otherwise it may be too late!
* The returned callback can be used any time, and also multiple times.
*/
function instrumentWhenWrapped(instrumentation) {
let isWrapped = false;
let callbacks = [];
if (!hasWrap(instrumentation)) {
isWrapped = true;
} else {
const originalWrap = instrumentation['_wrap'];
instrumentation['_wrap'] = (...args) => {
isWrapped = true;
callbacks.forEach(callback => callback());
callbacks = [];
return originalWrap(...args);
};
}
const registerCallback = (callback) => {
if (isWrapped) {
callback();
} else {
callbacks.push(callback);
}
};
return registerCallback;
}
function hasWrap(
instrumentation,
) {
return typeof (instrumentation )['_wrap'] === 'function';
}
export { INSTRUMENTED, generateInstrumentOnce, instrumentWhenWrapped };
//# sourceMappingURL=instrument.js.map
@@ -0,0 +1 @@
{"version":3,"file":"chevron-up-circle.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,2 @@
import { trimCharsEnd } from "../fp";
export = trimCharsEnd;
@@ -0,0 +1,6 @@
/**
* This is a shim for the Statsig integration.
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
*/
export declare const statsigIntegrationShim: (_options?: unknown) => import("@sentry/core").Integration;
//# sourceMappingURL=statsig.d.ts.map
@@ -0,0 +1,34 @@
'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import { XIcon } from '../../../icons/X/index.js';
import './index.scss';
const baseClass = 'clear-indicator';
export const ClearIndicator = props => {
const {
clearValue,
innerProps: {
ref,
...restInnerProps
}
} = props;
return /*#__PURE__*/_jsx("div", {
className: baseClass,
// TODO Fix this - Broke with React 19 types
ref: typeof ref === 'string' ? null : ref,
...restInnerProps,
onKeyDown: e => {
if (e.key === 'Enter') {
clearValue();
e.stopPropagation();
}
},
role: "button",
tabIndex: 0,
children: /*#__PURE__*/_jsx(XIcon, {
className: `${baseClass}__icon`
})
});
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1,20 @@
/**
* Result extraction functions for MCP server instrumentation
*
* Handles extraction of attributes from tool and prompt execution results.
*/
/**
* Extract tool result attributes for span instrumentation
* @param result - Tool execution result
* @param recordOutputs - Whether to include actual content or just metadata (counts, error status)
* @returns Attributes extracted from tool result content
*/
export declare function extractToolResultAttributes(result: unknown, recordOutputs: boolean): Record<string, string | number | boolean>;
/**
* Extract prompt result attributes for span instrumentation
* @param result - Prompt execution result
* @param recordOutputs - Whether to include actual content or just metadata (counts)
* @returns Attributes extracted from prompt result
*/
export declare function extractPromptResultAttributes(result: unknown, recordOutputs: boolean): Record<string, string | number | boolean>;
//# sourceMappingURL=resultExtraction.d.ts.map
@@ -0,0 +1,11 @@
/**
* 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 type { LexicalEditor, LexicalNode } from 'lexical';
import { LexicalCommandLog } from './useLexicalCommandsLog';
export type CustomPrintNodeFn = (node: LexicalNode, obfuscateText?: boolean) => string | undefined;
export declare function generateContent(editor: LexicalEditor, commandsLog: LexicalCommandLog, exportDOM: boolean, customPrintNode?: CustomPrintNodeFn, obfuscateText?: boolean): string;
@@ -0,0 +1,483 @@
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/fy/_lib/formatDistance.mjs
var formatDistanceLocale = {
lessThanXSeconds: {
one: "minder as 1 sekonde",
other: "minder as {{count}} sekonden"
},
xSeconds: {
one: "1 sekonde",
other: "{{count}} sekonden"
},
halfAMinute: "oardel min\xFAt",
lessThanXMinutes: {
one: "minder as 1 min\xFAt",
other: "minder as {{count}} minuten"
},
xMinutes: {
one: "1 min\xFAt",
other: "{{count}} minuten"
},
aboutXHours: {
one: "sawat 1 oere",
other: "sawat {{count}} oere"
},
xHours: {
one: "1 oere",
other: "{{count}} oere"
},
xDays: {
one: "1 dei",
other: "{{count}} dagen"
},
aboutXWeeks: {
one: "sawat 1 wike",
other: "sawat {{count}} wiken"
},
xWeeks: {
one: "1 wike",
other: "{{count}} wiken"
},
aboutXMonths: {
one: "sawat 1 moanne",
other: "sawat {{count}} moannen"
},
xMonths: {
one: "1 moanne",
other: "{{count}} moannen"
},
aboutXYears: {
one: "sawat 1 jier",
other: "sawat {{count}} jier"
},
xYears: {
one: "1 jier",
other: "{{count}} jier"
},
overXYears: {
one: "mear as 1 jier",
other: "mear as {{count}}s jier"
},
almostXYears: {
one: "hast 1 jier",
other: "hast {{count}} jier"
}
};
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}}", String(count));
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "oer " + result;
} else {
return result + " lyn";
}
}
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/fy/_lib/formatLong.mjs
var dateFormats = {
full: "EEEE d MMMM y",
long: "d MMMM y",
medium: "d MMM y",
short: "dd-MM-y"
};
var timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm"
};
var dateTimeFormats = {
full: "{{date}} 'om' {{time}}",
long: "{{date}} 'om' {{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/fy/_lib/formatRelative.mjs
var formatRelativeLocale = {
lastWeek: "'\xF4fr\xFBne' eeee 'om' p",
yesterday: "'juster om' p",
today: "'hjoed om' p",
tomorrow: "'moarn om' p",
nextWeek: "eeee 'om' 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/fy/_lib/localize.mjs
var eraValues = {
narrow: ["f.K.", "n.K."],
abbreviated: ["f.Kr.", "n.Kr."],
wide: ["foar Kristus", "nei Kristus"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["K1", "K2", "K3", "K4"],
wide: ["1e fearnsjier", "2e fearnsjier", "3e fearnsjier", "4e fearnsjier"]
};
var monthValues = {
narrow: ["j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
abbreviated: [
"jan.",
"feb.",
"mrt.",
"apr.",
"mai.",
"jun.",
"jul.",
"aug.",
"sep.",
"okt.",
"nov.",
"des."],
wide: [
"jannewaris",
"febrewaris",
"maart",
"april",
"maaie",
"juny",
"july",
"augustus",
"septimber",
"oktober",
"novimber",
"desimber"]
};
var dayValues = {
narrow: ["s", "m", "t", "w", "t", "f", "s"],
short: ["si", "mo", "ti", "wo", "to", "fr", "so"],
abbreviated: ["snein", "moa", "tii", "woa", "ton", "fre", "sneon"],
wide: [
"snein",
"moandei",
"tiisdei",
"woansdei",
"tongersdei",
"freed",
"sneon"]
};
var dayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "middernacht",
noon: "middei",
morning: "moarns",
afternoon: "middeis",
evening: "j\xFBns",
night: "nachts"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "middernacht",
noon: "middei",
morning: "moarns",
afternoon: "middeis",
evening: "j\xFBns",
night: "nachts"
},
wide: {
am: "AM",
pm: "PM",
midnight: "middernacht",
noon: "middei",
morning: "moarns",
afternoon: "middeis",
evening: "j\xFBns",
night: "nachts"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
var number = Number(dirtyNumber);
return number + "e";
};
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"
})
};
// 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/fy/_lib/match.mjs
var matchOrdinalNumberPattern = /^(\d+)e?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^([fn]\.? ?K\.?)/,
abbreviated: /^([fn]\. ?Kr\.?)/,
wide: /^((foar|nei) Kristus)/
};
var parseEraPatterns = {
any: [/^f/, /^n/]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^K[1234]/i,
wide: /^[1234]e fearnsjier/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan.|feb.|mrt.|apr.|mai.|jun.|jul.|aug.|sep.|okt.|nov.|des.)/i,
wide: /^(jannewaris|febrewaris|maart|april|maaie|juny|july|augustus|septimber|oktober|novimber|desimber)/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: [
/^jan/i,
/^feb/i,
/^m(r|a)/i,
/^apr/i,
/^mai/i,
/^jun/i,
/^jul/i,
/^aug/i,
/^sep/i,
/^okt/i,
/^nov/i,
/^des/i]
};
var matchDayPatterns = {
narrow: /^[smtwf]/i,
short: /^(si|mo|ti|wo|to|fr|so)/i,
abbreviated: /^(snein|moa|tii|woa|ton|fre|sneon)/i,
wide: /^(snein|moandei|tiisdei|woansdei|tongersdei|freed|sneon)/i
};
var parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^sn/i, /^mo/i, /^ti/i, /^wo/i, /^to/i, /^fr/i, /^sn/i]
};
var matchDayPeriodPatterns = {
any: /^(am|pm|middernacht|middeis|moarns|middei|jûns|nachts)/i
};
var parseDayPeriodPatterns = {
any: {
am: /^am/i,
pm: /^pm/i,
midnight: /^middernacht/i,
noon: /^middei/i,
morning: /moarns/i,
afternoon: /^middeis/i,
evening: /jûns/i,
night: /nachts/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/fy.mjs
var fy = {
code: "fy",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 4
}
};
// lib/locale/fy/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), {}, {
fy: fy }) });
//# debugId=C5DF32F9711547B064756e2164756e21
})();
//# sourceMappingURL=cdn.js.map
@@ -0,0 +1 @@
{"version":3,"file":"id-card.js","sources":["../../../src/icons/id-card.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name IdCard\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgMTBoMiIgLz4KICA8cGF0aCBkPSJNMTYgMTRoMiIgLz4KICA8cGF0aCBkPSJNNi4xNyAxNWEzIDMgMCAwIDEgNS42NiAwIiAvPgogIDxjaXJjbGUgY3g9IjkiIGN5PSIxMSIgcj0iMiIgLz4KICA8cmVjdCB4PSIyIiB5PSI1IiB3aWR0aD0iMjAiIGhlaWdodD0iMTQiIHJ4PSIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/id-card\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 IdCard = createLucideIcon('IdCard', [\n ['path', { d: 'M16 10h2', key: '8sgtl7' }],\n ['path', { d: 'M16 14h2', key: 'epxaof' }],\n ['path', { d: 'M6.17 15a3 3 0 0 1 5.66 0', key: 'n6f512' }],\n ['circle', { cx: '9', cy: '11', r: '2', key: 'yxgjnd' }],\n ['rect', { x: '2', y: '5', width: '20', height: '14', rx: '2', key: 'qneu4z' }],\n]);\n\nexport default IdCard;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC1D,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAG,KAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,QAAQ,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"calendar-x.js","sources":["../../../src/icons/calendar-x.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CalendarX\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAydjQiIC8+CiAgPHBhdGggZD0iTTE2IDJ2NCIgLz4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjQiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0zIDEwaDE4IiAvPgogIDxwYXRoIGQ9Im0xNCAxNC00IDQiIC8+CiAgPHBhdGggZD0ibTEwIDE0IDQgNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/calendar-x\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CalendarX = createLucideIcon('CalendarX', [\n ['path', { d: 'M8 2v4', key: '1cmpym' }],\n ['path', { d: 'M16 2v4', key: '4m81vk' }],\n ['rect', { width: '18', height: '18', x: '3', y: '4', rx: '2', key: '1hopcy' }],\n ['path', { d: 'M3 10h18', key: '8toen8' }],\n ['path', { d: 'm14 14-4 4', key: 'rymu2i' }],\n ['path', { d: 'm10 14 4 4', key: '3sz06r' }],\n]);\n\nexport default CalendarX;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,11 @@
import type { Locale } from "./types.js";
/**
* @category Locales
* @summary Chinese Traditional locale.
* @language Chinese Traditional
* @iso-639-2 zho
* @author tonypai [@tpai](https://github.com/tpai)
* @author Jack Hsu [@jackhsu978](https://github.com/jackhsu978)
* @author Terrence Lam [@skyuplam](https://github.com/skyuplam)
*/
export declare const zhTW: Locale;
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [suren-atoyan]
patreon: suren_atoyan
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,33 @@
import { entityKind } from "../entity.js";
class PgPolicy {
constructor(name, config) {
this.name = name;
if (config) {
this.as = config.as;
this.for = config.for;
this.to = config.to;
this.using = config.using;
this.withCheck = config.withCheck;
}
}
static [entityKind] = "PgPolicy";
as;
for;
to;
using;
withCheck;
/** @internal */
_linkedTable;
link(table) {
this._linkedTable = table;
return this;
}
}
function pgPolicy(name, config) {
return new PgPolicy(name, config);
}
export {
PgPolicy,
pgPolicy
};
//# sourceMappingURL=policies.js.map
@@ -0,0 +1 @@
module.exports={C:{"5":0.00585,"52":0.02339,"75":0.00585,"78":0.01169,"107":0.00585,"115":0.11109,"117":0.00585,"128":0.00585,"133":0.01169,"136":0.01754,"139":0.00585,"140":0.05262,"141":0.00585,"142":0.00585,"143":0.00585,"144":0.02339,"145":0.67241,"146":1.06415,_:"2 3 4 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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 108 109 110 111 112 113 114 116 118 119 120 121 122 123 124 125 126 127 129 130 131 132 134 135 137 138 147 148 149 3.5 3.6"},D:{"38":0.00585,"39":0.02924,"40":0.02924,"41":0.02924,"42":0.02924,"43":0.02924,"44":0.02924,"45":0.02924,"46":0.02924,"47":0.02924,"48":0.02924,"49":0.09355,"50":0.02924,"51":0.02924,"52":0.02924,"53":0.02924,"54":0.02924,"55":0.02924,"56":0.02924,"57":0.02924,"58":0.02924,"59":0.02924,"60":0.02924,"69":0.00585,"79":0.02924,"81":0.00585,"85":0.01169,"87":0.02339,"100":0.00585,"101":0.01754,"103":0.02339,"104":0.00585,"106":0.00585,"108":0.01754,"109":0.50284,"111":0.01169,"112":0.00585,"114":0.02924,"116":0.07016,"117":0.8712,"119":0.01169,"120":0.07601,"121":0.01169,"122":0.11694,"123":0.01754,"124":0.01754,"125":0.20465,"126":0.04678,"127":0.01169,"128":0.05262,"129":0.01169,"130":0.21049,"131":0.07016,"132":0.05262,"133":0.08186,"134":0.04093,"135":0.06432,"136":0.05262,"137":0.04678,"138":0.15787,"139":0.23973,"140":0.14033,"141":6.40247,"142":11.3958,"143":16.59963,"144":0.01754,"145":0.00585,_:"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 61 62 63 64 65 66 67 68 70 71 72 73 74 75 76 77 78 80 83 84 86 88 89 90 91 92 93 94 95 96 97 98 99 102 105 107 110 113 115 118 146"},F:{"93":0.02924,"95":0.00585,"102":0.00585,"121":0.00585,"122":0.01754,"123":0.02339,"124":3.16323,"125":0.97645,_:"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 94 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00585,"109":0.04093,"120":0.00585,"130":0.00585,"131":0.00585,"132":0.00585,"133":0.00585,"134":0.00585,"135":0.02339,"136":0.00585,"138":0.01169,"139":0.00585,"140":0.01169,"141":0.04093,"142":1.7541,"143":4.53143,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 121 122 123 124 125 126 127 128 129 137"},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 12.1 15.1 15.4","11.1":0.00585,"13.1":0.00585,"14.1":0.01169,"15.2-15.3":0.00585,"15.5":0.00585,"15.6":0.05262,"16.0":0.00585,"16.1":0.01169,"16.2":0.00585,"16.3":0.01169,"16.4":0.00585,"16.5":0.00585,"16.6":0.08771,"17.0":0.00585,"17.1":0.05262,"17.2":0.01754,"17.3":0.01169,"17.4":0.01754,"17.5":0.03508,"17.6":0.12863,"18.0":0.01754,"18.1":0.02339,"18.2":0.01169,"18.3":0.05262,"18.4":0.04678,"18.5-18.6":0.10525,"26.0":0.08771,"26.1":0.52038,"26.2":0.12863,"26.3":0.00585},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00217,"5.0-5.1":0,"6.0-6.1":0.00433,"7.0-7.1":0.00325,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00866,"10.0-10.2":0.00108,"10.3":0.01516,"11.0-11.2":0.18629,"11.3-11.4":0.00542,"12.0-12.1":0.00433,"12.2-12.5":0.04874,"13.0-13.1":0.00108,"13.2":0.00758,"13.3":0.00217,"13.4-13.7":0.00758,"14.0-14.4":0.01516,"14.5-14.8":0.01625,"15.0-15.1":0.01733,"15.2-15.3":0.013,"15.4":0.01408,"15.5":0.01516,"15.6-15.8":0.23503,"16.0":0.02708,"16.1":0.05199,"16.2":0.02708,"16.3":0.04874,"16.4":0.01191,"16.5":0.02058,"16.6-16.7":0.30543,"17.0":0.01733,"17.1":0.02816,"17.2":0.02058,"17.3":0.03141,"17.4":0.05307,"17.5":0.10398,"17.6-17.7":0.24045,"18.0":0.05416,"18.1":0.11264,"18.2":0.05957,"18.3":0.19388,"18.4":0.09965,"18.5-18.7":7.15497,"26.0":0.13972,"26.1":1.16217,"26.2":0.22095,"26.3":0.00975},P:{"4":0.02079,"22":0.0104,"23":0.0104,"24":0.0104,"25":0.0104,"26":0.0104,"27":0.04158,"28":0.06237,"29":1.49694,_:"20 21 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.03732,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00003},A:{"11":0.13448,_:"6 7 8 9 10 5.5"},K:{"0":0.23672,_:"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.00415},O:{"0":0.01661},H:{"0":0},L:{"0":32.0286},R:{_:"0"},M:{"0":0.23672}};
@@ -0,0 +1,104 @@
import type { IncomingMessage, RequestOptions } from 'node:http';
import type { SentryHttpInstrumentationOptions } from './SentryHttpInstrumentation';
interface HttpOptions {
/**
* Whether breadcrumbs should be recorded for outgoing requests.
* Defaults to true
*/
breadcrumbs?: boolean;
/**
* Whether to create spans for requests or not.
* As of now, creates spans for incoming requests, but not outgoing requests.
*
* @default `true`
*/
spans?: boolean;
/**
* Whether the integration should create [Sessions](https://docs.sentry.io/product/releases/health/#sessions) for incoming requests to track the health and crash-free rate of your releases in Sentry.
* Read more about Release Health: https://docs.sentry.io/product/releases/health/
*
* Defaults to `true`.
*/
trackIncomingRequestsAsSessions?: boolean;
/**
* Number of milliseconds until sessions tracked with `trackIncomingRequestsAsSessions` will be flushed as a session aggregate.
*
* Defaults to `60000` (60s).
*/
sessionFlushingDelayMS?: number;
/**
* Do not capture spans or breadcrumbs for outgoing HTTP requests to URLs where the given callback returns `true`.
* This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.
*
* The `url` param contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.
* For example: `'https://someService.com/users/details?id=123'`
*
* The `request` param contains the original {@type RequestOptions} object used to make the outgoing request.
* You can use it to filter on additional properties like method, headers, etc.
*/
ignoreOutgoingRequests?: (url: string, request: RequestOptions) => boolean;
/**
* Do not capture spans for incoming HTTP requests to URLs where the given callback returns `true`.
* Spans will be non recording if tracing is disabled.
*
* The `urlPath` param consists of the URL path and query string (if any) of the incoming request.
* For example: `'/users/details?id=123'`
*
* The `request` param contains the original {@type IncomingMessage} object of the incoming request.
* You can use it to filter on additional properties like method, headers, etc.
*/
ignoreIncomingRequests?: (urlPath: string, request: IncomingMessage) => boolean;
/**
* Do not capture spans for incoming HTTP requests with the given status codes.
* By default, spans with some 3xx and 4xx status codes are ignored (see @default).
* Expects an array of status codes or a range of status codes, e.g. [[300,399], 404] would ignore 3xx and 404 status codes.
*
* @default `[[401, 404], [301, 303], [305, 399]]`
*/
dropSpansForIncomingRequestStatusCodes?: (number | [number, number])[];
/**
* Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.
* This can be useful for long running requests where the body is not needed and we want to avoid capturing it.
*
* @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the incoming request.
* @param request Contains the {@type RequestOptions} object used to make the incoming request.
*/
ignoreIncomingRequestBody?: (url: string, request: RequestOptions) => boolean;
/**
* Whether to automatically ignore common static asset requests like favicon.ico, robots.txt, etc.
* This helps reduce noise in your transactions.
*
* @default `true`
*/
ignoreStaticAssets?: boolean;
/**
* Controls the maximum size of incoming HTTP request bodies attached to events.
*
* Available options:
* - 'none': No request bodies will be attached
* - 'small': Request bodies up to 1,000 bytes will be attached
* - 'medium': Request bodies up to 10,000 bytes will be attached (default)
* - 'always': Request bodies will always be attached
*
* Note that even with 'always' setting, bodies exceeding 1MB will never be attached
* for performance and security reasons.
*
* @default 'medium'
*/
maxIncomingRequestBodySize?: 'none' | 'small' | 'medium' | 'always';
/**
* If true, do not generate spans for incoming requests at all.
* This is used by Remix to avoid generating spans for incoming requests, as it generates its own spans.
*/
disableIncomingRequestSpans?: boolean;
}
export declare const instrumentSentryHttp: ((options?: SentryHttpInstrumentationOptions | undefined) => import("@opentelemetry/instrumentation").Instrumentation<import("@opentelemetry/instrumentation").InstrumentationConfig>) & {
id: string;
};
/**
* The http integration instruments Node's internal http and https modules.
* It creates breadcrumbs for outgoing HTTP requests which will be attached to the currently active span.
*/
export declare const httpIntegration: (options?: HttpOptions | undefined) => import("@sentry/core").Integration;
export {};
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,7 @@
"use strict";
exports.isEqual = void 0;
var _index = require("../isEqual.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const isEqual = (exports.isEqual = (0, _index2.convertToFP)(_index.isEqual, 2));
@@ -0,0 +1,2 @@
import { isMatchWith } from "../fp";
export = isMatchWith;
@@ -0,0 +1,90 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { getTranslation } from '@payloadcms/translations';
import React from 'react';
import { useEditDepth } from '../../../providers/EditDepth/index.js';
import { useTranslation } from '../../../providers/Translation/index.js';
import './index.scss';
const baseClass = 'radio-input';
export const Radio = props => {
const $ = _c(16);
const {
isSelected,
onChange,
option,
path,
readOnly,
uuid
} = props;
const {
i18n
} = useTranslation();
const editDepth = useEditDepth();
const id = `field-${path}-${option.value}${editDepth > 1 ? `-${editDepth}` : ""}${uuid ? `-${uuid}` : ""}`;
const t0 = isSelected && `${baseClass}--is-selected`;
let t1;
if ($[0] !== t0) {
t1 = [baseClass, t0].filter(Boolean);
$[0] = t0;
$[1] = t1;
} else {
t1 = $[1];
}
const t2 = t1.join(" ");
let t3;
if ($[2] !== onChange || $[3] !== option.value) {
t3 = () => typeof onChange === "function" ? onChange(option.value) : null;
$[2] = onChange;
$[3] = option.value;
$[4] = t3;
} else {
t3 = $[4];
}
let t4;
if ($[5] !== i18n || $[6] !== id || $[7] !== isSelected || $[8] !== option.label || $[9] !== path || $[10] !== readOnly || $[11] !== t2 || $[12] !== t3) {
const t5 = _jsx("input", {
checked: isSelected,
disabled: readOnly,
id,
name: path,
onChange: t3,
type: "radio"
});
const t6 = readOnly && `${baseClass}__styled-radio--disabled`;
let t7;
if ($[14] !== t6) {
t7 = [`${baseClass}__styled-radio`, t6].filter(Boolean);
$[14] = t6;
$[15] = t7;
} else {
t7 = $[15];
}
t4 = _jsx("label", {
htmlFor: id,
children: _jsxs("div", {
className: t2,
children: [t5, _jsx("span", {
className: t7.join(" ")
}), _jsx("span", {
className: `${baseClass}__label`,
children: getTranslation(option.label, i18n)
})]
})
});
$[5] = i18n;
$[6] = id;
$[7] = isSelected;
$[8] = option.label;
$[9] = path;
$[10] = readOnly;
$[11] = t2;
$[12] = t3;
$[13] = t4;
} else {
t4 = $[13];
}
return t4;
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1,46 @@
import { Pool, type PoolConfig } from '@neondatabase/serverless';
import type { Cache } from "../cache/core/cache.cjs";
import { entityKind } from "../entity.cjs";
import type { Logger } from "../logger.cjs";
import { PgDatabase } from "../pg-core/db.cjs";
import { PgDialect } from "../pg-core/dialect.cjs";
import { type RelationalSchemaConfig, type TablesRelationalConfig } from "../relations.cjs";
import { type DrizzleConfig } from "../utils.cjs";
import type { NeonClient, NeonQueryResultHKT } from "./session.cjs";
import { NeonSession } from "./session.cjs";
export interface NeonDriverOptions {
logger?: Logger;
cache?: Cache;
}
export declare class NeonDriver {
private client;
private dialect;
private options;
static readonly [entityKind]: string;
constructor(client: NeonClient, dialect: PgDialect, options?: NeonDriverOptions);
createSession(schema: RelationalSchemaConfig<TablesRelationalConfig> | undefined): NeonSession<Record<string, unknown>, TablesRelationalConfig>;
}
export declare class NeonDatabase<TSchema extends Record<string, unknown> = Record<string, never>> extends PgDatabase<NeonQueryResultHKT, TSchema> {
static readonly [entityKind]: string;
}
export declare function drizzle<TSchema extends Record<string, unknown> = Record<string, never>, TClient extends NeonClient = Pool>(...params: [
TClient | string
] | [
TClient | string,
DrizzleConfig<TSchema>
] | [
(DrizzleConfig<TSchema> & ({
connection: string | PoolConfig;
} | {
client: TClient;
}) & {
ws?: any;
})
]): NeonDatabase<TSchema> & {
$client: NeonClient extends TClient ? Pool : TClient;
};
export declare namespace drizzle {
function mock<TSchema extends Record<string, unknown> = Record<string, never>>(config?: DrizzleConfig<TSchema>): NeonDatabase<TSchema> & {
$client: '$client is not available on drizzle.mock()';
};
}
@@ -0,0 +1,67 @@
import { describe, it, expect } from 'vitest';
import { fieldSchemasToFormState } from './index.js';
describe('Form - fieldSchemasToFormState', () => {
const defaultValue = 'Default';
it('populates default value - normal fields', async () => {
const fieldSchema = [{
name: 'text',
type: 'text',
defaultValue,
label: 'Text'
}];
const state = await fieldSchemasToFormState({
req: {},
fields: fieldSchema
});
expect(state.text.value).toBe(defaultValue);
});
it('field value overrides defaultValue - normal fields', async () => {
const value = 'value';
const data = {
text: value
};
const fieldSchema = [{
name: 'text',
type: 'text',
defaultValue,
label: 'Text'
}];
const state = await fieldSchemasToFormState({
req: {},
data,
fields: fieldSchema
});
expect(state.text.value).toBe(value);
});
it('populates default value from a function - normal fields', async () => {
const user = {
email: 'user@example.com'
};
const locale = 'en';
const fieldSchema = [{
name: 'text',
type: 'text',
defaultValue: args => {
if (!args.locale) {
return 'missing locale';
}
if (!args.user) {
return 'missing user';
}
return 'Default';
},
label: 'Text'
}];
const state = await fieldSchemasToFormState({
req: {
locale: 'en',
user: {}
},
fields: fieldSchema,
locale,
user
});
expect(state.text.value).toBe(defaultValue);
});
});
//# sourceMappingURL=fieldSchemasToFormState.spec.js.map
@@ -0,0 +1,191 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.js";
const eraValues = {
narrow: ["v.Chr.", "n.Chr."],
abbreviated: ["v.Chr.", "n.Chr."],
wide: ["vor Christus", "nach Christus"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1. Quartal", "2. Quartal", "3. Quartal", "4. Quartal"],
};
// Note: in German, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mär",
"Apr",
"Mai",
"Jun",
"Jul",
"Aug",
"Sep",
"Okt",
"Nov",
"Dez",
],
wide: [
"Januar",
"Februar",
"März",
"April",
"Mai",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"Dezember",
],
};
// https://st.unicode.org/cldr-apps/v#/de/Gregorian/
const formattingMonthValues = {
narrow: monthValues.narrow,
abbreviated: [
"Jan.",
"Feb.",
"März",
"Apr.",
"Mai",
"Juni",
"Juli",
"Aug.",
"Sep.",
"Okt.",
"Nov.",
"Dez.",
],
wide: monthValues.wide,
};
const dayValues = {
narrow: ["S", "M", "D", "M", "D", "F", "S"],
short: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
abbreviated: ["So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."],
wide: [
"Sonntag",
"Montag",
"Dienstag",
"Mittwoch",
"Donnerstag",
"Freitag",
"Samstag",
],
};
// https://www.unicode.org/cldr/charts/32/summary/de.html#1881
const dayPeriodValues = {
narrow: {
am: "vm.",
pm: "nm.",
midnight: "Mitternacht",
noon: "Mittag",
morning: "Morgen",
afternoon: "Nachm.",
evening: "Abend",
night: "Nacht",
},
abbreviated: {
am: "vorm.",
pm: "nachm.",
midnight: "Mitternacht",
noon: "Mittag",
morning: "Morgen",
afternoon: "Nachmittag",
evening: "Abend",
night: "Nacht",
},
wide: {
am: "vormittags",
pm: "nachmittags",
midnight: "Mitternacht",
noon: "Mittag",
morning: "Morgen",
afternoon: "Nachmittag",
evening: "Abend",
night: "Nacht",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "vm.",
pm: "nm.",
midnight: "Mitternacht",
noon: "Mittag",
morning: "morgens",
afternoon: "nachm.",
evening: "abends",
night: "nachts",
},
abbreviated: {
am: "vorm.",
pm: "nachm.",
midnight: "Mitternacht",
noon: "Mittag",
morning: "morgens",
afternoon: "nachmittags",
evening: "abends",
night: "nachts",
},
wide: {
am: "vormittags",
pm: "nachmittags",
midnight: "Mitternacht",
noon: "Mittag",
morning: "morgens",
afternoon: "nachmittags",
evening: "abends",
night: "nachts",
},
};
const ordinalNumber = (dirtyNumber) => {
const number = Number(dirtyNumber);
return number + ".";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
formattingValues: formattingMonthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};
@@ -0,0 +1,11 @@
/**
* A function to diagnose why the SDK might not be successfully sending data.
*
* Possible return values wrapped in a Promise:
* - `"no-client-active"` - There was no active client when the function was called. This possibly means that the SDK was not initialized yet.
* - `"sentry-unreachable"` - The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.
*
* If the function doesn't detect an issue it resolves to `undefined`.
*/
export declare function diagnoseSdkConnectivity(): Promise<'no-client-active' | 'sentry-unreachable' | 'no-dsn-configured' | void>;
//# sourceMappingURL=diagnose-sdk.d.ts.map
@@ -0,0 +1,11 @@
"use strict";
exports.eachWeekendOfIntervalWithOptions = void 0;
var _index = require("../eachWeekendOfInterval.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const eachWeekendOfIntervalWithOptions =
(exports.eachWeekendOfIntervalWithOptions = (0, _index2.convertToFP)(
_index.eachWeekendOfInterval,
2,
));
@@ -0,0 +1,40 @@
export declare abstract class _CodeOrName {
abstract readonly str: string;
abstract readonly names: UsedNames;
abstract toString(): string;
abstract emptyStr(): boolean;
}
export declare const IDENTIFIER: RegExp;
export declare class Name extends _CodeOrName {
readonly str: string;
constructor(s: string);
toString(): string;
emptyStr(): boolean;
get names(): UsedNames;
}
export declare class _Code extends _CodeOrName {
readonly _items: readonly CodeItem[];
private _str?;
private _names?;
constructor(code: string | readonly CodeItem[]);
toString(): string;
emptyStr(): boolean;
get str(): string;
get names(): UsedNames;
}
export type CodeItem = Name | string | number | boolean | null;
export type UsedNames = Record<string, number | undefined>;
export type Code = _Code | Name;
export type SafeExpr = Code | number | boolean | null;
export declare const nil: _Code;
type CodeArg = SafeExpr | string | undefined;
export declare function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code;
export declare function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code;
export declare function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void;
export declare function strConcat(c1: Code, c2: Code): Code;
export declare function stringify(x: unknown): Code;
export declare function safeStringify(x: unknown): string;
export declare function getProperty(key: Code | string | number): Code;
export declare function getEsmExportName(key: Code | string | number): Code;
export declare function regexpCode(rx: RegExp): Code;
export {};
@@ -0,0 +1,91 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx } from "react/jsx-runtime";
import { useWindowInfo } from '@faceless-ui/window-info';
import { PREFERENCE_KEYS } from 'payload/shared';
import React from 'react';
import { usePreferences } from '../../../providers/Preferences/index.js';
import { useTranslation } from '../../../providers/Translation/index.js';
import { useNav } from '../context.js';
import './index.scss';
const baseClass = 'nav-toggler';
export const NavToggler = props => {
const $ = _c(15);
const {
id,
children,
className,
tabIndex: t0
} = props;
const tabIndex = t0 === undefined ? 0 : t0;
const {
t
} = useTranslation();
const {
setPreference
} = usePreferences();
const {
navOpen,
setNavOpen
} = useNav();
const {
breakpoints: t1
} = useWindowInfo();
const {
l: largeBreak
} = t1;
const t2 = `${navOpen ? t("general:close") : t("general:open")} ${t("general:menu")}`;
const t3 = navOpen && `${baseClass}--is-open`;
let t4;
if ($[0] !== className || $[1] !== t3) {
t4 = [baseClass, t3, className].filter(Boolean);
$[0] = className;
$[1] = t3;
$[2] = t4;
} else {
t4 = $[2];
}
const t5 = t4.join(" ");
let t6;
if ($[3] !== largeBreak || $[4] !== navOpen || $[5] !== setNavOpen || $[6] !== setPreference) {
t6 = async () => {
setNavOpen(!navOpen);
if (!largeBreak) {
await setPreference(PREFERENCE_KEYS.NAV, {
open: !navOpen
}, true);
}
};
$[3] = largeBreak;
$[4] = navOpen;
$[5] = setNavOpen;
$[6] = setPreference;
$[7] = t6;
} else {
t6 = $[7];
}
let t7;
if ($[8] !== children || $[9] !== id || $[10] !== t2 || $[11] !== t5 || $[12] !== t6 || $[13] !== tabIndex) {
t7 = _jsx("button", {
"aria-label": t2,
className: t5,
id,
onClick: t6,
tabIndex,
type: "button",
children
});
$[8] = children;
$[9] = id;
$[10] = t2;
$[11] = t5;
$[12] = t6;
$[13] = tabIndex;
$[14] = t7;
} else {
t7 = $[14];
}
return t7;
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1,58 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ROOT_CONFIG_FILENAMES = void 0;
exports.findConfigUpwards = findConfigUpwards;
exports.findPackageData = findPackageData;
exports.findRelativeConfig = findRelativeConfig;
exports.findRootConfig = findRootConfig;
exports.loadConfig = loadConfig;
exports.loadPlugin = loadPlugin;
exports.loadPreset = loadPreset;
exports.resolvePlugin = resolvePlugin;
exports.resolvePreset = resolvePreset;
exports.resolveShowConfigPath = resolveShowConfigPath;
function findConfigUpwards(rootDir) {
return null;
}
function* findPackageData(filepath) {
return {
filepath,
directories: [],
pkg: null,
isPackage: false
};
}
function* findRelativeConfig(pkgData, envName, caller) {
return {
config: null,
ignore: null
};
}
function* findRootConfig(dirname, envName, caller) {
return null;
}
function* loadConfig(name, dirname, envName, caller) {
throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`);
}
function* resolveShowConfigPath(dirname) {
return null;
}
const ROOT_CONFIG_FILENAMES = exports.ROOT_CONFIG_FILENAMES = [];
function resolvePlugin(name, dirname) {
return null;
}
function resolvePreset(name, dirname) {
return null;
}
function loadPlugin(name, dirname) {
throw new Error(`Cannot load plugin ${name} relative to ${dirname} in a browser`);
}
function loadPreset(name, dirname) {
throw new Error(`Cannot load preset ${name} relative to ${dirname} in a browser`);
}
0 && 0;
//# sourceMappingURL=index-browser.js.map
@@ -0,0 +1,34 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link nextMonday} function options.
*/
export interface NextMondayOptions<DateType extends Date = Date>
extends ContextOptions<DateType> {}
/**
* @name nextMonday
* @category Weekday Helpers
* @summary When is the next Monday?
*
* @description
* When is the next Monday?
*
* @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).
* @typeParam ResultDate - The result `Date` type, returned from the context function if passed, or inferred from the arguments.
*
* @param date - The date to start counting from
* @param options - An object with options
*
* @returns The next Monday
*
* @example
* // When is the next Monday after Mar, 22, 2020?
* const result = nextMonday(new Date(2020, 2, 22))
* //=> Mon Mar 23 2020 00:00:00
*/
export declare function nextMonday<
DateType extends Date,
ResultDate extends Date = DateType,
>(
date: DateArg<DateType>,
options?: NextMondayOptions<ResultDate> | undefined,
): ResultDate;
@@ -0,0 +1 @@
{"version":3,"file":"removeUndefined.d.ts","sourceRoot":"","sources":["../../src/utilities/removeUndefined.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAE3D"}
@@ -0,0 +1 @@
{"version":3,"file":"highlighter.js","sources":["../../../src/icons/highlighter.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Highlighter\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtOSAxMS02IDZ2M2g5bDMtMyIgLz4KICA8cGF0aCBkPSJtMjIgMTItNC42IDQuNmEyIDIgMCAwIDEtMi44IDBsLTUuMi01LjJhMiAyIDAgMCAxIDAtMi44TDE0IDQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/highlighter\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 Highlighter = createLucideIcon('Highlighter', [\n ['path', { d: 'm9 11-6 6v3h9l3-3', key: '1a3l36' }],\n ['path', { d: 'm22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4', key: '14a9rk' }],\n]);\n\nexport default Highlighter;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC/F,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/singlestore-core/columns/index.ts"],"sourcesContent":["export * from './bigint.ts';\nexport * from './binary.ts';\nexport * from './boolean.ts';\nexport * from './char.ts';\nexport * from './common.ts';\nexport * from './custom.ts';\nexport * from './date.ts';\nexport * from './datetime.ts';\nexport * from './decimal.ts';\nexport * from './double.ts';\nexport * from './enum.ts';\nexport * from './float.ts';\nexport * from './int.ts';\nexport * from './json.ts';\nexport * from './mediumint.ts';\nexport * from './real.ts';\nexport * from './serial.ts';\nexport * from './smallint.ts';\nexport * from './text.ts';\nexport * from './time.ts';\nexport * from './timestamp.ts';\nexport * from './tinyint.ts';\nexport * from './varbinary.ts';\nexport * from './varchar.ts';\nexport * from './vector.ts';\nexport * from './year.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,4BAAc,wBAAd;AACA,4BAAc,wBADd;AAEA,4BAAc,yBAFd;AAGA,4BAAc,sBAHd;AAIA,4BAAc,wBAJd;AAKA,4BAAc,wBALd;AAMA,4BAAc,sBANd;AAOA,4BAAc,0BAPd;AAQA,4BAAc,yBARd;AASA,4BAAc,wBATd;AAUA,4BAAc,sBAVd;AAWA,4BAAc,uBAXd;AAYA,4BAAc,qBAZd;AAaA,4BAAc,sBAbd;AAcA,4BAAc,2BAdd;AAeA,4BAAc,sBAfd;AAgBA,4BAAc,wBAhBd;AAiBA,4BAAc,0BAjBd;AAkBA,4BAAc,sBAlBd;AAmBA,4BAAc,sBAnBd;AAoBA,4BAAc,2BApBd;AAqBA,4BAAc,yBArBd;AAsBA,4BAAc,2BAtBd;AAuBA,4BAAc,yBAvBd;AAwBA,4BAAc,wBAxBd;AAyBA,4BAAc,sBAzBd;","names":[]}
@@ -0,0 +1,17 @@
/**
* Error that is thrown on timeouts.
*/
export declare class TimeoutError extends Error {
constructor(message?: string);
}
/**
* Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise
* rejects, and resolves if the specified promise resolves.
*
* <p> NOTE: this operation will continue even after it throws a {@link TimeoutError}.
*
* @param promise promise to use with timeout.
* @param timeout the timeout in milliseconds until the returned promise is rejected.
*/
export declare function callWithTimeout<T>(promise: Promise<T>, timeout: number): Promise<T>;
//# sourceMappingURL=timeout.d.ts.map
@@ -0,0 +1,311 @@
var eaw = {};
if ('undefined' == typeof module) {
window.eastasianwidth = eaw;
} else {
module.exports = eaw;
}
eaw.eastAsianWidth = function(character) {
var x = character.charCodeAt(0);
var y = (character.length == 2) ? character.charCodeAt(1) : 0;
var codePoint = x;
if ((0xD800 <= x && x <= 0xDBFF) && (0xDC00 <= y && y <= 0xDFFF)) {
x &= 0x3FF;
y &= 0x3FF;
codePoint = (x << 10) | y;
codePoint += 0x10000;
}
if ((0x3000 == codePoint) ||
(0xFF01 <= codePoint && codePoint <= 0xFF60) ||
(0xFFE0 <= codePoint && codePoint <= 0xFFE6)) {
return 'F';
}
if ((0x20A9 == codePoint) ||
(0xFF61 <= codePoint && codePoint <= 0xFFBE) ||
(0xFFC2 <= codePoint && codePoint <= 0xFFC7) ||
(0xFFCA <= codePoint && codePoint <= 0xFFCF) ||
(0xFFD2 <= codePoint && codePoint <= 0xFFD7) ||
(0xFFDA <= codePoint && codePoint <= 0xFFDC) ||
(0xFFE8 <= codePoint && codePoint <= 0xFFEE)) {
return 'H';
}
if ((0x1100 <= codePoint && codePoint <= 0x115F) ||
(0x11A3 <= codePoint && codePoint <= 0x11A7) ||
(0x11FA <= codePoint && codePoint <= 0x11FF) ||
(0x2329 <= codePoint && codePoint <= 0x232A) ||
(0x2E80 <= codePoint && codePoint <= 0x2E99) ||
(0x2E9B <= codePoint && codePoint <= 0x2EF3) ||
(0x2F00 <= codePoint && codePoint <= 0x2FD5) ||
(0x2FF0 <= codePoint && codePoint <= 0x2FFB) ||
(0x3001 <= codePoint && codePoint <= 0x303E) ||
(0x3041 <= codePoint && codePoint <= 0x3096) ||
(0x3099 <= codePoint && codePoint <= 0x30FF) ||
(0x3105 <= codePoint && codePoint <= 0x312D) ||
(0x3131 <= codePoint && codePoint <= 0x318E) ||
(0x3190 <= codePoint && codePoint <= 0x31BA) ||
(0x31C0 <= codePoint && codePoint <= 0x31E3) ||
(0x31F0 <= codePoint && codePoint <= 0x321E) ||
(0x3220 <= codePoint && codePoint <= 0x3247) ||
(0x3250 <= codePoint && codePoint <= 0x32FE) ||
(0x3300 <= codePoint && codePoint <= 0x4DBF) ||
(0x4E00 <= codePoint && codePoint <= 0xA48C) ||
(0xA490 <= codePoint && codePoint <= 0xA4C6) ||
(0xA960 <= codePoint && codePoint <= 0xA97C) ||
(0xAC00 <= codePoint && codePoint <= 0xD7A3) ||
(0xD7B0 <= codePoint && codePoint <= 0xD7C6) ||
(0xD7CB <= codePoint && codePoint <= 0xD7FB) ||
(0xF900 <= codePoint && codePoint <= 0xFAFF) ||
(0xFE10 <= codePoint && codePoint <= 0xFE19) ||
(0xFE30 <= codePoint && codePoint <= 0xFE52) ||
(0xFE54 <= codePoint && codePoint <= 0xFE66) ||
(0xFE68 <= codePoint && codePoint <= 0xFE6B) ||
(0x1B000 <= codePoint && codePoint <= 0x1B001) ||
(0x1F200 <= codePoint && codePoint <= 0x1F202) ||
(0x1F210 <= codePoint && codePoint <= 0x1F23A) ||
(0x1F240 <= codePoint && codePoint <= 0x1F248) ||
(0x1F250 <= codePoint && codePoint <= 0x1F251) ||
(0x20000 <= codePoint && codePoint <= 0x2F73F) ||
(0x2B740 <= codePoint && codePoint <= 0x2FFFD) ||
(0x30000 <= codePoint && codePoint <= 0x3FFFD)) {
return 'W';
}
if ((0x0020 <= codePoint && codePoint <= 0x007E) ||
(0x00A2 <= codePoint && codePoint <= 0x00A3) ||
(0x00A5 <= codePoint && codePoint <= 0x00A6) ||
(0x00AC == codePoint) ||
(0x00AF == codePoint) ||
(0x27E6 <= codePoint && codePoint <= 0x27ED) ||
(0x2985 <= codePoint && codePoint <= 0x2986)) {
return 'Na';
}
if ((0x00A1 == codePoint) ||
(0x00A4 == codePoint) ||
(0x00A7 <= codePoint && codePoint <= 0x00A8) ||
(0x00AA == codePoint) ||
(0x00AD <= codePoint && codePoint <= 0x00AE) ||
(0x00B0 <= codePoint && codePoint <= 0x00B4) ||
(0x00B6 <= codePoint && codePoint <= 0x00BA) ||
(0x00BC <= codePoint && codePoint <= 0x00BF) ||
(0x00C6 == codePoint) ||
(0x00D0 == codePoint) ||
(0x00D7 <= codePoint && codePoint <= 0x00D8) ||
(0x00DE <= codePoint && codePoint <= 0x00E1) ||
(0x00E6 == codePoint) ||
(0x00E8 <= codePoint && codePoint <= 0x00EA) ||
(0x00EC <= codePoint && codePoint <= 0x00ED) ||
(0x00F0 == codePoint) ||
(0x00F2 <= codePoint && codePoint <= 0x00F3) ||
(0x00F7 <= codePoint && codePoint <= 0x00FA) ||
(0x00FC == codePoint) ||
(0x00FE == codePoint) ||
(0x0101 == codePoint) ||
(0x0111 == codePoint) ||
(0x0113 == codePoint) ||
(0x011B == codePoint) ||
(0x0126 <= codePoint && codePoint <= 0x0127) ||
(0x012B == codePoint) ||
(0x0131 <= codePoint && codePoint <= 0x0133) ||
(0x0138 == codePoint) ||
(0x013F <= codePoint && codePoint <= 0x0142) ||
(0x0144 == codePoint) ||
(0x0148 <= codePoint && codePoint <= 0x014B) ||
(0x014D == codePoint) ||
(0x0152 <= codePoint && codePoint <= 0x0153) ||
(0x0166 <= codePoint && codePoint <= 0x0167) ||
(0x016B == codePoint) ||
(0x01CE == codePoint) ||
(0x01D0 == codePoint) ||
(0x01D2 == codePoint) ||
(0x01D4 == codePoint) ||
(0x01D6 == codePoint) ||
(0x01D8 == codePoint) ||
(0x01DA == codePoint) ||
(0x01DC == codePoint) ||
(0x0251 == codePoint) ||
(0x0261 == codePoint) ||
(0x02C4 == codePoint) ||
(0x02C7 == codePoint) ||
(0x02C9 <= codePoint && codePoint <= 0x02CB) ||
(0x02CD == codePoint) ||
(0x02D0 == codePoint) ||
(0x02D8 <= codePoint && codePoint <= 0x02DB) ||
(0x02DD == codePoint) ||
(0x02DF == codePoint) ||
(0x0300 <= codePoint && codePoint <= 0x036F) ||
(0x0391 <= codePoint && codePoint <= 0x03A1) ||
(0x03A3 <= codePoint && codePoint <= 0x03A9) ||
(0x03B1 <= codePoint && codePoint <= 0x03C1) ||
(0x03C3 <= codePoint && codePoint <= 0x03C9) ||
(0x0401 == codePoint) ||
(0x0410 <= codePoint && codePoint <= 0x044F) ||
(0x0451 == codePoint) ||
(0x2010 == codePoint) ||
(0x2013 <= codePoint && codePoint <= 0x2016) ||
(0x2018 <= codePoint && codePoint <= 0x2019) ||
(0x201C <= codePoint && codePoint <= 0x201D) ||
(0x2020 <= codePoint && codePoint <= 0x2022) ||
(0x2024 <= codePoint && codePoint <= 0x2027) ||
(0x2030 == codePoint) ||
(0x2032 <= codePoint && codePoint <= 0x2033) ||
(0x2035 == codePoint) ||
(0x203B == codePoint) ||
(0x203E == codePoint) ||
(0x2074 == codePoint) ||
(0x207F == codePoint) ||
(0x2081 <= codePoint && codePoint <= 0x2084) ||
(0x20AC == codePoint) ||
(0x2103 == codePoint) ||
(0x2105 == codePoint) ||
(0x2109 == codePoint) ||
(0x2113 == codePoint) ||
(0x2116 == codePoint) ||
(0x2121 <= codePoint && codePoint <= 0x2122) ||
(0x2126 == codePoint) ||
(0x212B == codePoint) ||
(0x2153 <= codePoint && codePoint <= 0x2154) ||
(0x215B <= codePoint && codePoint <= 0x215E) ||
(0x2160 <= codePoint && codePoint <= 0x216B) ||
(0x2170 <= codePoint && codePoint <= 0x2179) ||
(0x2189 == codePoint) ||
(0x2190 <= codePoint && codePoint <= 0x2199) ||
(0x21B8 <= codePoint && codePoint <= 0x21B9) ||
(0x21D2 == codePoint) ||
(0x21D4 == codePoint) ||
(0x21E7 == codePoint) ||
(0x2200 == codePoint) ||
(0x2202 <= codePoint && codePoint <= 0x2203) ||
(0x2207 <= codePoint && codePoint <= 0x2208) ||
(0x220B == codePoint) ||
(0x220F == codePoint) ||
(0x2211 == codePoint) ||
(0x2215 == codePoint) ||
(0x221A == codePoint) ||
(0x221D <= codePoint && codePoint <= 0x2220) ||
(0x2223 == codePoint) ||
(0x2225 == codePoint) ||
(0x2227 <= codePoint && codePoint <= 0x222C) ||
(0x222E == codePoint) ||
(0x2234 <= codePoint && codePoint <= 0x2237) ||
(0x223C <= codePoint && codePoint <= 0x223D) ||
(0x2248 == codePoint) ||
(0x224C == codePoint) ||
(0x2252 == codePoint) ||
(0x2260 <= codePoint && codePoint <= 0x2261) ||
(0x2264 <= codePoint && codePoint <= 0x2267) ||
(0x226A <= codePoint && codePoint <= 0x226B) ||
(0x226E <= codePoint && codePoint <= 0x226F) ||
(0x2282 <= codePoint && codePoint <= 0x2283) ||
(0x2286 <= codePoint && codePoint <= 0x2287) ||
(0x2295 == codePoint) ||
(0x2299 == codePoint) ||
(0x22A5 == codePoint) ||
(0x22BF == codePoint) ||
(0x2312 == codePoint) ||
(0x2460 <= codePoint && codePoint <= 0x24E9) ||
(0x24EB <= codePoint && codePoint <= 0x254B) ||
(0x2550 <= codePoint && codePoint <= 0x2573) ||
(0x2580 <= codePoint && codePoint <= 0x258F) ||
(0x2592 <= codePoint && codePoint <= 0x2595) ||
(0x25A0 <= codePoint && codePoint <= 0x25A1) ||
(0x25A3 <= codePoint && codePoint <= 0x25A9) ||
(0x25B2 <= codePoint && codePoint <= 0x25B3) ||
(0x25B6 <= codePoint && codePoint <= 0x25B7) ||
(0x25BC <= codePoint && codePoint <= 0x25BD) ||
(0x25C0 <= codePoint && codePoint <= 0x25C1) ||
(0x25C6 <= codePoint && codePoint <= 0x25C8) ||
(0x25CB == codePoint) ||
(0x25CE <= codePoint && codePoint <= 0x25D1) ||
(0x25E2 <= codePoint && codePoint <= 0x25E5) ||
(0x25EF == codePoint) ||
(0x2605 <= codePoint && codePoint <= 0x2606) ||
(0x2609 == codePoint) ||
(0x260E <= codePoint && codePoint <= 0x260F) ||
(0x2614 <= codePoint && codePoint <= 0x2615) ||
(0x261C == codePoint) ||
(0x261E == codePoint) ||
(0x2640 == codePoint) ||
(0x2642 == codePoint) ||
(0x2660 <= codePoint && codePoint <= 0x2661) ||
(0x2663 <= codePoint && codePoint <= 0x2665) ||
(0x2667 <= codePoint && codePoint <= 0x266A) ||
(0x266C <= codePoint && codePoint <= 0x266D) ||
(0x266F == codePoint) ||
(0x269E <= codePoint && codePoint <= 0x269F) ||
(0x26BE <= codePoint && codePoint <= 0x26BF) ||
(0x26C4 <= codePoint && codePoint <= 0x26CD) ||
(0x26CF <= codePoint && codePoint <= 0x26E1) ||
(0x26E3 == codePoint) ||
(0x26E8 <= codePoint && codePoint <= 0x26FF) ||
(0x273D == codePoint) ||
(0x2757 == codePoint) ||
(0x2776 <= codePoint && codePoint <= 0x277F) ||
(0x2B55 <= codePoint && codePoint <= 0x2B59) ||
(0x3248 <= codePoint && codePoint <= 0x324F) ||
(0xE000 <= codePoint && codePoint <= 0xF8FF) ||
(0xFE00 <= codePoint && codePoint <= 0xFE0F) ||
(0xFFFD == codePoint) ||
(0x1F100 <= codePoint && codePoint <= 0x1F10A) ||
(0x1F110 <= codePoint && codePoint <= 0x1F12D) ||
(0x1F130 <= codePoint && codePoint <= 0x1F169) ||
(0x1F170 <= codePoint && codePoint <= 0x1F19A) ||
(0xE0100 <= codePoint && codePoint <= 0xE01EF) ||
(0xF0000 <= codePoint && codePoint <= 0xFFFFD) ||
(0x100000 <= codePoint && codePoint <= 0x10FFFD)) {
return 'A';
}
return 'N';
};
eaw.characterLength = function(character) {
var code = this.eastAsianWidth(character);
if (code == 'F' || code == 'W' || code == 'A') {
return 2;
} else {
return 1;
}
};
// Split a string considering surrogate-pairs.
function stringToArray(string) {
return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
}
eaw.length = function(string) {
var characters = stringToArray(string);
var len = 0;
for (var i = 0; i < characters.length; i++) {
len = len + this.characterLength(characters[i]);
}
return len;
};
eaw.slice = function(text, start, end) {
textLen = eaw.length(text)
start = start ? start : 0;
end = end ? end : 1;
if (start < 0) {
start = textLen + start;
}
if (end < 0) {
end = textLen + end;
}
var result = '';
var eawLen = 0;
var chars = stringToArray(text);
for (var i = 0; i < chars.length; i++) {
var char = chars[i];
var charLen = eaw.length(char);
if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
if (eawLen + charLen <= end) {
result += char;
} else {
break;
}
}
eawLen += charLen;
}
return result;
};
@@ -0,0 +1,77 @@
import { flush } from '../exports.js';
import { debug } from './debug-logger.js';
import { vercelWaitUntil } from './vercelWaitUntil.js';
import { GLOBAL_OBJ } from './worldwide.js';
async function flushWithTimeout(timeout) {
try {
debug.log('Flushing events...');
await flush(timeout);
debug.log('Done flushing events');
} catch (e) {
debug.log('Error while flushing events:\n', e);
}
}
/**
* Flushes the event queue with a timeout in serverless environments to ensure that events are sent to Sentry before the
* serverless function execution ends.
*
* The function is async, but in environments that support a `waitUntil` mechanism, it will run synchronously.
*
* This function is aware of the following serverless platforms:
* - Cloudflare: If a Cloudflare context is provided, it will use `ctx.waitUntil()` to flush events (keeps the `this` context of `ctx`).
* If a `cloudflareWaitUntil` function is provided, it will use that to flush events (looses the `this` context of `ctx`).
* - Vercel: It detects the Vercel environment and uses Vercel's `waitUntil` function.
* - Other Serverless (AWS Lambda, Google Cloud, etc.): It detects the environment via environment variables
* and uses a regular `await flush()`.
*
* @internal This function is supposed for internal Sentry SDK usage only.
* @hidden
*/
async function flushIfServerless(
params
= {},
) {
const { timeout = 2000 } = params;
if ('cloudflareWaitUntil' in params && typeof params?.cloudflareWaitUntil === 'function') {
params.cloudflareWaitUntil(flushWithTimeout(timeout));
return;
}
if ('cloudflareCtx' in params && typeof params.cloudflareCtx?.waitUntil === 'function') {
params.cloudflareCtx.waitUntil(flushWithTimeout(timeout));
return;
}
// Note: vercelWaitUntil only does something in Vercel Edge runtime
// In Node runtime, we use process.on('SIGTERM') instead
// @ts-expect-error This is not typed
if (GLOBAL_OBJ[Symbol.for('@vercel/request-context')]) {
// Vercel has a waitUntil equivalent that works without execution context
vercelWaitUntil(flushWithTimeout(timeout));
return;
}
if (typeof process === 'undefined') {
return;
}
const isServerless =
!!process.env.FUNCTIONS_WORKER_RUNTIME || // Azure Functions
!!process.env.LAMBDA_TASK_ROOT || // AWS Lambda
!!process.env.K_SERVICE || // Google Cloud Run
!!process.env.CF_PAGES || // Cloudflare Pages
!!process.env.VERCEL ||
!!process.env.NETLIFY;
if (isServerless) {
// Use regular flush for environments without a generic waitUntil mechanism
await flushWithTimeout(timeout);
}
}
export { flushIfServerless };
//# sourceMappingURL=flushIfServerless.js.map
@@ -0,0 +1,3 @@
import type { PayloadHandler } from '../../config/types.js';
export declare const findDistinctHandler: PayloadHandler;
//# sourceMappingURL=findDistinct.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEzF,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,gBAAgB,EAAE,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;CAC/D;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,CAAC,CAAC;CACZ;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,OAAO,oBAAoB,GAAG,OAAO,iBAAiB,CAAC;AAE1E,MAAM,MAAM,MAAM,GAAG;IAAE,mBAAmB,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,CAAA;CAAE,CAAC;AACzE,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,GAAG;IAC5E,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG;IACjD,GAAG,EAAE,uBAAuB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,sBAAsB,GAAG,sBAAsB,GAAG,QAAQ,CAAC;AACjG,MAAM,MAAM,uBAAuB,GAAG,cAAc,GAAG,wBAAwB,CAAC;AAEhF,MAAM,MAAM,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEzF,MAAM,MAAM,WAAW,GACnB;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,IAAI,CAAC;IACb,YAAY,EAAE,IAAI,CAAC;IACnB,cAAc,EAAE,IAAI,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;CACZ,GACD;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEN,8BAAsB,SAAS;IACrB,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,eAAe,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;CAC/C;AAED,MAAM,MAAM,EAAE,CAAC,CAAC,IACd,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACpB,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GACvD,CAAC,SAAS,MAAM,GACd,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GACrD,CAAC,CAAC;AACV,KAAK,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1B,KAAK,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEvD,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAEnD"}
@@ -0,0 +1,60 @@
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function con(n) {
return 0x80 | n & 0x3f;
}
export function encode(str) {
var arr = str.split("").map(function (x) {
return x.charCodeAt(0);
});
return _encode(arr);
}
function _encode(arr) {
if (arr.length === 0) {
return [];
}
var _arr = _toArray(arr),
n = _arr[0],
ns = _arr.slice(1);
if (n < 0) {
throw new Error("utf8");
}
if (n < 0x80) {
return [n].concat(_toConsumableArray(_encode(ns)));
}
if (n < 0x800) {
return [0xc0 | n >>> 6, con(n)].concat(_toConsumableArray(_encode(ns)));
}
if (n < 0x10000) {
return [0xe0 | n >>> 12, con(n >>> 6), con(n)].concat(_toConsumableArray(_encode(ns)));
}
if (n < 0x110000) {
return [0xf0 | n >>> 18, con(n >>> 12), con(n >>> 6), con(n)].concat(_toConsumableArray(_encode(ns)));
}
throw new Error("utf8");
}
@@ -0,0 +1,66 @@
# quick-format-unescaped
## unescaped ?
Sometimes you want to embed the results of quick-format into another string,
and then escape the whole string.
## usage
```js
var format = require('quick-format-unescaped')
format('hello %s %j %d', ['world', [{obj: true}, 4, {another: 'obj'}]])
```
## format(fmt, parameters, [options])
### fmt
A `printf`-like format string. Example: `'hello %s %j %d'`
### parameters
Array of values to be inserted into the `format` string. Example: `['world', {obj:true}]`
### options.stringify
Passing an options object as the third parameter with a `stringify` will mean
any objects will be passed to the supplied function instead of an the
internal `tryStringify` function. This can be useful when using augmented
capability serializers such as [`fast-safe-stringify`](http://github.com/davidmarkclements/fast-safe-stringify) or [`fast-redact`](http://github.com/davidmarkclements/fast-redact).
## caveats
By default `quick-format-unescaped` uses `JSON.stringify` instead of `util.inspect`, this means functions *will not be serialized*.
## Benchmarks
### Node 8.11.2
```
util*100000: 350.325ms
quick*100000: 268.141ms
utilWithTailObj*100000: 586.387ms
quickWithTailObj*100000: 280.200ms
util*100000: 325.735ms
quick*100000: 270.251ms
utilWithTailObj*100000: 492.270ms
quickWithTailObj*100000: 261.797ms
```
### Node 10.4.0
```
util*100000: 301.035ms
quick*100000: 217.005ms
utilWithTailObj*100000: 404.778ms
quickWithTailObj*100000: 236.176ms
util*100000: 286.349ms
quick*100000: 214.646ms
utilWithTailObj*100000: 388.574ms
quickWithTailObj*100000: 226.036ms
```
## Acknowledgements
Sponsored by [nearForm](http://www.nearform.com)
@@ -0,0 +1,39 @@
import type { SanitizedCollectionConfig } from '../../../collections/config/types.js';
import type { SanitizedGlobalConfig } from '../../../globals/config/types.js';
import type { RequestContext } from '../../../index.js';
import type { JsonObject, PayloadRequest } from '../../../types/index.js';
import type { Field, TabAsField } from '../../config/types.js';
type Args<T> = {
/**
* Data of the nearest parent block. If no parent block exists, this will be the `undefined`
*/
blockData?: JsonObject;
collection: null | SanitizedCollectionConfig;
context: RequestContext;
data: T;
/**
* The original data (not modified by any hooks)
*/
doc: T;
fields: (Field | TabAsField)[];
global: null | SanitizedGlobalConfig;
id?: number | string;
operation: 'create' | 'update';
overrideAccess: boolean;
parentIndexPath: string;
/**
* @todo make required in v4.0
*/
parentIsLocalized?: boolean;
parentPath: string;
parentSchemaPath: string;
req: PayloadRequest;
siblingData: JsonObject;
/**
* The original siblingData (not modified by any hooks)
*/
siblingDoc: JsonObject;
};
export declare const traverseFields: <T>({ id, blockData, collection, context, data, doc, fields, global, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, }: Args<T>) => Promise<void>;
export {};
//# sourceMappingURL=traverseFields.d.ts.map
@@ -0,0 +1,33 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.addPath = addPath;
exports.pathToArray = pathToArray;
/**
* Given a Path and a key, return a new Path containing the new key.
*/
function addPath(prev, key, typename) {
return {
prev,
key,
typename,
};
}
/**
* Given a Path, return an Array of the path keys.
*/
function pathToArray(path) {
const flattened = [];
let curr = path;
while (curr) {
flattened.push(curr.key);
curr = curr.prev;
}
return flattened.reverse();
}
@@ -0,0 +1,83 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/**
* @param {number[]} array array of numbers
* @returns {number} sum of all numbers in array
*/
const arraySum = (array) => {
let sum = 0;
for (const item of array) sum += item;
return sum;
};
/**
* @param {string[]} args items to be truncated
* @param {number} maxLength maximum length of args including spaces between
* @returns {string[]} truncated args
*/
const truncateArgs = (args, maxLength) => {
const lengths = args.map((a) => `${a}`.length);
const availableLength = maxLength - lengths.length + 1;
if (availableLength > 0 && args.length === 1) {
if (availableLength >= args[0].length) {
return args;
} else if (availableLength > 3) {
return [`...${args[0].slice(-availableLength + 3)}`];
}
return [args[0].slice(-availableLength)];
}
// Check if there is space for at least 4 chars per arg
if (availableLength < arraySum(lengths.map((i) => Math.min(i, 6)))) {
// remove args
if (args.length > 1) return truncateArgs(args.slice(0, -1), maxLength);
return [];
}
let currentLength = arraySum(lengths);
// Check if all fits into maxLength
if (currentLength <= availableLength) return args;
// Try to remove chars from the longest items until it fits
while (currentLength > availableLength) {
const maxLength = Math.max(...lengths);
const shorterItems = lengths.filter((l) => l !== maxLength);
const nextToMaxLength =
shorterItems.length > 0 ? Math.max(...shorterItems) : 0;
const maxReduce = maxLength - nextToMaxLength;
let maxItems = lengths.length - shorterItems.length;
let overrun = currentLength - availableLength;
for (let i = 0; i < lengths.length; i++) {
if (lengths[i] === maxLength) {
const reduce = Math.min(Math.floor(overrun / maxItems), maxReduce);
lengths[i] -= reduce;
currentLength -= reduce;
overrun -= reduce;
maxItems--;
}
}
}
// Return args reduced to length in lengths
return args.map((a, i) => {
const str = `${a}`;
const length = lengths[i];
if (str.length === length) {
return str;
} else if (length > 5) {
return `...${str.slice(-length + 3)}`;
} else if (length > 0) {
return str.slice(-length);
}
return "";
});
};
module.exports = truncateArgs;
@@ -0,0 +1,526 @@
/**
* 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 { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
import { eventFiles } from '@lexical/rich-text';
import { mergeRegister, isHTMLElement, calculateZoomLevel } from '@lexical/utils';
import { DRAGOVER_COMMAND, COMMAND_PRIORITY_LOW, DROP_COMMAND, COMMAND_PRIORITY_HIGH, $getNodeByKey, $getNearestNodeFromDOMNode, $getRoot } from 'lexical';
import { useRef, useState, useCallback, useEffect } from 'react';
import { createPortal } from 'react-dom';
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
/**
* 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.
*
*/
class Point {
constructor(x, y) {
this._x = x;
this._y = y;
}
get x() {
return this._x;
}
get y() {
return this._y;
}
equals({
x,
y
}) {
return this.x === x && this.y === y;
}
calcDeltaXTo({
x
}) {
return this.x - x;
}
calcDeltaYTo({
y
}) {
return this.y - y;
}
calcHorizontalDistanceTo(point) {
return Math.abs(this.calcDeltaXTo(point));
}
calcVerticalDistance(point) {
return Math.abs(this.calcDeltaYTo(point));
}
calcDistanceTo(point) {
return Math.sqrt(Math.pow(this.calcDeltaXTo(point), 2) + Math.pow(this.calcDeltaYTo(point), 2));
}
}
function isPoint(x) {
return x instanceof Point;
}
/**
* 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.
*
*/
class Rectangle {
constructor(left, top, right, bottom) {
const [physicTop, physicBottom] = top <= bottom ? [top, bottom] : [bottom, top];
const [physicLeft, physicRight] = left <= right ? [left, right] : [right, left];
this._top = physicTop;
this._right = physicRight;
this._left = physicLeft;
this._bottom = physicBottom;
}
get top() {
return this._top;
}
get right() {
return this._right;
}
get bottom() {
return this._bottom;
}
get left() {
return this._left;
}
get width() {
return Math.abs(this._left - this._right);
}
get height() {
return Math.abs(this._bottom - this._top);
}
equals({
top,
left,
bottom,
right
}) {
return top === this._top && bottom === this._bottom && left === this._left && right === this._right;
}
contains(target) {
if (isPoint(target)) {
const {
x,
y
} = target;
const isOnTopSide = y < this._top;
const isOnBottomSide = y > this._bottom;
const isOnLeftSide = x < this._left;
const isOnRightSide = x > this._right;
const result = !isOnTopSide && !isOnBottomSide && !isOnLeftSide && !isOnRightSide;
return {
reason: {
isOnBottomSide,
isOnLeftSide,
isOnRightSide,
isOnTopSide
},
result
};
} else {
const {
top,
left,
bottom,
right
} = target;
return top >= this._top && top <= this._bottom && bottom >= this._top && bottom <= this._bottom && left >= this._left && left <= this._right && right >= this._left && right <= this._right;
}
}
intersectsWith(rect) {
const {
left: x1,
top: y1,
width: w1,
height: h1
} = rect;
const {
left: x2,
top: y2,
width: w2,
height: h2
} = this;
const maxX = x1 + w1 >= x2 + w2 ? x1 + w1 : x2 + w2;
const maxY = y1 + h1 >= y2 + h2 ? y1 + h1 : y2 + h2;
const minX = x1 <= x2 ? x1 : x2;
const minY = y1 <= y2 ? y1 : y2;
return maxX - minX <= w1 + w2 && maxY - minY <= h1 + h2;
}
generateNewRect({
left = this.left,
top = this.top,
right = this.right,
bottom = this.bottom
}) {
return new Rectangle(left, top, right, bottom);
}
static fromLTRB(left, top, right, bottom) {
return new Rectangle(left, top, right, bottom);
}
static fromLWTH(left, width, top, height) {
return new Rectangle(left, top, left + width, top + height);
}
static fromPoints(startPoint, endPoint) {
const {
y: top,
x: left
} = startPoint;
const {
y: bottom,
x: right
} = endPoint;
return Rectangle.fromLTRB(left, top, right, bottom);
}
static fromDOM(dom) {
const {
top,
width,
left,
height
} = dom.getBoundingClientRect();
return Rectangle.fromLWTH(left, width, top, height);
}
}
/**
* 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 SPACE = 4;
const TARGET_LINE_HALF_HEIGHT = 2;
const DRAG_DATA_FORMAT = 'application/x-lexical-drag-block';
const TEXT_BOX_HORIZONTAL_PADDING = 28;
const Downward = 1;
const Upward = -1;
const Indeterminate = 0;
let prevIndex = Infinity;
function getCurrentIndex(keysLength) {
if (keysLength === 0) {
return Infinity;
}
if (prevIndex >= 0 && prevIndex < keysLength) {
return prevIndex;
}
return Math.floor(keysLength / 2);
}
function getTopLevelNodeKeys(editor) {
return editor.getEditorState().read(() => $getRoot().getChildrenKeys());
}
function getCollapsedMargins(elem) {
const getMargin = (element, margin) => element ? parseFloat(window.getComputedStyle(element)[margin]) : 0;
const {
marginTop,
marginBottom
} = window.getComputedStyle(elem);
const prevElemSiblingMarginBottom = getMargin(elem.previousElementSibling, 'marginBottom');
const nextElemSiblingMarginTop = getMargin(elem.nextElementSibling, 'marginTop');
const collapsedTopMargin = Math.max(parseFloat(marginTop), prevElemSiblingMarginBottom);
const collapsedBottomMargin = Math.max(parseFloat(marginBottom), nextElemSiblingMarginTop);
return {
marginBottom: collapsedBottomMargin,
marginTop: collapsedTopMargin
};
}
function getBlockElement(anchorElem, editor, event, useEdgeAsDefault = false) {
const anchorElementRect = anchorElem.getBoundingClientRect();
const topLevelNodeKeys = getTopLevelNodeKeys(editor);
let blockElem = null;
editor.getEditorState().read(() => {
if (useEdgeAsDefault) {
const [firstNode, lastNode] = [editor.getElementByKey(topLevelNodeKeys[0]), editor.getElementByKey(topLevelNodeKeys[topLevelNodeKeys.length - 1])];
const [firstNodeRect, lastNodeRect] = [firstNode != null ? firstNode.getBoundingClientRect() : undefined, lastNode != null ? lastNode.getBoundingClientRect() : undefined];
if (firstNodeRect && lastNodeRect) {
const firstNodeZoom = calculateZoomLevel(firstNode);
const lastNodeZoom = calculateZoomLevel(lastNode);
if (event.y / firstNodeZoom < firstNodeRect.top) {
blockElem = firstNode;
} else if (event.y / lastNodeZoom > lastNodeRect.bottom) {
blockElem = lastNode;
}
if (blockElem) {
return;
}
}
}
let index = getCurrentIndex(topLevelNodeKeys.length);
let direction = Indeterminate;
while (index >= 0 && index < topLevelNodeKeys.length) {
const key = topLevelNodeKeys[index];
const elem = editor.getElementByKey(key);
if (elem === null) {
break;
}
const zoom = calculateZoomLevel(elem);
const point = new Point(event.x / zoom, event.y / zoom);
const domRect = Rectangle.fromDOM(elem);
const {
marginTop,
marginBottom
} = getCollapsedMargins(elem);
const rect = domRect.generateNewRect({
bottom: domRect.bottom + marginBottom,
left: anchorElementRect.left,
right: anchorElementRect.right,
top: domRect.top - marginTop
});
const {
result,
reason: {
isOnTopSide,
isOnBottomSide
}
} = rect.contains(point);
if (result) {
blockElem = elem;
prevIndex = index;
break;
}
if (direction === Indeterminate) {
if (isOnTopSide) {
direction = Upward;
} else if (isOnBottomSide) {
direction = Downward;
} else {
// stop search block element
direction = Infinity;
}
}
index += direction;
}
});
return blockElem;
}
function setMenuPosition(targetElem, floatingElem, anchorElem) {
if (!targetElem) {
floatingElem.style.opacity = '0';
floatingElem.style.transform = 'translate(-10000px, -10000px)';
return;
}
const targetRect = targetElem.getBoundingClientRect();
const targetStyle = window.getComputedStyle(targetElem);
const floatingElemRect = floatingElem.getBoundingClientRect();
const anchorElementRect = anchorElem.getBoundingClientRect();
// top left
let targetCalculateHeight = parseInt(targetStyle.lineHeight, 10);
if (isNaN(targetCalculateHeight)) {
// middle
targetCalculateHeight = targetRect.bottom - targetRect.top;
}
const top = targetRect.top + (targetCalculateHeight - floatingElemRect.height) / 2 - anchorElementRect.top + anchorElem.scrollTop;
const left = SPACE;
floatingElem.style.opacity = '1';
floatingElem.style.transform = `translate(${left}px, ${top}px)`;
}
function setDragImage(dataTransfer, draggableBlockElem) {
const {
transform
} = draggableBlockElem.style;
// Remove dragImage borders
draggableBlockElem.style.transform = 'translateZ(0)';
dataTransfer.setDragImage(draggableBlockElem, 0, 0);
setTimeout(() => {
draggableBlockElem.style.transform = transform;
});
}
function setTargetLine(targetLineElem, targetBlockElem, mouseY, anchorElem) {
const {
top: targetBlockElemTop,
height: targetBlockElemHeight
} = targetBlockElem.getBoundingClientRect();
const {
top: anchorTop,
width: anchorWidth
} = anchorElem.getBoundingClientRect();
const {
marginTop,
marginBottom
} = getCollapsedMargins(targetBlockElem);
let lineTop = targetBlockElemTop;
if (mouseY >= targetBlockElemTop) {
lineTop += targetBlockElemHeight + marginBottom / 2;
} else {
lineTop -= marginTop / 2;
}
const top = lineTop - anchorTop - TARGET_LINE_HALF_HEIGHT + anchorElem.scrollTop;
const left = TEXT_BOX_HORIZONTAL_PADDING - SPACE;
targetLineElem.style.transform = `translate(${left}px, ${top}px)`;
targetLineElem.style.width = `${anchorWidth - (TEXT_BOX_HORIZONTAL_PADDING - SPACE) * 2}px`;
targetLineElem.style.opacity = '.4';
}
function hideTargetLine(targetLineElem) {
if (targetLineElem) {
targetLineElem.style.opacity = '0';
targetLineElem.style.transform = 'translate(-10000px, -10000px)';
}
}
function useDraggableBlockMenu(editor, anchorElem, menuRef, targetLineRef, isEditable, menuComponent, targetLineComponent, isOnMenu, onElementChanged) {
const scrollerElem = anchorElem.parentElement;
const isDraggingBlockRef = useRef(false);
const [draggableBlockElem, setDraggableBlockElemState] = useState(null);
const setDraggableBlockElem = useCallback(elem => {
setDraggableBlockElemState(elem);
if (onElementChanged) {
onElementChanged(elem);
}
}, [onElementChanged]);
useEffect(() => {
function onMouseMove(event) {
const target = event.target;
if (!isHTMLElement(target)) {
setDraggableBlockElem(null);
return;
}
if (isOnMenu(target)) {
return;
}
const _draggableBlockElem = getBlockElement(anchorElem, editor, event);
setDraggableBlockElem(_draggableBlockElem);
}
function onMouseLeave() {
setDraggableBlockElem(null);
}
if (scrollerElem != null) {
scrollerElem.addEventListener('mousemove', onMouseMove);
scrollerElem.addEventListener('mouseleave', onMouseLeave);
}
return () => {
if (scrollerElem != null) {
scrollerElem.removeEventListener('mousemove', onMouseMove);
scrollerElem.removeEventListener('mouseleave', onMouseLeave);
}
};
}, [scrollerElem, anchorElem, editor, isOnMenu, setDraggableBlockElem]);
useEffect(() => {
if (menuRef.current) {
setMenuPosition(draggableBlockElem, menuRef.current, anchorElem);
}
}, [anchorElem, draggableBlockElem, menuRef]);
useEffect(() => {
function onDragover(event) {
if (!isDraggingBlockRef.current) {
return false;
}
const [isFileTransfer] = eventFiles(event);
if (isFileTransfer) {
return false;
}
const {
pageY,
target
} = event;
if (!isHTMLElement(target)) {
return false;
}
const targetBlockElem = getBlockElement(anchorElem, editor, event, true);
const targetLineElem = targetLineRef.current;
if (targetBlockElem === null || targetLineElem === null) {
return false;
}
setTargetLine(targetLineElem, targetBlockElem, pageY / calculateZoomLevel(target), anchorElem);
// Prevent default event to be able to trigger onDrop events
event.preventDefault();
return true;
}
function $onDrop(event) {
if (!isDraggingBlockRef.current) {
return false;
}
const [isFileTransfer] = eventFiles(event);
if (isFileTransfer) {
return false;
}
const {
target,
dataTransfer,
pageY
} = event;
const dragData = dataTransfer != null ? dataTransfer.getData(DRAG_DATA_FORMAT) : '';
const draggedNode = $getNodeByKey(dragData);
if (!draggedNode) {
return false;
}
if (!isHTMLElement(target)) {
return false;
}
const targetBlockElem = getBlockElement(anchorElem, editor, event, true);
if (!targetBlockElem) {
return false;
}
const targetNode = $getNearestNodeFromDOMNode(targetBlockElem);
if (!targetNode) {
return false;
}
if (targetNode === draggedNode) {
return true;
}
const targetBlockElemTop = targetBlockElem.getBoundingClientRect().top;
if (pageY / calculateZoomLevel(target) >= targetBlockElemTop) {
targetNode.insertAfter(draggedNode);
} else {
targetNode.insertBefore(draggedNode);
}
setDraggableBlockElem(null);
return true;
}
return mergeRegister(editor.registerCommand(DRAGOVER_COMMAND, event => {
return onDragover(event);
}, COMMAND_PRIORITY_LOW), editor.registerCommand(DROP_COMMAND, event => {
return $onDrop(event);
}, COMMAND_PRIORITY_HIGH));
}, [anchorElem, editor, targetLineRef, setDraggableBlockElem]);
function onDragStart(event) {
const dataTransfer = event.dataTransfer;
if (!dataTransfer || !draggableBlockElem) {
return;
}
setDragImage(dataTransfer, draggableBlockElem);
let nodeKey = '';
editor.update(() => {
const node = $getNearestNodeFromDOMNode(draggableBlockElem);
if (node) {
nodeKey = node.getKey();
}
});
isDraggingBlockRef.current = true;
dataTransfer.setData(DRAG_DATA_FORMAT, nodeKey);
}
function onDragEnd() {
isDraggingBlockRef.current = false;
hideTargetLine(targetLineRef.current);
}
return /*#__PURE__*/createPortal(/*#__PURE__*/jsxs(Fragment, {
children: [/*#__PURE__*/jsx("div", {
draggable: true,
onDragStart: onDragStart,
onDragEnd: onDragEnd,
children: isEditable && menuComponent
}), targetLineComponent]
}), anchorElem);
}
function DraggableBlockPlugin_EXPERIMENTAL({
anchorElem = document.body,
menuRef,
targetLineRef,
menuComponent,
targetLineComponent,
isOnMenu,
onElementChanged
}) {
const [editor] = useLexicalComposerContext();
return useDraggableBlockMenu(editor, anchorElem, menuRef, targetLineRef, editor._editable, menuComponent, targetLineComponent, isOnMenu, onElementChanged);
}
export { DraggableBlockPlugin_EXPERIMENTAL };
@@ -0,0 +1,46 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.js");
// Source: https://www.unicode.org/cldr/charts/32/summary/te.html
// CLDR #1807 - #1811
const dateFormats = {
full: "d, MMMM y, EEEE",
long: "d MMMM, y",
medium: "d MMM, y",
short: "dd-MM-yy",
};
// CLDR #1807 - #1811
const timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a",
};
// CLDR #1815 - #1818
const dateTimeFormats = {
full: "{{date}} {{time}}'కి'",
long: "{{date}} {{time}}'కి'",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}",
};
const formatLong = (exports.formatLong = {
date: (0, _index.buildFormatLongFn)({
formats: dateFormats,
defaultWidth: "full",
}),
time: (0, _index.buildFormatLongFn)({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: (0, _index.buildFormatLongFn)({
formats: dateTimeFormats,
defaultWidth: "full",
}),
});
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/upsertRow/deleteExistingArrayRows.ts"],"sourcesContent":["import { and, eq } from 'drizzle-orm'\n\nimport type { DrizzleAdapter, DrizzleTransaction } from '../types.js'\n\ntype Args = {\n adapter: DrizzleAdapter\n db: DrizzleAdapter['drizzle'] | DrizzleTransaction\n parentID: unknown\n tableName: string\n}\n\nexport const deleteExistingArrayRows = async ({\n adapter,\n db,\n parentID,\n tableName,\n}: Args): Promise<void> => {\n const table = adapter.tables[tableName]\n\n const whereConstraints = [eq(table._parentID, parentID)]\n\n await adapter.deleteWhere({\n db,\n tableName,\n where: and(...whereConstraints),\n })\n}\n"],"names":["and","eq","deleteExistingArrayRows","adapter","db","parentID","tableName","table","tables","whereConstraints","_parentID","deleteWhere","where"],"mappings":"AAAA,SAASA,GAAG,EAAEC,EAAE,QAAQ,cAAa;AAWrC,OAAO,MAAMC,0BAA0B,OAAO,EAC5CC,OAAO,EACPC,EAAE,EACFC,QAAQ,EACRC,SAAS,EACJ;IACL,MAAMC,QAAQJ,QAAQK,MAAM,CAACF,UAAU;IAEvC,MAAMG,mBAAmB;QAACR,GAAGM,MAAMG,SAAS,EAAEL;KAAU;IAExD,MAAMF,QAAQQ,WAAW,CAAC;QACxBP;QACAE;QACAM,OAAOZ,OAAOS;IAChB;AACF,EAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"addGlobalListeners.d.ts","sourceRoot":"","sources":["../../../../src/util/addGlobalListeners.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAwDhE"}
@@ -0,0 +1 @@
{"version":3,"file":"trending-up.js","sources":["../../../src/icons/trending-up.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TrendingUp\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIyMiA3IDEzLjUgMTUuNSA4LjUgMTAuNSAyIDE3IiAvPgogIDxwb2x5bGluZSBwb2ludHM9IjE2IDcgMjIgNyAyMiAxMyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/trending-up\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 TrendingUp = createLucideIcon('TrendingUp', [\n ['polyline', { points: '22 7 13.5 15.5 8.5 10.5 2 17', key: '126l90' }],\n ['polyline', { points: '16 7 22 7 22 13', key: 'kwv8wd' }],\n]);\n\nexport default TrendingUp;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACtE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_class_name_tdz_error.cjs",
"module": "../../esm/_class_name_tdz_error.js"
}
@@ -0,0 +1,5 @@
import { IImage } from './interface.js';
declare const ICO: IImage;
export { ICO };
@@ -0,0 +1 @@
{"version":3,"file":"dsn.d.ts","sourceRoot":"","sources":["../../../src/utils/dsn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAe,MAAM,oBAAoB,CAAC;AAa9E;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,EAAE,YAAY,GAAE,OAAe,GAAG,MAAM,CAMrF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CA8BpE;AAoDD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIxE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAczE;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAMhE"}
@@ -0,0 +1,11 @@
import type { DocumentPreferences, Payload, TypedUser } from 'payload';
type Args = {
collectionSlug?: string;
globalSlug?: string;
id?: number | string;
payload: Payload;
user: TypedUser;
};
export declare const getDocPreferences: ({ id, collectionSlug, globalSlug, payload, user, }: Args) => Promise<DocumentPreferences>;
export {};
//# sourceMappingURL=getDocPreferences.d.ts.map
@@ -0,0 +1,29 @@
"use strict";
exports.fi = void 0;
var _index = require("./fi/_lib/formatDistance.cjs");
var _index2 = require("./fi/_lib/formatLong.cjs");
var _index3 = require("./fi/_lib/formatRelative.cjs");
var _index4 = require("./fi/_lib/localize.cjs");
var _index5 = require("./fi/_lib/match.cjs");
/**
* @category Locales
* @summary Finnish locale.
* @language Finnish
* @iso-639-2 fin
* @author Pyry-Samuli Lahti [@Pyppe](https://github.com/Pyppe)
* @author Edo Rivai [@mikolajgrzyb](https://github.com/mikolajgrzyb)
* @author Samu Juvonen [@sjuvonen](https://github.com/sjuvonen)
*/
const fi = (exports.fi = {
code: "fi",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
});
@@ -0,0 +1 @@
{"version":3,"file":"_range.js","sourceRoot":"","sources":["../../src/definitions/_range.ts"],"names":[],"mappings":";;AAKA,SAAwB,WAAW,CAAC,OAAiB;IACnD,OAAO,GAAG,EAAE,CAAC,CAAC;QACZ,OAAO;QACP,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,OAAO;QACnB,KAAK,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,CAAmB;YAC3C,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;YAC7B,OAAO,OAAO,KAAK,OAAO;gBACxB,CAAC,CAAC,EAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC;gBAC9B,CAAC,CAAC,EAAC,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAC,CAAA;QACpD,CAAC;QACD,UAAU,EAAE;YACV,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,CAAC;YACX,KAAK,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;SACxB;KACF,CAAC,CAAA;IAEF,SAAS,mBAAmB,CAAC,GAAW,EAAE,GAAW;QACnD,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,KAAK,gBAAgB,IAAI,GAAG,KAAK,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;SACjD;IACH,CAAC;AACH,CAAC;AAxBD,8BAwBC"}
@@ -0,0 +1,2 @@
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
module.exports = require("./data/plugin-bugfixes.json");
@@ -0,0 +1 @@
{"version":3,"file":"handleGoBack.d.ts","sourceRoot":"","sources":["../../src/utilities/handleGoBack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2DAA2D,CAAA;AAIlG,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,iBAAiB,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,YAAY,sDAAuD,WAAW,SAM1F,CAAA"}
@@ -0,0 +1 @@
{"version":3,"file":"generateValueInjectionRules.js","sources":["../../../../src/config/turbopack/generateValueInjectionRules.ts"],"sourcesContent":["import * as path from 'path';\nimport type { VercelCronsConfig } from '../../common/types';\nimport type { RouteManifest } from '../manifest/types';\nimport type { JSONValue, TurbopackMatcherWithRule } from '../types';\nimport { getPackageModules } from '../util';\n\n/**\n * Generate the value injection rules for client and server in turbopack config.\n */\nexport function generateValueInjectionRules({\n routeManifest,\n nextJsVersion,\n tunnelPath,\n vercelCronsConfig,\n}: {\n routeManifest?: RouteManifest;\n nextJsVersion?: string;\n tunnelPath?: string;\n vercelCronsConfig?: VercelCronsConfig;\n}): TurbopackMatcherWithRule[] {\n const rules: TurbopackMatcherWithRule[] = [];\n const isomorphicValues: Record<string, JSONValue> = {};\n let clientValues: Record<string, JSONValue> = {};\n let serverValues: Record<string, JSONValue> = {};\n\n if (nextJsVersion) {\n // This is used to determine version-based dev-symbolication behavior\n isomorphicValues._sentryNextJsVersion = nextJsVersion;\n }\n\n if (routeManifest) {\n clientValues._sentryRouteManifest = JSON.stringify(routeManifest);\n }\n\n // Inject tunnel route path for both client and server\n if (tunnelPath) {\n isomorphicValues._sentryRewritesTunnelPath = tunnelPath;\n }\n\n // Inject Vercel crons config for server-side cron auto-instrumentation\n if (vercelCronsConfig) {\n serverValues._sentryVercelCronsConfig = JSON.stringify(vercelCronsConfig);\n }\n // Inject server modules (matching webpack's __SENTRY_SERVER_MODULES__ behavior)\n // Use process.cwd() to get the project directory at build time\n serverValues.__SENTRY_SERVER_MODULES__ = getPackageModules(process.cwd());\n\n if (Object.keys(isomorphicValues).length > 0) {\n clientValues = { ...clientValues, ...isomorphicValues };\n serverValues = { ...serverValues, ...isomorphicValues };\n }\n\n // Client value injection\n if (Object.keys(clientValues).length > 0) {\n rules.push({\n matcher: '**/instrumentation-client.*',\n rule: {\n loaders: [\n {\n loader: path.resolve(__dirname, '..', 'loaders', 'valueInjectionLoader.js'),\n options: {\n values: clientValues,\n },\n },\n ],\n },\n });\n }\n\n // Server value injection\n if (Object.keys(serverValues).length > 0) {\n rules.push({\n matcher: '**/instrumentation.*',\n rule: {\n loaders: [\n {\n loader: path.resolve(__dirname, '..', 'loaders', 'valueInjectionLoader.js'),\n options: {\n values: serverValues,\n },\n },\n ],\n },\n });\n }\n\n return rules;\n}\n"],"names":["getPackageModules"],"mappings":";;;;;AAMA;AACA;AACA;AACO,SAAS,2BAA2B,CAAC;AAC5C,EAAE,aAAa;AACf,EAAE,aAAa;AACf,EAAE,UAAU;AACZ,EAAE,iBAAiB;AACnB;;AAKA,EAA+B;AAC/B,EAAE,MAAM,KAAK,GAA+B,EAAE;AAC9C,EAAE,MAAM,gBAAgB,GAA8B,EAAE;AACxD,EAAE,IAAI,YAAY,GAA8B,EAAE;AAClD,EAAE,IAAI,YAAY,GAA8B,EAAE;;AAElD,EAAE,IAAI,aAAa,EAAE;AACrB;AACA,IAAI,gBAAgB,CAAC,oBAAA,GAAuB,aAAa;AACzD,EAAE;;AAEF,EAAE,IAAI,aAAa,EAAE;AACrB,IAAI,YAAY,CAAC,oBAAA,GAAuB,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;AACrE,EAAE;;AAEF;AACA,EAAE,IAAI,UAAU,EAAE;AAClB,IAAI,gBAAgB,CAAC,yBAAA,GAA4B,UAAU;AAC3D,EAAE;;AAEF;AACA,EAAE,IAAI,iBAAiB,EAAE;AACzB,IAAI,YAAY,CAAC,wBAAA,GAA2B,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC;AAC7E,EAAE;AACF;AACA;AACA,EAAE,YAAY,CAAC,yBAAA,GAA4BA,sBAAiB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;;AAE3E,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,MAAA,GAAS,CAAC,EAAE;AAChD,IAAI,YAAA,GAAe,EAAE,GAAG,YAAY,EAAE,GAAG,kBAAkB;AAC3D,IAAI,YAAA,GAAe,EAAE,GAAG,YAAY,EAAE,GAAG,kBAAkB;AAC3D,EAAE;;AAEF;AACA,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAA,GAAS,CAAC,EAAE;AAC5C,IAAI,KAAK,CAAC,IAAI,CAAC;AACf,MAAM,OAAO,EAAE,6BAA6B;AAC5C,MAAM,IAAI,EAAE;AACZ,QAAQ,OAAO,EAAE;AACjB,UAAU;AACV,YAAY,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,yBAAyB,CAAC;AACvF,YAAY,OAAO,EAAE;AACrB,cAAc,MAAM,EAAE,YAAY;AAClC,aAAa;AACb,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK,CAAC;AACN,EAAE;;AAEF;AACA,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAA,GAAS,CAAC,EAAE;AAC5C,IAAI,KAAK,CAAC,IAAI,CAAC;AACf,MAAM,OAAO,EAAE,sBAAsB;AACrC,MAAM,IAAI,EAAE;AACZ,QAAQ,OAAO,EAAE;AACjB,UAAU;AACV,YAAY,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,yBAAyB,CAAC;AACvF,YAAY,OAAO,EAAE;AACrB,cAAc,MAAM,EAAE,YAAY;AAClC,aAAa;AACb,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK,CAAC;AACN,EAAE;;AAEF,EAAE,OAAO,KAAK;AACd;;;;"}
@@ -0,0 +1,37 @@
import { getTranslation } from '@payloadcms/translations';
import { status as httpStatus } from 'http-status';
import { getRequestCollection } from '../../utilities/getRequestEntity.js';
import { headersWithCors } from '../../utilities/headersWithCors.js';
import { parseParams } from '../../utilities/parseParams/index.js';
import { createOperation } from '../operations/create.js';
export const createHandler = async (req)=>{
const collection = getRequestCollection(req);
const { autosave, depth, draft, populate, publishAllLocales, select } = parseParams(req.query);
const publishSpecificLocale = req.query.publishSpecificLocale;
const doc = await createOperation({
autosave,
collection,
data: req.data,
depth,
draft,
populate,
publishAllLocales,
publishSpecificLocale,
req,
select
});
return Response.json({
doc,
message: req.t('general:successfullyCreated', {
label: getTranslation(collection.config.labels.singular, req.i18n)
})
}, {
headers: headersWithCors({
headers: new Headers(),
req
}),
status: httpStatus.CREATED
});
};
//# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/integrations/context.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAI5C,OAAO,KAAK,EACV,UAAU,EAIV,aAAa,EAId,MAAM,cAAc,CAAC;AAGtB,eAAO,MAAM,aAAa,+BAAsB,CAAC;AACjD,eAAO,MAAM,YAAY,8BAAqB,CAAC;AAU/C,UAAU,oBAAoB;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,cAAc;IACtB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA0ED;;GAEG;AACH,eAAO,MAAM,sBAAsB,8EAA6C,CAAC;AAmFjF;;GAEG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAe1C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,oBAAoB,GAAG,IAAI,GAAG,aAAa,CAqCtF"}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('trimCharsEnd', require('../trimEnd'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1 @@
export default function scrollbarSize(recalc?: boolean): number;
@@ -0,0 +1,19 @@
import deepMerge from 'deepmerge';
export { deepMerge };
/**
* Fully-featured deepMerge.
*
* Array handling: Arrays in the target object are combined with the source object's arrays.
*/
export declare function deepMergeWithCombinedArrays<T extends object>(obj1: object, obj2: object, options?: deepMerge.Options): T;
/**
* Fully-featured deepMerge.
*
* Array handling: Arrays in the target object are replaced by the source object's arrays.
*/
export declare function deepMergeWithSourceArrays<T extends object>(obj1: object, obj2: object): T;
/**
* Fully-featured deepMerge. Does not clone React components by default.
*/
export declare function deepMergeWithReactComponents<T extends object>(obj1: object, obj2: object): T;
//# sourceMappingURL=deepMerge.d.ts.map
@@ -0,0 +1,46 @@
import parseRange from 'range-parser';
/**
* Parses HTTP Range header according to RFC 7233
*
* @returns Result object indicating whether to serve full file, partial content, or invalid range
*/ export function parseRangeHeader({ fileSize, rangeHeader }) {
// No Range header - serve full file
if (!rangeHeader) {
return {
type: 'full',
range: null
};
}
const result = parseRange(fileSize, rangeHeader);
// Invalid range syntax or unsatisfiable range
if (result === -1 || result === -2) {
return {
type: 'invalid',
range: null
};
}
// Must be bytes range type
if (result.type !== 'bytes' || result.length === 0) {
return {
type: 'invalid',
range: null
};
}
// Multi-range requests: use first range only (standard simplification)
const range = result[0];
if (!range) {
return {
type: 'invalid',
range: null
};
}
return {
type: 'partial',
range: {
end: range.end,
start: range.start
}
};
}
//# sourceMappingURL=parseRangeHeader.js.map
@@ -0,0 +1,29 @@
import { DirectusVersion } from "../../../schema/version.js";
import { NestedPartial } from "../../../types/utils.js";
import { ApplyQueryFields } from "../../../types/output.js";
import { Query } from "../../../types/query.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/create/versions.d.ts
type CreateContentVersionOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusVersion<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
/**
* Create multiple new Content Versions.
*
* @param items The Content Versions to create
* @param query Optional return data query
*
* @returns Returns the Content Version object for the created Content Versions.
*/
declare const createContentVersions: <Schema, const TQuery extends Query<Schema, DirectusVersion<Schema>>>(items: NestedPartial<DirectusVersion<Schema>>[], query?: TQuery) => RestCommand<CreateContentVersionOutput<Schema, TQuery>[], Schema>;
/**
* Create a new Content Version.
*
* @param item The Content Version to create
* @param query Optional return data query
*
* @returns Returns the Content Version object for the created Content Version.
*/
declare const createContentVersion: <Schema, const TQuery extends Query<Schema, DirectusVersion<Schema>>>(item: NestedPartial<DirectusVersion<Schema>>, query?: TQuery) => RestCommand<CreateContentVersionOutput<Schema, TQuery>, Schema>;
//#endregion
export { CreateContentVersionOutput, createContentVersion, createContentVersions };
//# sourceMappingURL=versions.d.ts.map
@@ -0,0 +1,29 @@
{
"name": "@formatjs/intl-localematcher",
"description": "Intl.LocaleMatcher ponyfill",
"version": "0.8.1",
"license": "MIT",
"author": "Long Ho <holevietlong@gmail.com>",
"type": "module",
"sideEffects": false,
"types": "index.d.ts",
"exports": {
".": "./index.js"
},
"dependencies": {
"tslib": "^2.8.1",
"@formatjs/fast-memoize": "3.1.0"
},
"bugs": "https://github.com/formatjs/formatjs/issues",
"homepage": "https://github.com/formatjs/formatjs#readme",
"keywords": [
"ecma402",
"formatjs",
"i18n",
"intl",
"locale",
"react-intl",
"tc39"
],
"repository": "formatjs/formatjs.git"
}
@@ -0,0 +1 @@
{"version":3,"file":"buildOrderBy.d.ts","sourceRoot":"","sources":["../../src/queries/buildOrderBy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAInD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAK9E,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,KAAK,EAAE,qBAAqB,CAAA;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iBAAiB,EAAE,OAAO,CAAA;IAC1B,OAAO,CAAC,EAAE,GAAG,CAAA;IACb,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAC3C,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,+GAWtB,IAAI,KAAG,gBAAgB,CAAC,SAAS,CA2EnC,CAAA"}
@@ -0,0 +1,518 @@
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/da/_lib/formatDistance.mjs
var formatDistanceLocale = {
lessThanXSeconds: {
one: "mindre end \xE9t sekund",
other: "mindre end {{count}} sekunder"
},
xSeconds: {
one: "1 sekund",
other: "{{count}} sekunder"
},
halfAMinute: "\xE9t halvt minut",
lessThanXMinutes: {
one: "mindre end \xE9t minut",
other: "mindre end {{count}} minutter"
},
xMinutes: {
one: "1 minut",
other: "{{count}} minutter"
},
aboutXHours: {
one: "cirka 1 time",
other: "cirka {{count}} timer"
},
xHours: {
one: "1 time",
other: "{{count}} timer"
},
xDays: {
one: "1 dag",
other: "{{count}} dage"
},
aboutXWeeks: {
one: "cirka 1 uge",
other: "cirka {{count}} uger"
},
xWeeks: {
one: "1 uge",
other: "{{count}} uger"
},
aboutXMonths: {
one: "cirka 1 m\xE5ned",
other: "cirka {{count}} m\xE5neder"
},
xMonths: {
one: "1 m\xE5ned",
other: "{{count}} m\xE5neder"
},
aboutXYears: {
one: "cirka 1 \xE5r",
other: "cirka {{count}} \xE5r"
},
xYears: {
one: "1 \xE5r",
other: "{{count}} \xE5r"
},
overXYears: {
one: "over 1 \xE5r",
other: "over {{count}} \xE5r"
},
almostXYears: {
one: "n\xE6sten 1 \xE5r",
other: "n\xE6sten {{count}} \xE5r"
}
};
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}}", String(count));
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "om " + result;
} else {
return result + " siden";
}
}
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/da/_lib/formatLong.mjs
var dateFormats = {
full: "EEEE 'den' d. MMMM y",
long: "d. MMMM y",
medium: "d. MMM y",
short: "dd/MM/y"
};
var timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm"
};
var dateTimeFormats = {
full: "{{date}} 'kl'. {{time}}",
long: "{{date}} 'kl'. {{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/da/_lib/formatRelative.mjs
var formatRelativeLocale = {
lastWeek: "'sidste' eeee 'kl.' p",
yesterday: "'i g\xE5r kl.' p",
today: "'i dag kl.' p",
tomorrow: "'i morgen kl.' p",
nextWeek: "'p\xE5' eeee 'kl.' 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/da/_lib/localize.mjs
var eraValues = {
narrow: ["fvt", "vt"],
abbreviated: ["f.v.t.", "v.t."],
wide: ["f\xF8r vesterlandsk tidsregning", "vesterlandsk tidsregning"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1. kvt.", "2. kvt.", "3. kvt.", "4. kvt."],
wide: ["1. kvartal", "2. kvartal", "3. kvartal", "4. kvartal"]
};
var monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"jan.",
"feb.",
"mar.",
"apr.",
"maj",
"jun.",
"jul.",
"aug.",
"sep.",
"okt.",
"nov.",
"dec."],
wide: [
"januar",
"februar",
"marts",
"april",
"maj",
"juni",
"juli",
"august",
"september",
"oktober",
"november",
"december"]
};
var dayValues = {
narrow: ["S", "M", "T", "O", "T", "F", "L"],
short: ["s\xF8", "ma", "ti", "on", "to", "fr", "l\xF8"],
abbreviated: ["s\xF8n.", "man.", "tir.", "ons.", "tor.", "fre.", "l\xF8r."],
wide: [
"s\xF8ndag",
"mandag",
"tirsdag",
"onsdag",
"torsdag",
"fredag",
"l\xF8rdag"]
};
var dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "midnat",
noon: "middag",
morning: "morgen",
afternoon: "eftermiddag",
evening: "aften",
night: "nat"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnat",
noon: "middag",
morning: "morgen",
afternoon: "eftermiddag",
evening: "aften",
night: "nat"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnat",
noon: "middag",
morning: "morgen",
afternoon: "eftermiddag",
evening: "aften",
night: "nat"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "midnat",
noon: "middag",
morning: "om morgenen",
afternoon: "om eftermiddagen",
evening: "om aftenen",
night: "om natten"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnat",
noon: "middag",
morning: "om morgenen",
afternoon: "om eftermiddagen",
evening: "om aftenen",
night: "om natten"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnat",
noon: "middag",
morning: "om morgenen",
afternoon: "om eftermiddagen",
evening: "om aftenen",
night: "om natten"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
var number = Number(dirtyNumber);
return 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/da/_lib/match.mjs
var matchOrdinalNumberPattern = /^(\d+)(\.)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(fKr|fvt|eKr|vt)/i,
abbreviated: /^(f\.Kr\.?|f\.v\.t\.?|e\.Kr\.?|v\.t\.)/i,
wide: /^(f.Kr.|før vesterlandsk tidsregning|e.Kr.|vesterlandsk tidsregning)/i
};
var parseEraPatterns = {
any: [/^f/i, /^(v|e)/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234]. kvt\./i,
wide: /^[1234]\.? kvartal/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan.|feb.|mar.|apr.|maj|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,
wide: /^(januar|februar|marts|april|maj|juni|juli|august|september|oktober|november|december)/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,
/^mar/i,
/^ap/i,
/^maj/i,
/^jun/i,
/^jul/i,
/^au/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i]
};
var matchDayPatterns = {
narrow: /^[smtofl]/i,
short: /^(søn.|man.|tir.|ons.|tor.|fre.|lør.)/i,
abbreviated: /^(søn|man|tir|ons|tor|fre|lør)/i,
wide: /^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i
};
var parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^o/i, /^t/i, /^f/i, /^l/i],
any: [/^s/i, /^m/i, /^ti/i, /^o/i, /^to/i, /^f/i, /^l/i]
};
var matchDayPeriodPatterns = {
narrow: /^(a|p|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i,
any: /^([ap]\.?\s?m\.?|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i
};
var parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /midnat/i,
noon: /middag/i,
morning: /morgen/i,
afternoon: /eftermiddag/i,
evening: /aften/i,
night: /nat/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/da.mjs
var da = {
code: "da",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 4
}
};
// lib/locale/da/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), {}, {
da: da }) });
//# debugId=7C95DD956A3C0B8B64756e2164756e21
})();
//# sourceMappingURL=cdn.js.map
@@ -0,0 +1 @@
{"version":3,"file":"encode.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["encode.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,YAAY,GAAG,qCAAqC,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACnC,OAAO,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAChD,CAAC;AACD;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC3C,OAAO,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAc,EAAE,GAAW;IACjD,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,KAAK,CAAC;IAEV,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;QACxC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;QACtB,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACjC,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC/B,IAAI,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAE9B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC1B,kDAAkD;YAClD,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE;gBACpB,MAAM,QAAQ,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBACvC,MAAM,KAAK,GACP,OAAO,IAAI,CAAC,CAAC,KAAK,QAAQ;oBACtB,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,QAAQ;wBACjB,CAAC,CAAC,IAAI,CAAC,CAAC;wBACR,CAAC,CAAC,SAAS;oBACf,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBAE/B,IAAI,KAAK,KAAK,SAAS,EAAE;oBACrB,GAAG,IAAI,KAAK,CAAC;oBACb,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC;oBAChC,SAAS;iBACZ;aACJ;YAED,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;SACjB;QAED,4EAA4E;QAC5E,IAAI,IAAI,KAAK,SAAS,EAAE;YACpB,GAAG,IAAI,IAAI,CAAC;YACZ,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;SACnB;aAAM;YACH,MAAM,EAAE,GAAG,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAChC,GAAG,IAAI,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC;YAChC,4CAA4C;YAC5C,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;SACrD;KACJ;IAED,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,153 @@
import { getCurrentScope } from '../currentScopes.js';
import { DEBUG_BUILD } from '../debug-build.js';
import { debug } from './debug-logger.js';
import { getActiveSpan, spanToJSON } from './spanUtils.js';
/**
* Ordered LRU cache for storing feature flags in the scope context. The name
* of each flag in the buffer is unique, and the output of getAll() is ordered
* from oldest to newest.
*/
/**
* Max size of the LRU flag buffer stored in Sentry scope and event contexts.
*/
const _INTERNAL_FLAG_BUFFER_SIZE = 100;
/**
* Max number of flag evaluations to record per span.
*/
const _INTERNAL_MAX_FLAGS_PER_SPAN = 10;
const SPAN_FLAG_ATTRIBUTE_PREFIX = 'flag.evaluation.';
/**
* Copies feature flags that are in current scope context to the event context
*/
function _INTERNAL_copyFlagsFromScopeToEvent(event) {
const scope = getCurrentScope();
const flagContext = scope.getScopeData().contexts.flags;
const flagBuffer = flagContext ? flagContext.values : [];
if (!flagBuffer.length) {
return event;
}
if (event.contexts === undefined) {
event.contexts = {};
}
event.contexts.flags = { values: [...flagBuffer] };
return event;
}
/**
* Inserts a flag into the current scope's context while maintaining ordered LRU properties.
* Not thread-safe. After inserting:
* - The flag buffer is sorted in order of recency, with the newest evaluation at the end.
* - The names in the buffer are always unique.
* - The length of the buffer never exceeds `maxSize`.
*
* @param name Name of the feature flag to insert.
* @param value Value of the feature flag.
* @param maxSize Max number of flags the buffer should store. Default value should always be used in production.
*/
function _INTERNAL_insertFlagToScope(
name,
value,
maxSize = _INTERNAL_FLAG_BUFFER_SIZE,
) {
const scopeContexts = getCurrentScope().getScopeData().contexts;
if (!scopeContexts.flags) {
scopeContexts.flags = { values: [] };
}
const flags = scopeContexts.flags.values;
_INTERNAL_insertToFlagBuffer(flags, name, value, maxSize);
}
/**
* Exported for tests only. Currently only accepts boolean values (otherwise no-op).
* Inserts a flag into a FeatureFlag array while maintaining the following properties:
* - Flags are sorted in order of recency, with the newest evaluation at the end.
* - The flag names are always unique.
* - The length of the array never exceeds `maxSize`.
*
* @param flags The buffer to insert the flag into.
* @param name Name of the feature flag to insert.
* @param value Value of the feature flag.
* @param maxSize Max number of flags the buffer should store. Default value should always be used in production.
*/
function _INTERNAL_insertToFlagBuffer(
flags,
name,
value,
maxSize,
) {
if (typeof value !== 'boolean') {
return;
}
if (flags.length > maxSize) {
DEBUG_BUILD && debug.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${maxSize}`);
return;
}
// Check if the flag is already in the buffer - O(n)
const index = flags.findIndex(f => f.flag === name);
if (index !== -1) {
// The flag was found, remove it from its current position - O(n)
flags.splice(index, 1);
}
if (flags.length === maxSize) {
// If at capacity, pop the earliest flag - O(n)
flags.shift();
}
// Push the flag to the end - O(1)
flags.push({
flag: name,
result: value,
});
}
/**
* Records a feature flag evaluation for the active span. This is a no-op for non-boolean values.
* The flag and its value is stored in span attributes with the `flag.evaluation` prefix. Once the
* unique flags for a span reaches maxFlagsPerSpan, subsequent flags are dropped.
*
* @param name Name of the feature flag.
* @param value Value of the feature flag. Non-boolean values are ignored.
* @param maxFlagsPerSpan Max number of flags a buffer should store. Default value should always be used in production.
*/
function _INTERNAL_addFeatureFlagToActiveSpan(
name,
value,
maxFlagsPerSpan = _INTERNAL_MAX_FLAGS_PER_SPAN,
) {
if (typeof value !== 'boolean') {
return;
}
const span = getActiveSpan();
if (!span) {
return;
}
const attributes = spanToJSON(span).data;
// If the flag already exists, always update it
if (`${SPAN_FLAG_ATTRIBUTE_PREFIX}${name}` in attributes) {
span.setAttribute(`${SPAN_FLAG_ATTRIBUTE_PREFIX}${name}`, value);
return;
}
// Else, add the flag to the span if we have not reached the max number of flags
const numOfAddedFlags = Object.keys(attributes).filter(key => key.startsWith(SPAN_FLAG_ATTRIBUTE_PREFIX)).length;
if (numOfAddedFlags < maxFlagsPerSpan) {
span.setAttribute(`${SPAN_FLAG_ATTRIBUTE_PREFIX}${name}`, value);
}
}
export { _INTERNAL_FLAG_BUFFER_SIZE, _INTERNAL_MAX_FLAGS_PER_SPAN, _INTERNAL_addFeatureFlagToActiveSpan, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_insertToFlagBuffer };
//# sourceMappingURL=featureFlags.js.map
@@ -0,0 +1,434 @@
'use strict'
const { MockNotMatchedError } = require('./mock-errors')
const {
kDispatches,
kMockAgent,
kOriginalDispatch,
kOrigin,
kGetNetConnect
} = require('./mock-symbols')
const { serializePathWithQuery } = require('../core/util')
const { STATUS_CODES } = require('node:http')
const {
types: {
isPromise
}
} = require('node:util')
const { InvalidArgumentError } = require('../core/errors')
function matchValue (match, value) {
if (typeof match === 'string') {
return match === value
}
if (match instanceof RegExp) {
return match.test(value)
}
if (typeof match === 'function') {
return match(value) === true
}
return false
}
function lowerCaseEntries (headers) {
return Object.fromEntries(
Object.entries(headers).map(([headerName, headerValue]) => {
return [headerName.toLocaleLowerCase(), headerValue]
})
)
}
/**
* @param {import('../../index').Headers|string[]|Record<string, string>} headers
* @param {string} key
*/
function getHeaderByName (headers, key) {
if (Array.isArray(headers)) {
for (let i = 0; i < headers.length; i += 2) {
if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
return headers[i + 1]
}
}
return undefined
} else if (typeof headers.get === 'function') {
return headers.get(key)
} else {
return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
}
}
/** @param {string[]} headers */
function buildHeadersFromArray (headers) { // fetch HeadersList
const clone = headers.slice()
const entries = []
for (let index = 0; index < clone.length; index += 2) {
entries.push([clone[index], clone[index + 1]])
}
return Object.fromEntries(entries)
}
function matchHeaders (mockDispatch, headers) {
if (typeof mockDispatch.headers === 'function') {
if (Array.isArray(headers)) { // fetch HeadersList
headers = buildHeadersFromArray(headers)
}
return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
}
if (typeof mockDispatch.headers === 'undefined') {
return true
}
if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
return false
}
for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
const headerValue = getHeaderByName(headers, matchHeaderName)
if (!matchValue(matchHeaderValue, headerValue)) {
return false
}
}
return true
}
function normalizeSearchParams (query) {
if (typeof query !== 'string') {
return query
}
const originalQp = new URLSearchParams(query)
const normalizedQp = new URLSearchParams()
for (let [key, value] of originalQp.entries()) {
key = key.replace('[]', '')
const valueRepresentsString = /^(['"]).*\1$/.test(value)
if (valueRepresentsString) {
normalizedQp.append(key, value)
continue
}
if (value.includes(',')) {
const values = value.split(',')
for (const v of values) {
normalizedQp.append(key, v)
}
continue
}
normalizedQp.append(key, value)
}
return normalizedQp
}
function safeUrl (path) {
if (typeof path !== 'string') {
return path
}
const pathSegments = path.split('?', 3)
if (pathSegments.length !== 2) {
return path
}
const qp = new URLSearchParams(pathSegments.pop())
qp.sort()
return [...pathSegments, qp.toString()].join('?')
}
function matchKey (mockDispatch, { path, method, body, headers }) {
const pathMatch = matchValue(mockDispatch.path, path)
const methodMatch = matchValue(mockDispatch.method, method)
const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
const headersMatch = matchHeaders(mockDispatch, headers)
return pathMatch && methodMatch && bodyMatch && headersMatch
}
function getResponseData (data) {
if (Buffer.isBuffer(data)) {
return data
} else if (data instanceof Uint8Array) {
return data
} else if (data instanceof ArrayBuffer) {
return data
} else if (typeof data === 'object') {
return JSON.stringify(data)
} else if (data) {
return data.toString()
} else {
return ''
}
}
function getMockDispatch (mockDispatches, key) {
const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path
const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath)
// Match path
let matchedMockDispatches = mockDispatches
.filter(({ consumed }) => !consumed)
.filter(({ path, ignoreTrailingSlash }) => {
return ignoreTrailingSlash
? matchValue(removeTrailingSlash(safeUrl(path)), resolvedPathWithoutTrailingSlash)
: matchValue(safeUrl(path), resolvedPath)
})
if (matchedMockDispatches.length === 0) {
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
}
// Match method
matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
if (matchedMockDispatches.length === 0) {
throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`)
}
// Match body
matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
if (matchedMockDispatches.length === 0) {
throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`)
}
// Match headers
matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
if (matchedMockDispatches.length === 0) {
const headers = typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers
throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`)
}
return matchedMockDispatches[0]
}
function addMockDispatch (mockDispatches, key, data, opts) {
const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false, ...opts }
const replyData = typeof data === 'function' ? { callback: data } : { ...data }
const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
mockDispatches.push(newMockDispatch)
return newMockDispatch
}
function deleteMockDispatch (mockDispatches, key) {
const index = mockDispatches.findIndex(dispatch => {
if (!dispatch.consumed) {
return false
}
return matchKey(dispatch, key)
})
if (index !== -1) {
mockDispatches.splice(index, 1)
}
}
/**
* @param {string} path Path to remove trailing slash from
*/
function removeTrailingSlash (path) {
while (path.endsWith('/')) {
path = path.slice(0, -1)
}
if (path.length === 0) {
path = '/'
}
return path
}
function buildKey (opts) {
const { path, method, body, headers, query } = opts
return {
path,
method,
body,
headers,
query
}
}
function generateKeyValues (data) {
const keys = Object.keys(data)
const result = []
for (let i = 0; i < keys.length; ++i) {
const key = keys[i]
const value = data[key]
const name = Buffer.from(`${key}`)
if (Array.isArray(value)) {
for (let j = 0; j < value.length; ++j) {
result.push(name, Buffer.from(`${value[j]}`))
}
} else {
result.push(name, Buffer.from(`${value}`))
}
}
return result
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
* @param {number} statusCode
*/
function getStatusText (statusCode) {
return STATUS_CODES[statusCode] || 'unknown'
}
async function getResponse (body) {
const buffers = []
for await (const data of body) {
buffers.push(data)
}
return Buffer.concat(buffers).toString('utf8')
}
/**
* Mock dispatch function used to simulate undici dispatches
*/
function mockDispatch (opts, handler) {
// Get mock dispatch from built key
const key = buildKey(opts)
const mockDispatch = getMockDispatch(this[kDispatches], key)
mockDispatch.timesInvoked++
// Here's where we resolve a callback if a callback is present for the dispatch data.
if (mockDispatch.data.callback) {
mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
}
// Parse mockDispatch data
const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
const { timesInvoked, times } = mockDispatch
// If it's used up and not persistent, mark as consumed
mockDispatch.consumed = !persist && timesInvoked >= times
mockDispatch.pending = timesInvoked < times
// If specified, trigger dispatch error
if (error !== null) {
deleteMockDispatch(this[kDispatches], key)
handler.onError(error)
return true
}
// Handle the request with a delay if necessary
if (typeof delay === 'number' && delay > 0) {
setTimeout(() => {
handleReply(this[kDispatches])
}, delay)
} else {
handleReply(this[kDispatches])
}
function handleReply (mockDispatches, _data = data) {
// fetch's HeadersList is a 1D string array
const optsHeaders = Array.isArray(opts.headers)
? buildHeadersFromArray(opts.headers)
: opts.headers
const body = typeof _data === 'function'
? _data({ ...opts, headers: optsHeaders })
: _data
// util.types.isPromise is likely needed for jest.
if (isPromise(body)) {
// If handleReply is asynchronous, throwing an error
// in the callback will reject the promise, rather than
// synchronously throw the error, which breaks some tests.
// Rather, we wait for the callback to resolve if it is a
// promise, and then re-run handleReply with the new body.
return body.then((newData) => handleReply(mockDispatches, newData))
}
const responseData = getResponseData(body)
const responseHeaders = generateKeyValues(headers)
const responseTrailers = generateKeyValues(trailers)
handler.onConnect?.(err => handler.onError(err), null)
handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode))
handler.onData?.(Buffer.from(responseData))
handler.onComplete?.(responseTrailers)
deleteMockDispatch(mockDispatches, key)
}
function resume () {}
return true
}
function buildMockDispatch () {
const agent = this[kMockAgent]
const origin = this[kOrigin]
const originalDispatch = this[kOriginalDispatch]
return function dispatch (opts, handler) {
if (agent.isMockActive) {
try {
mockDispatch.call(this, opts, handler)
} catch (error) {
if (error.code === 'UND_MOCK_ERR_MOCK_NOT_MATCHED') {
const netConnect = agent[kGetNetConnect]()
if (netConnect === false) {
throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
}
if (checkNetConnect(netConnect, origin)) {
originalDispatch.call(this, opts, handler)
} else {
throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
}
} else {
throw error
}
}
} else {
originalDispatch.call(this, opts, handler)
}
}
}
function checkNetConnect (netConnect, origin) {
const url = new URL(origin)
if (netConnect === true) {
return true
} else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
return true
}
return false
}
function buildAndValidateMockOptions (opts) {
const { agent, ...mockOptions } = opts
if ('enableCallHistory' in mockOptions && typeof mockOptions.enableCallHistory !== 'boolean') {
throw new InvalidArgumentError('options.enableCallHistory must to be a boolean')
}
if ('acceptNonStandardSearchParameters' in mockOptions && typeof mockOptions.acceptNonStandardSearchParameters !== 'boolean') {
throw new InvalidArgumentError('options.acceptNonStandardSearchParameters must to be a boolean')
}
if ('ignoreTrailingSlash' in mockOptions && typeof mockOptions.ignoreTrailingSlash !== 'boolean') {
throw new InvalidArgumentError('options.ignoreTrailingSlash must to be a boolean')
}
return mockOptions
}
module.exports = {
getResponseData,
getMockDispatch,
addMockDispatch,
deleteMockDispatch,
buildKey,
generateKeyValues,
matchValue,
getResponse,
getStatusText,
mockDispatch,
buildMockDispatch,
checkNetConnect,
buildAndValidateMockOptions,
getHeaderByName,
buildHeadersFromArray,
normalizeSearchParams
}
@@ -0,0 +1,18 @@
/**
* @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 Hash = createLucideIcon("Hash", [
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
]);
export { Hash as default };
//# sourceMappingURL=hash.js.map
@@ -0,0 +1,85 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const makeSerializable = require("../util/makeSerializable");
const HarmonyImportDependency = require("./HarmonyImportDependency");
/** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */
/** @typedef {import("../Dependency")} Dependency */
/** @typedef {import("../Dependency").GetConditionFn} GetConditionFn */
/** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
/** @typedef {import("../Module")} Module */
/** @typedef {import("../ModuleGraph")} ModuleGraph */
/** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */
/** @typedef {import("../javascript/JavascriptParser").ImportAttributes} ImportAttributes */
/** @typedef {import("./ImportPhase").ImportPhaseType} ImportPhaseType */
class HarmonyImportSideEffectDependency extends HarmonyImportDependency {
/**
* @param {string} request the request string
* @param {number} sourceOrder source order
* @param {ImportPhaseType} phase import phase
* @param {ImportAttributes=} attributes import attributes
*/
constructor(request, sourceOrder, phase, attributes) {
super(request, sourceOrder, phase, attributes);
}
get type() {
return "harmony side effect evaluation";
}
/**
* @param {ModuleGraph} moduleGraph module graph
* @returns {null | false | GetConditionFn} function to determine if the connection is active
*/
getCondition(moduleGraph) {
return (connection) => {
const refModule = connection.resolvedModule;
if (!refModule) return true;
return refModule.getSideEffectsConnectionState(moduleGraph);
};
}
/**
* @param {ModuleGraph} moduleGraph the module graph
* @returns {ConnectionState} how this dependency connects the module to referencing modules
*/
getModuleEvaluationSideEffectsState(moduleGraph) {
const refModule = moduleGraph.getModule(this);
if (!refModule) return true;
return refModule.getSideEffectsConnectionState(moduleGraph);
}
}
makeSerializable(
HarmonyImportSideEffectDependency,
"webpack/lib/dependencies/HarmonyImportSideEffectDependency"
);
HarmonyImportSideEffectDependency.Template = class HarmonyImportSideEffectDependencyTemplate extends (
HarmonyImportDependency.Template
) {
/**
* @param {Dependency} dependency the dependency for which the template should be applied
* @param {ReplaceSource} source the current replace source which can be modified
* @param {DependencyTemplateContext} templateContext the context object
* @returns {void}
*/
apply(dependency, source, templateContext) {
const { moduleGraph, concatenationScope } = templateContext;
if (concatenationScope) {
const module = /** @type {Module} */ (moduleGraph.getModule(dependency));
if (concatenationScope.isModuleInScope(module)) {
return;
}
}
super.apply(dependency, source, templateContext);
}
};
module.exports = HarmonyImportSideEffectDependency;
@@ -0,0 +1,18 @@
/**
* @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 Shrink = createLucideIcon("Shrink", [
["path", { d: "m15 15 6 6m-6-6v4.8m0-4.8h4.8", key: "17vawe" }],
["path", { d: "M9 19.8V15m0 0H4.2M9 15l-6 6", key: "chjx8e" }],
["path", { d: "M15 4.2V9m0 0h4.8M15 9l6-6", key: "lav6yq" }],
["path", { d: "M9 4.2V9m0 0H4.2M9 9 3 3", key: "1pxi2q" }]
]);
export { Shrink as default };
//# sourceMappingURL=shrink.js.map
@@ -0,0 +1,395 @@
# fast-copy
<img src="https://img.shields.io/badge/build-passing-brightgreen.svg"/>
<img src="https://img.shields.io/badge/coverage-100%25-brightgreen.svg"/>
<img src="https://img.shields.io/badge/license-MIT-blue.svg"/>
A [blazing fast](#benchmarks) deep object copier
## Table of contents
- [fast-copy](#fast-copy)
- [Table of contents](#table-of-contents)
- [Usage](#usage)
- [API](#api)
- [`copy`](#copy)
- [`copyStrict`](#copystrict)
- [`createCopier`](#createcopier)
- [Copier methods](#copier-methods)
- [Copier state](#copier-state)
- [`cache`](#cache)
- [`copier`](#copier)
- [`Constructor` / `prototype`](#constructor--prototype)
- [`createStrictCopier`](#createstrictcopier)
- [Types supported](#types-supported)
- [Aspects of default copiers](#aspects-of-default-copiers)
- [Error references are copied directly, instead of creating a new `*Error` object](#error-references-are-copied-directly-instead-of-creating-a-new-error-object)
- [The constructor of the original object is used, instead of using known globals](#the-constructor-of-the-original-object-is-used-instead-of-using-known-globals)
- [Generator objects are copied, but still reference the original generator's state](#generator-objects-are-copied-but-still-reference-the-original-generators-state)
- [Benchmarks](#benchmarks)
- [Simple objects](#simple-objects)
- [Complex objects](#complex-objects)
- [Big data](#big-data)
- [Circular objects](#circular-objects)
- [Special objects](#special-objects)
- [Development](#development)
## Usage
```js
import copy from 'fast-copy';
import { deepEqual } from 'fast-equals';
const object = {
array: [123, { deep: 'value' }],
map: new Map([
['foo', {}],
[{ bar: 'baz' }, 'quz'],
]),
};
const copiedObject = copy(object);
console.log(copiedObject === object); // false
console.log(deepEqual(copiedObject, object)); // true
```
## API
### `copy`
Deeply copy the object passed.
```js
import copy from 'fast-copy';
const copied = copy({ foo: 'bar' });
```
### `copyStrict`
Deeply copy the object passed, but with additional strictness when replicating the original object:
- Properties retain their original property descriptor
- Non-enumerable keys are copied
- Non-standard properties (e.g., keys on arrays / maps / sets) are copied
```js
import { copyStrict } from 'fast-copy';
const object = { foo: 'bar' };
object.nonEnumerable = Object.defineProperty(object, 'bar', {
enumerable: false,
value: 'baz',
});
const copied = copy(object);
```
**NOTE**: This method is significantly slower than [`copy`](#copy), so it is recommended to only use this when you have specific use-cases that require it.
### `createCopier`
Create a custom copier based on the type-specific methods passed. This is useful if you want to squeeze out maximum performance, or perform something other than a standard deep copy.
```js
import { createCopier } from 'fast-copy';
const copyShallow = createCopier({
array: (array) => [...array],
map: (map) => new Map(map.entries()),
object: (object) => ({ ...object }),
set: (set) => new Set(set.values()),
});
```
Each internal copier method has the following contract:
```js
type InternalCopier<Value> = (value: Value, state: State) => Value;
interface State {
Constructor: any;
cache: WeakMap;
copier: InternalCopier<any>;
prototype: any;
}
```
Any method overriding the defaults must maintain this contract.
#### Copier methods
- `array` => `Array`
- `arrayBuffer`=> `ArrayBuffer`, `Float32Array`, `Float64Array`, `Int8Array`, `Int16Array`, `Int32Array`, `Uint8Array`, `Uint8ClampedArray`, `Uint16Array`, `Uint32Array`, `Uint64Array`
- `blob` => `Blob`
- `dataView` => `DataView`
- `date` => `Date`
- `error` => `Error`, `AggregateError`, `EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, `URIError`
- `map` => `Map`
- `object` => `Object`, or any custom constructor
- `regExp` => `RegExp`
- `set` => `Set`
#### Copier state
##### `cache`
If you want to maintain circular reference handling, then you'll need the methods to handle cache population for future lookups:
```js
function shallowlyCloneArray<Value extends any[]>(
value: Value,
state: State
): Value {
const clone = [...value];
state.cache.set(value, clone);
return clone;
}
```
##### `copier`
`copier` is provided for recursive calls with deeply-nested objects.
```js
function deeplyCloneArray<Value extends any[]>(
value: Value,
state: State
): Value {
const clone = [];
state.cache.set(value, clone);
value.forEach((item) => state.copier(item, state));
return clone;
}
```
Note above I am using `forEach` instead of a simple `map`. This is because it is highly recommended to store the clone in [`cache`](#cache) eagerly when deeply copying, so that nested circular references are handled correctly.
##### `Constructor` / `prototype`
Both `Constructor` and `prototype` properties are only populated with complex objects that are not standard objects or arrays. This is mainly useful for custom subclasses of these globals, or maintaining custom prototypes of objects.
```js
function deeplyCloneSubclassArray<Value extends CustomArray>(
value: Value,
state: State
): Value {
const clone = new state.Constructor();
state.cache.set(value, clone);
value.forEach((item) => clone.push(item));
return clone;
}
function deeplyCloneCustomObject<Value extends CustomObject>(
value: Value,
state: State
): Value {
const clone = Object.create(state.prototype);
state.cache.set(value, clone);
Object.entries(value).forEach(([k, v]) => (clone[k] = v));
return clone;
}
```
### `createStrictCopier`
Create a custom copier based on the type-specific methods passed, but defaulting to the same functions normally used for `copyStrict`. This is useful if you want to squeeze out better performance while maintaining strict requirements, or perform something other than a strict deep copy.
```js
const createStrictClone = (value, clone) =>
Object.getOwnPropertyNames(value).reduce(
(clone, property) =>
Object.defineProperty(
clone,
property,
Object.getOwnPropertyDescriptor(value, property) || {
configurable: true,
enumerable: true,
value: clone[property],
writable: true,
}
),
clone
);
const copyStrictShallow = createStrictCopier({
array: (array) => createStrictClone(array, []),
map: (map) => createStrictClone(map, new Map(map.entries())),
object: (object) => createStrictClone(object, {}),
set: (set) => createStrictClone(set, new Set(set.values())),
});
```
**NOTE**: This method creates a copier that is significantly slower than [`copy`](#copy), as well as likely a copier created by [`createCopier`](#createcopier), so it is recommended to only use this when you have specific use-cases that require it.
## Types supported
The following object types are deeply cloned when they are either properties on the object passed, or the object itself:
- `Array`
- `ArrayBuffer`
- `Boolean` primitive wrappers (e.g., `new Boolean(true)`)
- `Blob`
- `Buffer`
- `DataView`
- `Date`
- `Float32Array`
- `Float64Array`
- `Int8Array`
- `Int16Array`
- `Int32Array`
- `Map`
- `Number` primitive wrappers (e.g., `new Number(123)`)
- `Object`
- `RegExp`
- `Set`
- `String` primitive wrappers (e.g., `new String('foo')`)
- `Uint8Array`
- `Uint8ClampedArray`
- `Uint16Array`
- `Uint32Array`
- `React` components
- Custom constructors
The following object types are copied directly, as they are either primitives, cannot be cloned, or the common use-case implementation does not expect cloning:
- `AsyncFunction`
- `Boolean` primitives
- `Error`
- `Function`
- `GeneratorFunction`
- `Number` primitives
- `Null`
- `Promise`
- `String` primitives
- `Symbol`
- `Undefined`
- `WeakMap`
- `WeakSet`
Circular objects are supported out of the box. By default, a cache based on `WeakSet` is used, but if `WeakSet` is not available then a fallback is used. The benchmarks quoted below are based on use of `WeakSet`.
## Aspects of default copiers
Inherently, what is considered a valid copy is subjective because of different requirements and use-cases. For this library, some decisions were explicitly made for the default copiers of specific object types, and those decisions are detailed below. If your use-cases require different handling, you can always create your own custom copier with [`createCopier`](#createcopier) or [`createStrictCopier`](#createstrictcopier).
### Error references are copied directly, instead of creating a new `*Error` object
While it would be relatively trivial to copy over the message and stack to a new object of the same `Error` subclass, it is a common practice to "override" the message or stack, and copies would not retain this mutation. As such, the original reference is copied.
### The constructor of the original object is used, instead of using known globals
Starting in ES2015, native globals can be subclassed like any custom class. When copying, we explicitly reuse the constructor of the original object. However, the expectation is that these subclasses would have the same constructur signature as their native base class. This is a common community practice, but there is the possibility of inaccuracy if the contract differs.
### Generator objects are copied, but still reference the original generator's state
[Generator objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator) are specific types of iterators, but appear like standard objects that just have a few methods (`next`, `throw`, `return`). These methods are bound to the internal state of the generator, which cannot be copied effectively. Normally this would be treated like other "uncopiable" objects and simply pass the reference through, however the "validation" of whether it is a generator object or a standard object is not guaranteed (duck-typing) and there is a runtime cost associated with. Therefore, the simplest path of treating it like a standard object (copying methods to a new object) was taken.
## Benchmarks
#### Simple objects
_Small number of properties, all values are primitives_
| | Operations / second |
| ------------------ | ------------------- |
| **fast-copy** | **5,880,312** |
| lodash.cloneDeep | 2,706,261 |
| clone | 2,207,231 |
| deepclone | 1,274,810 |
| fast-clone | 1,239,952 |
| ramda | 1,146,152 |
| fast-copy (strict) | 852,382 |
#### Complex objects
_Large number of properties, values are a combination of primitives and complex objects_
| | Operations / second |
| ------------------ | ------------------- |
| **fast-copy** | **162,858** |
| ramda | 142,104 |
| deepclone | 133,607 |
| fast-clone | 101,143 |
| clone | 70,872 |
| fast-copy (strict) | 62,961 |
| lodash.cloneDeep | 62,060 |
#### Big data
_Very large number of properties with high amount of nesting, mainly objects and arrays_
| | Operations / second |
| ------------------ | ------------------- |
| **fast-copy** | **303** |
| fast-clone | 245 |
| deepclone | 151 |
| lodash.cloneDeep | 150 |
| clone | 93 |
| fast-copy (strict) | 90 |
| ramda | 42 |
#### Circular objects
_Objects that deeply reference themselves_
| | Operations / second |
| ------------------ | ------------------- |
| **fast-copy** | **2,420,466** |
| deepclone | 1,386,896 |
| ramda | 1,024,108 |
| lodash.cloneDeep | 989,796 |
| clone | 987,721 |
| fast-copy (strict) | 617,602 |
| fast-clone | 0 (not supported) |
#### Special objects
_Custom constructors, React components, etc_
| | Operations / second |
| ------------------ | ------------------- |
| **fast-copy** | **152,792** |
| clone | 74,347 |
| fast-clone | 66,576 |
| lodash.cloneDeep | 64,760 |
| ramda | 53,542 |
| deepclone | 28,823 |
| fast-copy (strict) | 21,362 |
## Development
Standard practice, clone the repo and `yarn` (or `npm i`) to get the dependencies. The following npm scripts are available:
- benchmark => run benchmark tests against other equality libraries
- build => run `build:esm`, `build:cjs`, `build:umd`, and `build:min` scripts
- build:cjs => build CJS files and types
- build:esm => build ESM files and types
- build:min => build minified files and types
- build:umd => build UMD files and types
- clean => run `rimraf` on the `dist` folder
- dev => start webpack playground App
- dist => run `clean` and `build` scripts
- lint => run ESLint on all files in `src` folder (also runs on `dev` script)
- lint:fix => run `lint` script, but with auto-fixer
- prepublishOnly => run `lint`, `test:coverage`, and `dist` scripts
- release => run `prepublishOnly` and release with new version
- release:beta => run `prepublishOnly` and release with new beta version
- release:dry => run `prepublishOnly` and simulate a new release
- start => run `dev`
- test => run AVA with NODE_ENV=test on all files in `test` folder
- test:coverage => run same script as `test` with code coverage calculation via `nyc`
- test:watch => run same script as `test` but keep persistent watcher
- typecheck => run `tsc` on the codebase
@@ -0,0 +1,116 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const DelegatedModule = require("./DelegatedModule");
/** @typedef {import("../declarations/plugins/DllReferencePlugin").DllReferencePluginOptions} DllReferencePluginOptions */
/** @typedef {import("../declarations/plugins/DllReferencePlugin").DllReferencePluginOptionsContent} DllReferencePluginOptionsContent */
/** @typedef {import("./DelegatedModule").DelegatedModuleData} DelegatedModuleData */
/** @typedef {import("./DelegatedModule").DelegatedModuleSourceRequest} DelegatedModuleSourceRequest */
/** @typedef {import("./DelegatedModule").DelegatedModuleType} DelegatedModuleType */
/** @typedef {import("./NormalModuleFactory")} NormalModuleFactory */
/** @typedef {import("./util/identifier").AssociatedObjectForCache} AssociatedObjectForCache */
/**
* @typedef {object} Options
* @property {DelegatedModuleSourceRequest} source source
* @property {NonNullable<DllReferencePluginOptions["context"]>} context absolute context path to which lib ident is relative to
* @property {DllReferencePluginOptionsContent} content content
* @property {DllReferencePluginOptions["type"]} type type
* @property {DllReferencePluginOptions["extensions"]} extensions extensions
* @property {DllReferencePluginOptions["scope"]} scope scope
* @property {AssociatedObjectForCache=} associatedObjectForCache object for caching
*/
const PLUGIN_NAME = "DelegatedModuleFactoryPlugin";
class DelegatedModuleFactoryPlugin {
/**
* @param {Options} options options
*/
constructor(options) {
this.options = options;
options.type = options.type || "require";
options.extensions = options.extensions || ["", ".js", ".json", ".wasm"];
}
/**
* @param {NormalModuleFactory} normalModuleFactory the normal module factory
* @returns {void}
*/
apply(normalModuleFactory) {
const scope = this.options.scope;
if (scope) {
normalModuleFactory.hooks.factorize.tapAsync(
PLUGIN_NAME,
(data, callback) => {
const [dependency] = data.dependencies;
const { request } = dependency;
if (request && request.startsWith(`${scope}/`)) {
const innerRequest = `.${request.slice(scope.length)}`;
/** @type {undefined | DelegatedModuleData} */
let resolved;
if (innerRequest in this.options.content) {
resolved = this.options.content[innerRequest];
return callback(
null,
new DelegatedModule(
this.options.source,
resolved,
/** @type {DelegatedModuleType} */
(this.options.type),
innerRequest,
request
)
);
}
const extensions =
/** @type {string[]} */
(this.options.extensions);
for (let i = 0; i < extensions.length; i++) {
const extension = extensions[i];
const requestPlusExt = innerRequest + extension;
if (requestPlusExt in this.options.content) {
resolved = this.options.content[requestPlusExt];
return callback(
null,
new DelegatedModule(
this.options.source,
resolved,
/** @type {DelegatedModuleType} */
(this.options.type),
requestPlusExt,
request + extension
)
);
}
}
}
return callback();
}
);
} else {
normalModuleFactory.hooks.module.tap(PLUGIN_NAME, (module) => {
const request = module.libIdent(this.options);
if (request && request in this.options.content) {
const resolved = this.options.content[request];
return new DelegatedModule(
this.options.source,
resolved,
/** @type {DelegatedModuleType} */
(this.options.type),
request,
module
);
}
return module;
});
}
}
}
module.exports = DelegatedModuleFactoryPlugin;
@@ -0,0 +1,7 @@
/**
* Find the first scrollable parent of an element.
*
* @param element Starting element
* @param firstPossible Stop at the first scrollable parent, even if it's not currently scrollable
*/
export default function scrollParent(element: HTMLElement, firstPossible?: boolean): Document | HTMLElement;
@@ -0,0 +1,60 @@
/**
* 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 mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalUtils.dev.mjs') : import('./LexicalUtils.prod.mjs'));
export const $descendantsMatching = mod.$descendantsMatching;
export const $dfs = mod.$dfs;
export const $dfsIterator = mod.$dfsIterator;
export const $filter = mod.$filter;
export const $findMatchingParent = mod.$findMatchingParent;
export const $firstToLastIterator = mod.$firstToLastIterator;
export const $getAdjacentCaret = mod.$getAdjacentCaret;
export const $getAdjacentSiblingOrParentSiblingCaret = mod.$getAdjacentSiblingOrParentSiblingCaret;
export const $getDepth = mod.$getDepth;
export const $getNearestBlockElementAncestorOrThrow = mod.$getNearestBlockElementAncestorOrThrow;
export const $getNearestNodeOfType = mod.$getNearestNodeOfType;
export const $getNextRightPreorderNode = mod.$getNextRightPreorderNode;
export const $getNextSiblingOrParentSibling = mod.$getNextSiblingOrParentSibling;
export const $insertFirst = mod.$insertFirst;
export const $insertNodeToNearestRoot = mod.$insertNodeToNearestRoot;
export const $insertNodeToNearestRootAtCaret = mod.$insertNodeToNearestRootAtCaret;
export const $isEditorIsNestedEditor = mod.$isEditorIsNestedEditor;
export const $lastToFirstIterator = mod.$lastToFirstIterator;
export const $restoreEditorState = mod.$restoreEditorState;
export const $reverseDfs = mod.$reverseDfs;
export const $reverseDfsIterator = mod.$reverseDfsIterator;
export const $splitNode = mod.$splitNode;
export const $unwrapAndFilterDescendants = mod.$unwrapAndFilterDescendants;
export const $unwrapNode = mod.$unwrapNode;
export const $wrapNodeInElement = mod.$wrapNodeInElement;
export const CAN_USE_BEFORE_INPUT = mod.CAN_USE_BEFORE_INPUT;
export const CAN_USE_DOM = mod.CAN_USE_DOM;
export const IS_ANDROID = mod.IS_ANDROID;
export const IS_ANDROID_CHROME = mod.IS_ANDROID_CHROME;
export const IS_APPLE = mod.IS_APPLE;
export const IS_APPLE_WEBKIT = mod.IS_APPLE_WEBKIT;
export const IS_CHROME = mod.IS_CHROME;
export const IS_FIREFOX = mod.IS_FIREFOX;
export const IS_IOS = mod.IS_IOS;
export const IS_SAFARI = mod.IS_SAFARI;
export const addClassNamesToElement = mod.addClassNamesToElement;
export const calculateZoomLevel = mod.calculateZoomLevel;
export const isBlockDomNode = mod.isBlockDomNode;
export const isHTMLAnchorElement = mod.isHTMLAnchorElement;
export const isHTMLElement = mod.isHTMLElement;
export const isInlineDomNode = mod.isInlineDomNode;
export const isMimeType = mod.isMimeType;
export const makeStateWrapper = mod.makeStateWrapper;
export const markSelection = mod.markSelection;
export const mediaFileReader = mod.mediaFileReader;
export const mergeRegister = mod.mergeRegister;
export const objectKlassEquals = mod.objectKlassEquals;
export const positionNodeOnRange = mod.positionNodeOnRange;
export const registerNestedElementResolver = mod.registerNestedElementResolver;
export const removeClassNamesFromElement = mod.removeClassNamesFromElement;
export const selectionAlwaysOnDisplay = mod.selectionAlwaysOnDisplay;
@@ -0,0 +1,25 @@
import { GrowthBookClass } from './types';
/**
* Sentry integration for capturing feature flag evaluations from GrowthBook.
*
* See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags
*
* @example
* ```
* import { GrowthBook } from '@growthbook/growthbook';
* import * as Sentry from '@sentry/browser';
*
* Sentry.init({
* dsn: '___PUBLIC_DSN___',
* integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],
* });
*
* const gb = new GrowthBook();
* gb.isOn('my-feature');
* Sentry.captureException(new Error('something went wrong'));
* ```
*/
export declare const growthbookIntegration: ({ growthbookClass }: {
growthbookClass: GrowthBookClass;
}) => import("@sentry/core").Integration;
//# sourceMappingURL=integration.d.ts.map
@@ -0,0 +1,28 @@
name: ci
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [14.x, 16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Run tests
run: |
npm run test
@@ -0,0 +1,111 @@
.TH "MARKED" "1" "August 2024" "13.0.3"
.SH "NAME"
\fBmarked\fR \- a javascript markdown parser
.SH SYNOPSIS
.P
\fBmarked\fP [\fB\-o\fP <output file>] [\fB\-i\fP <input file>] [\fB\-s\fP <markdown string>] [\fB\-c\fP <config file>] [\fB\-\-help\fP] [\fB\-\-version\fP] [\fB\-\-tokens\fP] [\fB\-\-no\-clobber\fP] [\fB\-\-pedantic\fP] [\fB\-\-gfm\fP] [\fB\-\-breaks\fP] [\fB\-\-no\-etc\.\.\.\fP] [\fB\-\-silent\fP] [filename]
.SH DESCRIPTION
.P
marked is a full\-featured javascript markdown parser, built for speed\.
.br
It also includes multiple GFM features\.
.SH EXAMPLES
.RS 2
.nf
cat in\.md | marked > out\.html
.fi
.RE
.RS 2
.nf
echo "hello *world*" | marked
.fi
.RE
.RS 2
.nf
marked \-o out\.html \-i in\.md \-\-gfm
.fi
.RE
.RS 2
.nf
marked \-\-output="hello world\.html" \-i in\.md \-\-no\-breaks
.fi
.RE
.SH OPTIONS
.RS 1
.IP \(bu 2
\-o, \-\-output [output file]
.br
Specify file output\. If none is specified, write to stdout\.
.IP \(bu 2
\-i, \-\-input [input file]
.br
Specify file input, otherwise use last argument as input file\.
.br
If no input file is specified, read from stdin\.
.IP \(bu 2
\-s, \-\-string [markdown string]
.br
Specify string input instead of a file\.
.IP \(bu 2
\-c, \-\-config [config file]
.br
Specify config file to use instead of the default \fB~/\.marked\.json\fP or \fB~/\.marked\.js\fP or \fB~/\.marked/index\.js\fP\|\.
.IP \(bu 2
\-t, \-\-tokens
.br
Output a token list instead of html\.
.IP \(bu 2
\-n, \-\-no\-clobber
.br
Do not overwrite \fBoutput\fP if it exists\.
.IP \(bu 2
\-\-pedantic
.br
Conform to obscure parts of markdown\.pl as much as possible\.
.br
Don't fix original markdown bugs\.
.IP \(bu 2
\-\-gfm
.br
Enable github flavored markdown\.
.IP \(bu 2
\-\-breaks
.br
Enable GFM line breaks\. Only works with the gfm option\.
.IP \(bu 2
\-\-no\-breaks, \-no\-etc\.\.\.
.br
The inverse of any of the marked options above\.
.IP \(bu 2
\-\-silent
.br
Silence error output\.
.IP \(bu 2
\-h, \-\-help
.br
Display help information\.
.RE
.SH CONFIGURATION
.P
For configuring and running programmatically\.
.P
Example
.RS 2
.nf
import { Marked } from 'marked';
const marked = new Marked({ gfm: true });
marked\.parse('*foo*');
.fi
.RE
.SH BUGS
.P
Please report any bugs to https://github.com/markedjs/marked
.SH LICENSE
.P
Copyright (c) 2011\-2014, Christopher Jeffrey (MIT License)\.
.SH SEE ALSO
.P
markdown(1), nodejs(1)
@@ -0,0 +1 @@
{"version":3,"file":"sv.d.ts","sourceRoot":"","sources":["../../src/languages/sv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtE,eAAO,MAAM,cAAc,EAAE,yBA4nB5B,CAAA;AAED,eAAO,MAAM,EAAE,EAAE,QAGhB,CAAA"}
@@ -0,0 +1 @@
{"version":3,"file":"formatRelationshipTitle.js","names":["formatRelationshipTitle","data","Array","isArray","map","item","id","String","filter","Boolean","join"],"sources":["../../../src/utilities/formatDocTitle/formatRelationshipTitle.ts"],"sourcesContent":["export const formatRelationshipTitle = (data): string => {\n if (Array.isArray(data)) {\n return data\n .map((item) => {\n if (typeof item === 'object' && item !== null) {\n return item.id\n }\n return String(item)\n })\n .filter(Boolean)\n .join(', ')\n }\n\n if (typeof data === 'object' && data !== null) {\n return data.id || ''\n }\n\n return String(data)\n}\n"],"mappings":"AAAA,OAAO,MAAMA,uBAAA,GAA2BC,IAAA;EACtC,IAAIC,KAAA,CAAMC,OAAO,CAACF,IAAA,GAAO;IACvB,OAAOA,IAAA,CACJG,GAAG,CAAEC,IAAA;MACJ,IAAI,OAAOA,IAAA,KAAS,YAAYA,IAAA,KAAS,MAAM;QAC7C,OAAOA,IAAA,CAAKC,EAAE;MAChB;MACA,OAAOC,MAAA,CAAOF,IAAA;IAChB,GACCG,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;EACV;EAEA,IAAI,OAAOT,IAAA,KAAS,YAAYA,IAAA,KAAS,MAAM;IAC7C,OAAOA,IAAA,CAAKK,EAAE,IAAI;EACpB;EAEA,OAAOC,MAAA,CAAON,IAAA;AAChB","ignoreList":[]}
@@ -0,0 +1,8 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./modifiers.cjs.production.min.js')
} else {
module.exports = require('./modifiers.cjs.development.js')
}
@@ -0,0 +1,214 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React, { useCallback, useEffect, useMemo } from 'react';
import { Form, useForm } from '../../../forms/Form/index.js';
import { WatchChildErrors } from '../../../forms/WatchChildErrors/index.js';
import { useConfig } from '../../../providers/Config/index.js';
import { useDocumentEvents } from '../../../providers/DocumentEvents/index.js';
import { useDocumentInfo } from '../../../providers/DocumentInfo/index.js';
import { OperationProvider } from '../../../providers/Operation/index.js';
import { useServerFunctions } from '../../../providers/ServerFunctions/index.js';
import { abortAndIgnore, handleAbortRef } from '../../../utilities/abortAndIgnore.js';
import { useDocumentDrawerContext } from '../../DocumentDrawer/Provider.js';
import { DocumentFields } from '../../DocumentFields/index.js';
import { MoveDocToFolder } from '../../FolderView/MoveDocToFolder/index.js';
import { Upload_v4 } from '../../Upload/index.js';
import { useFormsManager } from '../FormsManager/index.js';
import './index.scss';
const baseClass = 'collection-edit';
// This component receives props only on _pages_
// When rendered within a drawer, props are empty
// This is solely to support custom edit views which get server-rendered
export function EditForm({
resetUploadEdits,
submitted,
updateUploadEdits,
uploadEdits
}) {
const {
action,
collectionSlug: docSlug,
docPermissions,
getDocPreferences,
hasSavePermission,
initialState,
isInitializing,
Upload: CustomUpload
} = useDocumentInfo();
const {
drawerSlug,
onSave: onSaveFromContext
} = useDocumentDrawerContext();
const {
getFormState
} = useServerFunctions();
const {
config: {
folders
},
getEntityConfig
} = useConfig();
const abortOnChangeRef = React.useRef(null);
const collectionConfig = getEntityConfig({
collectionSlug: docSlug
});
const {
reportUpdate
} = useDocumentEvents();
const collectionSlug = collectionConfig.slug;
const [schemaPath] = React.useState(collectionSlug);
const onSave = useCallback(json => {
reportUpdate({
doc: json?.doc || json?.result,
drawerSlug,
entitySlug: collectionSlug,
operation: 'create',
updatedAt: json?.result?.updatedAt || new Date().toISOString()
});
if (typeof onSaveFromContext === 'function') {
void onSaveFromContext({
...json,
operation: 'create'
});
}
resetUploadEdits();
}, [collectionSlug, onSaveFromContext, reportUpdate, resetUploadEdits, drawerSlug]);
const onChange = useCallback(async ({
formState: prevFormState,
submitted: submitted_0
}) => {
const controller = handleAbortRef(abortOnChangeRef);
const docPreferences = await getDocPreferences();
const {
state: newFormState
} = await getFormState({
collectionSlug,
docPermissions,
docPreferences,
formState: prevFormState,
operation: 'create',
schemaPath,
signal: controller.signal,
skipValidation: !submitted_0
});
abortOnChangeRef.current = null;
return newFormState;
}, [collectionSlug, schemaPath, getDocPreferences, getFormState, docPermissions]);
useEffect(() => {
const abortOnChange = abortOnChangeRef.current;
return () => {
abortAndIgnore(abortOnChange);
};
}, []);
return /*#__PURE__*/_jsx(OperationProvider, {
operation: "create",
children: /*#__PURE__*/_jsxs(Form, {
action: action,
className: `${baseClass}__form`,
disabled: isInitializing || !hasSavePermission,
initialState: isInitializing ? undefined : initialState,
isInitializing: isInitializing,
method: "POST",
onChange: [onChange],
onSuccess: onSave,
submitted: submitted,
children: [/*#__PURE__*/_jsx(DocumentFields, {
BeforeFields: /*#__PURE__*/_jsx(React.Fragment, {
children: CustomUpload || /*#__PURE__*/_jsx(Upload_v4, {
collectionSlug: collectionConfig.slug,
customActions: [folders && collectionConfig.folders && /*#__PURE__*/_jsx(MoveDocToFolder, {
buttonProps: {
buttonStyle: 'pill',
size: 'small'
},
folderCollectionSlug: folders.slug,
folderFieldName: folders.fieldName
}, "move-doc-to-folder")].filter(Boolean),
initialState: initialState,
resetUploadEdits: resetUploadEdits,
updateUploadEdits: updateUploadEdits,
uploadConfig: collectionConfig.upload,
uploadEdits: uploadEdits
})
}),
docPermissions: docPermissions,
fields: collectionConfig.fields,
schemaPathSegments: [collectionConfig.slug]
}), /*#__PURE__*/_jsx(ReportAllErrors, {}), /*#__PURE__*/_jsx(GetFieldProxy, {})]
})
});
}
function GetFieldProxy() {
const $ = _c(7);
const {
getField,
getFields
} = useForm();
const {
getFormDataRef
} = useFormsManager();
let t0;
if ($[0] !== getFields || $[1] !== getFormDataRef) {
t0 = () => {
getFormDataRef.current = getFields;
};
$[0] = getFields;
$[1] = getFormDataRef;
$[2] = t0;
} else {
t0 = $[2];
}
let t1;
if ($[3] !== getField || $[4] !== getFields || $[5] !== getFormDataRef) {
t1 = [getFields, getField, getFormDataRef];
$[3] = getField;
$[4] = getFields;
$[5] = getFormDataRef;
$[6] = t1;
} else {
t1 = $[6];
}
useEffect(t0, t1);
return null;
}
function ReportAllErrors() {
const {
docConfig
} = useDocumentInfo();
const {
activeIndex,
forms,
setFormTotalErrorCount
} = useFormsManager();
const errorCountRef = React.useRef(0);
const fileIsValid = useMemo(() => {
const currentForm = forms[activeIndex];
return currentForm?.formState?.file?.valid ?? true;
}, [activeIndex, forms]);
const reportFormErrorCount = React.useCallback(fieldErrorCount => {
let newErrorCount = fieldErrorCount;
// If the file is invalid, count that as an error
if (!fileIsValid) {
newErrorCount += 1;
}
if (newErrorCount === errorCountRef.current) {
return;
}
setFormTotalErrorCount({
errorCount: newErrorCount,
index: activeIndex
});
errorCountRef.current = newErrorCount;
}, [activeIndex, setFormTotalErrorCount, fileIsValid]);
if (!docConfig) {
return null;
}
return /*#__PURE__*/_jsx(WatchChildErrors, {
fields: docConfig.fields,
path: [],
setErrorCount: reportFormErrorCount
});
}
//# sourceMappingURL=index.js.map

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