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

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

View File

@@ -0,0 +1,34 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConnectNames = exports.ConnectTypes = exports.AttributeNames = void 0;
var AttributeNames;
(function (AttributeNames) {
AttributeNames["CONNECT_TYPE"] = "connect.type";
AttributeNames["CONNECT_NAME"] = "connect.name";
})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {}));
var ConnectTypes;
(function (ConnectTypes) {
ConnectTypes["MIDDLEWARE"] = "middleware";
ConnectTypes["REQUEST_HANDLER"] = "request_handler";
})(ConnectTypes = exports.ConnectTypes || (exports.ConnectTypes = {}));
var ConnectNames;
(function (ConnectNames) {
ConnectNames["MIDDLEWARE"] = "middleware";
ConnectNames["REQUEST_HANDLER"] = "request handler";
})(ConnectNames = exports.ConnectNames || (exports.ConnectNames = {}));
//# sourceMappingURL=AttributeNames.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"permissions.cjs","names":[],"sources":["../../../../src/rest/commands/create/permissions.ts"],"sourcesContent":["import type { DirectusPermission } from '../../../schema/permission.js';\nimport type { ApplyQueryFields, NestedPartial, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\n\nexport type CreatePermissionOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusPermission<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Create multiple new permission rules\n *\n * @param items The permission rules to create\n * @param query Optional return data query\n *\n * @returns Returns the permission objects for the created permissions.\n */\nexport const createPermissions =\n\t<Schema, const TQuery extends Query<Schema, DirectusPermission<Schema>>>(\n\t\titems: NestedPartial<DirectusPermission<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<CreatePermissionOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/permissions`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(items),\n\t\tmethod: 'POST',\n\t});\n\n/**\n * Create a new permission rule\n *\n * @param item The permission rule to create\n * @param query Optional return data query\n *\n * @returns Returns the permission object for the created permission.\n */\nexport const createPermission =\n\t<Schema, const TQuery extends Query<Schema, DirectusPermission<Schema>>>(\n\t\titem: NestedPartial<DirectusPermission<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<CreatePermissionOutput<Schema, TQuery>, Schema> =>\n\t() => ({\n\t\tpath: `/permissions`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(item),\n\t\tmethod: 'POST',\n\t});\n"],"mappings":"AAkBA,MAAa,GAEX,EACA,SAEM,CACN,KAAM,eACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,OACR,EAUW,GAEX,EACA,SAEM,CACN,KAAM,eACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,OACR"}

View File

@@ -0,0 +1,51 @@
import { getTranslation } from '@payloadcms/translations';
import { generateMetadata } from '../../utilities/meta.js';
/**
* @todo Remove the `MetaConfig` type assertions. They are currently required because of how the `Metadata` type from `next` consumes the `URL` type.
*/
export const generateVersionsViewMetadata = async ({
collectionConfig,
config,
globalConfig,
i18n
}) => {
const {
t
} = i18n;
const entityLabel = collectionConfig ? getTranslation(collectionConfig.labels.singular, i18n) : globalConfig ? getTranslation(globalConfig.label, i18n) : '';
let metaToUse = {
...(config.admin.meta || {})
};
const data = {} // TODO: figure this out
;
if (collectionConfig) {
const useAsTitle = collectionConfig?.admin?.useAsTitle || 'id';
const titleFromData = data?.[useAsTitle];
metaToUse = {
...(config.admin.meta || {}),
description: t('version:viewingVersions', {
documentTitle: data?.[useAsTitle],
entitySlug: collectionConfig.slug
}),
title: `${t('version:versions')}${titleFromData ? ` - ${titleFromData}` : ''} - ${entityLabel}`,
...(collectionConfig?.admin.meta || {}),
...(collectionConfig?.admin?.components?.views?.edit?.versions?.meta || {})
};
}
if (globalConfig) {
metaToUse = {
...(config.admin.meta || {}),
description: t('version:viewingVersionsGlobal', {
entitySlug: globalConfig.slug
}),
title: `${t('version:versions')} - ${entityLabel}`,
...(globalConfig?.admin.meta || {}),
...(globalConfig?.admin?.components?.views?.edit?.versions?.meta || {})
};
}
return generateMetadata({
...metaToUse,
serverURL: config.serverURL
});
};
//# sourceMappingURL=metadata.js.map

View File

@@ -0,0 +1,22 @@
/**
Convert an object with `readonly` properties into a mutable object. Inverse of `Readonly<T>`.
This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), and [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509).
@example
```
import {Mutable} from 'type-fest';
type Foo = {
readonly a: number;
readonly b: string;
};
const mutableFoo: Mutable<Foo> = {a: 1, b: '2'};
mutableFoo.a = 3;
```
*/
export type Mutable<ObjectType> = {
// For each `Key` in the keys of `ObjectType`, make a mapped type by removing the `readonly` modifier from the property.
-readonly [KeyType in keyof ObjectType]: ObjectType[KeyType];
};

View File

@@ -0,0 +1,6 @@
import type { ReplayContainer } from '../types';
/**
* Add global listeners that cannot be removed.
*/
export declare function addGlobalListeners(replay: ReplayContainer): void;
//# sourceMappingURL=addGlobalListeners.d.ts.map

View File

@@ -0,0 +1,44 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict';
var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
var LexicalHorizontalRuleNode = require('@lexical/react/LexicalHorizontalRuleNode');
var utils = require('@lexical/utils');
var lexical = require('lexical');
var react = require('react');
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
function HorizontalRulePlugin() {
const [editor] = LexicalComposerContext.useLexicalComposerContext();
react.useEffect(() => {
return editor.registerCommand(LexicalHorizontalRuleNode.INSERT_HORIZONTAL_RULE_COMMAND, type => {
const selection = lexical.$getSelection();
if (!lexical.$isRangeSelection(selection)) {
return false;
}
const focusNode = selection.focus.getNode();
if (focusNode !== null) {
const horizontalRuleNode = LexicalHorizontalRuleNode.$createHorizontalRuleNode();
utils.$insertNodeToNearestRoot(horizontalRuleNode);
}
return true;
}, lexical.COMMAND_PRIORITY_EDITOR);
}, [editor]);
return null;
}
exports.HorizontalRulePlugin = HorizontalRulePlugin;

View File

@@ -0,0 +1,25 @@
interface Location {
line: number;
column: number;
}
/**
* A representation of source input to GraphQL. The `name` and `locationOffset` parameters are
* optional, but they are useful for clients who store GraphQL documents in source files.
* For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might
* be useful for `name` to be `"Foo.graphql"` and location to be `{ line: 40, column: 1 }`.
* The `line` and `column` properties in `locationOffset` are 1-indexed.
*/
export declare class Source {
body: string;
name: string;
locationOffset: Location;
constructor(body: string, name?: string, locationOffset?: Location);
get [Symbol.toStringTag](): string;
}
/**
* Test if the given value is a Source object.
*
* @internal
*/
export declare function isSource(source: unknown): source is Source;
export {};

View File

@@ -0,0 +1,27 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: (date) => {
switch (date.getDay()) {
case 6: //Σάββατο
return "'το προηγούμενο' eeee 'στις' p";
default:
return "'την προηγούμενη' eeee 'στις' p";
}
},
yesterday: "'χθες στις' p",
today: "'σήμερα στις' p",
tomorrow: "'αύριο στις' p",
nextWeek: "eeee 'στις' p",
other: "P",
};
const formatRelative = (token, date) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") return format(date);
return format;
};
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,28 @@
# @dnd-kit/sortable
[![Stable release](https://img.shields.io/npm/v/@dnd-kit/sortable.svg)](https://npm.im/@dnd-kit/sortable)
The sortable preset provides the building blocks to build sortable interfaces with @dnd-kit.
## Installation
To get started, install the sortable preset via npm or yarn:
```
npm install @dnd-kit/sortable
```
## Architecture
The sortable preset builds on top of the primitives exposed by `@dnd-kit/core` to help building sortable interfaces.
The sortable preset exposes two main concepts: `SortableContext` and the `useSortable` hook:
- The SortableContext provides information via context that is consumed by the `useSortable` hook.
- The useSortable hook is an abstraction that composes the `useDroppable` and `useDraggable` hooks.
![The useSortable hook is an abstraction that composes the useDroppable and useDraggable hooks](/.github/assets/use-sortable.png)
## Usage
Visit [docs.dndkit.com](https://docs.dndkit.com/presets/sortable) to learn how to use the Sortable preset.

View File

@@ -0,0 +1,20 @@
import { APIError } from 'payload';
export const SAFE_STRING_REGEX = /^[\w @.\-+:]*$/;
export const escapeSQLValue = (value)=>{
if (value === null) {
return null;
}
if (typeof value === 'number' || typeof value === 'boolean') {
return value;
}
if (typeof value !== 'string') {
throw new Error('Invalid value type');
}
if (!SAFE_STRING_REGEX.test(value)) {
throw new APIError(`${value} is not allowed as a JSON query value`, 400);
}
const escaped = value.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
return escaped;
};
//# sourceMappingURL=escapeSQLValue.js.map

View File

@@ -0,0 +1,5 @@
export declare const differenceInBusinessDays: import("./types.js").FPFn2<
number,
string | number | Date,
string | number | Date
>;

View File

@@ -0,0 +1,25 @@
import type { Span as WriteableSpan, SpanKind, Tracer } from '@opentelemetry/api';
import type { BasicTracerProvider, ReadableSpan } from '@opentelemetry/sdk-trace-base';
import type { Scope, Span, StartSpanOptions } from '@sentry/core';
export interface OpenTelemetryClient {
tracer: Tracer;
traceProvider: BasicTracerProvider | undefined;
}
export interface OpenTelemetrySpanContext extends StartSpanOptions {
kind?: SpanKind;
}
/**
* The base `Span` type is basically a `WriteableSpan`.
* There are places where we basically want to allow passing _any_ span,
* so in these cases we type this as `AbstractSpan` which could be either a regular `Span` or a `ReadableSpan`.
* You'll have to make sure to check relevant fields before accessing them.
*
* Note that technically, the `Span` exported from `@opentelemetry/sdk-trace-base` matches this,
* but we cannot be 100% sure that we are actually getting such a span, so this type is more defensive.
*/
export type AbstractSpan = WriteableSpan | ReadableSpan | Span;
export interface CurrentScopes {
scope: Scope;
isolationScope: Scope;
}
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1,4 @@
import React from 'react';
import './index.scss';
export declare function AddingFilesView(): React.JSX.Element;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,151 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React, { useCallback, useState } from 'react';
import { Button } from '../../elements/Button/index.js';
import { useForm } from '../../forms/Form/index.js';
import { useField } from '../../forms/useField/index.js';
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js';
import { useServerFunctions } from '../../providers/ServerFunctions/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { FieldLabel } from '../FieldLabel/index.js';
import { TextInput } from '../Text/index.js';
import './index.scss';
/**
* @experimental This component is experimental and may change or be removed in the future. Use at your own risk.
*/
export const SlugField = t0 => {
const $ = _c(24);
const {
field,
path,
readOnly: readOnlyFromProps,
useAsSlug
} = t0;
const {
label
} = field;
const {
t
} = useTranslation();
const {
collectionSlug,
globalSlug
} = useDocumentInfo();
const {
slugify
} = useServerFunctions();
const t1 = path || field.name;
let t2;
if ($[0] !== t1) {
t2 = {
path: t1
};
$[0] = t1;
$[1] = t2;
} else {
t2 = $[1];
}
const {
setValue,
value
} = useField(t2);
const {
getData,
getDataByPath
} = useForm();
const [isLocked, setIsLocked] = useState(true);
let t3;
if ($[2] !== collectionSlug || $[3] !== getData || $[4] !== getDataByPath || $[5] !== globalSlug || $[6] !== path || $[7] !== setValue || $[8] !== slugify || $[9] !== useAsSlug || $[10] !== value) {
t3 = async e => {
e.preventDefault();
const valueToSlugify = getDataByPath(useAsSlug);
const formattedSlug = await slugify({
collectionSlug,
data: getData(),
globalSlug,
path,
valueToSlugify
});
if (formattedSlug === null || formattedSlug === undefined) {
setValue("");
return;
}
if (value !== formattedSlug) {
setValue(formattedSlug);
}
};
$[2] = collectionSlug;
$[3] = getData;
$[4] = getDataByPath;
$[5] = globalSlug;
$[6] = path;
$[7] = setValue;
$[8] = slugify;
$[9] = useAsSlug;
$[10] = value;
$[11] = t3;
} else {
t3 = $[11];
}
const handleGenerate = t3;
let t4;
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
t4 = e_0 => {
e_0.preventDefault();
setIsLocked(_temp);
};
$[12] = t4;
} else {
t4 = $[12];
}
const toggleLock = t4;
const t5 = `field-${path}`;
let t6;
if ($[13] !== field.name || $[14] !== handleGenerate || $[15] !== isLocked || $[16] !== label || $[17] !== path || $[18] !== readOnlyFromProps || $[19] !== setValue || $[20] !== t || $[21] !== t5 || $[22] !== value) {
t6 = _jsxs("div", {
className: "field-type slug-field-component",
children: [_jsxs("div", {
className: "label-wrapper",
children: [_jsx(FieldLabel, {
htmlFor: t5,
label
}), !isLocked && _jsx(Button, {
buttonStyle: "none",
className: "lock-button",
onClick: handleGenerate,
children: t("authentication:generate")
}), _jsx(Button, {
buttonStyle: "none",
className: "lock-button",
onClick: toggleLock,
children: isLocked ? t("general:unlock") : t("general:lock")
})]
}), _jsx(TextInput, {
onChange: setValue,
path: path || field.name,
readOnly: Boolean(readOnlyFromProps || isLocked),
value
})]
});
$[13] = field.name;
$[14] = handleGenerate;
$[15] = isLocked;
$[16] = label;
$[17] = path;
$[18] = readOnlyFromProps;
$[19] = setValue;
$[20] = t;
$[21] = t5;
$[22] = value;
$[23] = t6;
} else {
t6 = $[23];
}
return t6;
};
function _temp(prev) {
return !prev;
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,6 @@
import type { AddEventResult, AllEntryData, ReplayContainer, ReplayPerformanceEntry } from '../types';
/**
* Create a "span" for each performance entry.
*/
export declare function createPerformanceSpans(replay: ReplayContainer, entries: ReplayPerformanceEntry<AllEntryData>[]): Promise<AddEventResult | null>[];
//# sourceMappingURL=createPerformanceSpans.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"zap.js","sources":["../../../src/icons/zap.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Zap\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAxNGExIDEgMCAwIDEtLjc4LTEuNjNsOS45LTEwLjJhLjUuNSAwIDAgMSAuODYuNDZsLTEuOTIgNi4wMkExIDEgMCAwIDAgMTMgMTBoN2ExIDEgMCAwIDEgLjc4IDEuNjNsLTkuOSAxMC4yYS41LjUgMCAwIDEtLjg2LS40NmwxLjkyLTYuMDJBMSAxIDAgMCAwIDExIDE0eiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/zap\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 Zap = createLucideIcon('Zap', [\n [\n 'path',\n {\n d: 'M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z',\n key: '1xq2db',\n },\n ],\n]);\n\nexport default Zap;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,iBAAiB,KAAO,CAAA,CAAA,CAAA;AAAA,CAClC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"save-off.js","sources":["../../../src/icons/save-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SaveOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTMgMTNIOGExIDEgMCAwIDAtMSAxdjciIC8+CiAgPHBhdGggZD0iTTE0IDhoMSIgLz4KICA8cGF0aCBkPSJNMTcgMjF2LTQiIC8+CiAgPHBhdGggZD0ibTIgMiAyMCAyMCIgLz4KICA8cGF0aCBkPSJNMjAuNDEgMjAuNDFBMiAyIDAgMCAxIDE5IDIxSDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAuNTktMS40MSIgLz4KICA8cGF0aCBkPSJNMjkuNSAxMS41czUgNSA0IDUiIC8+CiAgPHBhdGggZD0iTTkgM2g2LjJhMiAyIDAgMCAxIDEuNC42bDMuOCAzLjhhMiAyIDAgMCAxIC42IDEuNFYxNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/save-off\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 SaveOff = createLucideIcon('SaveOff', [\n ['path', { d: 'M13 13H8a1 1 0 0 0-1 1v7', key: 'h8g396' }],\n ['path', { d: 'M14 8h1', key: '1lfen6' }],\n ['path', { d: 'M17 21v-4', key: '1yknxs' }],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n [\n 'path',\n { d: 'M20.41 20.41A2 2 0 0 1 19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 .59-1.41', key: '1t4vdl' },\n ],\n ['path', { d: 'M29.5 11.5s5 5 4 5', key: 'zzn4i6' }],\n ['path', { d: 'M9 3h6.2a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V15', key: '24cby9' }],\n]);\n\nexport default SaveOff;\n"],"names":[],"mappings":"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"}

View File

@@ -0,0 +1,24 @@
export class TaskError extends Error {
args;
constructor(args){
super(args.message);
this.args = args;
}
}
export class WorkflowError extends Error {
args;
constructor(args){
super(args.message);
this.args = args;
}
}
/**
* Throw this error from within a task or workflow handler to cancel the job.
* Unlike failing a job (e.g. by throwing any other error), a cancelled job will not be retried.
*/ export class JobCancelledError extends Error {
constructor(message){
super(message);
}
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,599 @@
import type { Language } from '../types.js';
export declare const enTranslations: {
authentication: {
account: string;
accountOfCurrentUser: string;
accountVerified: string;
alreadyActivated: string;
alreadyLoggedIn: string;
apiKey: string;
authenticated: string;
backToLogin: string;
beginCreateFirstUser: string;
changePassword: string;
checkYourEmailForPasswordReset: string;
confirmGeneration: string;
confirmPassword: string;
createFirstUser: string;
emailNotValid: string;
emailOrUsername: string;
emailSent: string;
emailVerified: string;
enableAPIKey: string;
failedToUnlock: string;
forceUnlock: string;
forgotPassword: string;
forgotPasswordEmailInstructions: string;
forgotPasswordUsernameInstructions: string;
usernameNotValid: string;
forgotPasswordQuestion: string;
generate: string;
generateNewAPIKey: string;
generatingNewAPIKeyWillInvalidate: string;
lockUntil: string;
logBackIn: string;
loggedIn: string;
loggedInChangePassword: string;
loggedOutInactivity: string;
loggedOutSuccessfully: string;
loggingOut: string;
login: string;
loginAttempts: string;
loginUser: string;
loginWithAnotherUser: string;
logOut: string;
logout: string;
logoutSuccessful: string;
logoutUser: string;
newAccountCreated: string;
newAPIKeyGenerated: string;
newPassword: string;
passed: string;
passwordResetSuccessfully: string;
resetPassword: string;
resetPasswordExpiration: string;
resetPasswordToken: string;
resetYourPassword: string;
stayLoggedIn: string;
successfullyRegisteredFirstUser: string;
successfullyUnlocked: string;
tokenRefreshSuccessful: string;
unableToVerify: string;
username: string;
verified: string;
verifiedSuccessfully: string;
verify: string;
verifyUser: string;
verifyYourEmail: string;
youAreInactive: string;
youAreReceivingResetPassword: string;
youDidNotRequestPassword: string;
};
dashboard: {
addWidget: string;
deleteWidget: string;
searchWidgets: string;
};
error: {
accountAlreadyActivated: string;
autosaving: string;
correctInvalidFields: string;
deletingFile: string;
deletingTitle: string;
documentNotFound: string;
emailOrPasswordIncorrect: string;
followingFieldsInvalid_one: string;
followingFieldsInvalid_other: string;
incorrectCollection: string;
insufficientClipboardPermissions: string;
invalidClipboardData: string;
invalidFileType: string;
invalidFileTypeValue: string;
invalidRequestArgs: string;
loadingDocument: string;
localesNotSaved_one: string;
localesNotSaved_other: string;
logoutFailed: string;
missingEmail: string;
missingIDOfDocument: string;
missingIDOfVersion: string;
missingRequiredData: string;
noFilesUploaded: string;
noMatchedField: string;
notAllowedToAccessPage: string;
notAllowedToPerformAction: string;
notFound: string;
noUser: string;
previewing: string;
problemUploadingFile: string;
restoringTitle: string;
revertingDocument: string;
tokenInvalidOrExpired: string;
tokenNotProvided: string;
unableToCopy: string;
unableToDeleteCount: string;
unableToReindexCollection: string;
unableToUpdateCount: string;
unauthorized: string;
unauthorizedAdmin: string;
unknown: string;
unPublishingDocument: string;
unspecific: string;
unverifiedEmail: string;
userEmailAlreadyRegistered: string;
userLocked: string;
usernameAlreadyRegistered: string;
usernameOrPasswordIncorrect: string;
valueMustBeUnique: string;
verificationTokenInvalid: string;
};
fields: {
addLabel: string;
addLink: string;
addNew: string;
addNewLabel: string;
addRelationship: string;
addUpload: string;
block: string;
blocks: string;
blockType: string;
chooseBetweenCustomTextOrDocument: string;
chooseDocumentToLink: string;
chooseFromExisting: string;
chooseLabel: string;
collapseAll: string;
customURL: string;
editLabelData: string;
editLink: string;
editRelationship: string;
enterURL: string;
internalLink: string;
itemsAndMore: string;
labelRelationship: string;
latitude: string;
linkedTo: string;
linkType: string;
longitude: string;
newLabel: string;
openInNewTab: string;
passwordsDoNotMatch: string;
relatedDocument: string;
relationTo: string;
removeRelationship: string;
removeUpload: string;
saveChanges: string;
searchForBlock: string;
searchForLanguage: string;
selectExistingLabel: string;
selectFieldsToEdit: string;
showAll: string;
swapRelationship: string;
swapUpload: string;
textToDisplay: string;
toggleBlock: string;
uploadNewLabel: string;
};
folder: {
browseByFolder: string;
byFolder: string;
deleteFolder: string;
folderName: string;
folders: string;
folderTypeDescription: string;
itemHasBeenMoved: string;
itemHasBeenMovedToRoot: string;
itemsMovedToFolder: string;
itemsMovedToRoot: string;
moveFolder: string;
moveItemsToFolderConfirmation: string;
moveItemsToRootConfirmation: string;
moveItemToFolderConfirmation: string;
moveItemToRootConfirmation: string;
movingFromFolder: string;
newFolder: string;
noFolder: string;
renameFolder: string;
searchByNameInFolder: string;
selectFolderForItem: string;
};
general: {
name: string;
aboutToDelete: string;
aboutToDeleteCount_many: string;
aboutToDeleteCount_one: string;
aboutToDeleteCount_other: string;
aboutToPermanentlyDelete: string;
aboutToPermanentlyDeleteTrash: string;
aboutToRestore: string;
aboutToRestoreAsDraft: string;
aboutToRestoreAsDraftCount: string;
aboutToRestoreCount: string;
aboutToTrash: string;
aboutToTrashCount: string;
addBelow: string;
addFilter: string;
adminTheme: string;
all: string;
allCollections: string;
allLocales: string;
and: string;
anotherUser: string;
anotherUserTakenOver: string;
applyChanges: string;
ascending: string;
automatic: string;
backToDashboard: string;
cancel: string;
changesNotSaved: string;
clear: string;
clearAll: string;
close: string;
collapse: string;
collections: string;
columns: string;
columnToSort: string;
confirm: string;
confirmCopy: string;
confirmDeletion: string;
confirmDuplication: string;
confirmMove: string;
confirmReindex: string;
confirmReindexAll: string;
confirmReindexDescription: string;
confirmReindexDescriptionAll: string;
confirmRestoration: string;
copied: string;
copy: string;
copyField: string;
copying: string;
copyRow: string;
copyWarning: string;
create: string;
created: string;
createdAt: string;
createNew: string;
createNewLabel: string;
creating: string;
creatingNewLabel: string;
currentlyEditing: string;
custom: string;
dark: string;
dashboard: string;
delete: string;
deleted: string;
deletedAt: string;
deletedCountSuccessfully: string;
deletedSuccessfully: string;
deleteLabel: string;
deletePermanently: string;
deleting: string;
depth: string;
descending: string;
deselectAllRows: string;
document: string;
documentIsTrashed: string;
documentLocked: string;
documents: string;
duplicate: string;
duplicateWithoutSaving: string;
edit: string;
editAll: string;
editedSince: string;
editing: string;
editingLabel_many: string;
editingLabel_one: string;
editingLabel_other: string;
editingTakenOver: string;
editLabel: string;
email: string;
emailAddress: string;
emptyTrash: string;
emptyTrashLabel: string;
enterAValue: string;
error: string;
errors: string;
exitLivePreview: string;
export: string;
fallbackToDefaultLocale: string;
false: string;
filter: string;
filters: string;
filterWhere: string;
globals: string;
goBack: string;
groupByLabel: string;
import: string;
isEditing: string;
item: string;
items: string;
language: string;
lastModified: string;
layout: string;
leaveAnyway: string;
leaveWithoutSaving: string;
light: string;
livePreview: string;
loading: string;
locale: string;
locales: string;
lock: string;
menu: string;
moreOptions: string;
move: string;
moveConfirm: string;
moveCount: string;
moveDown: string;
moveUp: string;
moving: string;
movingCount: string;
newLabel: string;
newPassword: string;
next: string;
no: string;
noDateSelected: string;
noFiltersSet: string;
noLabel: string;
none: string;
noOptions: string;
noResults: string;
noResultsDescription: string;
noResultsFound: string;
notFound: string;
nothingFound: string;
noTrashResults: string;
noUpcomingEventsScheduled: string;
noValue: string;
of: string;
only: string;
open: string;
or: string;
order: string;
overwriteExistingData: string;
pageNotFound: string;
password: string;
pasteField: string;
pasteRow: string;
payloadSettings: string;
permanentlyDelete: string;
permanentlyDeletedCountSuccessfully: string;
perPage: string;
previous: string;
reindex: string;
reindexingAll: string;
remove: string;
rename: string;
reset: string;
resetPreferences: string;
resetPreferencesDescription: string;
resettingPreferences: string;
restore: string;
restoreAsPublished: string;
restoredCountSuccessfully: string;
restoring: string;
row: string;
rows: string;
save: string;
saveChanges: string;
saving: string;
schedulePublishFor: string;
searchBy: string;
select: string;
selectAll: string;
selectAllRows: string;
selectedCount: string;
selectLabel: string;
selectValue: string;
showAllLabel: string;
sorryNotFound: string;
sort: string;
sortByLabelDirection: string;
stayOnThisPage: string;
submissionSuccessful: string;
submit: string;
submitting: string;
success: string;
successfullyCreated: string;
successfullyDuplicated: string;
successfullyReindexed: string;
takeOver: string;
thisLanguage: string;
time: string;
timezone: string;
titleDeleted: string;
titleRestored: string;
titleTrashed: string;
trash: string;
trashedCountSuccessfully: string;
true: string;
unauthorized: string;
unlock: string;
unsavedChanges: string;
unsavedChangesDuplicate: string;
untitled: string;
upcomingEvents: string;
updatedAt: string;
updatedCountSuccessfully: string;
updatedLabelSuccessfully: string;
updatedSuccessfully: string;
updateForEveryone: string;
updating: string;
uploading: string;
uploadingBulk: string;
user: string;
username: string;
users: string;
value: string;
viewing: string;
viewReadOnly: string;
welcome: string;
yes: string;
};
localization: {
cannotCopySameLocale: string;
copyFrom: string;
copyFromTo: string;
copyTo: string;
copyToLocale: string;
localeToPublish: string;
selectedLocales: string;
selectLocaleToCopy: string;
selectLocaleToDuplicate: string;
};
operators: {
contains: string;
equals: string;
exists: string;
intersects: string;
isGreaterThan: string;
isGreaterThanOrEqualTo: string;
isIn: string;
isLessThan: string;
isLessThanOrEqualTo: string;
isLike: string;
isNotEqualTo: string;
isNotIn: string;
isNotLike: string;
near: string;
within: string;
};
upload: {
addFile: string;
addFiles: string;
bulkUpload: string;
crop: string;
cropToolDescription: string;
download: string;
dragAndDrop: string;
dragAndDropHere: string;
editImage: string;
fileName: string;
fileSize: string;
filesToUpload: string;
fileToUpload: string;
focalPoint: string;
focalPointDescription: string;
height: string;
lessInfo: string;
moreInfo: string;
noFile: string;
pasteURL: string;
previewSizes: string;
selectCollectionToBrowse: string;
selectFile: string;
setCropArea: string;
setFocalPoint: string;
sizes: string;
sizesFor: string;
width: string;
};
validation: {
emailAddress: string;
enterNumber: string;
fieldHasNo: string;
greaterThanMax: string;
invalidBlock: string;
invalidBlocks: string;
invalidInput: string;
invalidSelection: string;
invalidSelections: string;
latitudeOutOfBounds: string;
lessThanMin: string;
limitReached: string;
longerThanMin: string;
longitudeOutOfBounds: string;
notValidDate: string;
required: string;
requiresAtLeast: string;
requiresNoMoreThan: string;
requiresTwoNumbers: string;
shorterThanMax: string;
timezoneRequired: string;
trueOrFalse: string;
username: string;
validUploadID: string;
};
version: {
type: string;
aboutToPublishSelection: string;
aboutToRestore: string;
aboutToRestoreGlobal: string;
aboutToRevertToPublished: string;
aboutToUnpublish: string;
aboutToUnpublishIn: string;
aboutToUnpublishSelection: string;
autosave: string;
autosavedSuccessfully: string;
autosavedVersion: string;
changed: string;
changedFieldsCount_one: string;
changedFieldsCount_other: string;
compareVersion: string;
compareVersions: string;
comparingAgainst: string;
confirmPublish: string;
confirmRevertToSaved: string;
confirmUnpublish: string;
confirmVersionRestoration: string;
currentDocumentStatus: string;
currentDraft: string;
currentlyPublished: string;
currentlyViewing: string;
currentPublishedVersion: string;
draft: string;
draftHasPublishedVersion: string;
draftSavedSuccessfully: string;
lastSavedAgo: string;
modifiedOnly: string;
moreVersions: string;
noFurtherVersionsFound: string;
noLabelGroup: string;
noRowsFound: string;
noRowsSelected: string;
preview: string;
previouslyDraft: string;
previouslyPublished: string;
previousVersion: string;
problemRestoringVersion: string;
publish: string;
publishAllLocales: string;
publishChanges: string;
published: string;
publishIn: string;
publishing: string;
restoreAsDraft: string;
restoredSuccessfully: string;
restoreThisVersion: string;
restoring: string;
reverting: string;
revertToPublished: string;
revertUnsuccessful: string;
saveDraft: string;
scheduledSuccessfully: string;
schedulePublish: string;
selectLocales: string;
selectVersionToCompare: string;
showingVersionsFor: string;
showLocales: string;
specificVersion: string;
status: string;
unpublish: string;
unpublished: string;
unpublishedSuccessfully: string;
unpublishIn: string;
unpublishing: string;
version: string;
versionAgo: string;
versionCount_many: string;
versionCount_none: string;
versionCount_one: string;
versionCount_other: string;
versionID: string;
versions: string;
viewingVersion: string;
viewingVersionGlobal: string;
viewingVersions: string;
viewingVersionsGlobal: string;
};
};
export declare const en: Language;
//# sourceMappingURL=en.d.ts.map

View File

@@ -0,0 +1,4 @@
{
"main": "../../cjs/_class_extract_field_descriptor.cjs",
"module": "../../esm/_class_extract_field_descriptor.js"
}

View File

@@ -0,0 +1,24 @@
{
"name": "pg-int8",
"version": "1.0.1",
"description": "64-bit big-endian signed integer-to-string conversion",
"bugs": "https://github.com/charmander/pg-int8/issues",
"license": "ISC",
"files": [
"index.js"
],
"repository": {
"type": "git",
"url": "https://github.com/charmander/pg-int8"
},
"scripts": {
"test": "tap test"
},
"devDependencies": {
"@charmander/eslint-config-base": "1.0.2",
"tap": "10.7.3"
},
"engines": {
"node": ">=4.0.0"
}
}

View File

@@ -0,0 +1,218 @@
import { status as httpStatus } from 'http-status';
import { match } from 'path-to-regexp';
import { createPayloadRequest } from './createPayloadRequest.js';
import { formatAdminURL } from './formatAdminURL.js';
import { headersWithCors } from './headersWithCors.js';
import { mergeHeaders } from './mergeHeaders.js';
import { routeError } from './routeError.js';
const notFoundResponse = (req, pathname)=>{
return Response.json({
message: `Route not found "${pathname ?? new URL(req.url).pathname}"`
}, {
headers: headersWithCors({
headers: new Headers(),
req
}),
status: httpStatus.NOT_FOUND
});
};
/**
* Attaches the Payload REST API to any backend framework that uses Fetch Request/Response
* like Next.js (app router), Remix, Bun, Hono.
*
* ### Example: Using Hono
* ```ts
* import { handleEndpoints } from 'payload';
* import { serve } from '@hono/node-server';
* import { loadEnv } from 'payload/node';
*
* const port = 3001;
* loadEnv();
*
* const { default: config } = await import('@payload-config');
*
* const server = serve({
* fetch: async (request) => {
* const response = await handleEndpoints({
* config,
* request: request.clone(),
* });
*
* return response;
* },
* port,
* });
*
* server.on('listening', () => {
* console.log(`API server is listening on http://localhost:${port}/api`);
* });
* ```
*/ export const handleEndpoints = async ({ basePath = '', config: incomingConfig, path, payloadInstanceCacheKey, request })=>{
let handler;
let req;
let collection;
// This can be used against GET request search params size limit.
// Instead you can do POST request with a text body as search params.
// We use this internally for relationships querying on the frontend
// packages/ui/src/fields/Relationship/index.tsx
if (request.method.toLowerCase() === 'post' && (request.headers.get('X-Payload-HTTP-Method-Override') === 'GET' || request.headers.get('X-HTTP-Method-Override') === 'GET')) {
let url = request.url;
let data = undefined;
if (request.headers.get('Content-Type') === 'application/x-www-form-urlencoded') {
const search = await request.text();
url = `${request.url}?${search}`;
} else if (request.headers.get('Content-Type') === 'application/json') {
// May not be supported by every endpoint
data = await request.json();
// locale and fallbackLocale is read by createPayloadRequest to populate req.locale and req.fallbackLocale
// => add to searchParams
if (data?.locale) {
url += `?locale=${data.locale}`;
}
if (data?.fallbackLocale) {
url += `&fallbackLocale=${data.depth}`;
}
}
const req = new Request(url, {
// @ts-expect-error // TODO: check if this is required
cache: request.cache,
credentials: request.credentials,
headers: request.headers,
method: 'GET',
signal: request.signal
});
if (data) {
// @ts-expect-error attach data to request - less overhead than using urlencoded
req.data = data;
}
const response = await handleEndpoints({
basePath,
config: incomingConfig,
path,
payloadInstanceCacheKey,
request: req
});
return response;
}
try {
req = await createPayloadRequest({
canSetHeaders: true,
config: incomingConfig,
payloadInstanceCacheKey,
request
});
const { payload } = req;
const { config } = payload;
const pathname = path ?? new URL(req.url).pathname;
const baseAPIPath = formatAdminURL({
apiRoute: config.routes.api,
path: ''
});
if (!pathname.startsWith(baseAPIPath)) {
return notFoundResponse(req, pathname);
}
// /api/posts/route -> /posts/route
let adjustedPathname = pathname.replace(baseAPIPath, '');
let isGlobals = false;
// /globals/header/route -> /header/route
if (adjustedPathname.startsWith('/globals')) {
isGlobals = true;
adjustedPathname = adjustedPathname.replace('/globals', '');
}
const segments = adjustedPathname.split('/');
// remove empty string first element
segments.shift();
const firstParam = segments[0];
let globalConfig;
// first param can be a global slug or collection slug, find the relevant config
if (firstParam) {
if (isGlobals) {
globalConfig = payload.globals.config.find((each)=>each.slug === firstParam);
} else if (payload.collections[firstParam]) {
collection = payload.collections[firstParam];
}
}
let endpoints = config.endpoints;
if (collection) {
endpoints = collection.config.endpoints;
// /posts/route -> /route
adjustedPathname = adjustedPathname.replace(`/${collection.config.slug}`, '');
} else if (globalConfig) {
// /header/route -> /route
adjustedPathname = adjustedPathname.replace(`/${globalConfig.slug}`, '');
endpoints = globalConfig.endpoints;
}
// sanitize when endpoint.path is '/'
if (adjustedPathname === '') {
adjustedPathname = '/';
}
if (endpoints === false) {
return Response.json({
message: `Cannot ${req.method?.toUpperCase()} ${req.url}`
}, {
headers: headersWithCors({
headers: new Headers(),
req
}),
status: httpStatus.NOT_IMPLEMENTED
});
}
// Find the relevant endpoint configuration
const endpoint = endpoints?.find((endpoint)=>{
if (endpoint.method !== req.method?.toLowerCase()) {
return false;
}
const pathMatchFn = match(endpoint.path, {
decode: decodeURIComponent
});
const matchResult = pathMatchFn(adjustedPathname);
if (!matchResult) {
return false;
}
req.routeParams = matchResult.params;
// Inject to routeParams the slug as well so it can be used later
if (collection) {
req.routeParams.collection = collection.config.slug;
} else if (globalConfig) {
req.routeParams.global = globalConfig.slug;
}
return true;
});
if (endpoint) {
handler = endpoint.handler;
}
if (!handler) {
// If no custom handler found and this is an OPTIONS request,
// return default CORS response for preflight requests
if (req.method?.toLowerCase() === 'options') {
return Response.json({}, {
headers: headersWithCors({
headers: new Headers(),
req
}),
status: 200
});
}
return notFoundResponse(req, pathname);
}
const response = await handler(req);
return new Response(response.body, {
headers: headersWithCors({
headers: mergeHeaders(req.responseHeaders ?? new Headers(), response.headers),
req
}),
status: response.status,
statusText: response.statusText
});
} catch (_err) {
const err = _err;
return routeError({
collection,
config: incomingConfig,
err,
req: req
});
}
};
//# sourceMappingURL=handleEndpoints.js.map

View File

@@ -0,0 +1,6 @@
import React from 'react';
import './index.scss';
export declare const CollapsibleField: React.FC<import("payload").FieldPaths & {
readonly field: Omit<import("payload").CollapsibleFieldClient, "type"> & Partial<Pick<import("payload").CollapsibleFieldClient, "type">>;
} & Omit<import("payload").ClientComponentProps, "customComponents" | "field">>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/Popup/PopupGroupLabel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC;IACzC,KAAK,EAAE,MAAM,CAAA;CACd,CAEA,CAAA"}

View File

@@ -0,0 +1,21 @@
import { expect, expectTypeOf, test } from "vitest";
import * as z from "zod/v4";
const schema = z.nan();
test("passing validations", () => {
schema.parse(Number.NaN);
schema.parse(Number("Not a number"));
expectTypeOf<typeof schema._output>().toEqualTypeOf<number>();
});
test("failing validations", () => {
expect(() => schema.parse(5)).toThrow();
expect(() => schema.parse("John")).toThrow();
expect(() => schema.parse(true)).toThrow();
expect(() => schema.parse(null)).toThrow();
expect(() => schema.parse(undefined)).toThrow();
expect(() => schema.parse({})).toThrow();
expect(() => schema.parse([])).toThrow();
});

View File

@@ -0,0 +1,10 @@
"use strict";
exports.getSeconds = void 0;
var _index = require("../getSeconds.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const getSeconds = (exports.getSeconds = (0, _index2.convertToFP)(
_index.getSeconds,
1,
));

View File

@@ -0,0 +1,6 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";function t(r,{instancePath:e="",parentData:n,parentDataProperty:s,rootData:o=r}={}){let a=null,l=0;const i=l;let p=!1;const u=l;if("string"!=typeof r){const t={params:{type:"string"}};null===a?a=[t]:a.push(t),l++}var c=u===l;if(p=p||c,!p){const t=l;if(!(r instanceof Function)){const t={params:{}};null===a?a=[t]:a.push(t),l++}if(c=t===l,p=p||c,!p){const t=l;if(l==l)if(r&&"object"==typeof r&&!Array.isArray(r)){let t;if(void 0===r.source&&(t="source")){const r={params:{missingProperty:t}};null===a?a=[r]:a.push(r),l++}else{const t=l;for(const t in r)if("source"!==t&&"type"!==t&&"version"!==t){const r={params:{additionalProperty:t}};null===a?a=[r]:a.push(r),l++;break}if(t===l){if(void 0!==r.source){const t=l;if(!(r.source instanceof Function)){const t={params:{}};null===a?a=[t]:a.push(t),l++}var f=t===l}else f=!0;if(f){if(void 0!==r.type){const t=l;if("string"!=typeof r.type){const t={params:{type:"string"}};null===a?a=[t]:a.push(t),l++}f=t===l}else f=!0;if(f)if(void 0!==r.version){let t=r.version;const e=l,n=l;let s=!1;const o=l;if("boolean"!=typeof t){const t={params:{type:"boolean"}};null===a?a=[t]:a.push(t),l++}if(!0!==t){const t={params:{}};null===a?a=[t]:a.push(t),l++}var y=o===l;if(s=s||y,!s){const r=l;if("string"!=typeof t){const t={params:{type:"string"}};null===a?a=[t]:a.push(t),l++}if(y=r===l,s=s||y,!s){const r=l;if(!(t instanceof Function)){const t={params:{}};null===a?a=[t]:a.push(t),l++}y=r===l,s=s||y}}if(s)l=n,null!==a&&(n?a.length=n:a=null);else{const t={params:{}};null===a?a=[t]:a.push(t),l++}f=e===l}else f=!0}}}}else{const t={params:{type:"object"}};null===a?a=[t]:a.push(t),l++}c=t===l,p=p||c}}if(!p){const r={params:{}};return null===a?a=[r]:a.push(r),l++,t.errors=a,!1}return l=i,null!==a&&(i?a.length=i:a=null),t.errors=a,0===l}function r(e,{instancePath:n="",parentData:s,parentDataProperty:o,rootData:a=e}={}){let l=null,i=0;if(0===i){if(!e||"object"!=typeof e||Array.isArray(e))return r.errors=[{params:{type:"object"}}],!1;{let s;if(void 0===e.modules&&(s="modules"))return r.errors=[{params:{missingProperty:s}}],!1;{const s=i;for(const t in e)if("modules"!==t&&"scheme"!==t)return r.errors=[{params:{additionalProperty:t}}],!1;if(s===i){if(void 0!==e.modules){let s=e.modules;const o=i;if(i===o){if(!s||"object"!=typeof s||Array.isArray(s))return r.errors=[{params:{type:"object"}}],!1;for(const r in s){const e=i;if(t(s[r],{instancePath:n+"/modules/"+r.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:s,parentDataProperty:r,rootData:a})||(l=null===l?t.errors:l.concat(t.errors),i=l.length),e!==i)break}}var p=o===i}else p=!0;if(p)if(void 0!==e.scheme){const t=i;if("string"!=typeof e.scheme)return r.errors=[{params:{type:"string"}}],!1;p=t===i}else p=!0}}}}return r.errors=l,0===i}function e(t,{instancePath:n="",parentData:s,parentDataProperty:o,rootData:a=t}={}){let l=null,i=0;const p=i;let u=!1,c=null;const f=i;if(r(t,{instancePath:n,parentData:s,parentDataProperty:o,rootData:a})||(l=null===l?r.errors:l.concat(r.errors),i=l.length),f===i&&(u=!0,c=0),!u){const t={params:{passingSchemas:c}};return null===l?l=[t]:l.push(t),i++,e.errors=l,!1}return i=p,null!==l&&(p?l.length=p:l=null),e.errors=l,0===i}module.exports=e,module.exports.default=e;

View File

@@ -0,0 +1,20 @@
/**
* @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 Router = createLucideIcon("Router", [
["rect", { width: "20", height: "8", x: "2", y: "14", rx: "2", key: "w68u3i" }],
["path", { d: "M6.01 18H6", key: "19vcac" }],
["path", { d: "M10.01 18H10", key: "uamcmx" }],
["path", { d: "M15 10v4", key: "qjz1xs" }],
["path", { d: "M17.84 7.17a4 4 0 0 0-5.66 0", key: "1rif40" }],
["path", { d: "M20.66 4.34a8 8 0 0 0-11.31 0", key: "6a5xfq" }]
]);
export { Router as default };
//# sourceMappingURL=router.js.map

View File

@@ -0,0 +1,10 @@
import type { AuthCollectionSlug, Payload, RequestContext } from '../../../index.js';
import type { PayloadRequest } from '../../../types/index.js';
export type Options<TSlug extends AuthCollectionSlug> = {
collection: TSlug;
context?: RequestContext;
req?: Partial<PayloadRequest>;
token: string;
};
export declare function verifyEmailLocal<T extends AuthCollectionSlug>(payload: Payload, options: Options<T>): Promise<boolean>;
//# sourceMappingURL=verifyEmail.d.ts.map

View File

@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { eachWeekendOfMonth as fn } from "../eachWeekendOfMonth.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const eachWeekendOfMonth = convertToFP(fn, 1);
// Fallback for modularized imports:
export default eachWeekendOfMonth;

View File

@@ -0,0 +1,527 @@
import { expect, expectTypeOf, test } from "vitest";
import * as z from "zod/v4";
declare const iss: z.core.$ZodIssueCode;
const Test = z.object({
f1: z.number(),
f2: z.string().optional(),
f3: z.string().nullable(),
f4: z.array(z.object({ t: z.union([z.string(), z.boolean()]) })),
});
// type TestFlattenedErrors = core.inferFlattenedErrors<typeof Test, { message: string; code: number }>;
// type TestFormErrors = core.inferFlattenedErrors<typeof Test>;
const parsed = Test.safeParse({});
test("regular error", () => {
expect(parsed).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"expected": "number",
"code": "invalid_type",
"path": [
"f1"
],
"message": "Invalid input: expected number, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"f3"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "array",
"code": "invalid_type",
"path": [
"f4"
],
"message": "Invalid input: expected array, received undefined"
}
]],
"success": false,
}
`);
});
test(".flatten()", () => {
const flattened = parsed.error!.flatten();
// flattened.
expectTypeOf(flattened).toMatchTypeOf<{
formErrors: string[];
fieldErrors: {
f2?: string[];
f1?: string[];
f3?: string[];
f4?: string[];
};
}>();
expect(flattened).toMatchInlineSnapshot(`
{
"fieldErrors": {
"f1": [
"Invalid input: expected number, received undefined",
],
"f3": [
"Invalid input: expected string, received undefined",
],
"f4": [
"Invalid input: expected array, received undefined",
],
},
"formErrors": [],
}
`);
});
test("custom .flatten()", () => {
type ErrorType = { message: string; code: number };
const flattened = parsed.error!.flatten((iss) => ({ message: iss.message, code: 1234 }));
expectTypeOf(flattened).toMatchTypeOf<{
formErrors: ErrorType[];
fieldErrors: {
f2?: ErrorType[];
f1?: ErrorType[];
f3?: ErrorType[];
f4?: ErrorType[];
};
}>();
expect(flattened).toMatchInlineSnapshot(`
{
"fieldErrors": {
"f1": [
{
"code": 1234,
"message": "Invalid input: expected number, received undefined",
},
],
"f3": [
{
"code": 1234,
"message": "Invalid input: expected string, received undefined",
},
],
"f4": [
{
"code": 1234,
"message": "Invalid input: expected array, received undefined",
},
],
},
"formErrors": [],
}
`);
});
test(".format()", () => {
const formatted = parsed.error!.format();
expectTypeOf(formatted).toMatchTypeOf<{
_errors: string[];
f2?: { _errors: string[] };
f1?: { _errors: string[] };
f3?: { _errors: string[] };
f4?: {
[x: number]: {
_errors: string[];
t?: {
_errors: string[];
};
};
_errors: string[];
};
}>();
expect(formatted).toMatchInlineSnapshot(`
{
"_errors": [],
"f1": {
"_errors": [
"Invalid input: expected number, received undefined",
],
},
"f3": {
"_errors": [
"Invalid input: expected string, received undefined",
],
},
"f4": {
"_errors": [
"Invalid input: expected array, received undefined",
],
},
}
`);
});
test("custom .format()", () => {
type ErrorType = { message: string; code: number };
const formatted = parsed.error!.format((iss) => ({ message: iss.message, code: 1234 }));
expectTypeOf(formatted).toMatchTypeOf<{
_errors: ErrorType[];
f2?: { _errors: ErrorType[] };
f1?: { _errors: ErrorType[] };
f3?: { _errors: ErrorType[] };
f4?: {
[x: number]: {
_errors: ErrorType[];
t?: {
_errors: ErrorType[];
};
};
_errors: ErrorType[];
};
}>();
expect(formatted).toMatchInlineSnapshot(`
{
"_errors": [],
"f1": {
"_errors": [
{
"code": 1234,
"message": "Invalid input: expected number, received undefined",
},
],
},
"f3": {
"_errors": [
{
"code": 1234,
"message": "Invalid input: expected string, received undefined",
},
],
},
"f4": {
"_errors": [
{
"code": 1234,
"message": "Invalid input: expected array, received undefined",
},
],
},
}
`);
});
test("all errors", () => {
const propertySchema = z.string();
const schema = z
.object({
a: propertySchema,
b: propertySchema,
})
.refine(
(val) => {
return val.a === val.b;
},
{ message: "Must be equal" }
);
const r1 = schema.safeParse({
a: "asdf",
b: "qwer",
});
expect(z.core.flattenError(r1.error!)).toEqual({
formErrors: ["Must be equal"],
fieldErrors: {},
});
const r2 = schema.safeParse({
a: null,
b: null,
});
// const error = _error as z.ZodError;
expect(z.core.flattenError(r2.error!)).toMatchInlineSnapshot(`
{
"fieldErrors": {
"a": [
"Invalid input: expected string, received null",
],
"b": [
"Invalid input: expected string, received null",
],
},
"formErrors": [],
}
`);
expect(z.core.flattenError(r2.error!, (iss) => iss.message.toUpperCase())).toMatchInlineSnapshot(`
{
"fieldErrors": {
"a": [
"INVALID INPUT: EXPECTED STRING, RECEIVED NULL",
],
"b": [
"INVALID INPUT: EXPECTED STRING, RECEIVED NULL",
],
},
"formErrors": [],
}
`);
// Test identity
expect(z.core.flattenError(r2.error!, (i: z.ZodIssue) => i)).toMatchInlineSnapshot(`
{
"fieldErrors": {
"a": [
{
"code": "invalid_type",
"expected": "string",
"message": "Invalid input: expected string, received null",
"path": [
"a",
],
},
],
"b": [
{
"code": "invalid_type",
"expected": "string",
"message": "Invalid input: expected string, received null",
"path": [
"b",
],
},
],
},
"formErrors": [],
}
`);
// Test mapping
const f1 = z.core.flattenError(r2.error!, (i: z.ZodIssue) => i.message.length);
expect(f1).toMatchInlineSnapshot(`
{
"fieldErrors": {
"a": [
45,
],
"b": [
45,
],
},
"formErrors": [],
}
`);
// expect(f1.fieldErrors.a![0]).toEqual("Invalid input: expected string".length);
// expect(f1).toMatchObject({
// formErrors: [],
// fieldErrors: {
// a: ["Invalid input: expected string".length],
// b: ["Invalid input: expected string".length],
// },
// });
});
const schema = z.strictObject({
username: z.string(),
favoriteNumbers: z.array(z.number()),
nesting: z.object({
a: z.string(),
}),
});
const result = schema.safeParse({
username: 1234,
favoriteNumbers: [1234, "4567"],
nesting: {
a: 123,
},
extra: 1234,
});
test("z.treeifyError", () => {
expect(z.treeifyError(result.error!)).toMatchInlineSnapshot(`
{
"errors": [
"Unrecognized key: "extra"",
],
"properties": {
"favoriteNumbers": {
"errors": [],
"items": [
,
{
"errors": [
"Invalid input: expected number, received string",
],
},
],
},
"nesting": {
"errors": [],
"properties": {
"a": {
"errors": [
"Invalid input: expected string, received number",
],
},
},
},
"username": {
"errors": [
"Invalid input: expected string, received number",
],
},
},
}
`);
});
test("z.treeifyError 2", () => {
const schema = z.strictObject({
name: z.string(),
logLevel: z.union([z.string(), z.number()]),
env: z.literal(["production", "development"]),
});
const data = {
name: 1000,
logLevel: false,
extra: 1000,
};
const result = schema.safeParse(data);
const err = z.treeifyError(result.error!);
expect(err).toMatchInlineSnapshot(`
{
"errors": [
"Unrecognized key: "extra"",
],
"properties": {
"env": {
"errors": [
"Invalid option: expected one of "production"|"development"",
],
},
"logLevel": {
"errors": [
"Invalid input: expected string, received boolean",
"Invalid input: expected number, received boolean",
],
},
"name": {
"errors": [
"Invalid input: expected string, received number",
],
},
},
}
`);
});
test("z.prettifyError", () => {
expect(z.prettifyError(result.error!)).toMatchInlineSnapshot(`
"✖ Unrecognized key: "extra"
✖ Invalid input: expected string, received number
→ at username
✖ Invalid input: expected number, received string
→ at favoriteNumbers[1]
✖ Invalid input: expected string, received number
→ at nesting.a"
`);
});
test("z.toDotPath", () => {
expect(z.core.toDotPath(["a", "b", 0, "c"])).toMatchInlineSnapshot(`"a.b[0].c"`);
expect(z.core.toDotPath(["a", Symbol("b"), 0, "c"])).toMatchInlineSnapshot(`"a["Symbol(b)"][0].c"`);
// Test with periods in keys
expect(z.core.toDotPath(["user.name", "first.last"])).toMatchInlineSnapshot(`"["user.name"]["first.last"]"`);
// Test with special characters
expect(z.core.toDotPath(["user", "$special", Symbol("#symbol")])).toMatchInlineSnapshot(
`"user.$special["Symbol(#symbol)"]"`
);
// Test with dots and quotes
expect(z.core.toDotPath(["search", `query("foo.bar"="abc")`])).toMatchInlineSnapshot(
`"search["query(\\"foo.bar\\"=\\"abc\\")"]"`
);
// Test with newlines
expect(z.core.toDotPath(["search", `foo\nbar`])).toMatchInlineSnapshot(`"search["foo\\nbar"]"`);
// Test with empty strings
expect(z.core.toDotPath(["", "empty"])).toMatchInlineSnapshot(`".empty"`);
// Test with array indices
expect(z.core.toDotPath(["items", 0, 1, 2])).toMatchInlineSnapshot(`"items[0][1][2]"`);
// Test with mixed path elements
expect(z.core.toDotPath(["users", "user.config", 0, "settings.theme"])).toMatchInlineSnapshot(
`"users["user.config"][0]["settings.theme"]"`
);
// Test with square brackets in keys
expect(z.core.toDotPath(["data[0]", "value"])).toMatchInlineSnapshot(`"["data[0]"].value"`);
// Test with empty path
expect(z.core.toDotPath([])).toMatchInlineSnapshot(`""`);
});
test("inheritance", () => {
const e1 = new z.ZodError([]);
expect(e1).toBeInstanceOf(z.core.$ZodError);
expect(e1).toBeInstanceOf(z.ZodError);
// expect(e1).not.toBeInstanceOf(Error);
const e2 = new z.ZodRealError([]);
expect(e2).toBeInstanceOf(z.ZodError);
expect(e2).toBeInstanceOf(z.ZodRealError);
expect(e2).toBeInstanceOf(Error);
});
test("disc union treeify/format", () => {
const schema = z.discriminatedUnion(
"foo",
[
z.object({
foo: z.literal("x"),
x: z.string(),
}),
z.object({
foo: z.literal("y"),
y: z.string(),
}),
],
{
error: "Invalid discriminator",
}
);
const error = schema.safeParse({ foo: "invalid" }).error;
expect(z.treeifyError(error!)).toMatchInlineSnapshot(`
{
"errors": [],
"properties": {
"foo": {
"errors": [
"Invalid discriminator",
],
},
},
}
`);
expect(z.prettifyError(error!)).toMatchInlineSnapshot(`
"✖ Invalid discriminator
→ at foo"
`);
expect(z.formatError(error!)).toMatchInlineSnapshot(`
{
"_errors": [],
"foo": {
"_errors": [
"Invalid discriminator",
],
},
}
`);
});

View File

@@ -0,0 +1,10 @@
"use strict";
exports.previousSaturday = void 0;
var _index = require("../previousSaturday.js");
var _index2 = require("./_lib/convertToFP.js"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const previousSaturday = (exports.previousSaturday = (0, _index2.convertToFP)(
_index.previousSaturday,
1,
));

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["index.ts"],"names":[],"mappings":"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"}

View File

@@ -0,0 +1,208 @@
import { ZERO } from "../constants.js";
import "../types/number.js";
import { invariant, repeat } from "../utils.js";
import { ApplyUnsignedRoundingMode } from "./ApplyUnsignedRoundingMode.js";
import { getPowerOf10 } from "./decimal-cache.js";
//IMPL: Helper function to find n1, e1, and r1 using direct calculation
function findN1E1R1(x, p) {
const maxN1 = getPowerOf10(p);
const minN1 = getPowerOf10(p - 1);
// Direct calculation: compute e1 from logarithm
// e1 is the exponent such that n1 * 10^(e1-p+1) <= x
// Taking log: log(n1) + (e1-p+1)*log(10) <= log(x)
// Since n1 is between 10^(p-1) and 10^p, we have:
// (p-1) + (e1-p+1) <= log10(x) < p + (e1-p+1)
// Simplifying: e1 <= log10(x) < e1 + 1
// Therefore: e1 = floor(log10(x))
const log10x = x.log(10);
let e1 = log10x.floor();
// Calculate n1 and r1 from e1
const divisor = getPowerOf10(e1.minus(p).plus(1));
let n1 = x.div(divisor).floor();
let r1 = n1.times(divisor);
// Verify and adjust if n1 is out of bounds
// This handles edge cases near powers of 10
if (n1.greaterThanOrEqualTo(maxN1)) {
e1 = e1.plus(1);
const newDivisor = getPowerOf10(e1.minus(p).plus(1));
n1 = x.div(newDivisor).floor();
r1 = n1.times(newDivisor);
} else if (n1.lessThan(minN1)) {
e1 = e1.minus(1);
const newDivisor = getPowerOf10(e1.minus(p).plus(1));
n1 = x.div(newDivisor).floor();
r1 = n1.times(newDivisor);
}
// Final verification with fallback to iterative search if needed
if (r1.lessThanOrEqualTo(x) && n1.lessThan(maxN1) && n1.greaterThanOrEqualTo(minN1)) {
return {
n1,
e1,
r1
};
}
// Fallback: iterative search (should rarely be needed)
const maxE1 = x.div(minN1).log(10).plus(p).minus(1).ceil();
let currentE1 = maxE1;
while (true) {
const currentDivisor = getPowerOf10(currentE1.minus(p).plus(1));
let currentN1 = x.div(currentDivisor).floor();
if (currentN1.lessThan(maxN1) && currentN1.greaterThanOrEqualTo(minN1)) {
const currentR1 = currentN1.times(currentDivisor);
if (currentR1.lessThanOrEqualTo(x)) {
return {
n1: currentN1,
e1: currentE1,
r1: currentR1
};
}
}
currentE1 = currentE1.minus(1);
}
}
//IMPL: Helper function to find n2, e2, and r2 using direct calculation
function findN2E2R2(x, p) {
const maxN2 = getPowerOf10(p);
const minN2 = getPowerOf10(p - 1);
// Direct calculation: similar to findN1E1R1 but with ceiling
const log10x = x.log(10);
let e2 = log10x.floor();
// Calculate n2 and r2 from e2
const divisor = getPowerOf10(e2.minus(p).plus(1));
let n2 = x.div(divisor).ceil();
let r2 = n2.times(divisor);
// Verify and adjust if n2 is out of bounds
if (n2.greaterThanOrEqualTo(maxN2)) {
e2 = e2.plus(1);
const newDivisor = getPowerOf10(e2.minus(p).plus(1));
n2 = x.div(newDivisor).ceil();
r2 = n2.times(newDivisor);
} else if (n2.lessThan(minN2)) {
e2 = e2.minus(1);
const newDivisor = getPowerOf10(e2.minus(p).plus(1));
n2 = x.div(newDivisor).ceil();
r2 = n2.times(newDivisor);
}
// Final verification with fallback to iterative search if needed
if (r2.greaterThanOrEqualTo(x) && n2.lessThan(maxN2) && n2.greaterThanOrEqualTo(minN2)) {
return {
n2,
e2,
r2
};
}
// Fallback: iterative search (should rarely be needed)
const minE2 = x.div(maxN2).log(10).plus(p).minus(1).floor();
let currentE2 = minE2;
while (true) {
const currentDivisor = getPowerOf10(currentE2.minus(p).plus(1));
let currentN2 = x.div(currentDivisor).ceil();
if (currentN2.lessThan(maxN2) && currentN2.greaterThanOrEqualTo(minN2)) {
const currentR2 = currentN2.times(currentDivisor);
if (currentR2.greaterThanOrEqualTo(x)) {
return {
n2: currentN2,
e2: currentE2,
r2: currentR2
};
}
}
currentE2 = currentE2.plus(1);
}
}
/**
* https://tc39.es/ecma402/#sec-torawprecision
* @param x a finite non-negative Number or BigInt
* @param minPrecision an integer between 1 and 21
* @param maxPrecision an integer between 1 and 21
*/
export function ToRawPrecision(x, minPrecision, maxPrecision, unsignedRoundingMode) {
// 1. Let p be maxPrecision.
const p = maxPrecision;
let m;
let e;
let xFinal;
// 2. If x = 0, then
if (x.isZero()) {
// a. Let m be the String value consisting of p occurrences of the character "0".
m = repeat("0", p);
// b. Let e be 0.
e = 0;
// c. Let xFinal be 0.
xFinal = ZERO;
} else {
// 3. Else,
// a. Let {n1, e1, r1} be the result of findN1E1R1(x, p).
const { n1, e1, r1 } = findN1E1R1(x, p);
// b. Let {n2, e2, r2} be the result of findN2E2R2(x, p).
const { n2, e2, r2 } = findN2E2R2(x, p);
// c. Let r be ApplyUnsignedRoundingMode(x, r1, r2, unsignedRoundingMode).
let r = ApplyUnsignedRoundingMode(x, r1, r2, unsignedRoundingMode);
let n;
// d. If r = r1, then
if (r.eq(r1)) {
// i. Let n be n1.
n = n1;
// ii. Let e be e1.
e = e1.toNumber();
// iii. Let xFinal be r1.
xFinal = r1;
} else {
// e. Else,
// i. Let n be n2.
n = n2;
// ii. Let e be e2.
e = e2.toNumber();
// iii. Let xFinal be r2.
xFinal = r2;
}
// f. Let m be the String representation of n.
m = n.toString();
}
let int;
// 4. If e ≥ p - 1, then
if (e >= p - 1) {
// a. Let m be the string-concatenation of m and p - 1 - e occurrences of the character "0".
m = m + repeat("0", e - p + 1);
// b. Let int be e + 1.
int = e + 1;
} else if (e >= 0) {
// 5. Else if e ≥ 0, then
// a. Let m be the string-concatenation of the first e + 1 characters of m, ".", and the remaining p - (e + 1) characters of m.
m = m.slice(0, e + 1) + "." + m.slice(m.length - (p - (e + 1)));
// b. Let int be e + 1.
int = e + 1;
} else {
// 6. Else,
// a. Assert: e < 0.
invariant(e < 0, "e should be less than 0");
// b. Let m be the string-concatenation of "0.", -e - 1 occurrences of the character "0", and m.
m = "0." + repeat("0", -e - 1) + m;
// c. Let int be 1.
int = 1;
}
// 7. If m contains ".", and maxPrecision > minPrecision, then
if (m.includes(".") && maxPrecision > minPrecision) {
// a. Let cut be maxPrecision - minPrecision.
let cut = maxPrecision - minPrecision;
// b. Repeat, while cut > 0 and the last character of m is "0",
while (cut > 0 && m[m.length - 1] === "0") {
// i. Remove the last character from m.
m = m.slice(0, m.length - 1);
// ii. Decrease cut by 1.
cut--;
}
// c. If the last character of m is ".", then
if (m[m.length - 1] === ".") {
// i. Remove the last character from m.
m = m.slice(0, m.length - 1);
}
}
// 8. Return the Record { [[FormattedString]]: m, [[RoundedNumber]]: xFinal, [[IntegerDigitsCount]]: int, [[RoundingMagnitude]]: e }.
return {
formattedString: m,
roundedNumber: xFinal,
integerDigitsCount: int,
roundingMagnitude: e
};
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"2020.js","sourceRoot":"","sources":["../lib/2020.ts"],"names":[],"mappings":";;;AACA,iCAAuC;AAEvC,wDAA4D;AAC5D,gEAAwD;AACxD,oEAA0D;AAE1D,MAAM,cAAc,GAAG,8CAA8C,CAAA;AAErE,MAAa,OAAQ,SAAQ,cAAO;IAClC,YAAY,OAAgB,EAAE;QAC5B,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,IAAI;SAClB,CAAC,CAAA;IACJ,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,mBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QAC3D,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,IAAI,CAAC,UAAU,CAAC,uBAAa,CAAC,CAAA;IAC7D,CAAC;IAED,qBAAqB;QACnB,KAAK,CAAC,qBAAqB,EAAE,CAAA;QAC7B,MAAM,EAAC,KAAK,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;QAC/B,IAAI,CAAC,IAAI;YAAE,OAAM;QACjB,6BAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACnC,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,GAAG,cAAc,CAAA;IAC7D,CAAC;IAED,WAAW;QACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW;YAC3B,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IACzF,CAAC;CACF;AA5BD,0BA4BC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAClC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAA;AAChC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,OAAO,CAAA;AAyBtB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAIlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"}

View File

@@ -0,0 +1,16 @@
import { WebSocketInterface } from "../../types/globals.js";
//#region src/realtime/utils/message-callback.d.ts
/**
* Wait for a websocket response
*
* @param socket WebSocket
* @param number timeout
*
* @returns Incoming message object
*/
declare const messageCallback: (socket: WebSocketInterface, timeout?: number) => Promise<Record<string, any> | MessageEvent<string> | undefined>;
//#endregion
export { messageCallback };
//# sourceMappingURL=message-callback.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"bus.js","sources":["../../../src/icons/bus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Bus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCA2djYiIC8+CiAgPHBhdGggZD0iTTE1IDZ2NiIgLz4KICA8cGF0aCBkPSJNMiAxMmgxOS42IiAvPgogIDxwYXRoIGQ9Ik0xOCAxOGgzcy41LTEuNy44LTIuOGMuMS0uNC4yLS44LjItMS4yIDAtLjQtLjEtLjgtLjItMS4ybC0xLjQtNUMyMC4xIDYuOCAxOS4xIDYgMTggNkg0YTIgMiAwIDAgMC0yIDJ2MTBoMyIgLz4KICA8Y2lyY2xlIGN4PSI3IiBjeT0iMTgiIHI9IjIiIC8+CiAgPHBhdGggZD0iTTkgMThoNSIgLz4KICA8Y2lyY2xlIGN4PSIxNiIgY3k9IjE4IiByPSIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/bus\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 Bus = createLucideIcon('Bus', [\n ['path', { d: 'M8 6v6', key: '18i7km' }],\n ['path', { d: 'M15 6v6', key: '1sg6z9' }],\n ['path', { d: 'M2 12h19.6', key: 'de5uta' }],\n [\n 'path',\n {\n d: 'M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3',\n key: '1wwztk',\n },\n ],\n ['circle', { cx: '7', cy: '18', r: '2', key: '19iecd' }],\n ['path', { d: 'M9 18h5', key: 'lrx6i' }],\n ['circle', { cx: '16', cy: '18', r: '2', key: '1v4tcr' }],\n]);\n\nexport default Bus;\n"],"names":[],"mappings":"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"}

View File

@@ -0,0 +1,11 @@
const formatRelativeLocale = {
lastWeek: "eeee 'שעבר בשעה' p",
yesterday: "'אתמול בשעה' p",
today: "'היום בשעה' p",
tomorrow: "'מחר בשעה' p",
nextWeek: "eeee 'בשעה' p",
other: "P",
};
export const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];

View File

@@ -0,0 +1 @@
{"version":3,"file":"sendReplayRequest.d.ts","sourceRoot":"","sources":["../../../../src/util/sendReplayRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAe,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAI1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/C;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,aAAa,EACb,QAAQ,EACR,SAAS,EAAE,UAAU,EACrB,YAAY,EACZ,SAAS,EACT,OAAO,GACR,EAAE,cAAc,GAAG,OAAO,CAAC,4BAA4B,CAAC,CA+GxD;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;gBAC9B,UAAU,EAAE,MAAM;CAGtC;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IAChC,UAAU,EAAE,UAAU,CAAC;gBAEX,UAAU,EAAE,UAAU;CAI1C;AAED;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;;CAIlD"}

View File

@@ -0,0 +1,42 @@
import { dynamicImport } from '../../../../utilities/dynamicImport.js';
/**
* Imports a handler function from a given path.
*/ export async function importHandlerPath(path) {
let runner;
const [runnerPath, runnerImportName] = path.split('#');
let runnerModule;
try {
runnerModule = await dynamicImport(runnerPath);
} catch (e) {
throw new Error(`Error importing job queue handler module for path ${path}. This is an advanced feature that may require a sophisticated build pipeline, especially when using it in production or within Next.js, e.g. by calling opening the /api/payload-jobs/run endpoint. You will have to transpile the handler files separately and ensure they are available in the same location when the job is run. If you're using an endpoint to execute your jobs, it's recommended to define your handlers as functions directly in your Payload Config, or use import paths handlers outside of Next.js. Import Error: \n${e instanceof Error ? e.message : 'Unknown error'}`);
}
// If the path has indicated an #exportName, try to get it
if (runnerImportName && runnerModule[runnerImportName]) {
runner = runnerModule[runnerImportName];
}
// If there is a default export, use it
if (!runner && runnerModule.default) {
runner = runnerModule.default;
}
// Finally, use whatever was imported
if (!runner) {
runner = runnerModule;
}
return runner;
}
/**
* The `handler` property of a task config can either be a function or a path to a module that exports a function.
* This function resolves the handler to a function, either by importing it from the path or returning the function directly
* if it is already a function.
*/ export async function getTaskHandlerFromConfig(taskConfig) {
if (!taskConfig) {
throw new Error('Task config is required to get the task handler');
}
if (typeof taskConfig.handler === 'function') {
return taskConfig.handler;
} else {
return await importHandlerPath(taskConfig.handler);
}
}
//# sourceMappingURL=importHandlerPath.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../src/auth/baseFields/sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAE9D,eAAO,MAAM,mBAAmB,EAAE,UA6BjC,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"scroll-text.js","sources":["../../../src/icons/scroll-text.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ScrollText\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgMTJoLTUiIC8+CiAgPHBhdGggZD0iTTE1IDhoLTUiIC8+CiAgPHBhdGggZD0iTTE5IDE3VjVhMiAyIDAgMCAwLTItMkg0IiAvPgogIDxwYXRoIGQ9Ik04IDIxaDEyYTIgMiAwIDAgMCAyLTJ2LTFhMSAxIDAgMCAwLTEtMUgxMWExIDEgMCAwIDAtMSAxdjFhMiAyIDAgMSAxLTQgMFY1YTIgMiAwIDEgMC00IDB2MmExIDEgMCAwIDAgMSAxaDMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/scroll-text\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ScrollText = createLucideIcon('ScrollText', [\n ['path', { d: 'M15 12h-5', key: 'r7krc0' }],\n ['path', { d: 'M15 8h-5', key: '1khuty' }],\n ['path', { d: 'M19 17V5a2 2 0 0 0-2-2H4', key: 'zz82l3' }],\n [\n 'path',\n {\n d: 'M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3',\n key: '1ph1d7',\n },\n ],\n]);\n\nexport default ScrollText;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,297 @@
import { isValid } from "./isValid.js";
import { parse } from "./parse.js";
/**
* The {@link isMatch} function options.
*/
/**
* @name isMatch
* @category Common Helpers
* @summary validates the date string against given formats
*
* @description
* Return the true if given date is string correct against the given format else
* will return false.
*
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* The characters in the format string wrapped between two single quotes characters (') are escaped.
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
*
* Format of the format string is based on Unicode Technical Standard #35:
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
* with a few additions (see note 5 below the table).
*
* Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
* and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
*
* ```javascript
* isMatch('23 AM', 'HH a')
* //=> RangeError: The format string mustn't contain `HH` and `a` at the same time
* ```
*
* See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
*
* Accepted format string patterns:
* | Unit |Prior| Pattern | Result examples | Notes |
* |---------------------------------|-----|---------|-----------------------------------|-------|
* | Era | 140 | G..GGG | AD, BC | |
* | | | GGGG | Anno Domini, Before Christ | 2 |
* | | | GGGGG | A, B | |
* | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
* | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
* | | | yy | 44, 01, 00, 17 | 4 |
* | | | yyy | 044, 001, 123, 999 | 4 |
* | | | yyyy | 0044, 0001, 1900, 2017 | 4 |
* | | | yyyyy | ... | 2,4 |
* | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
* | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
* | | | YY | 44, 01, 00, 17 | 4,6 |
* | | | YYY | 044, 001, 123, 999 | 4 |
* | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
* | | | YYYYY | ... | 2,4 |
* | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
* | | | RR | -43, 01, 00, 17 | 4,5 |
* | | | RRR | -043, 001, 123, 999, -999 | 4,5 |
* | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
* | | | RRRRR | ... | 2,4,5 |
* | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
* | | | uu | -43, 01, 99, -99 | 4 |
* | | | uuu | -043, 001, 123, 999, -999 | 4 |
* | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
* | | | uuuuu | ... | 2,4 |
* | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
* | | | Qo | 1st, 2nd, 3rd, 4th | 5 |
* | | | QQ | 01, 02, 03, 04 | |
* | | | QQQ | Q1, Q2, Q3, Q4 | |
* | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
* | | | QQQQQ | 1, 2, 3, 4 | 4 |
* | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
* | | | qo | 1st, 2nd, 3rd, 4th | 5 |
* | | | qq | 01, 02, 03, 04 | |
* | | | qqq | Q1, Q2, Q3, Q4 | |
* | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
* | | | qqqqq | 1, 2, 3, 4 | 3 |
* | Month (formatting) | 110 | M | 1, 2, ..., 12 | |
* | | | Mo | 1st, 2nd, ..., 12th | 5 |
* | | | MM | 01, 02, ..., 12 | |
* | | | MMM | Jan, Feb, ..., Dec | |
* | | | MMMM | January, February, ..., December | 2 |
* | | | MMMMM | J, F, ..., D | |
* | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
* | | | Lo | 1st, 2nd, ..., 12th | 5 |
* | | | LL | 01, 02, ..., 12 | |
* | | | LLL | Jan, Feb, ..., Dec | |
* | | | LLLL | January, February, ..., December | 2 |
* | | | LLLLL | J, F, ..., D | |
* | Local week of year | 100 | w | 1, 2, ..., 53 | |
* | | | wo | 1st, 2nd, ..., 53th | 5 |
* | | | ww | 01, 02, ..., 53 | |
* | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
* | | | Io | 1st, 2nd, ..., 53th | 5 |
* | | | II | 01, 02, ..., 53 | 5 |
* | Day of month | 90 | d | 1, 2, ..., 31 | |
* | | | do | 1st, 2nd, ..., 31st | 5 |
* | | | dd | 01, 02, ..., 31 | |
* | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
* | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
* | | | DD | 01, 02, ..., 365, 366 | 7 |
* | | | DDD | 001, 002, ..., 365, 366 | |
* | | | DDDD | ... | 2 |
* | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Su | |
* | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
* | | | EEEEE | M, T, W, T, F, S, S | |
* | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
* | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
* | | | io | 1st, 2nd, ..., 7th | 5 |
* | | | ii | 01, 02, ..., 07 | 5 |
* | | | iii | Mon, Tue, Wed, ..., Su | 5 |
* | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
* | | | iiiii | M, T, W, T, F, S, S | 5 |
* | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |
* | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
* | | | eo | 2nd, 3rd, ..., 1st | 5 |
* | | | ee | 02, 03, ..., 01 | |
* | | | eee | Mon, Tue, Wed, ..., Su | |
* | | | eeee | Monday, Tuesday, ..., Sunday | 2 |
* | | | eeeee | M, T, W, T, F, S, S | |
* | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
* | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
* | | | co | 2nd, 3rd, ..., 1st | 5 |
* | | | cc | 02, 03, ..., 01 | |
* | | | ccc | Mon, Tue, Wed, ..., Su | |
* | | | cccc | Monday, Tuesday, ..., Sunday | 2 |
* | | | ccccc | M, T, W, T, F, S, S | |
* | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
* | AM, PM | 80 | a..aaa | AM, PM | |
* | | | aaaa | a.m., p.m. | 2 |
* | | | aaaaa | a, p | |
* | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
* | | | bbbb | a.m., p.m., noon, midnight | 2 |
* | | | bbbbb | a, p, n, mi | |
* | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
* | | | BBBB | at night, in the morning, ... | 2 |
* | | | BBBBB | at night, in the morning, ... | |
* | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
* | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
* | | | hh | 01, 02, ..., 11, 12 | |
* | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
* | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
* | | | HH | 00, 01, 02, ..., 23 | |
* | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
* | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
* | | | KK | 01, 02, ..., 11, 00 | |
* | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
* | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
* | | | kk | 24, 01, 02, ..., 23 | |
* | Minute | 60 | m | 0, 1, ..., 59 | |
* | | | mo | 0th, 1st, ..., 59th | 5 |
* | | | mm | 00, 01, ..., 59 | |
* | Second | 50 | s | 0, 1, ..., 59 | |
* | | | so | 0th, 1st, ..., 59th | 5 |
* | | | ss | 00, 01, ..., 59 | |
* | Seconds timestamp | 40 | t | 512969520 | |
* | | | tt | ... | 2 |
* | Fraction of second | 30 | S | 0, 1, ..., 9 | |
* | | | SS | 00, 01, ..., 99 | |
* | | | SSS | 000, 001, ..., 999 | |
* | | | SSSS | ... | 2 |
* | Milliseconds timestamp | 20 | T | 512969520900 | |
* | | | TT | ... | 2 |
* | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
* | | | XX | -0800, +0530, Z | |
* | | | XXX | -08:00, +05:30, Z | |
* | | | XXXX | -0800, +0530, Z, +123456 | 2 |
* | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
* | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
* | | | xx | -0800, +0530, +0000 | |
* | | | xxx | -08:00, +05:30, +00:00 | 2 |
* | | | xxxx | -0800, +0530, +0000, +123456 | |
* | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
* | Long localized date | NA | P | 05/29/1453 | 5,8 |
* | | | PP | May 29, 1453 | |
* | | | PPP | May 29th, 1453 | |
* | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
* | Long localized time | NA | p | 12:00 AM | 5,8 |
* | | | pp | 12:00:00 AM | |
* | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
* | | | PPpp | May 29, 1453, 12:00:00 AM | |
* | | | PPPpp | May 29th, 1453 at ... | |
* | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
* Notes:
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
* are the same as "stand-alone" units, but are different in some languages.
* "Formatting" units are declined according to the rules of the language
* in the context of a date. "Stand-alone" units are always nominative singular.
* In `format` function, they will produce different result:
*
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
*
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
*
* `isMatch` will try to match both formatting and stand-alone units interchangeably.
*
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
* the single quote characters (see below).
* If the sequence is longer than listed in table:
* - for numerical units (`yyyyyyyy`) `isMatch` will try to match a number
* as wide as the sequence
* - for text units (`MMMMMMMM`) `isMatch` will try to match the widest variation of the unit.
* These variations are marked with "2" in the last column of the table.
*
* 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
* These tokens represent the shortest form of the quarter.
*
* 4. The main difference between `y` and `u` patterns are B.C. years:
*
* | Year | `y` | `u` |
* |------|-----|-----|
* | AC 1 | 1 | 1 |
* | BC 1 | 1 | 0 |
* | BC 2 | 2 | -1 |
*
* Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
*
* `isMatch('50', 'yy') //=> true`
*
* `isMatch('75', 'yy') //=> true`
*
* while `uu` will use the year as is:
*
* `isMatch('50', 'uu') //=> true`
*
* `isMatch('75', 'uu') //=> true`
*
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
* except local week-numbering years are dependent on `options.weekStartsOn`
* and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)
* and [setWeekYear](https://date-fns.org/docs/setWeekYear)).
*
* 5. These patterns are not in the Unicode Technical Standard #35:
* - `i`: ISO day of week
* - `I`: ISO week of year
* - `R`: ISO week-numbering year
* - `o`: ordinal number modifier
* - `P`: long localized date
* - `p`: long localized time
*
* 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* 7. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
* on the given locale.
*
* using `en-US` locale: `P` => `MM/dd/yyyy`
* using `en-US` locale: `p` => `hh:mm a`
* using `pt-BR` locale: `P` => `dd/MM/yyyy`
* using `pt-BR` locale: `p` => `HH:mm`
*
* Values will be checked in the descending order of its unit's priority.
* Units of an equal priority overwrite each other in the order of appearance.
*
* If no values of higher priority are matched (e.g. when matching string 'January 1st' without a year),
* the values will be taken from today's using `new Date()` date which works as a context of parsing.
*
* The result may vary by locale.
*
* If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
*
* @param dateStr - The date string to verify
* @param format - The string of tokens
* @param options - An object with options.
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* @returns Is format string a match for date string?
*
* @throws `options.locale` must contain `match` property
* @throws use `yyyy` instead of `YYYY` for formatting years; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `yy` instead of `YY` for formatting years; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `d` instead of `D` for formatting days of the month; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `dd` instead of `DD` for formatting days of the month; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws format string contains an unescaped latin alphabet character
*
* @example
* // Match 11 February 2014 from middle-endian format:
* const result = isMatch('02/11/2014', 'MM/dd/yyyy')
* //=> true
*
* @example
* // Match 28th of February in Esperanto locale in the context of 2010 year:
* import eo from 'date-fns/locale/eo'
* const result = isMatch('28-a de februaro', "do 'de' MMMM", {
* locale: eo
* })
* //=> true
*/
export function isMatch(dateStr, formatStr, options) {
return isValid(parse(dateStr, formatStr, new Date(), options));
}
// Fallback for modularized imports:
export default isMatch;

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('upperFirst', require('../upperFirst'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1,137 @@
/* eslint-disable */
/** @type {import('@date-fns/docs').DateFnsDocs.Config} */
export const config = {
package: "..",
json: "../tmp/docs.json",
categories: [
"General",
"Misc",
"Common Helpers",
"Conversion Helpers",
"Interval Helpers",
"Timestamp Helpers",
"Millisecond Helpers",
"Second Helpers",
"Minute Helpers",
"Hour Helpers",
"Day Helpers",
"Weekday Helpers",
"Week Helpers",
"ISO Week Helpers",
"Month Helpers",
"Quarter Helpers",
"Year Helpers",
"ISO Week-Numbering Year Helpers",
"Decade Helpers",
"Generic Helpers",
],
files: [
{
type: "markdown",
slug: "Getting-Started",
category: "General",
title: "Getting Started",
summary: "Introduction & installation instructions",
path: "gettingStarted.md",
},
{
type: "markdown",
slug: "Change-Log",
category: "General",
title: "Change Log",
summary: "Changes for each version of the library",
path: "../CHANGELOG.md",
},
{
type: "markdown",
slug: "Contributing",
category: "General",
title: "Contributing",
summary: "Contribution manual",
path: "../CONTRIBUTING.md",
},
{
type: "markdown",
slug: "Security",
category: "General",
title: "Security policy",
summary: "Security policy",
path: "../SECURITY.md",
},
{
type: "markdown",
slug: "I18n",
category: "General",
title: "I18n",
summary: "Internationalization",
path: "i18n.md",
},
{
type: "markdown",
slug: "I18n-Contribution-Guide",
category: "General",
title: "I18n Contribution Guide",
summary: "Locales manual",
path: "i18nContributionGuide.md",
},
{
type: "markdown",
slug: "Time-Zones",
category: "General",
title: "Time Zones",
summary: "Time zone support",
path: "timeZones.md",
},
{
type: "markdown",
slug: "CDN",
category: "General",
title: "CDN",
summary: "CDN version of date-fns",
path: "cdn.md",
},
{
type: "markdown",
slug: "webpack",
category: "General",
title: "webpack",
summary: "Using date-fns with webpack",
path: "webpack.md",
},
{
type: "markdown",
slug: "FP-Guide",
category: "General",
title: "FP Guide",
summary: "Curried functions",
path: "fp.md",
},
{
type: "markdown",
slug: "Unicode-Tokens",
category: "General",
title: "Unicode Tokens",
summary: "Usage of the Unicode tokens in parse and format",
path: "unicodeTokens.md",
},
{
type: "markdown",
slug: "License",
category: "General",
title: "License",
summary: "MIT © Sasha Koss",
path: "../LICENSE.md",
},
],
kindsMap: {
"src/constants/index.ts": {
kind: "constants",
category: "Misc",
},
},
};

View File

@@ -0,0 +1,10 @@
import React from 'react';
import './index.scss';
type Props = {
readonly acceptMimeTypes?: string;
readonly onCancel: () => void;
readonly onDrop: (acceptedFiles: FileList) => void;
};
export declare function AddFilesView({ acceptMimeTypes, onCancel, onDrop }: Props): React.JSX.Element;
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,162 @@
import * as os from 'node:os';
import { trace } from '@opentelemetry/api';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { ServerRuntimeClient, applySdkMetadata, debug, _INTERNAL_flushLogsBuffer, SDK_VERSION, _INTERNAL_clearAiProviderSkips } from '@sentry/core';
import { getTraceContextForScope } from '@sentry/opentelemetry';
import { threadId, isMainThread } from 'worker_threads';
import { DEBUG_BUILD } from '../debug-build.js';
const DEFAULT_CLIENT_REPORT_FLUSH_INTERVAL_MS = 60000; // 60s was chosen arbitrarily
/** A client for using Sentry with Node & OpenTelemetry. */
class NodeClient extends ServerRuntimeClient {
constructor(options) {
const serverName =
options.includeServerName === false
? undefined
: options.serverName || global.process.env.SENTRY_NAME || os.hostname();
const clientOptions = {
...options,
platform: 'node',
// Use provided runtime or default to 'node' with current process version
runtime: options.runtime || { name: 'node', version: global.process.version },
serverName,
};
if (options.openTelemetryInstrumentations) {
registerInstrumentations({
instrumentations: options.openTelemetryInstrumentations,
});
}
applySdkMetadata(clientOptions, 'node');
debug.log(`Initializing Sentry: process: ${process.pid}, thread: ${isMainThread ? 'main' : `worker-${threadId}`}.`);
super(clientOptions);
if (this.getOptions().enableLogs) {
this._logOnExitFlushListener = () => {
_INTERNAL_flushLogsBuffer(this);
};
if (serverName) {
this.on('beforeCaptureLog', log => {
log.attributes = {
...log.attributes,
'server.address': serverName,
};
});
}
process.on('beforeExit', this._logOnExitFlushListener);
}
}
/** Get the OTEL tracer. */
get tracer() {
if (this._tracer) {
return this._tracer;
}
const name = '@sentry/node';
const version = SDK_VERSION;
const tracer = trace.getTracer(name, version);
this._tracer = tracer;
return tracer;
}
/** @inheritDoc */
// @ts-expect-error - PromiseLike is a subset of Promise
async flush(timeout) {
await this.traceProvider?.forceFlush();
if (this.getOptions().sendClientReports) {
this._flushOutcomes();
}
return super.flush(timeout);
}
/** @inheritDoc */
// @ts-expect-error - PromiseLike is a subset of Promise
async close(timeout) {
if (this._clientReportInterval) {
clearInterval(this._clientReportInterval);
}
if (this._clientReportOnExitFlushListener) {
process.off('beforeExit', this._clientReportOnExitFlushListener);
}
if (this._logOnExitFlushListener) {
process.off('beforeExit', this._logOnExitFlushListener);
}
const allEventsSent = await super.close(timeout);
if (this.traceProvider) {
await this.traceProvider.shutdown();
}
return allEventsSent;
}
/**
* Will start tracking client reports for this client.
*
* NOTICE: This method will create an interval that is periodically called and attach a `process.on('beforeExit')`
* hook. To clean up these resources, call `.close()` when you no longer intend to use the client. Not doing so will
* result in a memory leak.
*/
// The reason client reports need to be manually activated with this method instead of just enabling them in a
// constructor, is that if users periodically and unboundedly create new clients, we will create more and more
// intervals and beforeExit listeners, thus leaking memory. In these situations, users are required to call
// `client.close()` in order to dispose of the acquired resources.
// We assume that calling this method in Sentry.init() is a sensible default, because calling Sentry.init() over and
// over again would also result in memory leaks.
// Note: We have experimented with using `FinalizationRegisty` to clear the interval when the client is garbage
// collected, but it did not work, because the cleanup function never got called.
startClientReportTracking() {
const clientOptions = this.getOptions();
if (clientOptions.sendClientReports) {
this._clientReportOnExitFlushListener = () => {
this._flushOutcomes();
};
this._clientReportInterval = setInterval(() => {
DEBUG_BUILD && debug.log('Flushing client reports based on interval.');
this._flushOutcomes();
}, clientOptions.clientReportFlushInterval ?? DEFAULT_CLIENT_REPORT_FLUSH_INTERVAL_MS)
// Unref is critical for not preventing the process from exiting because the interval is active.
.unref();
process.on('beforeExit', this._clientReportOnExitFlushListener);
}
}
/** @inheritDoc */
_setupIntegrations() {
// Clear AI provider skip registrations before setting up integrations
// This ensures a clean state between different client initializations
// (e.g., when LangChain skips OpenAI in one client, but a subsequent client uses OpenAI standalone)
_INTERNAL_clearAiProviderSkips();
super._setupIntegrations();
}
/** Custom implementation for OTEL, so we can handle scope-span linking. */
_getTraceInfoFromScope(
scope,
) {
if (!scope) {
return [undefined, undefined];
}
return getTraceContextForScope(this, scope);
}
}
export { NodeClient };
//# sourceMappingURL=client.js.map

View File

@@ -0,0 +1,134 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const browser = require('@sentry/browser');
const core = require('@sentry/core');
/**
* A custom browser tracing integration for TanStack Router.
*
* The minimum compatible version of `@tanstack/react-router` is `1.64.0`.
*
* @param router A TanStack Router `Router` instance that should be used for routing instrumentation.
* @param options Sentry browser tracing configuration.
*/
function tanstackRouterBrowserTracingIntegration(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
router, // This is `any` because we don't want any type mismatches if TanStack Router changes their types
options = {},
) {
const castRouterInstance = router;
const browserTracingIntegrationInstance = browser.browserTracingIntegration({
...options,
instrumentNavigation: false,
instrumentPageLoad: false,
});
const { instrumentPageLoad = true, instrumentNavigation = true } = options;
return {
...browserTracingIntegrationInstance,
afterAllSetup(client) {
browserTracingIntegrationInstance.afterAllSetup(client);
const initialWindowLocation = browser.WINDOW.location;
if (instrumentPageLoad && initialWindowLocation) {
const matchedRoutes = castRouterInstance.matchRoutes(
initialWindowLocation.pathname,
castRouterInstance.options.parseSearch(initialWindowLocation.search),
{ preload: false, throwOnError: false },
);
const lastMatch = matchedRoutes[matchedRoutes.length - 1];
// If we only match __root__, we ended up not matching any route at all, so
// we fall back to the pathname.
const routeMatch = lastMatch?.routeId !== '__root__' ? lastMatch : undefined;
browser.startBrowserTracingPageLoadSpan(client, {
name: routeMatch ? routeMatch.routeId : initialWindowLocation.pathname,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.react.tanstack_router',
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: routeMatch ? 'route' : 'url',
...routeMatchToParamSpanAttributes(routeMatch),
},
});
}
if (instrumentNavigation) {
// The onBeforeNavigate hook is called at the very beginning of a navigation and is only called once per navigation, even when the user is redirected
castRouterInstance.subscribe('onBeforeNavigate', onBeforeNavigateArgs => {
// onBeforeNavigate is called during pageloads. We can avoid creating navigation spans by:
// 1. Checking if there's no fromLocation (initial pageload)
// 2. Comparing the states of the to and from arguments
if (
!onBeforeNavigateArgs.fromLocation ||
onBeforeNavigateArgs.toLocation.state === onBeforeNavigateArgs.fromLocation.state
) {
return;
}
const matchedRoutesOnBeforeNavigate = castRouterInstance.matchRoutes(
onBeforeNavigateArgs.toLocation.pathname,
onBeforeNavigateArgs.toLocation.search,
{ preload: false, throwOnError: false },
);
const onBeforeNavigateLastMatch = matchedRoutesOnBeforeNavigate[matchedRoutesOnBeforeNavigate.length - 1];
const onBeforeNavigateRouteMatch =
onBeforeNavigateLastMatch?.routeId !== '__root__' ? onBeforeNavigateLastMatch : undefined;
const navigationLocation = browser.WINDOW.location;
const navigationSpan = browser.startBrowserTracingNavigationSpan(client, {
name: onBeforeNavigateRouteMatch ? onBeforeNavigateRouteMatch.routeId : navigationLocation.pathname,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.react.tanstack_router',
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: onBeforeNavigateRouteMatch ? 'route' : 'url',
},
});
// In case the user is redirected during navigation we want to update the span with the right value.
const unsubscribeOnResolved = castRouterInstance.subscribe('onResolved', onResolvedArgs => {
unsubscribeOnResolved();
if (navigationSpan) {
const matchedRoutesOnResolved = castRouterInstance.matchRoutes(
onResolvedArgs.toLocation.pathname,
onResolvedArgs.toLocation.search,
{ preload: false, throwOnError: false },
);
const onResolvedLastMatch = matchedRoutesOnResolved[matchedRoutesOnResolved.length - 1];
const onResolvedRouteMatch =
onResolvedLastMatch?.routeId !== '__root__' ? onResolvedLastMatch : undefined;
if (onResolvedRouteMatch) {
navigationSpan.updateName(onResolvedRouteMatch.routeId);
navigationSpan.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');
navigationSpan.setAttributes(routeMatchToParamSpanAttributes(onResolvedRouteMatch));
}
}
});
});
}
},
};
}
function routeMatchToParamSpanAttributes(match) {
if (!match) {
return {};
}
const paramAttributes = {};
Object.entries(match.params).forEach(([key, value]) => {
paramAttributes[`url.path.params.${key}`] = value; // TODO(v11): remove attribute which does not adhere to Sentry's semantic convention
paramAttributes[`url.path.parameter.${key}`] = value;
paramAttributes[`params.${key}`] = value; // params.[key] is an alias
});
return paramAttributes;
}
exports.tanstackRouterBrowserTracingIntegration = tanstackRouterBrowserTracingIntegration;
//# sourceMappingURL=tanstackrouter.js.map

View File

@@ -0,0 +1,38 @@
"use strict";
exports.differenceInCalendarQuarters = differenceInCalendarQuarters;
var _index = require("./getQuarter.js");
var _index2 = require("./toDate.js");
/**
* @name differenceInCalendarQuarters
* @category Quarter Helpers
* @summary Get the number of calendar quarters between the given dates.
*
* @description
* Get the number of calendar quarters between the given dates.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param dateLeft - The later date
* @param dateRight - The earlier date
* @returns The number of calendar quarters
*
* @example
* // How many calendar quarters are between 31 December 2013 and 2 July 2014?
* const result = differenceInCalendarQuarters(
* new Date(2014, 6, 2),
* new Date(2013, 11, 31)
* )
* //=> 3
*/
function differenceInCalendarQuarters(dateLeft, dateRight) {
const _dateLeft = (0, _index2.toDate)(dateLeft);
const _dateRight = (0, _index2.toDate)(dateRight);
const yearDiff = _dateLeft.getFullYear() - _dateRight.getFullYear();
const quarterDiff =
(0, _index.getQuarter)(_dateLeft) - (0, _index.getQuarter)(_dateRight);
return yearDiff * 4 + quarterDiff;
}

View File

@@ -0,0 +1,411 @@
import type Ajv from "../../core"
import type {SchemaObject} from "../../types"
import {jtdForms, JTDForm, SchemaObjectMap} from "./types"
import {SchemaEnv, getCompilingSchema} from ".."
import {_, str, and, or, nil, not, CodeGen, Code, Name, SafeExpr} from "../codegen"
import MissingRefError from "../ref_error"
import N from "../names"
import {hasPropFunc} from "../../vocabularies/code"
import {hasRef} from "../../vocabularies/jtd/ref"
import {intRange, IntType} from "../../vocabularies/jtd/type"
import {parseJson, parseJsonNumber, parseJsonString} from "../../runtime/parseJson"
import {useFunc} from "../util"
import validTimestamp from "../../runtime/timestamp"
type GenParse = (cxt: ParseCxt) => void
const genParse: {[F in JTDForm]: GenParse} = {
elements: parseElements,
values: parseValues,
discriminator: parseDiscriminator,
properties: parseProperties,
optionalProperties: parseProperties,
enum: parseEnum,
type: parseType,
ref: parseRef,
}
interface ParseCxt {
readonly gen: CodeGen
readonly self: Ajv // current Ajv instance
readonly schemaEnv: SchemaEnv
readonly definitions: SchemaObjectMap
schema: SchemaObject
data: Code
parseName: Name
char: Name
}
export default function compileParser(
this: Ajv,
sch: SchemaEnv,
definitions: SchemaObjectMap
): SchemaEnv {
const _sch = getCompilingSchema.call(this, sch)
if (_sch) return _sch
const {es5, lines} = this.opts.code
const {ownProperties} = this.opts
const gen = new CodeGen(this.scope, {es5, lines, ownProperties})
const parseName = gen.scopeName("parse")
const cxt: ParseCxt = {
self: this,
gen,
schema: sch.schema as SchemaObject,
schemaEnv: sch,
definitions,
data: N.data,
parseName,
char: gen.name("c"),
}
let sourceCode: string | undefined
try {
this._compilations.add(sch)
sch.parseName = parseName
parserFunction(cxt)
gen.optimize(this.opts.code.optimize)
const parseFuncCode = gen.toString()
sourceCode = `${gen.scopeRefs(N.scope)}return ${parseFuncCode}`
const makeParse = new Function(`${N.scope}`, sourceCode)
const parse: (json: string) => unknown = makeParse(this.scope.get())
this.scope.value(parseName, {ref: parse})
sch.parse = parse
} catch (e) {
if (sourceCode) this.logger.error("Error compiling parser, function code:", sourceCode)
delete sch.parse
delete sch.parseName
throw e
} finally {
this._compilations.delete(sch)
}
return sch
}
const undef = _`undefined`
function parserFunction(cxt: ParseCxt): void {
const {gen, parseName, char} = cxt
gen.func(parseName, _`${N.json}, ${N.jsonPos}, ${N.jsonPart}`, false, () => {
gen.let(N.data)
gen.let(char)
gen.assign(_`${parseName}.message`, undef)
gen.assign(_`${parseName}.position`, undef)
gen.assign(N.jsonPos, _`${N.jsonPos} || 0`)
gen.const(N.jsonLen, _`${N.json}.length`)
parseCode(cxt)
skipWhitespace(cxt)
gen.if(N.jsonPart, () => {
gen.assign(_`${parseName}.position`, N.jsonPos)
gen.return(N.data)
})
gen.if(_`${N.jsonPos} === ${N.jsonLen}`, () => gen.return(N.data))
jsonSyntaxError(cxt)
})
}
function parseCode(cxt: ParseCxt): void {
let form: JTDForm | undefined
for (const key of jtdForms) {
if (key in cxt.schema) {
form = key
break
}
}
if (form) parseNullable(cxt, genParse[form])
else parseEmpty(cxt)
}
const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError))
function parseNullable(cxt: ParseCxt, parseForm: GenParse): void {
const {gen, schema, data} = cxt
if (!schema.nullable) return parseForm(cxt)
tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null))
}
function parseElements(cxt: ParseCxt): void {
const {gen, schema, data} = cxt
parseToken(cxt, "[")
const ix = gen.let("i", 0)
gen.assign(data, _`[]`)
parseItems(cxt, "]", () => {
const el = gen.let("el")
parseCode({...cxt, schema: schema.elements, data: el})
gen.assign(_`${data}[${ix}++]`, el)
})
}
function parseValues(cxt: ParseCxt): void {
const {gen, schema, data} = cxt
parseToken(cxt, "{")
gen.assign(data, _`{}`)
parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values))
}
function parseItems(cxt: ParseCxt, endToken: string, block: () => void): void {
tryParseItems(cxt, endToken, block)
parseToken(cxt, endToken)
}
function tryParseItems(cxt: ParseCxt, endToken: string, block: () => void): void {
const {gen} = cxt
gen.for(_`;${N.jsonPos}<${N.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => {
block()
tryParseToken(cxt, ",", () => gen.break(), hasItem)
})
function hasItem(): void {
tryParseToken(cxt, endToken, () => {}, jsonSyntaxError)
}
}
function parseKeyValue(cxt: ParseCxt, schema: SchemaObject): void {
const {gen} = cxt
const key = gen.let("key")
parseString({...cxt, data: key})
parseToken(cxt, ":")
parsePropertyValue(cxt, key, schema)
}
function parseDiscriminator(cxt: ParseCxt): void {
const {gen, data, schema} = cxt
const {discriminator, mapping} = schema
parseToken(cxt, "{")
gen.assign(data, _`{}`)
const startPos = gen.const("pos", N.jsonPos)
const value = gen.let("value")
const tag = gen.let("tag")
tryParseItems(cxt, "}", () => {
const key = gen.let("key")
parseString({...cxt, data: key})
parseToken(cxt, ":")
gen.if(
_`${key} === ${discriminator}`,
() => {
parseString({...cxt, data: tag})
gen.assign(_`${data}[${key}]`, tag)
gen.break()
},
() => parseEmpty({...cxt, data: value}) // can be discarded/skipped
)
})
gen.assign(N.jsonPos, startPos)
gen.if(_`${tag} === undefined`)
parsingError(cxt, str`discriminator tag not found`)
for (const tagValue in mapping) {
gen.elseIf(_`${tag} === ${tagValue}`)
parseSchemaProperties({...cxt, schema: mapping[tagValue]}, discriminator)
}
gen.else()
parsingError(cxt, str`discriminator value not in schema`)
gen.endIf()
}
function parseProperties(cxt: ParseCxt): void {
const {gen, data} = cxt
parseToken(cxt, "{")
gen.assign(data, _`{}`)
parseSchemaProperties(cxt)
}
function parseSchemaProperties(cxt: ParseCxt, discriminator?: string): void {
const {gen, schema, data} = cxt
const {properties, optionalProperties, additionalProperties} = schema
parseItems(cxt, "}", () => {
const key = gen.let("key")
parseString({...cxt, data: key})
parseToken(cxt, ":")
gen.if(false)
parseDefinedProperty(cxt, key, properties)
parseDefinedProperty(cxt, key, optionalProperties)
if (discriminator) {
gen.elseIf(_`${key} === ${discriminator}`)
const tag = gen.let("tag")
parseString({...cxt, data: tag}) // can be discarded, it is already assigned
}
gen.else()
if (additionalProperties) {
parseEmpty({...cxt, data: _`${data}[${key}]`})
} else {
parsingError(cxt, str`property ${key} not allowed`)
}
gen.endIf()
})
if (properties) {
const hasProp = hasPropFunc(gen)
const allProps: Code = and(
...Object.keys(properties).map((p): Code => _`${hasProp}.call(${data}, ${p})`)
)
gen.if(not(allProps), () => parsingError(cxt, str`missing required properties`))
}
}
function parseDefinedProperty(cxt: ParseCxt, key: Name, schemas: SchemaObjectMap = {}): void {
const {gen} = cxt
for (const prop in schemas) {
gen.elseIf(_`${key} === ${prop}`)
parsePropertyValue(cxt, key, schemas[prop] as SchemaObject)
}
}
function parsePropertyValue(cxt: ParseCxt, key: Name, schema: SchemaObject): void {
parseCode({...cxt, schema, data: _`${cxt.data}[${key}]`})
}
function parseType(cxt: ParseCxt): void {
const {gen, schema, data, self} = cxt
switch (schema.type) {
case "boolean":
parseBoolean(cxt)
break
case "string":
parseString(cxt)
break
case "timestamp": {
parseString(cxt)
const vts = useFunc(gen, validTimestamp)
const {allowDate, parseDate} = self.opts
const notValid = allowDate ? _`!${vts}(${data}, true)` : _`!${vts}(${data})`
const fail: Code = parseDate
? or(notValid, _`(${data} = new Date(${data}), false)`, _`isNaN(${data}.valueOf())`)
: notValid
gen.if(fail, () => parsingError(cxt, str`invalid timestamp`))
break
}
case "float32":
case "float64":
parseNumber(cxt)
break
default: {
const t = schema.type as IntType
if (!self.opts.int32range && (t === "int32" || t === "uint32")) {
parseNumber(cxt, 16) // 2 ** 53 - max safe integer
if (t === "uint32") {
gen.if(_`${data} < 0`, () => parsingError(cxt, str`integer out of range`))
}
} else {
const [min, max, maxDigits] = intRange[t]
parseNumber(cxt, maxDigits)
gen.if(_`${data} < ${min} || ${data} > ${max}`, () =>
parsingError(cxt, str`integer out of range`)
)
}
}
}
}
function parseString(cxt: ParseCxt): void {
parseToken(cxt, '"')
parseWith(cxt, parseJsonString)
}
function parseEnum(cxt: ParseCxt): void {
const {gen, data, schema} = cxt
const enumSch = schema.enum
parseToken(cxt, '"')
// TODO loopEnum
gen.if(false)
for (const value of enumSch) {
const valueStr = JSON.stringify(value).slice(1) // remove starting quote
gen.elseIf(_`${jsonSlice(valueStr.length)} === ${valueStr}`)
gen.assign(data, str`${value}`)
gen.add(N.jsonPos, valueStr.length)
}
gen.else()
jsonSyntaxError(cxt)
gen.endIf()
}
function parseNumber(cxt: ParseCxt, maxDigits?: number): void {
const {gen} = cxt
skipWhitespace(cxt)
gen.if(
_`"-0123456789".indexOf(${jsonSlice(1)}) < 0`,
() => jsonSyntaxError(cxt),
() => parseWith(cxt, parseJsonNumber, maxDigits)
)
}
function parseBooleanToken(bool: boolean, fail: GenParse): GenParse {
return (cxt) => {
const {gen, data} = cxt
tryParseToken(
cxt,
`${bool}`,
() => fail(cxt),
() => gen.assign(data, bool)
)
}
}
function parseRef(cxt: ParseCxt): void {
const {gen, self, definitions, schema, schemaEnv} = cxt
const {ref} = schema
const refSchema = definitions[ref]
if (!refSchema) throw new MissingRefError(self.opts.uriResolver, "", ref, `No definition ${ref}`)
if (!hasRef(refSchema)) return parseCode({...cxt, schema: refSchema})
const {root} = schemaEnv
const sch = compileParser.call(self, new SchemaEnv({schema: refSchema, root}), definitions)
partialParse(cxt, getParser(gen, sch), true)
}
function getParser(gen: CodeGen, sch: SchemaEnv): Code {
return sch.parse
? gen.scopeValue("parse", {ref: sch.parse})
: _`${gen.scopeValue("wrapper", {ref: sch})}.parse`
}
function parseEmpty(cxt: ParseCxt): void {
parseWith(cxt, parseJson)
}
function parseWith(cxt: ParseCxt, parseFunc: {code: string}, args?: SafeExpr): void {
partialParse(cxt, useFunc(cxt.gen, parseFunc), args)
}
function partialParse(cxt: ParseCxt, parseFunc: Name, args?: SafeExpr): void {
const {gen, data} = cxt
gen.assign(data, _`${parseFunc}(${N.json}, ${N.jsonPos}${args ? _`, ${args}` : nil})`)
gen.assign(N.jsonPos, _`${parseFunc}.position`)
gen.if(_`${data} === undefined`, () => parsingError(cxt, _`${parseFunc}.message`))
}
function parseToken(cxt: ParseCxt, tok: string): void {
tryParseToken(cxt, tok, jsonSyntaxError)
}
function tryParseToken(cxt: ParseCxt, tok: string, fail: GenParse, success?: GenParse): void {
const {gen} = cxt
const n = tok.length
skipWhitespace(cxt)
gen.if(
_`${jsonSlice(n)} === ${tok}`,
() => {
gen.add(N.jsonPos, n)
success?.(cxt)
},
() => fail(cxt)
)
}
function skipWhitespace({gen, char: c}: ParseCxt): void {
gen.code(
_`while((${c}=${N.json}[${N.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${N.jsonPos}++;`
)
}
function jsonSlice(len: number | Name): Code {
return len === 1
? _`${N.json}[${N.jsonPos}]`
: _`${N.json}.slice(${N.jsonPos}, ${N.jsonPos}+${len})`
}
function jsonSyntaxError(cxt: ParseCxt): void {
parsingError(cxt, _`"unexpected token " + ${N.json}[${N.jsonPos}]`)
}
function parsingError({gen, parseName}: ParseCxt, msg: Code): void {
gen.assign(_`${parseName}.message`, msg)
gen.assign(_`${parseName}.position`, N.jsonPos)
gen.return(undef)
}

View File

@@ -0,0 +1,83 @@
// import type { StandardSchemaV1 } from "@standard-schema/spec";
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
import { util } from "../helpers/util.js";
import type { StandardSchemaV1 } from "../standard-schema.js";
test("assignability", () => {
const _s1: StandardSchemaV1 = z.string();
const _s2: StandardSchemaV1<string> = z.string();
const _s3: StandardSchemaV1<string, string> = z.string();
const _s4: StandardSchemaV1<unknown, string> = z.string();
[_s1, _s2, _s3, _s4];
});
test("type inference", () => {
const stringToNumber = z.string().transform((x) => x.length);
type input = StandardSchemaV1.InferInput<typeof stringToNumber>;
util.assertEqual<input, string>(true);
type output = StandardSchemaV1.InferOutput<typeof stringToNumber>;
util.assertEqual<output, number>(true);
});
test("valid parse", () => {
const schema = z.string();
const result = schema["~standard"].validate("hello");
if (result instanceof Promise) {
throw new Error("Expected sync result");
}
expect(result.issues).toEqual(undefined);
if (result.issues) {
throw new Error("Expected no issues");
} else {
expect(result.value).toEqual("hello");
}
});
test("invalid parse", () => {
const schema = z.string();
const result = schema["~standard"].validate(1234);
if (result instanceof Promise) {
throw new Error("Expected sync result");
}
expect(result.issues).toBeDefined();
if (!result.issues) {
throw new Error("Expected issues");
}
expect(result.issues.length).toEqual(1);
expect(result.issues[0].path).toEqual([]);
});
test("valid parse async", async () => {
const schema = z.string().refine(async () => true);
const _result = schema["~standard"].validate("hello");
if (_result instanceof Promise) {
const result = await _result;
expect(result.issues).toEqual(undefined);
if (result.issues) {
throw new Error("Expected no issues");
} else {
expect(result.value).toEqual("hello");
}
} else {
throw new Error("Expected async result");
}
});
test("invalid parse async", async () => {
const schema = z.string().refine(async () => false);
const _result = schema["~standard"].validate("hello");
if (_result instanceof Promise) {
const result = await _result;
expect(result.issues).toBeDefined();
if (!result.issues) {
throw new Error("Expected issues");
}
expect(result.issues.length).toEqual(1);
expect(result.issues[0].path).toEqual([]);
} else {
throw new Error("Expected async result");
}
});

View File

@@ -0,0 +1,15 @@
import { NativeAnimationControls } from './NativeAnimationControls.mjs';
import { convertMotionOptionsToNative } from './utils/convert-options.mjs';
class PseudoAnimation extends NativeAnimationControls {
constructor(target, pseudoElement, valueName, keyframes, options) {
const animationOptions = convertMotionOptionsToNative(valueName, keyframes, options);
const animation = target.animate(animationOptions.keyframes, {
pseudoElement,
...animationOptions.options,
});
super(animation);
}
}
export { PseudoAnimation };

View File

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

View File

@@ -0,0 +1,162 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.js";
const eraValues = {
narrow: ["ق", "ب"],
abbreviated: ["ق.م.", "ب.م."],
wide: ["قبل الميلاد", "بعد الميلاد"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["ر1", "ر2", "ر3", "ر4"],
wide: ["الربع الأول", "الربع الثاني", "الربع الثالث", "الربع الرابع"],
};
const monthValues = {
narrow: ["ج", "ف", "م", "أ", "م", "ج", "ج", "أ", "س", "أ", "ن", "د"],
abbreviated: [
"جانـ",
"فيفـ",
"مارس",
"أفريل",
"مايـ",
"جوانـ",
"جويـ",
"أوت",
"سبتـ",
"أكتـ",
"نوفـ",
"ديسـ",
],
wide: [
"جانفي",
"فيفري",
"مارس",
"أفريل",
"ماي",
"جوان",
"جويلية",
"أوت",
"سبتمبر",
"أكتوبر",
"نوفمبر",
"ديسمبر",
],
};
const dayValues = {
narrow: ["ح", "ن", "ث", "ر", "خ", "ج", "س"],
short: ["أحد", "اثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"],
abbreviated: ["أحد", "اثنـ", "ثلا", "أربـ", "خميـ", "جمعة", "سبت"],
wide: [
"الأحد",
"الاثنين",
"الثلاثاء",
"الأربعاء",
"الخميس",
"الجمعة",
"السبت",
],
};
const dayPeriodValues = {
narrow: {
am: "ص",
pm: "م",
midnight: "ن",
noon: "ظ",
morning: "صباحاً",
afternoon: "بعد الظهر",
evening: "مساءاً",
night: "ليلاً",
},
abbreviated: {
am: "ص",
pm: "م",
midnight: "نصف الليل",
noon: "ظهر",
morning: "صباحاً",
afternoon: "بعد الظهر",
evening: "مساءاً",
night: "ليلاً",
},
wide: {
am: "ص",
pm: "م",
midnight: "نصف الليل",
noon: "ظهر",
morning: "صباحاً",
afternoon: "بعد الظهر",
evening: "مساءاً",
night: "ليلاً",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ص",
pm: "م",
midnight: "ن",
noon: "ظ",
morning: "في الصباح",
afternoon: "بعد الظـهر",
evening: "في المساء",
night: "في الليل",
},
abbreviated: {
am: "ص",
pm: "م",
midnight: "نصف الليل",
noon: "ظهر",
morning: "في الصباح",
afternoon: "بعد الظهر",
evening: "في المساء",
night: "في الليل",
},
wide: {
am: "ص",
pm: "م",
midnight: "نصف الليل",
noon: "ظهر",
morning: "صباحاً",
afternoon: "بعد الظـهر",
evening: "في المساء",
night: "في الليل",
},
};
const ordinalNumber = (dirtyNumber) => {
return String(dirtyNumber);
};
export const localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => Number(quarter) - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1,2 @@
export { openFeatureIntegration, OpenFeatureIntegrationHook } from './integration';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,11 @@
Copyright 2008 Fair Oaks Labs, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,16 @@
import type { PayloadRequest, TypedUser } from 'payload';
type Args = {
collectionSlug?: string;
globalSlug?: string;
id?: number | string;
req: PayloadRequest;
updateLastEdited?: boolean;
};
type Result = {
isLocked: boolean;
lastEditedAt: string;
user: TypedUser;
};
export declare const handleFormStateLocking: ({ id, collectionSlug, globalSlug, req, updateLastEdited, }: Args) => Promise<Result>;
export {};
//# sourceMappingURL=handleFormStateLocking.d.ts.map

View File

@@ -0,0 +1,20 @@
// Backwards-compatible iterator interfaces, augmented with iterator helper methods by lib.esnext.iterator in TypeScript 5.6.
// The IterableIterator interface does not contain these methods, which creates assignability issues in places where IteratorObjects
// are expected (eg. DOM-compatible APIs) if lib.esnext.iterator is loaded.
// Also ensures that iterators returned by the Node API, which inherit from Iterator.prototype, correctly expose the iterator helper methods
// if lib.esnext.iterator is loaded.
// Placeholders for TS <5.6
interface IteratorObject<T, TReturn, TNext> {}
interface AsyncIteratorObject<T, TReturn, TNext> {}
declare namespace NodeJS {
// Populate iterator methods for TS <5.6
interface Iterator<T, TReturn, TNext> extends globalThis.Iterator<T, TReturn, TNext> {}
interface AsyncIterator<T, TReturn, TNext> extends globalThis.AsyncIterator<T, TReturn, TNext> {}
// Polyfill for TS 5.6's instrinsic BuiltinIteratorReturn type, required for DOM-compatible iterators
type BuiltinIteratorReturn = ReturnType<any[][typeof Symbol.iterator]> extends
globalThis.Iterator<any, infer TReturn> ? TReturn
: any;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"panels-left-bottom.js","sources":["../../../src/icons/panels-left-bottom.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PanelsLeftBottom\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik05IDN2MTgiIC8+CiAgPHBhdGggZD0iTTkgMTVoMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/panels-left-bottom\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 PanelsLeftBottom = createLucideIcon('PanelsLeftBottom', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M9 3v18', key: 'fh3hqa' }],\n ['path', { d: 'M9 15h12', key: '5ijen5' }],\n]);\n\nexport default PanelsLeftBottom;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmB,iBAAiB,kBAAoB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5D,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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,19 @@
Copyright (c) 2017-2018 Fredrik Nicol
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1 @@
{"version":3,"file":"copy-minus.js","sources":["../../../src/icons/copy-minus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CopyMinus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iMTIiIHgyPSIxOCIgeTE9IjE1IiB5Mj0iMTUiIC8+CiAgPHJlY3Qgd2lkdGg9IjE0IiBoZWlnaHQ9IjE0IiB4PSI4IiB5PSI4IiByeD0iMiIgcnk9IjIiIC8+CiAgPHBhdGggZD0iTTQgMTZjLTEuMSAwLTItLjktMi0yVjRjMC0xLjEuOS0yIDItMmgxMGMxLjEgMCAyIC45IDIgMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/copy-minus\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 CopyMinus = createLucideIcon('CopyMinus', [\n ['line', { x1: '12', x2: '18', y1: '15', y2: '15', key: '1nscbv' }],\n ['rect', { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2', key: '17jyea' }],\n ['path', { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2', key: 'zix9uf' }],\n]);\n\nexport default CopyMinus;\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,CAC9C,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAClE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,KAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,EAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,KAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAA,EAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAU,CAAA,CAAA;AAAA,CAAA,CACvF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1F,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,2 @@
import { GraphQLScalarType } from 'graphql';
export declare const GraphQLTimestamp: GraphQLScalarType<Date, number>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transports/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC"}

View File

@@ -0,0 +1,30 @@
import { toDate } from "./toDate.mjs";
/**
* @name isBefore
* @category Common Helpers
* @summary Is the first date before the second one?
*
* @description
* Is the first date before the second one?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date that should be before the other one to return true
* @param dateToCompare - The date to compare with
*
* @returns The first date is before the second date
*
* @example
* // Is 10 July 1989 before 11 February 1987?
* const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
* //=> false
*/
export function isBefore(date, dateToCompare) {
const _date = toDate(date);
const _dateToCompare = toDate(dateToCompare);
return +_date < +_dateToCompare;
}
// Fallback for modularized imports:
export default isBefore;

View File

@@ -0,0 +1,9 @@
export declare const isWithinIntervalWithOptions: import("./types.js").FPFn3<
boolean,
import("../isWithinInterval.js").IsWithinIntervalOptions | undefined,
import("../fp.js").Interval<
import("../fp.js").DateArg<Date>,
import("../fp.js").DateArg<Date>
>,
string | number | Date
>;

View File

@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { endOfDecade as fn } from "../endOfDecade.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const endOfDecade = convertToFP(fn, 1);
// Fallback for modularized imports:
export default endOfDecade;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/forms/NullifyField/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,OAAO,cAAc,CAAA;AAIrB,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,IAAI,GAAG,MAAM,CAAA;IACxC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAwEhE,CAAA"}

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('flatMapDeep', require('../flatMapDeep'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1,146 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.js";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.js";
const matchOrdinalNumberPattern = /^(\d+)\./i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(pr\.n\.e\.|AD)/i,
abbreviated: /^(pr\.\s?Kr\.|po\.\s?Kr\.)/i,
wide: /^(Prije Krista|prije nove ere|Poslije Krista|nova era)/i,
};
const parseEraPatterns = {
any: [/^pr/i, /^(po|nova)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234]\.\s?kv\.?/i,
wide: /^[1234]\. kvartal/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^(10|11|12|[123456789])\./i,
abbreviated: /^(sij|velj|(ožu|ozu)|tra|svi|lip|srp|kol|ruj|lis|stu|pro)/i,
wide: /^((siječanj|siječnja|sijecanj|sijecnja)|(veljača|veljače|veljaca|veljace)|(ožujak|ožujka|ozujak|ozujka)|(travanj|travnja)|(svibanj|svibnja)|(lipanj|lipnja)|(srpanj|srpnja)|(kolovoz|kolovoza)|(rujan|rujna)|(listopad|listopada)|(studeni|studenog)|(prosinac|prosinca))/i,
};
const parseMonthPatterns = {
narrow: [
/1/i,
/2/i,
/3/i,
/4/i,
/5/i,
/6/i,
/7/i,
/8/i,
/9/i,
/10/i,
/11/i,
/12/i,
],
abbreviated: [
/^sij/i,
/^velj/i,
/^(ožu|ozu)/i,
/^tra/i,
/^svi/i,
/^lip/i,
/^srp/i,
/^kol/i,
/^ruj/i,
/^lis/i,
/^stu/i,
/^pro/i,
],
wide: [
/^sij/i,
/^velj/i,
/^(ožu|ozu)/i,
/^tra/i,
/^svi/i,
/^lip/i,
/^srp/i,
/^kol/i,
/^ruj/i,
/^lis/i,
/^stu/i,
/^pro/i,
],
};
const matchDayPatterns = {
narrow: /^[npusčc]/i,
short: /^(ned|pon|uto|sri|(čet|cet)|pet|sub)/i,
abbreviated: /^(ned|pon|uto|sri|(čet|cet)|pet|sub)/i,
wide: /^(nedjelja|ponedjeljak|utorak|srijeda|(četvrtak|cetvrtak)|petak|subota)/i,
};
const parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
};
const matchDayPeriodPatterns = {
any: /^(am|pm|ponoc|ponoć|(po)?podne|navecer|navečer|noću|poslije podne|ujutro)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^pono/i,
noon: /^pod/i,
morning: /jutro/i,
afternoon: /(poslije\s|po)+podne/i,
evening: /(navece|naveče)/i,
night: /(nocu|noću)/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "wide",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};

View File

@@ -0,0 +1,12 @@
import type { Locale } from "./types.js";
/**
* @category Locales
* @summary Polish locale.
* @language Polish
* @iso-639-2 pol
* @author Mateusz Derks [@ertrzyiks](https://github.com/ertrzyiks)
* @author Just RAG [@justrag](https://github.com/justrag)
* @author Mikolaj Grzyb [@mikolajgrzyb](https://github.com/mikolajgrzyb)
* @author Mateusz Tokarski [@mutisz](https://github.com/mutisz)
*/
export declare const pl: Locale;

View File

@@ -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 CircleEllipsis = createLucideIcon("CircleEllipsis", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["path", { d: "M17 12h.01", key: "1m0b6t" }],
["path", { d: "M12 12h.01", key: "1mp3jc" }],
["path", { d: "M7 12h.01", key: "eqddd0" }]
]);
export { CircleEllipsis as default };
//# sourceMappingURL=circle-ellipsis.js.map

View File

@@ -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.
*
*/
'use strict'
const LexicalDecoratorBlockNode = process.env.NODE_ENV !== 'production' ? require('./LexicalDecoratorBlockNode.dev.js') : require('./LexicalDecoratorBlockNode.prod.js');
module.exports = LexicalDecoratorBlockNode;

View File

@@ -0,0 +1 @@
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../src/admin/fields/Group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAChF,OAAO,KAAK,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAC7F,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,UAAU,EACV,oBAAoB,EACpB,eAAe,EAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,+BAA+B,EAC/B,+BAA+B,EAC/B,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,aAAa,CAAA;AAEpB,KAAK,2BAA2B,GAAG,YAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;AAEzE,KAAK,yBAAyB,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;AAEzD,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAA;AAElD,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC,2BAA2B,CAAC,GAC9E,yBAAyB,CAAA;AAE3B,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,GAC3D,eAAe,CAAC,UAAU,EAAE,2BAA2B,CAAC,CAAA;AAE1D,MAAM,MAAM,yBAAyB,GAAG,oBAAoB,CAC1D,UAAU,EACV,2BAA2B,EAC3B,yBAAyB,CAC1B,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,oBAAoB,CAC1D,2BAA2B,EAC3B,yBAAyB,CAC1B,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG,yBAAyB,CACpE,UAAU,EACV,2BAA2B,CAC5B,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG,yBAAyB,CAAC,2BAA2B,CAAC,CAAA;AAEnG,MAAM,MAAM,oCAAoC,GAAG,+BAA+B,CAChF,UAAU,EACV,2BAA2B,CAC5B,CAAA;AAED,MAAM,MAAM,oCAAoC,GAC9C,+BAA+B,CAAC,2BAA2B,CAAC,CAAA;AAE9D,MAAM,MAAM,8BAA8B,GAAG,yBAAyB,CACpE,UAAU,EACV,2BAA2B,CAC5B,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG,yBAAyB,CAAC,2BAA2B,CAAC,CAAA;AAEnG,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAA;AAElG,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,CAAC,gBAAgB,CAAC,CAAA"}

View File

@@ -0,0 +1,15 @@
/**
* @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 FishSymbol = createLucideIcon("FishSymbol", [
["path", { d: "M2 16s9-15 20-4C11 23 2 8 2 8", key: "h4oh4o" }]
]);
export { FishSymbol as default };
//# sourceMappingURL=fish-symbol.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"square-radical.js","sources":["../../../src/icons/square-radical.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareRadical\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNyAxMmgybDIgNSAyLTEwaDQiIC8+CiAgPHJlY3QgeD0iMyIgeT0iMyIgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiByeD0iMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/square-radical\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 SquareRadical = createLucideIcon('SquareRadical', [\n ['path', { d: 'M7 12h2l2 5 2-10h4', key: '1fxv6h' }],\n ['rect', { x: '3', y: '3', width: '18', height: '18', rx: '2', key: 'h1oib' }],\n]);\n\nexport default SquareRadical;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACnD,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,SAAS,CAAA;AAC/E,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,75 @@
'use strict';
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
var React = require('react');
var _excluded = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inputValue", "menuIsOpen", "onChange", "onInputChange", "onMenuClose", "onMenuOpen", "value"];
function useStateManager(_ref) {
var _ref$defaultInputValu = _ref.defaultInputValue,
defaultInputValue = _ref$defaultInputValu === void 0 ? '' : _ref$defaultInputValu,
_ref$defaultMenuIsOpe = _ref.defaultMenuIsOpen,
defaultMenuIsOpen = _ref$defaultMenuIsOpe === void 0 ? false : _ref$defaultMenuIsOpe,
_ref$defaultValue = _ref.defaultValue,
defaultValue = _ref$defaultValue === void 0 ? null : _ref$defaultValue,
propsInputValue = _ref.inputValue,
propsMenuIsOpen = _ref.menuIsOpen,
propsOnChange = _ref.onChange,
propsOnInputChange = _ref.onInputChange,
propsOnMenuClose = _ref.onMenuClose,
propsOnMenuOpen = _ref.onMenuOpen,
propsValue = _ref.value,
restSelectProps = _objectWithoutProperties(_ref, _excluded);
var _useState = React.useState(propsInputValue !== undefined ? propsInputValue : defaultInputValue),
_useState2 = _slicedToArray(_useState, 2),
stateInputValue = _useState2[0],
setStateInputValue = _useState2[1];
var _useState3 = React.useState(propsMenuIsOpen !== undefined ? propsMenuIsOpen : defaultMenuIsOpen),
_useState4 = _slicedToArray(_useState3, 2),
stateMenuIsOpen = _useState4[0],
setStateMenuIsOpen = _useState4[1];
var _useState5 = React.useState(propsValue !== undefined ? propsValue : defaultValue),
_useState6 = _slicedToArray(_useState5, 2),
stateValue = _useState6[0],
setStateValue = _useState6[1];
var onChange = React.useCallback(function (value, actionMeta) {
if (typeof propsOnChange === 'function') {
propsOnChange(value, actionMeta);
}
setStateValue(value);
}, [propsOnChange]);
var onInputChange = React.useCallback(function (value, actionMeta) {
var newValue;
if (typeof propsOnInputChange === 'function') {
newValue = propsOnInputChange(value, actionMeta);
}
setStateInputValue(newValue !== undefined ? newValue : value);
}, [propsOnInputChange]);
var onMenuOpen = React.useCallback(function () {
if (typeof propsOnMenuOpen === 'function') {
propsOnMenuOpen();
}
setStateMenuIsOpen(true);
}, [propsOnMenuOpen]);
var onMenuClose = React.useCallback(function () {
if (typeof propsOnMenuClose === 'function') {
propsOnMenuClose();
}
setStateMenuIsOpen(false);
}, [propsOnMenuClose]);
var inputValue = propsInputValue !== undefined ? propsInputValue : stateInputValue;
var menuIsOpen = propsMenuIsOpen !== undefined ? propsMenuIsOpen : stateMenuIsOpen;
var value = propsValue !== undefined ? propsValue : stateValue;
return _objectSpread(_objectSpread({}, restSelectProps), {}, {
inputValue: inputValue,
menuIsOpen: menuIsOpen,
onChange: onChange,
onInputChange: onInputChange,
onMenuClose: onMenuClose,
onMenuOpen: onMenuOpen,
value: value
});
}
exports.useStateManager = useStateManager;

View File

@@ -0,0 +1,8 @@
import React from 'react';
export declare const GroupContext: React.Context<boolean>;
export declare const GroupProvider: React.FC<{
children?: React.ReactNode;
withinGroup?: boolean;
}>;
export declare const useGroup: () => boolean;
//# sourceMappingURL=provider.d.ts.map

View File

@@ -0,0 +1,74 @@
var SetCache = require('./_SetCache'),
arrayIncludes = require('./_arrayIncludes'),
arrayIncludesWith = require('./_arrayIncludesWith'),
arrayMap = require('./_arrayMap'),
baseUnary = require('./_baseUnary'),
cacheHas = require('./_cacheHas');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* The base implementation of methods like `_.intersection`, without support
* for iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of shared values.
*/
function baseIntersection(arrays, iteratee, comparator) {
var includes = comparator ? arrayIncludesWith : arrayIncludes,
length = arrays[0].length,
othLength = arrays.length,
othIndex = othLength,
caches = Array(othLength),
maxLength = Infinity,
result = [];
while (othIndex--) {
var array = arrays[othIndex];
if (othIndex && iteratee) {
array = arrayMap(array, baseUnary(iteratee));
}
maxLength = nativeMin(array.length, maxLength);
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
? new SetCache(othIndex && array)
: undefined;
}
array = arrays[0];
var index = -1,
seen = caches[0];
outer:
while (++index < length && result.length < maxLength) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (!(seen
? cacheHas(seen, computed)
: includes(result, computed, comparator)
)) {
othIndex = othLength;
while (--othIndex) {
var cache = caches[othIndex];
if (!(cache
? cacheHas(cache, computed)
: includes(arrays[othIndex], computed, comparator))
) {
continue outer;
}
}
if (seen) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
module.exports = baseIntersection;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAe,MAAM,UAAU,CAAA;AAI3C,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,8DAA8D;IAC9D,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qEAAqE;IACrE,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,kBAAkB;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,4CAA4C;IAC5C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kEAAkE;IAClE,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,qDAAqD;IACrD,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,eAAO,MAAM,SAAS;QACjB,MAAM,WACA,MAAM,YACN,gBAAgB;;;sBA4Gf,MAAM,YAAW,gBAAgB,MAC1C,GAAG,MAAM;oBAOkB,gBAAgB,KAAG,OAAO,SAAS;2BAuFtD,MAAM,YACN,gBAAgB;sBA2BK,MAAM,YAAW,gBAAgB;kBAKzD,MAAM,EAAE,WACL,MAAM,YACN,gBAAgB;;;;;CApO1B,CAAA;AAkED,MAAM,MAAM,GAAG,GAAG,IAAI,GAAG,GAAG,CAAA;AAQ5B,eAAO,MAAM,GAAG,KAC+C,CAAA;AAG/D,eAAO,MAAM,QAAQ,eAAwB,CAAA;AAmB7C,eAAO,MAAM,MAAM,GAChB,SAAS,MAAM,EAAE,UAAS,gBAAqB,MAC/C,GAAG,MAAM,YACsB,CAAA;AAMlC,eAAO,MAAM,QAAQ,GAAI,KAAK,gBAAgB,KAAG,OAAO,SAyEvD,CAAA;AAaD,eAAO,MAAM,WAAW,GACtB,SAAS,MAAM,EACf,UAAS,gBAAqB,aAY/B,CAAA;AAeD,eAAO,MAAM,MAAM,GAAI,SAAS,MAAM,EAAE,UAAS,gBAAqB,qBAC5B,CAAA;AAG1C,eAAO,MAAM,KAAK,GAChB,MAAM,MAAM,EAAE,EACd,SAAS,MAAM,EACf,UAAS,gBAAqB,aAQ/B,CAAA;AAQD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,QAAQ,CAAA;AACrE,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,KAAK,CAAA;AAErD,qBAAa,SAAS;IACpB,OAAO,EAAE,gBAAgB,CAAA;IACzB,GAAG,EAAE,mBAAmB,EAAE,EAAE,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;IAEf,oBAAoB,EAAE,OAAO,CAAA;IAC7B,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;IACd,uBAAuB,EAAE,OAAO,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAA;IACrB,MAAM,EAAE,OAAO,CAAA;IAEf,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,QAAQ,CAAA;IAClB,kBAAkB,EAAE,OAAO,CAAA;IAE3B,MAAM,EAAE,KAAK,GAAG,IAAI,GAAG,QAAQ,CAAA;gBACnB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAoC3D,QAAQ,IAAI,OAAO;IAYnB,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE;IAEjB,IAAI;IA6FJ,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA8BhC,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAiB/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAoBtC,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IA6D7C,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA0F1C,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE;IAkBxD,UAAU,CACR,CAAC,EAAE,MAAM,EAAE,EACX,CAAC,EAAE,MAAM,EAAE,EACX,YAAY,GAAE,OAAe,GAC5B,KAAK,GAAG,MAAM,EAAE;IA+CnB,WAAW;IAqBX,QAAQ,CACN,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,WAAW,EAAE,EACtB,OAAO,GAAE,OAAe;IA4N1B,WAAW;IAIX,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IA6CnC,MAAM;IAuGN,UAAU,CAAC,CAAC,EAAE,MAAM;IAepB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,UAAe;IAiEvC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB;CAGtC;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}

View File

@@ -0,0 +1,28 @@
import type { FeedbackInternalOptions, FeedbackModalIntegration } from '@sentry/core';
import type { ComponentType, h as hType } from 'preact';
import type * as Hooks from 'preact/hooks';
interface FactoryParams {
h: typeof hType;
hooks: typeof Hooks;
/**
* A ref to a Canvas Element that serves as our "value" or image output.
*/
outputBuffer: HTMLCanvasElement;
/**
* A reference to the whole dialog (the parent of this component) so that we
* can show/hide it and take a clean screenshot of the webpage.
*/
dialog: ReturnType<FeedbackModalIntegration['createDialog']>;
/**
* The whole options object.
*
* Needed to set nonce and id values for editor specific styles
*/
options: FeedbackInternalOptions;
}
interface Props {
onError: (error: Error) => void;
}
export declare function ScreenshotEditorFactory({ h, hooks, outputBuffer, dialog, options, }: FactoryParams): ComponentType<Props>;
export {};
//# sourceMappingURL=ScreenshotEditor.d.ts.map

View File

@@ -0,0 +1,17 @@
/**
* IsValidTimeZoneName ( timeZone )
* https://tc39.es/ecma402/#sec-isvalidtimezonename
*
* Extended to support UTC offset time zones per ECMA-402 PR #788 (ES2026).
* The abstract operation validates both:
* 1. UTC offset identifiers (e.g., "+01:00", "-05:30")
* 2. Available named time zone identifiers from IANA Time Zone Database
*
* @param tz - The timezone identifier to validate
* @param implDetails - Implementation details containing timezone data
* @returns true if timeZone is a valid identifier
*/
export declare function IsValidTimeZoneName(tz: string, { zoneNamesFromData, uppercaseLinks }: {
zoneNamesFromData: readonly string[];
uppercaseLinks: Record<string, string>;
}): boolean;

View File

@@ -0,0 +1,262 @@
// This file is auto-generated! Do not modify it directly.
// Run `yarn gulp bundle-dts` to re-generate it.
/* eslint-disable @typescript-eslint/consistent-type-imports, @typescript-eslint/no-redundant-type-constituents */
import { File, Expression } from '@babel/types';
declare class Position {
line: number;
column: number;
index: number;
constructor(line: number, col: number, index: number);
}
type SyntaxPlugin = "flow" | "typescript" | "jsx" | "pipelineOperator" | "placeholders";
type ParseErrorCode = "BABEL_PARSER_SYNTAX_ERROR" | "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";
interface ParseErrorSpecification<ErrorDetails> {
code: ParseErrorCode;
reasonCode: string;
syntaxPlugin?: SyntaxPlugin;
missingPlugin?: string | string[];
loc: Position;
details: ErrorDetails;
pos: number;
}
type ParseError$1<ErrorDetails> = SyntaxError & ParseErrorSpecification<ErrorDetails>;
type BABEL_8_BREAKING = false;
type IF_BABEL_7<V> = false extends BABEL_8_BREAKING ? V : never;
type Plugin$1 =
| "asyncDoExpressions"
| IF_BABEL_7<"asyncGenerators">
| IF_BABEL_7<"bigInt">
| IF_BABEL_7<"classPrivateMethods">
| IF_BABEL_7<"classPrivateProperties">
| IF_BABEL_7<"classProperties">
| IF_BABEL_7<"classStaticBlock">
| IF_BABEL_7<"decimal">
| "decorators-legacy"
| "deferredImportEvaluation"
| "decoratorAutoAccessors"
| "destructuringPrivate"
| IF_BABEL_7<"deprecatedImportAssert">
| "doExpressions"
| IF_BABEL_7<"dynamicImport">
| IF_BABEL_7<"explicitResourceManagement">
| "exportDefaultFrom"
| IF_BABEL_7<"exportNamespaceFrom">
| "flow"
| "flowComments"
| "functionBind"
| "functionSent"
| "importMeta"
| "jsx"
| IF_BABEL_7<"jsonStrings">
| IF_BABEL_7<"logicalAssignment">
| IF_BABEL_7<"importAssertions">
| IF_BABEL_7<"importReflection">
| "moduleBlocks"
| IF_BABEL_7<"moduleStringNames">
| IF_BABEL_7<"nullishCoalescingOperator">
| IF_BABEL_7<"numericSeparator">
| IF_BABEL_7<"objectRestSpread">
| IF_BABEL_7<"optionalCatchBinding">
| IF_BABEL_7<"optionalChaining">
| "partialApplication"
| "placeholders"
| IF_BABEL_7<"privateIn">
| IF_BABEL_7<"regexpUnicodeSets">
| "sourcePhaseImports"
| "throwExpressions"
| IF_BABEL_7<"topLevelAwait">
| "v8intrinsic"
| ParserPluginWithOptions[0];
type ParserPluginWithOptions =
| ["decorators", DecoratorsPluginOptions]
| ["discardBinding", { syntaxType: "void" }]
| ["estree", { classFeatures?: boolean }]
| IF_BABEL_7<["importAttributes", { deprecatedAssertSyntax: boolean }]>
| IF_BABEL_7<["moduleAttributes", { version: "may-2020" }]>
| ["optionalChainingAssign", { version: "2023-07" }]
| ["pipelineOperator", PipelineOperatorPluginOptions]
| ["recordAndTuple", RecordAndTuplePluginOptions]
| ["flow", FlowPluginOptions]
| ["typescript", TypeScriptPluginOptions];
type PluginConfig = Plugin$1 | ParserPluginWithOptions;
interface DecoratorsPluginOptions {
decoratorsBeforeExport?: boolean;
allowCallParenthesized?: boolean;
}
interface PipelineOperatorPluginOptions {
proposal: BABEL_8_BREAKING extends false
? "minimal" | "fsharp" | "hack" | "smart"
: "fsharp" | "hack";
topicToken?: "%" | "#" | "@@" | "^^" | "^";
}
interface RecordAndTuplePluginOptions {
syntaxType: "bar" | "hash";
}
type FlowPluginOptions = BABEL_8_BREAKING extends true
? {
all?: boolean;
enums?: boolean;
}
: {
all?: boolean;
};
interface TypeScriptPluginOptions {
dts?: boolean;
disallowAmbiguousJSXLike?: boolean;
}
type Plugin = PluginConfig;
type SourceType = "script" | "commonjs" | "module" | "unambiguous";
interface Options {
/**
* By default, import and export declarations can only appear at a program's top level.
* Setting this option to true allows them anywhere where a statement is allowed.
*/
allowImportExportEverywhere?: boolean;
/**
* By default, await use is not allowed outside of an async function.
* Set this to true to accept such code.
*/
allowAwaitOutsideFunction?: boolean;
/**
* By default, a return statement at the top level raises an error.
* Set this to true to accept such code.
*/
allowReturnOutsideFunction?: boolean;
/**
* By default, new.target use is not allowed outside of a function or class.
* Set this to true to accept such code.
*/
allowNewTargetOutsideFunction?: boolean;
/**
* By default, super calls are not allowed outside of a method.
* Set this to true to accept such code.
*/
allowSuperOutsideMethod?: boolean;
/**
* By default, exported identifiers must refer to a declared variable.
* Set this to true to allow export statements to reference undeclared variables.
*/
allowUndeclaredExports?: boolean;
/**
* By default, yield use is not allowed outside of a generator function.
* Set this to true to accept such code.
*/
allowYieldOutsideFunction?: boolean;
/**
* By default, Babel parser JavaScript code according to Annex B syntax.
* Set this to `false` to disable such behavior.
*/
annexB?: boolean;
/**
* By default, Babel attaches comments to adjacent AST nodes.
* When this option is set to false, comments are not attached.
* It can provide up to 30% performance improvement when the input code has many comments.
* @babel/eslint-parser will set it for you.
* It is not recommended to use attachComment: false with Babel transform,
* as doing so removes all the comments in output code, and renders annotations such as
* /* istanbul ignore next *\/ nonfunctional.
*/
attachComment?: boolean;
/**
* By default, Babel always throws an error when it finds some invalid code.
* When this option is set to true, it will store the parsing error and
* try to continue parsing the invalid input file.
*/
errorRecovery?: boolean;
/**
* Indicate the mode the code should be parsed in.
* Can be one of "script", "commonjs", "module", or "unambiguous". Defaults to "script".
* "unambiguous" will make @babel/parser attempt to guess, based on the presence
* of ES6 import or export statements.
* Files with ES6 imports and exports are considered "module" and are otherwise "script".
*
* Use "commonjs" to parse code that is intended to be run in a CommonJS environment such as Node.js.
*/
sourceType?: SourceType;
/**
* Correlate output AST nodes with their source filename.
* Useful when generating code and source maps from the ASTs of multiple input files.
*/
sourceFilename?: string;
/**
* By default, all source indexes start from 0.
* You can provide a start index to alternatively start with.
* Useful for integration with other source tools.
*/
startIndex?: number;
/**
* By default, the first line of code parsed is treated as line 1.
* You can provide a line number to alternatively start with.
* Useful for integration with other source tools.
*/
startLine?: number;
/**
* By default, the parsed code is treated as if it starts from line 1, column 0.
* You can provide a column number to alternatively start with.
* Useful for integration with other source tools.
*/
startColumn?: number;
/**
* Array containing the plugins that you want to enable.
*/
plugins?: Plugin[];
/**
* Should the parser work in strict mode.
* Defaults to true if sourceType === 'module'. Otherwise, false.
*/
strictMode?: boolean;
/**
* Adds a ranges property to each node: [node.start, node.end]
*/
ranges?: boolean;
/**
* Adds all parsed tokens to a tokens property on the File node.
*/
tokens?: boolean;
/**
* By default, the parser adds information about parentheses by setting
* `extra.parenthesized` to `true` as needed.
* When this option is `true` the parser creates `ParenthesizedExpression`
* AST nodes instead of using the `extra` property.
*/
createParenthesizedExpressions?: boolean;
/**
* The default is false in Babel 7 and true in Babel 8
* Set this to true to parse it as an `ImportExpression` node.
* Otherwise `import(foo)` is parsed as `CallExpression(Import, [Identifier(foo)])`.
*/
createImportExpressions?: boolean;
}
type ParserOptions = Partial<Options>;
type ParseError = ParseError$1<object>;
type ParseResult<Result extends File | Expression = File> = Result & {
comments: File["comments"];
errors: null | ParseError[];
tokens?: File["tokens"];
};
/**
* Parse the provided code as an entire ECMAScript program.
*/
declare function parse(input: string, options?: ParserOptions): ParseResult<File>;
declare function parseExpression(input: string, options?: ParserOptions): ParseResult<Expression>;
declare const tokTypes: {
// todo(flow->ts) real token type
[name: string]: any;
};
export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParseResult, ParserOptions, PluginConfig as ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes };

View File

@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { endOfMonth as fn } from "../endOfMonth.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const endOfMonth = convertToFP(fn, 1);
// Fallback for modularized imports:
export default endOfMonth;

View File

@@ -0,0 +1,6 @@
export declare const setMonthWithOptions: import("./types.js").FPFn3<
Date,
import("../setMonth.js").SetMonthOptions<Date> | undefined,
number,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1,269 @@
"use strict";
exports.__esModule = true;
exports.default = exports.modes = void 0;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _Transition = require("./Transition");
var _TransitionGroupContext = _interopRequireDefault(require("./TransitionGroupContext"));
var _leaveRenders, _enterRenders;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
function areChildrenDifferent(oldChildren, newChildren) {
if (oldChildren === newChildren) return false;
if (_react.default.isValidElement(oldChildren) && _react.default.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {
return false;
}
return true;
}
/**
* Enum of modes for SwitchTransition component
* @enum { string }
*/
var modes = {
out: 'out-in',
in: 'in-out'
};
exports.modes = modes;
var callHook = function callHook(element, name, cb) {
return function () {
var _element$props;
element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);
cb();
};
};
var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {
var current = _ref.current,
changeState = _ref.changeState;
return _react.default.cloneElement(current, {
in: false,
onExited: callHook(current, 'onExited', function () {
changeState(_Transition.ENTERING, null);
})
});
}, _leaveRenders[modes.in] = function (_ref2) {
var current = _ref2.current,
changeState = _ref2.changeState,
children = _ref2.children;
return [current, _react.default.cloneElement(children, {
in: true,
onEntered: callHook(children, 'onEntered', function () {
changeState(_Transition.ENTERING);
})
})];
}, _leaveRenders);
var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {
var children = _ref3.children,
changeState = _ref3.changeState;
return _react.default.cloneElement(children, {
in: true,
onEntered: callHook(children, 'onEntered', function () {
changeState(_Transition.ENTERED, _react.default.cloneElement(children, {
in: true
}));
})
});
}, _enterRenders[modes.in] = function (_ref4) {
var current = _ref4.current,
children = _ref4.children,
changeState = _ref4.changeState;
return [_react.default.cloneElement(current, {
in: false,
onExited: callHook(current, 'onExited', function () {
changeState(_Transition.ENTERED, _react.default.cloneElement(children, {
in: true
}));
})
}), _react.default.cloneElement(children, {
in: true
})];
}, _enterRenders);
/**
* A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).
* You can use it when you want to control the render between state transitions.
* Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.
*
* If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.
* If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.
*
* **Note**: If you want the animation to happen simultaneously
* (that is, to have the old child removed and a new child inserted **at the same time**),
* you should use
* [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)
* instead.
*
* ```jsx
* function App() {
* const [state, setState] = useState(false);
* return (
* <SwitchTransition>
* <CSSTransition
* key={state ? "Goodbye, world!" : "Hello, world!"}
* addEndListener={(node, done) => node.addEventListener("transitionend", done, false)}
* classNames='fade'
* >
* <button onClick={() => setState(state => !state)}>
* {state ? "Goodbye, world!" : "Hello, world!"}
* </button>
* </CSSTransition>
* </SwitchTransition>
* );
* }
* ```
*
* ```css
* .fade-enter{
* opacity: 0;
* }
* .fade-exit{
* opacity: 1;
* }
* .fade-enter-active{
* opacity: 1;
* }
* .fade-exit-active{
* opacity: 0;
* }
* .fade-enter-active,
* .fade-exit-active{
* transition: opacity 500ms;
* }
* ```
*/
var SwitchTransition = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(SwitchTransition, _React$Component);
function SwitchTransition() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.state = {
status: _Transition.ENTERED,
current: null
};
_this.appeared = false;
_this.changeState = function (status, current) {
if (current === void 0) {
current = _this.state.current;
}
_this.setState({
status: status,
current: current
});
};
return _this;
}
var _proto = SwitchTransition.prototype;
_proto.componentDidMount = function componentDidMount() {
this.appeared = true;
};
SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
if (props.children == null) {
return {
current: null
};
}
if (state.status === _Transition.ENTERING && props.mode === modes.in) {
return {
status: _Transition.ENTERING
};
}
if (state.current && areChildrenDifferent(state.current, props.children)) {
return {
status: _Transition.EXITING
};
}
return {
current: _react.default.cloneElement(props.children, {
in: true
})
};
};
_proto.render = function render() {
var _this$props = this.props,
children = _this$props.children,
mode = _this$props.mode,
_this$state = this.state,
status = _this$state.status,
current = _this$state.current;
var data = {
children: children,
current: current,
changeState: this.changeState,
status: status
};
var component;
switch (status) {
case _Transition.ENTERING:
component = enterRenders[mode](data);
break;
case _Transition.EXITING:
component = leaveRenders[mode](data);
break;
case _Transition.ENTERED:
component = current;
}
return /*#__PURE__*/_react.default.createElement(_TransitionGroupContext.default.Provider, {
value: {
isMounting: !this.appeared
}
}, component);
};
return SwitchTransition;
}(_react.default.Component);
SwitchTransition.propTypes = process.env.NODE_ENV !== "production" ? {
/**
* Transition modes.
* `out-in`: Current element transitions out first, then when complete, the new element transitions in.
* `in-out`: New element transitions in first, then when complete, the current element transitions out.
*
* @type {'out-in'|'in-out'}
*/
mode: _propTypes.default.oneOf([modes.in, modes.out]),
/**
* Any `Transition` or `CSSTransition` component.
*/
children: _propTypes.default.oneOfType([_propTypes.default.element.isRequired])
} : {};
SwitchTransition.defaultProps = {
mode: modes.out
};
var _default = SwitchTransition;
exports.default = _default;

View File

@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { subSeconds as fn } from "../subSeconds.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const subSecondsWithOptions = convertToFP(fn, 3);
// Fallback for modularized imports:
export default subSecondsWithOptions;

View File

@@ -0,0 +1,40 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link addMonths} function options.
*/
export interface AddMonthsOptions<DateType extends Date = Date>
extends ContextOptions<DateType> {}
/**
* @name addMonths
* @category Month Helpers
* @summary Add the specified number of months to the given date.
*
* @description
* Add the specified number of months to the given date.
*
* @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 date to be changed
* @param amount - The amount of months to be added.
* @param options - The options object
*
* @returns The new date with the months added
*
* @example
* // Add 5 months to 1 September 2014:
* const result = addMonths(new Date(2014, 8, 1), 5)
* //=> Sun Feb 01 2015 00:00:00
*
* // Add one month to 30 January 2023:
* const result = addMonths(new Date(2023, 0, 30), 1)
* //=> Tue Feb 28 2023 00:00:00
*/
export declare function addMonths<
DateType extends Date,
ResultDate extends Date = DateType,
>(
date: DateArg<DateType>,
amount: number,
options?: AddMonthsOptions<ResultDate> | undefined,
): ResultDate;

View File

@@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = AsyncIterator;
var _OverloadYield = require("./OverloadYield.js");
var _regeneratorDefine = require("./regeneratorDefine.js");
function AsyncIterator(generator, PromiseImpl) {
if (!this.next) {
(0, _regeneratorDefine.default)(AsyncIterator.prototype);
(0, _regeneratorDefine.default)(AsyncIterator.prototype, typeof Symbol === "function" && Symbol.asyncIterator || "@asyncIterator", function () {
return this;
});
}
function invoke(method, arg, resolve, reject) {
try {
var result = generator[method](arg);
var value = result.value;
if (value instanceof _OverloadYield.default) {
return PromiseImpl.resolve(value.v).then(function (value) {
invoke("next", value, resolve, reject);
}, function (err) {
invoke("throw", err, resolve, reject);
});
}
return PromiseImpl.resolve(value).then(function (unwrapped) {
result.value = unwrapped;
resolve(result);
}, function (error) {
return invoke("throw", error, resolve, reject);
});
} catch (error) {
reject(error);
}
}
var previousPromise;
function enqueue(method, i, arg) {
function callInvokeWithMethodAndArg() {
return new PromiseImpl(function (resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
}
(0, _regeneratorDefine.default)(this, "_invoke", enqueue, true);
}
//# sourceMappingURL=regeneratorAsyncIterator.js.map

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