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,3 @@
/** Creates a function that gets the module name from a filename */
export declare function createGetModuleFromFilename(basePath?: string, isWindows?: boolean): (filename: string | undefined) => string | undefined;
//# sourceMappingURL=module.d.ts.map

View File

@@ -0,0 +1,3 @@
export * from "./declarations/src/index";
export { default } from "./declarations/src/index";
//# sourceMappingURL=emotion-weak-memoize.cjs.d.ts.map

View File

@@ -0,0 +1,11 @@
/**
* Adds module metadata to stack frames.
*
* Metadata can be injected by the Sentry bundler plugins using the `moduleMetadata` config option.
*
* When this integration is added, the metadata passed to the bundler plugin is added to the stack frames of all events
* under the `module_metadata` property. This can be used to help in tagging or routing of events from different teams
* our sources
*/
export declare const moduleMetadataIntegration: () => import("..").Integration;
//# sourceMappingURL=moduleMetadata.d.ts.map

View File

@@ -0,0 +1,195 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useModal } from '@faceless-ui/modal';
import { getTranslation } from '@payloadcms/translations';
import { toWords } from 'payload/shared';
import React, { useEffect, useMemo, useState } from 'react';
import { DefaultBlockImage } from '../../graphics/DefaultBlockImage/index.js';
import { useConfig } from '../../providers/Config/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { Drawer } from '../Drawer/index.js';
import { ThumbnailCard } from '../ThumbnailCard/index.js';
import './index.scss';
import { ItemSearch } from './ItemSearch/index.js';
const baseClass = 'items-drawer';
const getItemLabel = (item, i18n) => {
// Handle ClientBlock
if ('labels' in item && item.labels?.singular) {
if (typeof item.labels.singular === 'string') {
return item.labels.singular.toLowerCase();
}
if (typeof item.labels.singular === 'object') {
return getTranslation(item.labels.singular, i18n).toLowerCase();
}
}
// Handle ClientWidget with label (already resolved from function on server)
if ('label' in item && item.label) {
if (typeof item.label === 'string') {
return item.label.toLowerCase();
}
if (typeof item.label === 'object') {
return getTranslation(item.label, i18n).toLowerCase();
}
}
// Fallback to slug
if ('slug' in item) {
return toWords(item.slug).toLowerCase();
}
return '';
};
const getItemSlug = item => {
return item.slug;
};
const getItemImageInfo = item => {
if ('imageURL' in item) {
return {
imageAltText: item.imageAltText,
imageURL: item.imageURL
};
}
return {
imageAltText: undefined,
imageURL: undefined
};
};
const getItemDisplayLabel = (item, i18n) => {
// Handle ClientBlock
if ('labels' in item && item.labels?.singular) {
return getTranslation(item.labels.singular, i18n);
}
// Handle ClientWidget with label (already resolved from function on server)
if ('label' in item && item.label) {
if (typeof item.label === 'string') {
return item.label;
}
if (typeof item.label === 'object') {
return getTranslation(item.label, i18n);
}
}
// Fallback to slug - convert to human-readable label
return toWords(item.slug);
};
export const ItemsDrawer = props => {
const {
addRowIndex,
drawerSlug,
items,
labels,
onItemClick,
searchPlaceholder,
title
} = props;
const [searchTerm, setSearchTerm] = useState('');
const [filteredItems, setFilteredItems] = useState(items);
const {
closeModal,
isModalOpen
} = useModal();
const {
i18n,
t
} = useTranslation();
const {
config
} = useConfig();
const itemGroups = useMemo(() => {
const groups = {
_none: []
};
filteredItems.forEach(item => {
if (typeof item === 'object' && 'admin' in item && item.admin?.group) {
const group = item.admin.group;
const label = typeof group === 'string' ? group : getTranslation(group, i18n);
if (Object.hasOwn(groups, label)) {
groups[label].push(item);
} else {
groups[label] = [item];
}
} else {
groups._none.push(item);
}
});
return groups;
}, [filteredItems, i18n]);
useEffect(() => {
if (!isModalOpen(drawerSlug)) {
setSearchTerm('');
}
}, [isModalOpen, drawerSlug]);
useEffect(() => {
const searchTermToUse = searchTerm.toLowerCase();
const matchingItems = items?.reduce((matchedItems, _item) => {
let item_0;
if (typeof _item === 'string') {
// Handle string references (for blocks)
item_0 = config.blocksMap?.[_item];
} else {
item_0 = _item;
}
if (item_0) {
const itemLabel = getItemLabel(item_0, i18n);
if (itemLabel.includes(searchTermToUse)) {
matchedItems.push(item_0);
}
}
return matchedItems;
}, []);
setFilteredItems(matchingItems || []);
}, [searchTerm, items, i18n, config.blocksMap]);
const finalTitle = title || (labels ? t('fields:addLabel', {
label: getTranslation(labels.singular, i18n)
}) : t('fields:addNew'));
return /*#__PURE__*/_jsxs(Drawer, {
slug: drawerSlug,
title: finalTitle,
children: [/*#__PURE__*/_jsx(ItemSearch, {
placeholder: searchPlaceholder || t('fields:searchForBlock'),
setSearchTerm: setSearchTerm
}), /*#__PURE__*/_jsx("div", {
className: `${baseClass}__items-wrapper`,
children: /*#__PURE__*/_jsx("ul", {
className: `${baseClass}__item-groups`,
children: Object.entries(itemGroups).map(([groupLabel, groupItems]) => !groupItems.length ? null : /*#__PURE__*/_jsxs("li", {
className: [`${baseClass}__item-group`, groupLabel === '_none' && `${baseClass}__item-group-none`].filter(Boolean).join(' '),
children: [groupLabel !== '_none' && /*#__PURE__*/_jsx("h3", {
className: `${baseClass}__item-group-label`,
children: groupLabel
}), /*#__PURE__*/_jsx("ul", {
className: `${baseClass}__items`,
children: groupItems.map((_item_0, index) => {
const item_1 = typeof _item_0 === 'string' ? config.blocksMap?.[_item_0] : _item_0;
if (!item_1) {
return null;
}
const {
imageAltText,
imageURL
} = getItemImageInfo(item_1);
const displayLabel = getItemDisplayLabel(item_1, i18n);
return /*#__PURE__*/_jsx("li", {
className: `${baseClass}__item`,
children: /*#__PURE__*/_jsx(ThumbnailCard, {
alignLabel: "center",
label: displayLabel,
onClick: () => {
void onItemClick(item_1, addRowIndex);
closeModal(drawerSlug);
},
thumbnail: /*#__PURE__*/_jsx("div", {
className: `${baseClass}__default-image`,
children: imageURL ? /*#__PURE__*/_jsx("img", {
alt: imageAltText,
src: imageURL
}) : /*#__PURE__*/_jsx(DefaultBlockImage, {})
})
})
}, index);
})
})]
}, groupLabel))
})
})]
});
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,96 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.graphql = graphql;
exports.graphqlSync = graphqlSync;
var _devAssert = require('./jsutils/devAssert.js');
var _isPromise = require('./jsutils/isPromise.js');
var _parser = require('./language/parser.js');
var _validate = require('./type/validate.js');
var _validate2 = require('./validation/validate.js');
var _execute = require('./execution/execute.js');
function graphql(args) {
// Always return a Promise for a consistent API.
return new Promise((resolve) => resolve(graphqlImpl(args)));
}
/**
* The graphqlSync function also fulfills GraphQL operations by parsing,
* validating, and executing a GraphQL document along side a GraphQL schema.
* However, it guarantees to complete synchronously (or throw an error) assuming
* that all field resolvers are also synchronous.
*/
function graphqlSync(args) {
const result = graphqlImpl(args); // Assert that the execution was synchronous.
if ((0, _isPromise.isPromise)(result)) {
throw new Error('GraphQL execution failed to complete synchronously.');
}
return result;
}
function graphqlImpl(args) {
// Temporary for v15 to v16 migration. Remove in v17
arguments.length < 2 ||
(0, _devAssert.devAssert)(
false,
'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.',
);
const {
schema,
source,
rootValue,
contextValue,
variableValues,
operationName,
fieldResolver,
typeResolver,
} = args; // Validate Schema
const schemaValidationErrors = (0, _validate.validateSchema)(schema);
if (schemaValidationErrors.length > 0) {
return {
errors: schemaValidationErrors,
};
} // Parse
let document;
try {
document = (0, _parser.parse)(source);
} catch (syntaxError) {
return {
errors: [syntaxError],
};
} // Validate
const validationErrors = (0, _validate2.validate)(schema, document);
if (validationErrors.length > 0) {
return {
errors: validationErrors,
};
} // Execute
return (0, _execute.execute)({
schema,
document,
rootValue,
contextValue,
variableValues,
operationName,
fieldResolver,
typeResolver,
});
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"chart-bar-decreasing.js","sources":["../../../src/icons/chart-bar-decreasing.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChartBarDecreasing\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyAzdjE2YTIgMiAwIDAgMCAyIDJoMTYiIC8+CiAgPHBhdGggZD0iTTcgMTFoOCIgLz4KICA8cGF0aCBkPSJNNyAxNmgzIiAvPgogIDxwYXRoIGQ9Ik03IDZoMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/chart-bar-decreasing\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 ChartBarDecreasing = createLucideIcon('ChartBarDecreasing', [\n ['path', { d: 'M3 3v16a2 2 0 0 0 2 2h16', key: 'c24i48' }],\n ['path', { d: 'M7 11h8', key: '1feolt' }],\n ['path', { d: 'M7 16h3', key: 'ur6vzw' }],\n ['path', { d: 'M7 6h12', key: 'sz5b0d' }],\n]);\n\nexport default ChartBarDecreasing;\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,CAAA,CAAA,CAAqB,iBAAiB,oBAAsB,CAAA,CAAA,CAAA;AAAA,CAAA,CAChE,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,CAAA,CACzD,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,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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,233 @@
'use strict';
Object.defineProperty(exports, 'commentRegex', {
get: function getCommentRegex () {
// Groups: 1: media type, 2: MIME type, 3: charset, 4: encoding, 5: data.
return /^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/mg;
}
});
Object.defineProperty(exports, 'mapFileCommentRegex', {
get: function getMapFileCommentRegex () {
// Matches sourceMappingURL in either // or /* comment styles.
return /(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/mg;
}
});
var decodeBase64;
if (typeof Buffer !== 'undefined') {
if (typeof Buffer.from === 'function') {
decodeBase64 = decodeBase64WithBufferFrom;
} else {
decodeBase64 = decodeBase64WithNewBuffer;
}
} else {
decodeBase64 = decodeBase64WithAtob;
}
function decodeBase64WithBufferFrom(base64) {
return Buffer.from(base64, 'base64').toString();
}
function decodeBase64WithNewBuffer(base64) {
if (typeof value === 'number') {
throw new TypeError('The value to decode must not be of type number.');
}
return new Buffer(base64, 'base64').toString();
}
function decodeBase64WithAtob(base64) {
return decodeURIComponent(escape(atob(base64)));
}
function stripComment(sm) {
return sm.split(',').pop();
}
function readFromFileMap(sm, read) {
var r = exports.mapFileCommentRegex.exec(sm);
// for some odd reason //# .. captures in 1 and /* .. */ in 2
var filename = r[1] || r[2];
try {
var sm = read(filename);
if (sm != null && typeof sm.catch === 'function') {
return sm.catch(throwError);
} else {
return sm;
}
} catch (e) {
throwError(e);
}
function throwError(e) {
throw new Error('An error occurred while trying to read the map file at ' + filename + '\n' + e.stack);
}
}
function Converter (sm, opts) {
opts = opts || {};
if (opts.hasComment) {
sm = stripComment(sm);
}
if (opts.encoding === 'base64') {
sm = decodeBase64(sm);
} else if (opts.encoding === 'uri') {
sm = decodeURIComponent(sm);
}
if (opts.isJSON || opts.encoding) {
sm = JSON.parse(sm);
}
this.sourcemap = sm;
}
Converter.prototype.toJSON = function (space) {
return JSON.stringify(this.sourcemap, null, space);
};
if (typeof Buffer !== 'undefined') {
if (typeof Buffer.from === 'function') {
Converter.prototype.toBase64 = encodeBase64WithBufferFrom;
} else {
Converter.prototype.toBase64 = encodeBase64WithNewBuffer;
}
} else {
Converter.prototype.toBase64 = encodeBase64WithBtoa;
}
function encodeBase64WithBufferFrom() {
var json = this.toJSON();
return Buffer.from(json, 'utf8').toString('base64');
}
function encodeBase64WithNewBuffer() {
var json = this.toJSON();
if (typeof json === 'number') {
throw new TypeError('The json to encode must not be of type number.');
}
return new Buffer(json, 'utf8').toString('base64');
}
function encodeBase64WithBtoa() {
var json = this.toJSON();
return btoa(unescape(encodeURIComponent(json)));
}
Converter.prototype.toURI = function () {
var json = this.toJSON();
return encodeURIComponent(json);
};
Converter.prototype.toComment = function (options) {
var encoding, content, data;
if (options != null && options.encoding === 'uri') {
encoding = '';
content = this.toURI();
} else {
encoding = ';base64';
content = this.toBase64();
}
data = 'sourceMappingURL=data:application/json;charset=utf-8' + encoding + ',' + content;
return options != null && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
};
// returns copy instead of original
Converter.prototype.toObject = function () {
return JSON.parse(this.toJSON());
};
Converter.prototype.addProperty = function (key, value) {
if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead');
return this.setProperty(key, value);
};
Converter.prototype.setProperty = function (key, value) {
this.sourcemap[key] = value;
return this;
};
Converter.prototype.getProperty = function (key) {
return this.sourcemap[key];
};
exports.fromObject = function (obj) {
return new Converter(obj);
};
exports.fromJSON = function (json) {
return new Converter(json, { isJSON: true });
};
exports.fromURI = function (uri) {
return new Converter(uri, { encoding: 'uri' });
};
exports.fromBase64 = function (base64) {
return new Converter(base64, { encoding: 'base64' });
};
exports.fromComment = function (comment) {
var m, encoding;
comment = comment
.replace(/^\/\*/g, '//')
.replace(/\*\/$/g, '');
m = exports.commentRegex.exec(comment);
encoding = m && m[4] || 'uri';
return new Converter(comment, { encoding: encoding, hasComment: true });
};
function makeConverter(sm) {
return new Converter(sm, { isJSON: true });
}
exports.fromMapFileComment = function (comment, read) {
if (typeof read === 'string') {
throw new Error(
'String directory paths are no longer supported with `fromMapFileComment`\n' +
'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading'
)
}
var sm = readFromFileMap(comment, read);
if (sm != null && typeof sm.then === 'function') {
return sm.then(makeConverter);
} else {
return makeConverter(sm);
}
};
// Finds last sourcemap comment in file or returns null if none was found
exports.fromSource = function (content) {
var m = content.match(exports.commentRegex);
return m ? exports.fromComment(m.pop()) : null;
};
// Finds last sourcemap comment in file or returns null if none was found
exports.fromMapFileSource = function (content, read) {
if (typeof read === 'string') {
throw new Error(
'String directory paths are no longer supported with `fromMapFileSource`\n' +
'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading'
)
}
var m = content.match(exports.mapFileCommentRegex);
return m ? exports.fromMapFileComment(m.pop(), read) : null;
};
exports.removeComments = function (src) {
return src.replace(exports.commentRegex, '');
};
exports.removeMapFileComments = function (src) {
return src.replace(exports.mapFileCommentRegex, '');
};
exports.generateMapFileComment = function (file, options) {
var data = 'sourceMappingURL=' + file;
return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
};

View File

@@ -0,0 +1,605 @@
import { h as hasOwn, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext } from './emotion-element-489459f2.browser.development.esm.js';
export { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-489459f2.browser.development.esm.js';
import * as React from 'react';
import { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';
import { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';
import { serializeStyles } from '@emotion/serialize';
import '@emotion/cache';
import '@babel/runtime/helpers/extends';
import '@emotion/weak-memoize';
import '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.esm.js';
import 'hoist-non-react-statics';
var isDevelopment = true;
var pkg = {
name: "@emotion/react",
version: "11.14.0",
main: "dist/emotion-react.cjs.js",
module: "dist/emotion-react.esm.js",
types: "dist/emotion-react.cjs.d.ts",
exports: {
".": {
types: {
"import": "./dist/emotion-react.cjs.mjs",
"default": "./dist/emotion-react.cjs.js"
},
development: {
"edge-light": {
module: "./dist/emotion-react.development.edge-light.esm.js",
"import": "./dist/emotion-react.development.edge-light.cjs.mjs",
"default": "./dist/emotion-react.development.edge-light.cjs.js"
},
worker: {
module: "./dist/emotion-react.development.edge-light.esm.js",
"import": "./dist/emotion-react.development.edge-light.cjs.mjs",
"default": "./dist/emotion-react.development.edge-light.cjs.js"
},
workerd: {
module: "./dist/emotion-react.development.edge-light.esm.js",
"import": "./dist/emotion-react.development.edge-light.cjs.mjs",
"default": "./dist/emotion-react.development.edge-light.cjs.js"
},
browser: {
module: "./dist/emotion-react.browser.development.esm.js",
"import": "./dist/emotion-react.browser.development.cjs.mjs",
"default": "./dist/emotion-react.browser.development.cjs.js"
},
module: "./dist/emotion-react.development.esm.js",
"import": "./dist/emotion-react.development.cjs.mjs",
"default": "./dist/emotion-react.development.cjs.js"
},
"edge-light": {
module: "./dist/emotion-react.edge-light.esm.js",
"import": "./dist/emotion-react.edge-light.cjs.mjs",
"default": "./dist/emotion-react.edge-light.cjs.js"
},
worker: {
module: "./dist/emotion-react.edge-light.esm.js",
"import": "./dist/emotion-react.edge-light.cjs.mjs",
"default": "./dist/emotion-react.edge-light.cjs.js"
},
workerd: {
module: "./dist/emotion-react.edge-light.esm.js",
"import": "./dist/emotion-react.edge-light.cjs.mjs",
"default": "./dist/emotion-react.edge-light.cjs.js"
},
browser: {
module: "./dist/emotion-react.browser.esm.js",
"import": "./dist/emotion-react.browser.cjs.mjs",
"default": "./dist/emotion-react.browser.cjs.js"
},
module: "./dist/emotion-react.esm.js",
"import": "./dist/emotion-react.cjs.mjs",
"default": "./dist/emotion-react.cjs.js"
},
"./jsx-runtime": {
types: {
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
},
development: {
"edge-light": {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.js"
},
worker: {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.js"
},
workerd: {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.js"
},
browser: {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.development.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.development.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.development.cjs.js"
},
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.development.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.cjs.js"
},
"edge-light": {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.js"
},
worker: {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.js"
},
workerd: {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.js"
},
browser: {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.cjs.js"
},
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
},
"./_isolated-hnrs": {
types: {
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
},
development: {
"edge-light": {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.js"
},
worker: {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.js"
},
workerd: {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.js"
},
browser: {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.cjs.js"
},
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.cjs.js"
},
"edge-light": {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.js"
},
worker: {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.js"
},
workerd: {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.js"
},
browser: {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.cjs.js"
},
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
},
"./jsx-dev-runtime": {
types: {
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
},
development: {
"edge-light": {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.js"
},
worker: {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.js"
},
workerd: {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.js"
},
browser: {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.development.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.development.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.development.cjs.js"
},
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.cjs.js"
},
"edge-light": {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.js"
},
worker: {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.js"
},
workerd: {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.js"
},
browser: {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.cjs.js"
},
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
},
"./package.json": "./package.json",
"./types/css-prop": "./types/css-prop.d.ts",
"./macro": {
types: {
"import": "./macro.d.mts",
"default": "./macro.d.ts"
},
"default": "./macro.js"
}
},
imports: {
"#is-development": {
development: "./src/conditions/true.ts",
"default": "./src/conditions/false.ts"
},
"#is-browser": {
"edge-light": "./src/conditions/false.ts",
workerd: "./src/conditions/false.ts",
worker: "./src/conditions/false.ts",
browser: "./src/conditions/true.ts",
"default": "./src/conditions/is-browser.ts"
}
},
files: [
"src",
"dist",
"jsx-runtime",
"jsx-dev-runtime",
"_isolated-hnrs",
"types/css-prop.d.ts",
"macro.*"
],
sideEffects: false,
author: "Emotion Contributors",
license: "MIT",
scripts: {
"test:typescript": "dtslint types"
},
dependencies: {
"@babel/runtime": "^7.18.3",
"@emotion/babel-plugin": "^11.13.5",
"@emotion/cache": "^11.14.0",
"@emotion/serialize": "^1.3.3",
"@emotion/use-insertion-effect-with-fallbacks": "^1.2.0",
"@emotion/utils": "^1.4.2",
"@emotion/weak-memoize": "^0.4.0",
"hoist-non-react-statics": "^3.3.1"
},
peerDependencies: {
react: ">=16.8.0"
},
peerDependenciesMeta: {
"@types/react": {
optional: true
}
},
devDependencies: {
"@definitelytyped/dtslint": "0.0.112",
"@emotion/css": "11.13.5",
"@emotion/css-prettifier": "1.2.0",
"@emotion/server": "11.11.0",
"@emotion/styled": "11.14.0",
"@types/hoist-non-react-statics": "^3.3.5",
"html-tag-names": "^1.1.2",
react: "16.14.0",
"svg-tag-names": "^1.1.1",
typescript: "^5.4.5"
},
repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
publishConfig: {
access: "public"
},
"umd:main": "dist/emotion-react.umd.min.js",
preconstruct: {
entrypoints: [
"./index.ts",
"./jsx-runtime.ts",
"./jsx-dev-runtime.ts",
"./_isolated-hnrs.ts"
],
umdName: "emotionReact",
exports: {
extra: {
"./types/css-prop": "./types/css-prop.d.ts",
"./macro": {
types: {
"import": "./macro.d.mts",
"default": "./macro.d.ts"
},
"default": "./macro.js"
}
}
}
}
};
var jsx = function jsx(type, props) {
// eslint-disable-next-line prefer-rest-params
var args = arguments;
if (props == null || !hasOwn.call(props, 'css')) {
return React.createElement.apply(undefined, args);
}
var argsLength = args.length;
var createElementArgArray = new Array(argsLength);
createElementArgArray[0] = Emotion;
createElementArgArray[1] = createEmotionProps(type, props);
for (var i = 2; i < argsLength; i++) {
createElementArgArray[i] = args[i];
}
return React.createElement.apply(null, createElementArgArray);
};
(function (_jsx) {
var JSX;
(function (_JSX) {})(JSX || (JSX = _jsx.JSX || (_jsx.JSX = {})));
})(jsx || (jsx = {}));
var warnedAboutCssPropForGlobal = false; // maintain place over rerenders.
// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
// initial client-side render from SSR, use place of hydrating tag
var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
if (!warnedAboutCssPropForGlobal && ( // check for className as well since the user is
// probably using the custom createElement which
// means it will be turned into a className prop
// I don't really want to add it to the type since it shouldn't be used
'className' in props && props.className || 'css' in props && props.css)) {
console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
warnedAboutCssPropForGlobal = true;
}
var styles = props.styles;
var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext));
// but it is based on a constant that will never change at runtime
// it's effectively like having two implementations and switching them out
// so it's not actually breaking anything
var sheetRef = React.useRef();
useInsertionEffectWithLayoutFallback(function () {
var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675
var sheet = new cache.sheet.constructor({
key: key,
nonce: cache.sheet.nonce,
container: cache.sheet.container,
speedy: cache.sheet.isSpeedy
});
var rehydrating = false;
var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]");
if (cache.sheet.tags.length) {
sheet.before = cache.sheet.tags[0];
}
if (node !== null) {
rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s
node.setAttribute('data-emotion', key);
sheet.hydrate([node]);
}
sheetRef.current = [sheet, rehydrating];
return function () {
sheet.flush();
};
}, [cache]);
useInsertionEffectWithLayoutFallback(function () {
var sheetRefCurrent = sheetRef.current;
var sheet = sheetRefCurrent[0],
rehydrating = sheetRefCurrent[1];
if (rehydrating) {
sheetRefCurrent[1] = false;
return;
}
if (serialized.next !== undefined) {
// insert keyframes
insertStyles(cache, serialized.next, true);
}
if (sheet.tags.length) {
// if this doesn't exist then it will be null so the style element will be appended
var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
sheet.before = element;
sheet.flush();
}
cache.insert("", serialized, sheet, false);
}, [cache, serialized.name]);
return null;
});
{
Global.displayName = 'EmotionGlobal';
}
function css() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return serializeStyles(args);
}
function keyframes() {
var insertable = css.apply(void 0, arguments);
var name = "animation-" + insertable.name;
return {
name: name,
styles: "@keyframes " + name + "{" + insertable.styles + "}",
anim: 1,
toString: function toString() {
return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
}
};
}
var classnames = function classnames(args) {
var len = args.length;
var i = 0;
var cls = '';
for (; i < len; i++) {
var arg = args[i];
if (arg == null) continue;
var toAdd = void 0;
switch (typeof arg) {
case 'boolean':
break;
case 'object':
{
if (Array.isArray(arg)) {
toAdd = classnames(arg);
} else {
if (arg.styles !== undefined && arg.name !== undefined) {
console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component.');
}
toAdd = '';
for (var k in arg) {
if (arg[k] && k) {
toAdd && (toAdd += ' ');
toAdd += k;
}
}
}
break;
}
default:
{
toAdd = arg;
}
}
if (toAdd) {
cls && (cls += ' ');
cls += toAdd;
}
}
return cls;
};
function merge(registered, css, className) {
var registeredStyles = [];
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
if (registeredStyles.length < 2) {
return className;
}
return rawClassName + css(registeredStyles);
}
var Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serializedArr = _ref.serializedArr;
useInsertionEffectAlwaysWithSyncFallback(function () {
for (var i = 0; i < serializedArr.length; i++) {
insertStyles(cache, serializedArr[i], false);
}
});
return null;
};
var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
var hasRendered = false;
var serializedArr = [];
var css = function css() {
if (hasRendered && isDevelopment) {
throw new Error('css can only be used during render');
}
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var serialized = serializeStyles(args, cache.registered);
serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`
registerStyles(cache, serialized, false);
return cache.key + "-" + serialized.name;
};
var cx = function cx() {
if (hasRendered && isDevelopment) {
throw new Error('cx can only be used during render');
}
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return merge(cache.registered, css, classnames(args));
};
var content = {
css: css,
cx: cx,
theme: React.useContext(ThemeContext)
};
var ele = props.children(content);
hasRendered = true;
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
cache: cache,
serializedArr: serializedArr
}), ele);
});
{
ClassNames.displayName = 'EmotionClassNames';
}
{
var isBrowser = typeof document !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked
var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined';
if (isBrowser && !isTestEnv) {
// globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later
var globalContext = typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef
: isBrowser ? window : global;
var globalKey = "__EMOTION_REACT_" + pkg.version.split('.')[0] + "__";
if (globalContext[globalKey]) {
console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');
}
globalContext[globalKey] = true;
}
}
export { ClassNames, Global, jsx as createElement, css, jsx, keyframes };

View File

@@ -0,0 +1,79 @@
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
// src/heading.tsx
import * as React from "react";
// src/utils/spaces.ts
var withMargin = (props) => {
const nonEmptyStyles = [
withSpace(props.m, ["margin"]),
withSpace(props.mx, ["marginLeft", "marginRight"]),
withSpace(props.my, ["marginTop", "marginBottom"]),
withSpace(props.mt, ["marginTop"]),
withSpace(props.mr, ["marginRight"]),
withSpace(props.mb, ["marginBottom"]),
withSpace(props.ml, ["marginLeft"])
].filter((s) => Object.keys(s).length);
const mergedStyles = nonEmptyStyles.reduce((acc, style) => {
return __spreadValues(__spreadValues({}, acc), style);
}, {});
return mergedStyles;
};
var withSpace = (value, properties) => {
return properties.reduce((styles, property) => {
if (!isNaN(parseFloat(value))) {
return __spreadProps(__spreadValues({}, styles), { [property]: `${value}px` });
}
return styles;
}, {});
};
// src/heading.tsx
import { jsx } from "react/jsx-runtime";
var Heading = React.forwardRef(
(_a, ref) => {
var _b = _a, { as: Tag = "h1", children, style, m, mx, my, mt, mr, mb, ml } = _b, props = __objRest(_b, ["as", "children", "style", "m", "mx", "my", "mt", "mr", "mb", "ml"]);
return /* @__PURE__ */ jsx(
Tag,
__spreadProps(__spreadValues({}, props), {
ref,
style: __spreadValues(__spreadValues({}, withMargin({ m, mx, my, mt, mr, mb, ml })), style),
children
})
);
}
);
Heading.displayName = "Heading";
export {
Heading
};

View File

@@ -0,0 +1,17 @@
/*
* 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.
*/
export {};
//# sourceMappingURL=link.js.map

View File

@@ -0,0 +1,37 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { getTranslation } from '@payloadcms/translations';
import React from 'react';
import { TrashIcon } from '../../icons/Trash/index.js';
import { useConfig } from '../../providers/Config/index.js';
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import './index.scss';
const baseClass = 'trash-banner';
export const TrashBanner = () => {
const {
getEntityConfig
} = useConfig();
const {
collectionSlug
} = useDocumentInfo();
const collectionConfig = getEntityConfig({
collectionSlug
});
const {
labels
} = collectionConfig;
const {
i18n
} = useTranslation();
return _jsxs("div", {
className: baseClass,
children: [_jsx(TrashIcon, {}), _jsx("p", {
children: i18n.t("general:documentIsTrashed", {
label: `${getTranslation(labels?.singular, i18n)}`
})
})]
});
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,6 @@
import { _ as _await_value } from "./_await_value.js";
function _await_async_generator(value) {
return new _await_value(value);
}
export { _await_async_generator as _ };

View File

@@ -0,0 +1,8 @@
import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export type EnumError = ErrorObject<"enum", {
allowedValues: any[];
}, any[] | {
$data: string;
}>;
declare const def: CodeKeywordDefinition;
export default def;

View File

@@ -0,0 +1,19 @@
import { KafkaJsInstrumentation } from '@opentelemetry/instrumentation-kafkajs';
export declare const instrumentKafka: ((options?: unknown) => KafkaJsInstrumentation) & {
id: string;
};
/**
* Adds Sentry tracing instrumentation for the [kafkajs](https://www.npmjs.com/package/kafkajs) library.
*
* For more information, see the [`kafkaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/kafka/).
*
* @example
* ```javascript
* const Sentry = require('@sentry/node');
*
* Sentry.init({
* integrations: [Sentry.kafkaIntegration()],
* });
*/
export declare const kafkaIntegration: () => import("@sentry/core").Integration;
//# sourceMappingURL=kafka.d.ts.map

View File

@@ -0,0 +1,17 @@
/**
* @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 Download = createLucideIcon("Download", [
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
["polyline", { points: "7 10 12 15 17 10", key: "2ggqvy" }],
["line", { x1: "12", x2: "12", y1: "15", y2: "3", key: "1vk2je" }]
]);
export { Download as default };
//# sourceMappingURL=download.js.map

View File

@@ -0,0 +1,26 @@
import type { ClientField } from 'payload';
import React from 'react';
import './index.scss';
type Props = {
hideGutter?: boolean;
initCollapsed?: boolean;
Label: React.ReactNode;
locales: string[] | undefined;
parentIsLocalized: boolean;
valueTo: unknown;
} & ({
children: React.ReactNode;
field?: never;
fields: ClientField[];
isIterable?: false;
valueFrom: unknown;
} | {
children: React.ReactNode;
field: ClientField;
fields?: never;
isIterable: true;
valueFrom?: unknown;
});
export declare const DiffCollapser: React.FC<Props>;
export {};
//# sourceMappingURL=index.d.ts.map

View File

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

View File

@@ -0,0 +1,83 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/** @typedef {import("ajv").default} Ajv */
/** @typedef {import("ajv").SchemaValidateFunction} SchemaValidateFunction */
/** @typedef {import("ajv").AnySchemaObject} AnySchemaObject */
/** @typedef {import("../validate").SchemaUtilErrorObject} SchemaUtilErrorObject */
/**
* @param {string} message message
* @param {object} schema schema
* @param {string} data data
* @returns {SchemaUtilErrorObject} error object
*/
function errorMessage(message, schema, data) {
return {
dataPath: undefined,
// @ts-expect-error
schemaPath: undefined,
keyword: "absolutePath",
params: {
absolutePath: data
},
message,
parentSchema: schema
};
}
/**
* @param {boolean} shouldBeAbsolute true when should be absolute path, otherwise false
* @param {object} schema schema
* @param {string} data data
* @returns {SchemaUtilErrorObject} error object
*/
function getErrorFor(shouldBeAbsolute, schema, data) {
const message = shouldBeAbsolute ? `The provided value ${JSON.stringify(data)} is not an absolute path!` : `A relative path is expected. However, the provided value ${JSON.stringify(data)} is an absolute path!`;
return errorMessage(message, schema, data);
}
/**
* @param {Ajv} ajv ajv
* @returns {Ajv} configured ajv
*/
function addAbsolutePathKeyword(ajv) {
ajv.addKeyword({
keyword: "absolutePath",
type: "string",
errors: true,
/**
* @param {boolean} schema schema
* @param {AnySchemaObject} parentSchema parent schema
* @returns {SchemaValidateFunction} validate function
*/
compile(schema, parentSchema) {
/** @type {SchemaValidateFunction} */
const callback = data => {
let passes = true;
const isExclamationMarkPresent = data.includes("!");
if (isExclamationMarkPresent) {
callback.errors = [errorMessage(`The provided value ${JSON.stringify(data)} contains exclamation mark (!) which is not allowed because it's reserved for loader syntax.`, parentSchema, data)];
passes = false;
}
// ?:[A-Za-z]:\\ - Windows absolute path
// \\\\ - Windows network absolute path
// \/ - Unix-like OS absolute path
const isCorrectAbsolutePath = schema === /^(?:[A-Za-z]:(\\|\/)|\\\\|\/)/.test(data);
if (!isCorrectAbsolutePath) {
callback.errors = [getErrorFor(schema, parentSchema, data)];
passes = false;
}
return passes;
};
callback.errors = [];
return callback;
}
});
return ajv;
}
var _default = exports.default = addAbsolutePathKeyword;

View File

@@ -0,0 +1,25 @@
import { LDInspectionFlagUsedHandler } from './types';
/**
* Sentry integration for capturing feature flag evaluations from LaunchDarkly.
*
* See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
*
* @example
* ```
* import * as Sentry from '@sentry/browser';
* import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';
* import * as LaunchDarkly from 'launchdarkly-js-client-sdk';
*
* Sentry.init(..., integrations: [launchDarklyIntegration()])
* const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});
* ```
*/
export declare const launchDarklyIntegration: () => import("@sentry/core").Integration;
/**
* LaunchDarkly hook to listen for and buffer flag evaluations. This needs to
* be registered as an 'inspector' in LaunchDarkly initialize() options,
* separately from `launchDarklyIntegration`. Both the hook and the integration
* are needed to capture LaunchDarkly flags.
*/
export declare function buildLaunchDarklyFlagUsedHandler(): LDInspectionFlagUsedHandler;
//# sourceMappingURL=integration.d.ts.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.
*
*/
const mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalHistoryPlugin.dev.mjs') : import('./LexicalHistoryPlugin.prod.mjs'));
export const HistoryPlugin = mod.HistoryPlugin;
export const createEmptyHistoryState = mod.createEmptyHistoryState;

View File

@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CircleCheckBig = createLucideIcon("CircleCheckBig", [
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
]);
export { CircleCheckBig as default };
//# sourceMappingURL=circle-check-big.js.map

View File

@@ -0,0 +1,5 @@
import OverloadYield from "./OverloadYield.js";
function _awaitAsyncGenerator(e) {
return new OverloadYield(e, 0);
}
export { _awaitAsyncGenerator as default };

View File

@@ -0,0 +1,92 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const currentScopes = require('../currentScopes.js');
const debugBuild = require('../debug-build.js');
const console = require('../instrument/console.js');
const integration = require('../integration.js');
const semanticAttributes = require('../semanticAttributes.js');
const debugLogger = require('../utils/debug-logger.js');
const internal = require('./internal.js');
const utils = require('./utils.js');
const INTEGRATION_NAME = 'ConsoleLogs';
const DEFAULT_ATTRIBUTES = {
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.log.console',
};
const _consoleLoggingIntegration = ((options = {}) => {
const levels = options.levels || debugLogger.CONSOLE_LEVELS;
return {
name: INTEGRATION_NAME,
setup(client) {
const { enableLogs, normalizeDepth = 3, normalizeMaxBreadth = 1000 } = client.getOptions();
if (!enableLogs) {
debugBuild.DEBUG_BUILD && debugLogger.debug.warn('`enableLogs` is not enabled, ConsoleLogs integration disabled');
return;
}
console.addConsoleInstrumentationHandler(({ args, level }) => {
if (currentScopes.getClient() !== client || !levels.includes(level)) {
return;
}
const firstArg = args[0];
const followingArgs = args.slice(1);
if (level === 'assert') {
if (!firstArg) {
const assertionMessage =
followingArgs.length > 0
? `Assertion failed: ${utils.formatConsoleArgs(followingArgs, normalizeDepth, normalizeMaxBreadth)}`
: 'Assertion failed';
internal._INTERNAL_captureLog({ level: 'error', message: assertionMessage, attributes: DEFAULT_ATTRIBUTES });
}
return;
}
const isLevelLog = level === 'log';
const shouldGenerateTemplate =
args.length > 1 && typeof args[0] === 'string' && !utils.hasConsoleSubstitutions(args[0]);
const attributes = {
...DEFAULT_ATTRIBUTES,
...(shouldGenerateTemplate ? utils.createConsoleTemplateAttributes(firstArg, followingArgs) : {}),
};
internal._INTERNAL_captureLog({
level: isLevelLog ? 'info' : level,
message: utils.formatConsoleArgs(args, normalizeDepth, normalizeMaxBreadth),
severityNumber: isLevelLog ? 10 : undefined,
attributes,
});
});
},
};
}) ;
/**
* Captures calls to the `console` API as logs in Sentry. Requires the `enableLogs` option to be enabled.
*
* @experimental This feature is experimental and may be changed or removed in future versions.
*
* By default the integration instruments `console.debug`, `console.info`, `console.warn`, `console.error`,
* `console.log`, `console.trace`, and `console.assert`. You can use the `levels` option to customize which
* levels are captured.
*
* @example
*
* ```ts
* import * as Sentry from '@sentry/browser';
*
* Sentry.init({
* enableLogs: true,
* integrations: [Sentry.consoleLoggingIntegration({ levels: ['error', 'warn'] })],
* });
* ```
*/
const consoleLoggingIntegration = integration.defineIntegration(_consoleLoggingIntegration);
exports.consoleLoggingIntegration = consoleLoggingIntegration;
//# sourceMappingURL=console-integration.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-auth-endpoint.cjs","names":[],"sources":["../../../src/rest/utils/get-auth-endpoint.ts"],"sourcesContent":["/**\n * @param provider Use a specific authentication provider\n * @returns The endpoint to be used for authentication\n */\nexport function getAuthEndpoint(provider?: string) {\n\tif (provider) return `/auth/login/${provider}`;\n\treturn '/auth/login';\n}\n"],"mappings":"AAIA,SAAgB,EAAgB,EAAmB,CAElD,OADI,EAAiB,eAAe,IAC7B"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/exports/i18n/ko.ts"],"sourcesContent":["export { ko } from '@payloadcms/translations/languages/ko'\n"],"names":["ko"],"mappings":"AAAA,SAASA,EAAE,QAAQ,wCAAuC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../src/admin/fields/Email.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,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AACvE,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;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,oBAAoB,CAAA;CACzC,CAAA;AAED,KAAK,yBAAyB,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;AAEzD,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,9 @@
import { JSONHydrator } from './postcss.js'
interface FromJSON extends JSONHydrator {
default: FromJSON
}
declare const fromJSON: FromJSON
export = fromJSON

View File

@@ -0,0 +1,67 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { compareModulesByIdentifier } = require("../util/comparators");
const {
assignAscendingModuleIds,
assignNames,
getLongModuleName,
getShortModuleName,
getUsedModuleIdsAndModules
} = require("./IdHelpers");
/** @typedef {import("../Compiler")} Compiler */
/**
* @typedef {object} NamedModuleIdsPluginOptions
* @property {string=} context context
*/
const PLUGIN_NAME = "NamedModuleIdsPlugin";
class NamedModuleIdsPlugin {
/**
* @param {NamedModuleIdsPluginOptions=} options options
*/
constructor(options = {}) {
this.options = options;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
const { root } = compiler;
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
const hashFunction = compilation.outputOptions.hashFunction;
compilation.hooks.moduleIds.tap(PLUGIN_NAME, () => {
const chunkGraph = compilation.chunkGraph;
const context = this.options.context
? this.options.context
: compiler.context;
const [usedIds, modules] = getUsedModuleIdsAndModules(compilation);
const unnamedModules = assignNames(
modules,
(m) => getShortModuleName(m, context, root),
(m, shortName) =>
getLongModuleName(shortName, m, context, hashFunction, root),
compareModulesByIdentifier,
usedIds,
(m, name) => chunkGraph.setModuleId(m, name)
);
if (unnamedModules.length > 0) {
assignAscendingModuleIds(usedIds, unnamedModules, compilation);
}
});
});
}
}
module.exports = NamedModuleIdsPlugin;

View File

@@ -0,0 +1,233 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var assert_1 = require("assert");
var parser_1 = require("../../syntax/parser");
var image_1 = require("../image");
var color_1 = require("../color");
var tokenizer_1 = require("../../syntax/tokenizer");
var angle_1 = require("../angle");
var parse = function (context, value) { return image_1.image.parse(context, parser_1.Parser.parseValue(value)); };
var colorParse = function (context, value) { return color_1.color.parse(context, parser_1.Parser.parseValue(value)); };
jest.mock('../../../core/features');
jest.mock('../../../core/context');
var context_1 = require("../../../core/context");
describe('types', function () {
var context;
beforeEach(function () {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
context = new context_1.Context({}, {});
});
describe('<image>', function () {
describe('parsing', function () {
describe('url', function () {
it('url(test.jpg)', function () {
return assert_1.deepStrictEqual(parse(context, 'url(http://example.com/test.jpg)'), {
url: 'http://example.com/test.jpg',
type: 0 /* URL */
});
});
it('url("test.jpg")', function () {
return assert_1.deepStrictEqual(parse(context, 'url("http://example.com/test.jpg")'), {
url: 'http://example.com/test.jpg',
type: 0 /* URL */
});
});
});
describe('linear-gradient', function () {
it('linear-gradient(#f69d3c, #3f87a6)', function () {
return assert_1.deepStrictEqual(parse(context, 'linear-gradient(#f69d3c, #3f87a6)'), {
angle: angle_1.deg(180),
type: 1 /* LINEAR_GRADIENT */,
stops: [
{ color: color_1.pack(0xf6, 0x9d, 0x3c, 1), stop: null },
{ color: color_1.pack(0x3f, 0x87, 0xa6, 1), stop: null }
]
});
});
it('linear-gradient(yellow, blue)', function () {
return assert_1.deepStrictEqual(parse(context, 'linear-gradient(yellow, blue)'), {
angle: angle_1.deg(180),
type: 1 /* LINEAR_GRADIENT */,
stops: [
{ color: colorParse(context, 'yellow'), stop: null },
{ color: colorParse(context, 'blue'), stop: null }
]
});
});
it('linear-gradient(to bottom, yellow, blue)', function () {
return assert_1.deepStrictEqual(parse(context, 'linear-gradient(to bottom, yellow, blue)'), {
angle: angle_1.deg(180),
type: 1 /* LINEAR_GRADIENT */,
stops: [
{ color: colorParse(context, 'yellow'), stop: null },
{ color: colorParse(context, 'blue'), stop: null }
]
});
});
it('linear-gradient(180deg, yellow, blue)', function () {
return assert_1.deepStrictEqual(parse(context, 'linear-gradient(180deg, yellow, blue)'), {
angle: angle_1.deg(180),
type: 1 /* LINEAR_GRADIENT */,
stops: [
{ color: colorParse(context, 'yellow'), stop: null },
{ color: colorParse(context, 'blue'), stop: null }
]
});
});
it('linear-gradient(to top, blue, yellow)', function () {
return assert_1.deepStrictEqual(parse(context, 'linear-gradient(to top, blue, yellow)'), {
angle: 0,
type: 1 /* LINEAR_GRADIENT */,
stops: [
{ color: colorParse(context, 'blue'), stop: null },
{ color: colorParse(context, 'yellow'), stop: null }
]
});
});
it('linear-gradient(to top right, blue, yellow)', function () {
return assert_1.deepStrictEqual(parse(context, 'linear-gradient(to top right, blue, yellow)'), {
angle: [
{ type: 16 /* PERCENTAGE_TOKEN */, number: 100, flags: 4 },
{ type: 17 /* NUMBER_TOKEN */, number: 0, flags: 4 }
],
type: 1 /* LINEAR_GRADIENT */,
stops: [
{ color: colorParse(context, 'blue'), stop: null },
{ color: colorParse(context, 'yellow'), stop: null }
]
});
});
it('linear-gradient(to bottom, yellow 0%, blue 100%)', function () {
return assert_1.deepStrictEqual(parse(context, 'linear-gradient(to bottom, yellow 0%, blue 100%)'), {
angle: angle_1.deg(180),
type: 1 /* LINEAR_GRADIENT */,
stops: [
{
color: colorParse(context, 'yellow'),
stop: {
type: 16 /* PERCENTAGE_TOKEN */,
number: 0,
flags: tokenizer_1.FLAG_INTEGER
}
},
{
color: colorParse(context, 'blue'),
stop: {
type: 16 /* PERCENTAGE_TOKEN */,
number: 100,
flags: tokenizer_1.FLAG_INTEGER
}
}
]
});
});
it('linear-gradient(to top left, lightpink, lightpink 5px, white 5px, white 10px)', function () {
return assert_1.deepStrictEqual(parse(context, 'linear-gradient(to top left, lightpink, lightpink 5px, white 5px, white 10px)'), {
angle: [
{ type: 16 /* PERCENTAGE_TOKEN */, number: 100, flags: 4 },
{ type: 16 /* PERCENTAGE_TOKEN */, number: 100, flags: 4 }
],
type: 1 /* LINEAR_GRADIENT */,
stops: [
{ color: colorParse(context, 'lightpink'), stop: null },
{
color: colorParse(context, 'lightpink'),
stop: {
type: 15 /* DIMENSION_TOKEN */,
number: 5,
flags: tokenizer_1.FLAG_INTEGER,
unit: 'px'
}
},
{
color: colorParse(context, 'white'),
stop: {
type: 15 /* DIMENSION_TOKEN */,
number: 5,
flags: tokenizer_1.FLAG_INTEGER,
unit: 'px'
}
},
{
color: colorParse(context, 'white'),
stop: {
type: 15 /* DIMENSION_TOKEN */,
number: 10,
flags: tokenizer_1.FLAG_INTEGER,
unit: 'px'
}
}
]
});
});
});
describe('-prefix-linear-gradient', function () {
it('-webkit-linear-gradient(left, #cedbe9 0%, #aac5de 17%, #3a8bc2 84%, #26558b 100%)', function () {
return assert_1.deepStrictEqual(parse(context, '-webkit-linear-gradient(left, #cedbe9 0%, #aac5de 17%, #3a8bc2 84%, #26558b 100%)'), {
angle: angle_1.deg(90),
type: 1 /* LINEAR_GRADIENT */,
stops: [
{
color: colorParse(context, '#cedbe9'),
stop: {
type: 16 /* PERCENTAGE_TOKEN */,
number: 0,
flags: tokenizer_1.FLAG_INTEGER
}
},
{
color: colorParse(context, '#aac5de'),
stop: {
type: 16 /* PERCENTAGE_TOKEN */,
number: 17,
flags: tokenizer_1.FLAG_INTEGER
}
},
{
color: colorParse(context, '#3a8bc2'),
stop: {
type: 16 /* PERCENTAGE_TOKEN */,
number: 84,
flags: tokenizer_1.FLAG_INTEGER
}
},
{
color: colorParse(context, '#26558b'),
stop: {
type: 16 /* PERCENTAGE_TOKEN */,
number: 100,
flags: tokenizer_1.FLAG_INTEGER
}
}
]
});
});
it('-moz-linear-gradient(top, #cce5f4 0%, #00263c 100%)', function () {
return assert_1.deepStrictEqual(parse(context, '-moz-linear-gradient(top, #cce5f4 0%, #00263c 100%)'), {
angle: angle_1.deg(180),
type: 1 /* LINEAR_GRADIENT */,
stops: [
{
color: colorParse(context, '#cce5f4'),
stop: {
type: 16 /* PERCENTAGE_TOKEN */,
number: 0,
flags: tokenizer_1.FLAG_INTEGER
}
},
{
color: colorParse(context, '#00263c'),
stop: {
type: 16 /* PERCENTAGE_TOKEN */,
number: 100,
flags: tokenizer_1.FLAG_INTEGER
}
}
]
});
});
});
});
});
});
//# sourceMappingURL=image-tests.js.map

View File

@@ -0,0 +1,11 @@
import { _ as _class_apply_descriptor_update } from "./_class_apply_descriptor_update.js";
import { _ as _class_check_private_static_access } from "./_class_check_private_static_access.js";
import { _ as _class_check_private_static_field_descriptor } from "./_class_check_private_static_field_descriptor.js";
function _class_static_private_field_update(receiver, classConstructor, descriptor) {
_class_check_private_static_access(receiver, classConstructor);
_class_check_private_static_field_descriptor(descriptor, "update");
return _class_apply_descriptor_update(receiver, descriptor);
}
export { _class_static_private_field_update as _ };

View File

@@ -0,0 +1,4 @@
function _initializerWarningHelper(r, e) {
throw Error("Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.");
}
module.exports = _initializerWarningHelper, module.exports.__esModule = true, module.exports["default"] = module.exports;

View File

@@ -0,0 +1,650 @@
'use strict'
const EventEmitter = require('events').EventEmitter
const utils = require('./utils')
const sasl = require('./crypto/sasl')
const TypeOverrides = require('./type-overrides')
const ConnectionParameters = require('./connection-parameters')
const Query = require('./query')
const defaults = require('./defaults')
const Connection = require('./connection')
const crypto = require('./crypto/utils')
class Client extends EventEmitter {
constructor(config) {
super()
this.connectionParameters = new ConnectionParameters(config)
this.user = this.connectionParameters.user
this.database = this.connectionParameters.database
this.port = this.connectionParameters.port
this.host = this.connectionParameters.host
// "hiding" the password so it doesn't show up in stack traces
// or if the client is console.logged
Object.defineProperty(this, 'password', {
configurable: true,
enumerable: false,
writable: true,
value: this.connectionParameters.password,
})
this.replication = this.connectionParameters.replication
const c = config || {}
this._Promise = c.Promise || global.Promise
this._types = new TypeOverrides(c.types)
this._ending = false
this._ended = false
this._connecting = false
this._connected = false
this._connectionError = false
this._queryable = true
this.enableChannelBinding = Boolean(c.enableChannelBinding) // set true to use SCRAM-SHA-256-PLUS when offered
this.connection =
c.connection ||
new Connection({
stream: c.stream,
ssl: this.connectionParameters.ssl,
keepAlive: c.keepAlive || false,
keepAliveInitialDelayMillis: c.keepAliveInitialDelayMillis || 0,
encoding: this.connectionParameters.client_encoding || 'utf8',
})
this.queryQueue = []
this.binary = c.binary || defaults.binary
this.processID = null
this.secretKey = null
this.ssl = this.connectionParameters.ssl || false
// As with Password, make SSL->Key (the private key) non-enumerable.
// It won't show up in stack traces
// or if the client is console.logged
if (this.ssl && this.ssl.key) {
Object.defineProperty(this.ssl, 'key', {
enumerable: false,
})
}
this._connectionTimeoutMillis = c.connectionTimeoutMillis || 0
}
_errorAllQueries(err) {
const enqueueError = (query) => {
process.nextTick(() => {
query.handleError(err, this.connection)
})
}
if (this.activeQuery) {
enqueueError(this.activeQuery)
this.activeQuery = null
}
this.queryQueue.forEach(enqueueError)
this.queryQueue.length = 0
}
_connect(callback) {
const self = this
const con = this.connection
this._connectionCallback = callback
if (this._connecting || this._connected) {
const err = new Error('Client has already been connected. You cannot reuse a client.')
process.nextTick(() => {
callback(err)
})
return
}
this._connecting = true
if (this._connectionTimeoutMillis > 0) {
this.connectionTimeoutHandle = setTimeout(() => {
con._ending = true
con.stream.destroy(new Error('timeout expired'))
}, this._connectionTimeoutMillis)
if (this.connectionTimeoutHandle.unref) {
this.connectionTimeoutHandle.unref()
}
}
if (this.host && this.host.indexOf('/') === 0) {
con.connect(this.host + '/.s.PGSQL.' + this.port)
} else {
con.connect(this.port, this.host)
}
// once connection is established send startup message
con.on('connect', function () {
if (self.ssl) {
con.requestSsl()
} else {
con.startup(self.getStartupConf())
}
})
con.on('sslconnect', function () {
con.startup(self.getStartupConf())
})
this._attachListeners(con)
con.once('end', () => {
const error = this._ending ? new Error('Connection terminated') : new Error('Connection terminated unexpectedly')
clearTimeout(this.connectionTimeoutHandle)
this._errorAllQueries(error)
this._ended = true
if (!this._ending) {
// if the connection is ended without us calling .end()
// on this client then we have an unexpected disconnection
// treat this as an error unless we've already emitted an error
// during connection.
if (this._connecting && !this._connectionError) {
if (this._connectionCallback) {
this._connectionCallback(error)
} else {
this._handleErrorEvent(error)
}
} else if (!this._connectionError) {
this._handleErrorEvent(error)
}
}
process.nextTick(() => {
this.emit('end')
})
})
}
connect(callback) {
if (callback) {
this._connect(callback)
return
}
return new this._Promise((resolve, reject) => {
this._connect((error) => {
if (error) {
reject(error)
} else {
resolve()
}
})
})
}
_attachListeners(con) {
// password request handling
con.on('authenticationCleartextPassword', this._handleAuthCleartextPassword.bind(this))
// password request handling
con.on('authenticationMD5Password', this._handleAuthMD5Password.bind(this))
// password request handling (SASL)
con.on('authenticationSASL', this._handleAuthSASL.bind(this))
con.on('authenticationSASLContinue', this._handleAuthSASLContinue.bind(this))
con.on('authenticationSASLFinal', this._handleAuthSASLFinal.bind(this))
con.on('backendKeyData', this._handleBackendKeyData.bind(this))
con.on('error', this._handleErrorEvent.bind(this))
con.on('errorMessage', this._handleErrorMessage.bind(this))
con.on('readyForQuery', this._handleReadyForQuery.bind(this))
con.on('notice', this._handleNotice.bind(this))
con.on('rowDescription', this._handleRowDescription.bind(this))
con.on('dataRow', this._handleDataRow.bind(this))
con.on('portalSuspended', this._handlePortalSuspended.bind(this))
con.on('emptyQuery', this._handleEmptyQuery.bind(this))
con.on('commandComplete', this._handleCommandComplete.bind(this))
con.on('parseComplete', this._handleParseComplete.bind(this))
con.on('copyInResponse', this._handleCopyInResponse.bind(this))
con.on('copyData', this._handleCopyData.bind(this))
con.on('notification', this._handleNotification.bind(this))
}
// TODO(bmc): deprecate pgpass "built in" integration since this.password can be a function
// it can be supplied by the user if required - this is a breaking change!
_checkPgPass(cb) {
const con = this.connection
if (typeof this.password === 'function') {
this._Promise
.resolve()
.then(() => this.password())
.then((pass) => {
if (pass !== undefined) {
if (typeof pass !== 'string') {
con.emit('error', new TypeError('Password must be a string'))
return
}
this.connectionParameters.password = this.password = pass
} else {
this.connectionParameters.password = this.password = null
}
cb()
})
.catch((err) => {
con.emit('error', err)
})
} else if (this.password !== null) {
cb()
} else {
try {
const pgPass = require('pgpass')
pgPass(this.connectionParameters, (pass) => {
if (undefined !== pass) {
this.connectionParameters.password = this.password = pass
}
cb()
})
} catch (e) {
this.emit('error', e)
}
}
}
_handleAuthCleartextPassword(msg) {
this._checkPgPass(() => {
this.connection.password(this.password)
})
}
_handleAuthMD5Password(msg) {
this._checkPgPass(async () => {
try {
const hashedPassword = await crypto.postgresMd5PasswordHash(this.user, this.password, msg.salt)
this.connection.password(hashedPassword)
} catch (e) {
this.emit('error', e)
}
})
}
_handleAuthSASL(msg) {
this._checkPgPass(() => {
try {
this.saslSession = sasl.startSession(msg.mechanisms, this.enableChannelBinding && this.connection.stream)
this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism, this.saslSession.response)
} catch (err) {
this.connection.emit('error', err)
}
})
}
async _handleAuthSASLContinue(msg) {
try {
await sasl.continueSession(
this.saslSession,
this.password,
msg.data,
this.enableChannelBinding && this.connection.stream
)
this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)
} catch (err) {
this.connection.emit('error', err)
}
}
_handleAuthSASLFinal(msg) {
try {
sasl.finalizeSession(this.saslSession, msg.data)
this.saslSession = null
} catch (err) {
this.connection.emit('error', err)
}
}
_handleBackendKeyData(msg) {
this.processID = msg.processID
this.secretKey = msg.secretKey
}
_handleReadyForQuery(msg) {
if (this._connecting) {
this._connecting = false
this._connected = true
clearTimeout(this.connectionTimeoutHandle)
// process possible callback argument to Client#connect
if (this._connectionCallback) {
this._connectionCallback(null, this)
// remove callback for proper error handling
// after the connect event
this._connectionCallback = null
}
this.emit('connect')
}
const { activeQuery } = this
this.activeQuery = null
this.readyForQuery = true
if (activeQuery) {
activeQuery.handleReadyForQuery(this.connection)
}
this._pulseQueryQueue()
}
// if we receive an error event or error message
// during the connection process we handle it here
_handleErrorWhileConnecting(err) {
if (this._connectionError) {
// TODO(bmc): this is swallowing errors - we shouldn't do this
return
}
this._connectionError = true
clearTimeout(this.connectionTimeoutHandle)
if (this._connectionCallback) {
return this._connectionCallback(err)
}
this.emit('error', err)
}
// if we're connected and we receive an error event from the connection
// this means the socket is dead - do a hard abort of all queries and emit
// the socket error on the client as well
_handleErrorEvent(err) {
if (this._connecting) {
return this._handleErrorWhileConnecting(err)
}
this._queryable = false
this._errorAllQueries(err)
this.emit('error', err)
}
// handle error messages from the postgres backend
_handleErrorMessage(msg) {
if (this._connecting) {
return this._handleErrorWhileConnecting(msg)
}
const activeQuery = this.activeQuery
if (!activeQuery) {
this._handleErrorEvent(msg)
return
}
this.activeQuery = null
activeQuery.handleError(msg, this.connection)
}
_handleRowDescription(msg) {
// delegate rowDescription to active query
this.activeQuery.handleRowDescription(msg)
}
_handleDataRow(msg) {
// delegate dataRow to active query
this.activeQuery.handleDataRow(msg)
}
_handlePortalSuspended(msg) {
// delegate portalSuspended to active query
this.activeQuery.handlePortalSuspended(this.connection)
}
_handleEmptyQuery(msg) {
// delegate emptyQuery to active query
this.activeQuery.handleEmptyQuery(this.connection)
}
_handleCommandComplete(msg) {
if (this.activeQuery == null) {
const error = new Error('Received unexpected commandComplete message from backend.')
this._handleErrorEvent(error)
return
}
// delegate commandComplete to active query
this.activeQuery.handleCommandComplete(msg, this.connection)
}
_handleParseComplete() {
if (this.activeQuery == null) {
const error = new Error('Received unexpected parseComplete message from backend.')
this._handleErrorEvent(error)
return
}
// if a prepared statement has a name and properly parses
// we track that its already been executed so we don't parse
// it again on the same client
if (this.activeQuery.name) {
this.connection.parsedStatements[this.activeQuery.name] = this.activeQuery.text
}
}
_handleCopyInResponse(msg) {
this.activeQuery.handleCopyInResponse(this.connection)
}
_handleCopyData(msg) {
this.activeQuery.handleCopyData(msg, this.connection)
}
_handleNotification(msg) {
this.emit('notification', msg)
}
_handleNotice(msg) {
this.emit('notice', msg)
}
getStartupConf() {
const params = this.connectionParameters
const data = {
user: params.user,
database: params.database,
}
const appName = params.application_name || params.fallback_application_name
if (appName) {
data.application_name = appName
}
if (params.replication) {
data.replication = '' + params.replication
}
if (params.statement_timeout) {
data.statement_timeout = String(parseInt(params.statement_timeout, 10))
}
if (params.lock_timeout) {
data.lock_timeout = String(parseInt(params.lock_timeout, 10))
}
if (params.idle_in_transaction_session_timeout) {
data.idle_in_transaction_session_timeout = String(parseInt(params.idle_in_transaction_session_timeout, 10))
}
if (params.options) {
data.options = params.options
}
return data
}
cancel(client, query) {
if (client.activeQuery === query) {
const con = this.connection
if (this.host && this.host.indexOf('/') === 0) {
con.connect(this.host + '/.s.PGSQL.' + this.port)
} else {
con.connect(this.port, this.host)
}
// once connection is established send cancel message
con.on('connect', function () {
con.cancel(client.processID, client.secretKey)
})
} else if (client.queryQueue.indexOf(query) !== -1) {
client.queryQueue.splice(client.queryQueue.indexOf(query), 1)
}
}
setTypeParser(oid, format, parseFn) {
return this._types.setTypeParser(oid, format, parseFn)
}
getTypeParser(oid, format) {
return this._types.getTypeParser(oid, format)
}
// escapeIdentifier and escapeLiteral moved to utility functions & exported
// on PG
// re-exported here for backwards compatibility
escapeIdentifier(str) {
return utils.escapeIdentifier(str)
}
escapeLiteral(str) {
return utils.escapeLiteral(str)
}
_pulseQueryQueue() {
if (this.readyForQuery === true) {
this.activeQuery = this.queryQueue.shift()
if (this.activeQuery) {
this.readyForQuery = false
this.hasExecuted = true
const queryError = this.activeQuery.submit(this.connection)
if (queryError) {
process.nextTick(() => {
this.activeQuery.handleError(queryError, this.connection)
this.readyForQuery = true
this._pulseQueryQueue()
})
}
} else if (this.hasExecuted) {
this.activeQuery = null
this.emit('drain')
}
}
}
query(config, values, callback) {
// can take in strings, config object or query object
let query
let result
let readTimeout
let readTimeoutTimer
let queryCallback
if (config === null || config === undefined) {
throw new TypeError('Client was passed a null or undefined query')
} else if (typeof config.submit === 'function') {
readTimeout = config.query_timeout || this.connectionParameters.query_timeout
result = query = config
if (typeof values === 'function') {
query.callback = query.callback || values
}
} else {
readTimeout = config.query_timeout || this.connectionParameters.query_timeout
query = new Query(config, values, callback)
if (!query.callback) {
result = new this._Promise((resolve, reject) => {
query.callback = (err, res) => (err ? reject(err) : resolve(res))
}).catch((err) => {
// replace the stack trace that leads to `TCP.onStreamRead` with one that leads back to the
// application that created the query
Error.captureStackTrace(err)
throw err
})
}
}
if (readTimeout) {
queryCallback = query.callback
readTimeoutTimer = setTimeout(() => {
const error = new Error('Query read timeout')
process.nextTick(() => {
query.handleError(error, this.connection)
})
queryCallback(error)
// we already returned an error,
// just do nothing if query completes
query.callback = () => {}
// Remove from queue
const index = this.queryQueue.indexOf(query)
if (index > -1) {
this.queryQueue.splice(index, 1)
}
this._pulseQueryQueue()
}, readTimeout)
query.callback = (err, res) => {
clearTimeout(readTimeoutTimer)
queryCallback(err, res)
}
}
if (this.binary && !query.binary) {
query.binary = true
}
if (query._result && !query._result._types) {
query._result._types = this._types
}
if (!this._queryable) {
process.nextTick(() => {
query.handleError(new Error('Client has encountered a connection error and is not queryable'), this.connection)
})
return result
}
if (this._ending) {
process.nextTick(() => {
query.handleError(new Error('Client was closed and is not queryable'), this.connection)
})
return result
}
this.queryQueue.push(query)
this._pulseQueryQueue()
return result
}
ref() {
this.connection.ref()
}
unref() {
this.connection.unref()
}
end(cb) {
this._ending = true
// if we have never connected, then end is a noop, callback immediately
if (!this.connection._connecting || this._ended) {
if (cb) {
cb()
} else {
return this._Promise.resolve()
}
}
if (this.activeQuery || !this._queryable) {
// if we have an active query we need to force a disconnect
// on the socket - otherwise a hung query could block end forever
this.connection.stream.destroy()
} else {
this.connection.end()
}
if (cb) {
this.connection.once('end', cb)
} else {
return new this._Promise((resolve) => {
this.connection.once('end', resolve)
})
}
}
}
// expose a Query constructor
Client.Query = Query
module.exports = Client

View File

@@ -0,0 +1,150 @@
import { getNextRequestI18n } from '../../utilities/getNextRequestI18n.js';
import { generateAPIViewMetadata } from '../API/metadata.js';
import { generateEditViewMetadata } from '../Edit/metadata.js';
import { generateNotFoundViewMetadata } from '../NotFound/metadata.js';
import { generateVersionViewMetadata } from '../Version/metadata.js';
import { generateVersionsViewMetadata } from '../Versions/metadata.js';
import { getDocumentView } from './getDocumentView.js';
export const getMetaBySegment = async ({
collectionConfig,
config,
globalConfig,
params
}) => {
const {
segments
} = params;
let fn = null;
const [segmentOne] = segments;
const isCollection = segmentOne === 'collections';
const isGlobal = segmentOne === 'globals';
const isEditing = isGlobal || Boolean(isCollection && segments?.length > 2 && segments[2] !== 'create');
if (isCollection) {
// `/:collection/:id`
if (params.segments.length === 3) {
fn = generateEditViewMetadata;
}
// `/collections/:collection/trash/:id`
if (segments.length === 4 && segments[2] === 'trash') {
fn = args => generateEditViewMetadata({
...args,
isReadOnly: true
});
}
// `/:collection/:id/:view`
if (params.segments.length === 4) {
switch (params.segments[3]) {
case 'api':
// `/:collection/:id/api`
fn = generateAPIViewMetadata;
break;
case 'versions':
// `/:collection/:id/versions`
fn = generateVersionsViewMetadata;
break;
default:
break;
}
}
// `/:collection/:id/:slug-1/:slug-2`
if (params.segments.length === 5) {
switch (params.segments[3]) {
case 'versions':
// `/:collection/:id/versions/:version`
fn = generateVersionViewMetadata;
break;
default:
break;
}
}
// `/collections/:collection/trash/:id/:view`
if (segments.length === 5 && segments[2] === 'trash') {
switch (segments[4]) {
case 'api':
fn = generateAPIViewMetadata;
break;
case 'versions':
fn = generateVersionsViewMetadata;
break;
default:
break;
}
}
// `/collections/:collection/trash/:id/versions/:versionID`
if (segments.length === 6 && segments[2] === 'trash' && segments[4] === 'versions') {
fn = generateVersionViewMetadata;
}
}
if (isGlobal) {
// `/:global`
if (params.segments?.length === 2) {
fn = generateEditViewMetadata;
}
// `/:global/:view`
if (params.segments?.length === 3) {
switch (params.segments[2]) {
case 'api':
// `/:global/api`
fn = generateAPIViewMetadata;
break;
case 'versions':
// `/:global/versions`
fn = generateVersionsViewMetadata;
break;
default:
break;
}
}
// `/:global/versions/:version`
if (params.segments?.length === 4 && params.segments[2] === 'versions') {
fn = generateVersionViewMetadata;
}
}
const i18n = await getNextRequestI18n({
config
});
if (typeof fn === 'function') {
return fn({
collectionConfig,
config,
globalConfig,
i18n,
isEditing
});
} else {
const {
viewKey
} = getDocumentView({
collectionConfig,
config,
docPermissions: {
create: true,
delete: true,
fields: true,
read: true,
readVersions: true,
update: true
},
globalConfig,
routeSegments: typeof segments === 'string' ? [segments] : segments
});
if (viewKey) {
const customViewConfig = collectionConfig?.admin?.components?.views?.edit?.[viewKey] || globalConfig?.admin?.components?.views?.edit?.[viewKey];
if (customViewConfig) {
return generateEditViewMetadata({
collectionConfig,
config,
globalConfig,
i18n,
isEditing,
view: viewKey
});
}
}
}
return generateNotFoundViewMetadata({
config,
i18n
});
};
//# sourceMappingURL=getMetaBySegment.js.map

View File

@@ -0,0 +1,271 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var db_exports = {};
__export(db_exports, {
SingleStoreDatabase: () => SingleStoreDatabase,
withReplicas: () => withReplicas
});
module.exports = __toCommonJS(db_exports);
var import_entity = require("../entity.cjs");
var import_selection_proxy = require("../selection-proxy.cjs");
var import_sql = require("../sql/sql.cjs");
var import_subquery = require("../subquery.cjs");
var import_count = require("./query-builders/count.cjs");
var import_query_builders = require("./query-builders/index.cjs");
class SingleStoreDatabase {
constructor(dialect, session, schema) {
this.dialect = dialect;
this.session = session;
this._ = schema ? {
schema: schema.schema,
fullSchema: schema.fullSchema,
tableNamesMap: schema.tableNamesMap
} : {
schema: void 0,
fullSchema: {},
tableNamesMap: {}
};
this.query = {};
this.$cache = { invalidate: async (_params) => {
} };
}
static [import_entity.entityKind] = "SingleStoreDatabase";
// We are waiting for SingleStore support for `json_array` function
/**@inrernal */
query;
/**
* Creates a subquery that defines a temporary named result set as a CTE.
*
* It is useful for breaking down complex queries into simpler parts and for reusing the result set in subsequent parts of the query.
*
* See docs: {@link https://orm.drizzle.team/docs/select#with-clause}
*
* @param alias The alias for the subquery.
*
* Failure to provide an alias will result in a DrizzleTypeError, preventing the subquery from being referenced in other queries.
*
* @example
*
* ```ts
* // Create a subquery with alias 'sq' and use it in the select query
* const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));
*
* const result = await db.with(sq).select().from(sq);
* ```
*
* To select arbitrary SQL values as fields in a CTE and reference them in other CTEs or in the main query, you need to add aliases to them:
*
* ```ts
* // Select an arbitrary SQL value as a field in a CTE and reference it in the main query
* const sq = db.$with('sq').as(db.select({
* name: sql<string>`upper(${users.name})`.as('name'),
* })
* .from(users));
*
* const result = await db.with(sq).select({ name: sq.name }).from(sq);
* ```
*/
$with = (alias, selection) => {
const self = this;
const as = (qb) => {
if (typeof qb === "function") {
qb = qb(new import_query_builders.QueryBuilder(self.dialect));
}
return new Proxy(
new import_subquery.WithSubquery(
qb.getSQL(),
selection ?? ("getSelectedFields" in qb ? qb.getSelectedFields() ?? {} : {}),
alias,
true
),
new import_selection_proxy.SelectionProxyHandler({ alias, sqlAliasedBehavior: "alias", sqlBehavior: "error" })
);
};
return { as };
};
$count(source, filters) {
return new import_count.SingleStoreCountBuilder({ source, filters, session: this.session });
}
/**
* Incorporates a previously defined CTE (using `$with`) into the main query.
*
* This method allows the main query to reference a temporary named result set.
*
* See docs: {@link https://orm.drizzle.team/docs/select#with-clause}
*
* @param queries The CTEs to incorporate into the main query.
*
* @example
*
* ```ts
* // Define a subquery 'sq' as a CTE using $with
* const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));
*
* // Incorporate the CTE 'sq' into the main query and select from it
* const result = await db.with(sq).select().from(sq);
* ```
*/
with(...queries) {
const self = this;
function select(fields) {
return new import_query_builders.SingleStoreSelectBuilder({
fields: fields ?? void 0,
session: self.session,
dialect: self.dialect,
withList: queries
});
}
function selectDistinct(fields) {
return new import_query_builders.SingleStoreSelectBuilder({
fields: fields ?? void 0,
session: self.session,
dialect: self.dialect,
withList: queries,
distinct: true
});
}
function update(table) {
return new import_query_builders.SingleStoreUpdateBuilder(table, self.session, self.dialect, queries);
}
function delete_(table) {
return new import_query_builders.SingleStoreDeleteBase(table, self.session, self.dialect, queries);
}
return { select, selectDistinct, update, delete: delete_ };
}
select(fields) {
return new import_query_builders.SingleStoreSelectBuilder({ fields: fields ?? void 0, session: this.session, dialect: this.dialect });
}
selectDistinct(fields) {
return new import_query_builders.SingleStoreSelectBuilder({
fields: fields ?? void 0,
session: this.session,
dialect: this.dialect,
distinct: true
});
}
/**
* Creates an update query.
*
* Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.
*
* Use `.set()` method to specify which values to update.
*
* See docs: {@link https://orm.drizzle.team/docs/update}
*
* @param table The table to update.
*
* @example
*
* ```ts
* // Update all rows in the 'cars' table
* await db.update(cars).set({ color: 'red' });
*
* // Update rows with filters and conditions
* await db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));
* ```
*/
update(table) {
return new import_query_builders.SingleStoreUpdateBuilder(table, this.session, this.dialect);
}
/**
* Creates an insert query.
*
* Calling this method will create new rows in a table. Use `.values()` method to specify which values to insert.
*
* See docs: {@link https://orm.drizzle.team/docs/insert}
*
* @param table The table to insert into.
*
* @example
*
* ```ts
* // Insert one row
* await db.insert(cars).values({ brand: 'BMW' });
*
* // Insert multiple rows
* await db.insert(cars).values([{ brand: 'BMW' }, { brand: 'Porsche' }]);
* ```
*/
insert(table) {
return new import_query_builders.SingleStoreInsertBuilder(table, this.session, this.dialect);
}
/**
* Creates a delete query.
*
* Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.
*
* See docs: {@link https://orm.drizzle.team/docs/delete}
*
* @param table The table to delete from.
*
* @example
*
* ```ts
* // Delete all rows in the 'cars' table
* await db.delete(cars);
*
* // Delete rows with filters and conditions
* await db.delete(cars).where(eq(cars.color, 'green'));
* ```
*/
delete(table) {
return new import_query_builders.SingleStoreDeleteBase(table, this.session, this.dialect);
}
execute(query) {
return this.session.execute(typeof query === "string" ? import_sql.sql.raw(query) : query.getSQL());
}
$cache;
transaction(transaction, config) {
return this.session.transaction(transaction, config);
}
}
const withReplicas = (primary, replicas, getReplica = () => replicas[Math.floor(Math.random() * replicas.length)]) => {
const select = (...args) => getReplica(replicas).select(...args);
const selectDistinct = (...args) => getReplica(replicas).selectDistinct(...args);
const $count = (...args) => getReplica(replicas).$count(...args);
const $with = (...args) => getReplica(replicas).with(...args);
const update = (...args) => primary.update(...args);
const insert = (...args) => primary.insert(...args);
const $delete = (...args) => primary.delete(...args);
const execute = (...args) => primary.execute(...args);
const transaction = (...args) => primary.transaction(...args);
return {
...primary,
update,
insert,
delete: $delete,
execute,
transaction,
$primary: primary,
$replicas: replicas,
select,
selectDistinct,
$count,
with: $with,
get query() {
return getReplica(replicas).query;
}
};
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SingleStoreDatabase,
withReplicas
});
//# sourceMappingURL=db.cjs.map

View File

@@ -0,0 +1,7 @@
import getPrototypeOf from "./getPrototypeOf.js";
import isNativeReflectConstruct from "./isNativeReflectConstruct.js";
import possibleConstructorReturn from "./possibleConstructorReturn.js";
function _callSuper(t, o, e) {
return o = getPrototypeOf(o), possibleConstructorReturn(t, isNativeReflectConstruct() ? Reflect.construct(o, e || [], getPrototypeOf(t).constructor) : o.apply(t, e));
}
export { _callSuper as default };

View File

@@ -0,0 +1,26 @@
"use strict";
exports.isFriday = isFriday;
var _index = require("./toDate.js");
/**
* @name isFriday
* @category Weekday Helpers
* @summary Is the given date Friday?
*
* @description
* Is the given date Friday?
*
* @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 to check
*
* @returns The date is Friday
*
* @example
* // Is 26 September 2014 Friday?
* const result = isFriday(new Date(2014, 8, 26))
* //=> true
*/
function isFriday(date) {
return (0, _index.toDate)(date).getDay() === 5;
}

View File

@@ -0,0 +1,9 @@
'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
export const Separator = () => /*#__PURE__*/_jsx("span", {
className: "paginator__separator",
children: "—"
});
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,104 @@
import { MCP_PROMPT_NAME_ATTRIBUTE, MCP_RESOURCE_URI_ATTRIBUTE, MCP_TOOL_NAME_ATTRIBUTE, MCP_REQUEST_ARGUMENT } from './attributes.js';
/**
* Method configuration and request processing for MCP server instrumentation
*/
/**
* Configuration for MCP methods to extract targets and arguments
* @internal Maps method names to their extraction configuration
*/
const METHOD_CONFIGS = {
'tools/call': {
targetField: 'name',
targetAttribute: MCP_TOOL_NAME_ATTRIBUTE,
captureArguments: true,
argumentsField: 'arguments',
},
'resources/read': {
targetField: 'uri',
targetAttribute: MCP_RESOURCE_URI_ATTRIBUTE,
captureUri: true,
},
'resources/subscribe': {
targetField: 'uri',
targetAttribute: MCP_RESOURCE_URI_ATTRIBUTE,
},
'resources/unsubscribe': {
targetField: 'uri',
targetAttribute: MCP_RESOURCE_URI_ATTRIBUTE,
},
'prompts/get': {
targetField: 'name',
targetAttribute: MCP_PROMPT_NAME_ATTRIBUTE,
captureName: true,
captureArguments: true,
argumentsField: 'arguments',
},
};
/**
* Extracts target info from method and params based on method type
* @param method - MCP method name
* @param params - Method parameters
* @returns Target name and attributes for span instrumentation
*/
function extractTargetInfo(
method,
params,
)
{
const config = METHOD_CONFIGS[method];
if (!config) {
return { attributes: {} };
}
const target =
config.targetField && typeof params?.[config.targetField] === 'string'
? (params[config.targetField] )
: undefined;
return {
target,
attributes: target && config.targetAttribute ? { [config.targetAttribute]: target } : {},
};
}
/**
* Extracts request arguments based on method type
* @param method - MCP method name
* @param params - Method parameters
* @returns Arguments as span attributes with mcp.request.argument prefix
*/
function getRequestArguments(method, params) {
const args = {};
const config = METHOD_CONFIGS[method];
if (!config) {
return args;
}
if (config.captureArguments && config.argumentsField && params?.[config.argumentsField]) {
const argumentsObj = params[config.argumentsField];
if (typeof argumentsObj === 'object' && argumentsObj !== null) {
for (const [key, value] of Object.entries(argumentsObj )) {
args[`${MCP_REQUEST_ARGUMENT}.${key.toLowerCase()}`] = JSON.stringify(value);
}
}
}
if (config.captureUri && params?.uri) {
args[`${MCP_REQUEST_ARGUMENT}.uri`] = JSON.stringify(params.uri);
}
if (config.captureName && params?.name) {
args[`${MCP_REQUEST_ARGUMENT}.name`] = JSON.stringify(params.name);
}
return args;
}
export { extractTargetInfo, getRequestArguments };
//# sourceMappingURL=methodConfig.js.map

View File

@@ -0,0 +1,7 @@
import type { FormState } from 'payload';
import type { FieldAction } from './types.js';
/**
* Reducer which modifies the form field state (all the current data of the fields in the form). When called using dispatch, it will return a new state object.
*/
export declare function fieldReducer(state: FormState, action: FieldAction): FormState;
//# sourceMappingURL=fieldReducer.d.ts.map

View File

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

View File

@@ -0,0 +1,24 @@
/**
* @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 DnaOff = createLucideIcon("DnaOff", [
["path", { d: "M15 2c-1.35 1.5-2.092 3-2.5 4.5L14 8", key: "1bivrr" }],
["path", { d: "m17 6-2.891-2.891", key: "xu6p2f" }],
["path", { d: "M2 15c3.333-3 6.667-3 10-3", key: "nxix30" }],
["path", { d: "m2 2 20 20", key: "1ooewy" }],
["path", { d: "m20 9 .891.891", key: "3xwk7g" }],
["path", { d: "M22 9c-1.5 1.35-3 2.092-4.5 2.5l-1-1", key: "18cutr" }],
["path", { d: "M3.109 14.109 4 15", key: "q76aoh" }],
["path", { d: "m6.5 12.5 1 1", key: "cs35ky" }],
["path", { d: "m7 18 2.891 2.891", key: "1sisit" }],
["path", { d: "M9 22c1.35-1.5 2.092-3 2.5-4.5L10 16", key: "rlvei3" }]
]);
export { DnaOff as default };
//# sourceMappingURL=dna-off.js.map

View File

@@ -0,0 +1,11 @@
export const withDefault = (column, field)=>{
if (typeof field.defaultValue === 'undefined' || typeof field.defaultValue === 'function') {
return column;
}
return {
...column,
default: field.defaultValue
};
};
//# sourceMappingURL=withDefault.js.map

View File

@@ -0,0 +1,49 @@
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
// src/head.tsx
import * as React from "react";
import { jsx, jsxs } from "react/jsx-runtime";
var Head = React.forwardRef(
(_a, ref) => {
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
return /* @__PURE__ */ jsxs("head", __spreadProps(__spreadValues({}, props), { ref, children: [
/* @__PURE__ */ jsx("meta", { content: "text/html; charset=UTF-8", httpEquiv: "Content-Type" }),
/* @__PURE__ */ jsx("meta", { name: "x-apple-disable-message-reformatting" }),
children
] }));
}
);
Head.displayName = "Head";
export {
Head
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"handleGoBack.js","names":["formatAdminURL","handleGoBack","adminRoute","collectionSlug","router","serverURL","redirectRoute","path","push"],"sources":["../../src/utilities/handleGoBack.tsx"],"sourcesContent":["import type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime.js'\n\nimport { formatAdminURL } from 'payload/shared'\n\ntype GoBackProps = {\n adminRoute: string\n collectionSlug: string\n router: AppRouterInstance\n serverURL?: string\n}\n\nexport const handleGoBack = ({ adminRoute, collectionSlug, router, serverURL }: GoBackProps) => {\n const redirectRoute = formatAdminURL({\n adminRoute,\n path: collectionSlug ? `/collections/${collectionSlug}` : '/',\n })\n router.push(redirectRoute)\n}\n"],"mappings":"AAEA,SAASA,cAAc,QAAQ;AAS/B,OAAO,MAAMC,YAAA,GAAeA,CAAC;EAAEC,UAAU;EAAEC,cAAc;EAAEC,MAAM;EAAEC;AAAS,CAAe;EACzF,MAAMC,aAAA,GAAgBN,cAAA,CAAe;IACnCE,UAAA;IACAK,IAAA,EAAMJ,cAAA,GAAiB,gBAAgBA,cAAA,EAAgB,GAAG;EAC5D;EACAC,MAAA,CAAOI,IAAI,CAACF,aAAA;AACd","ignoreList":[]}

View File

@@ -0,0 +1,246 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.ValuesOfCorrectTypeRule = ValuesOfCorrectTypeRule;
var _didYouMean = require('../../jsutils/didYouMean.js');
var _inspect = require('../../jsutils/inspect.js');
var _keyMap = require('../../jsutils/keyMap.js');
var _suggestionList = require('../../jsutils/suggestionList.js');
var _GraphQLError = require('../../error/GraphQLError.js');
var _kinds = require('../../language/kinds.js');
var _printer = require('../../language/printer.js');
var _definition = require('../../type/definition.js');
/**
* Value literals of correct type
*
* A GraphQL document is only valid if all value literals are of the type
* expected at their position.
*
* See https://spec.graphql.org/draft/#sec-Values-of-Correct-Type
*/
function ValuesOfCorrectTypeRule(context) {
let variableDefinitions = {};
return {
OperationDefinition: {
enter() {
variableDefinitions = {};
},
},
VariableDefinition(definition) {
variableDefinitions[definition.variable.name.value] = definition;
},
ListValue(node) {
// Note: TypeInfo will traverse into a list's item type, so look to the
// parent input type to check if it is a list.
const type = (0, _definition.getNullableType)(
context.getParentInputType(),
);
if (!(0, _definition.isListType)(type)) {
isValidValueNode(context, node);
return false; // Don't traverse further.
}
},
ObjectValue(node) {
const type = (0, _definition.getNamedType)(context.getInputType());
if (!(0, _definition.isInputObjectType)(type)) {
isValidValueNode(context, node);
return false; // Don't traverse further.
} // Ensure every required field exists.
const fieldNodeMap = (0, _keyMap.keyMap)(
node.fields,
(field) => field.name.value,
);
for (const fieldDef of Object.values(type.getFields())) {
const fieldNode = fieldNodeMap[fieldDef.name];
if (!fieldNode && (0, _definition.isRequiredInputField)(fieldDef)) {
const typeStr = (0, _inspect.inspect)(fieldDef.type);
context.reportError(
new _GraphQLError.GraphQLError(
`Field "${type.name}.${fieldDef.name}" of required type "${typeStr}" was not provided.`,
{
nodes: node,
},
),
);
}
}
if (type.isOneOf) {
validateOneOfInputObject(context, node, type, fieldNodeMap);
}
},
ObjectField(node) {
const parentType = (0, _definition.getNamedType)(
context.getParentInputType(),
);
const fieldType = context.getInputType();
if (!fieldType && (0, _definition.isInputObjectType)(parentType)) {
const suggestions = (0, _suggestionList.suggestionList)(
node.name.value,
Object.keys(parentType.getFields()),
);
context.reportError(
new _GraphQLError.GraphQLError(
`Field "${node.name.value}" is not defined by type "${parentType.name}".` +
(0, _didYouMean.didYouMean)(suggestions),
{
nodes: node,
},
),
);
}
},
NullValue(node) {
const type = context.getInputType();
if ((0, _definition.isNonNullType)(type)) {
context.reportError(
new _GraphQLError.GraphQLError(
`Expected value of type "${(0, _inspect.inspect)(
type,
)}", found ${(0, _printer.print)(node)}.`,
{
nodes: node,
},
),
);
}
},
EnumValue: (node) => isValidValueNode(context, node),
IntValue: (node) => isValidValueNode(context, node),
FloatValue: (node) => isValidValueNode(context, node),
StringValue: (node) => isValidValueNode(context, node),
BooleanValue: (node) => isValidValueNode(context, node),
};
}
/**
* Any value literal may be a valid representation of a Scalar, depending on
* that scalar type.
*/
function isValidValueNode(context, node) {
// Report any error at the full type expected by the location.
const locationType = context.getInputType();
if (!locationType) {
return;
}
const type = (0, _definition.getNamedType)(locationType);
if (!(0, _definition.isLeafType)(type)) {
const typeStr = (0, _inspect.inspect)(locationType);
context.reportError(
new _GraphQLError.GraphQLError(
`Expected value of type "${typeStr}", found ${(0, _printer.print)(
node,
)}.`,
{
nodes: node,
},
),
);
return;
} // Scalars and Enums determine if a literal value is valid via parseLiteral(),
// which may throw or return an invalid value to indicate failure.
try {
const parseResult = type.parseLiteral(
node,
undefined,
/* variables */
);
if (parseResult === undefined) {
const typeStr = (0, _inspect.inspect)(locationType);
context.reportError(
new _GraphQLError.GraphQLError(
`Expected value of type "${typeStr}", found ${(0, _printer.print)(
node,
)}.`,
{
nodes: node,
},
),
);
}
} catch (error) {
const typeStr = (0, _inspect.inspect)(locationType);
if (error instanceof _GraphQLError.GraphQLError) {
context.reportError(error);
} else {
context.reportError(
new _GraphQLError.GraphQLError(
`Expected value of type "${typeStr}", found ${(0, _printer.print)(
node,
)}; ` + error.message,
{
nodes: node,
originalError: error,
},
),
);
}
}
}
function validateOneOfInputObject(context, node, type, fieldNodeMap) {
var _fieldNodeMap$keys$;
const keys = Object.keys(fieldNodeMap);
const isNotExactlyOneField = keys.length !== 1;
if (isNotExactlyOneField) {
context.reportError(
new _GraphQLError.GraphQLError(
`OneOf Input Object "${type.name}" must specify exactly one key.`,
{
nodes: [node],
},
),
);
return;
}
const value =
(_fieldNodeMap$keys$ = fieldNodeMap[keys[0]]) === null ||
_fieldNodeMap$keys$ === void 0
? void 0
: _fieldNodeMap$keys$.value;
const isNullLiteral = !value || value.kind === _kinds.Kind.NULL;
if (isNullLiteral) {
context.reportError(
new _GraphQLError.GraphQLError(
`Field "${type.name}.${keys[0]}" must be non-null.`,
{
nodes: [node],
},
),
);
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"invariant.js","sourceRoot":"","sources":["../../src/invariant.ts"],"names":[],"mappings":";;;AAAO,IAAM,SAAS,GAAG,UAAC,SAAkB,EAAE,KAAa;IACvD,IAAI,CAAC,SAAS,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACxB;AACL,CAAC,CAAC;AAJW,QAAA,SAAS,aAIpB"}

View File

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

View File

@@ -0,0 +1,109 @@
#ifndef EVENT_H
#define EVENT_H
#include <string>
#include <node_api.h>
#include "wasm/include.h"
#include <napi.h>
#include <mutex>
#include <map>
#include <optional>
using namespace Napi;
struct Event {
std::string path;
bool isCreated;
bool isDeleted;
Event(std::string path) : path(path), isCreated(false), isDeleted(false) {}
Value toJS(const Env& env) {
EscapableHandleScope scope(env);
Object res = Object::New(env);
std::string type = isCreated ? "create" : isDeleted ? "delete" : "update";
res.Set(String::New(env, "path"), String::New(env, path.c_str()));
res.Set(String::New(env, "type"), String::New(env, type.c_str()));
return scope.Escape(res);
}
};
class EventList {
public:
void create(std::string path) {
std::lock_guard<std::mutex> l(mMutex);
Event *event = internalUpdate(path);
if (event->isDeleted) {
// Assume update event when rapidly removed and created
// https://github.com/parcel-bundler/watcher/issues/72
event->isDeleted = false;
} else {
event->isCreated = true;
}
}
Event *update(std::string path) {
std::lock_guard<std::mutex> l(mMutex);
return internalUpdate(path);
}
void remove(std::string path) {
std::lock_guard<std::mutex> l(mMutex);
Event *event = internalUpdate(path);
event->isDeleted = true;
}
size_t size() {
std::lock_guard<std::mutex> l(mMutex);
return mEvents.size();
}
std::vector<Event> getEvents() {
std::lock_guard<std::mutex> l(mMutex);
std::vector<Event> eventsCloneVector;
for(auto it = mEvents.begin(); it != mEvents.end(); ++it) {
if (!(it->second.isCreated && it->second.isDeleted)) {
eventsCloneVector.push_back(it->second);
}
}
return eventsCloneVector;
}
void clear() {
std::lock_guard<std::mutex> l(mMutex);
mEvents.clear();
mError.reset();
}
void error(std::string err) {
std::lock_guard<std::mutex> l(mMutex);
if (!mError.has_value()) {
mError.emplace(err);
}
}
bool hasError() {
std::lock_guard<std::mutex> l(mMutex);
return mError.has_value();
}
std::string getError() {
std::lock_guard<std::mutex> l(mMutex);
return mError.value_or("");
}
private:
mutable std::mutex mMutex;
std::map<std::string, Event> mEvents;
std::optional<std::string> mError;
Event *internalUpdate(std::string path) {
auto found = mEvents.find(path);
if (found == mEvents.end()) {
auto it = mEvents.emplace(path, Event(path));
return &it.first->second;
}
return &found->second;
}
};
#endif

View File

@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ChefHat = createLucideIcon("ChefHat", [
[
"path",
{
d: "M17 21a1 1 0 0 0 1-1v-5.35c0-.457.316-.844.727-1.041a4 4 0 0 0-2.134-7.589 5 5 0 0 0-9.186 0 4 4 0 0 0-2.134 7.588c.411.198.727.585.727 1.041V20a1 1 0 0 0 1 1Z",
key: "1qvrer"
}
],
["path", { d: "M6 17h12", key: "1jwigz" }]
]);
export { ChefHat as default };
//# sourceMappingURL=chef-hat.js.map

View File

@@ -0,0 +1,135 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "znaků", verb: "mít" },
file: { unit: "bajtů", verb: "mít" },
array: { unit: "prvků", verb: "mít" },
set: { unit: "prvků", verb: "mít" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "číslo";
}
case "string": {
return "řetězec";
}
case "boolean": {
return "boolean";
}
case "bigint": {
return "bigint";
}
case "function": {
return "funkce";
}
case "symbol": {
return "symbol";
}
case "undefined": {
return "undefined";
}
case "object": {
if (Array.isArray(data)) {
return "pole";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "regulární výraz",
email: "e-mailová adresa",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "datum a čas ve formátu ISO",
date: "datum ve formátu ISO",
time: "čas ve formátu ISO",
duration: "doba trvání ISO",
ipv4: "IPv4 adresa",
ipv6: "IPv6 adresa",
cidrv4: "rozsah IPv4",
cidrv6: "rozsah IPv6",
base64: "řetězec zakódovaný ve formátu base64",
base64url: "řetězec zakódovaný ve formátu base64url",
json_string: "řetězec ve formátu JSON",
e164: "číslo E.164",
jwt: "JWT",
template_literal: "vstup",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Neplatný vstup: očekáváno ${issue.expected}, obdrženo ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Neplatný vstup: očekáváno ${util.stringifyPrimitive(issue.values[0])}`;
return `Neplatná možnost: očekávána jedna z hodnot ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Hodnota je příliš velká: ${issue.origin ?? "hodnota"} musí mít ${adj}${issue.maximum.toString()} ${sizing.unit ?? "prvků"}`;
}
return `Hodnota je příliš velká: ${issue.origin ?? "hodnota"} musí být ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Hodnota je příliš malá: ${issue.origin ?? "hodnota"} musí mít ${adj}${issue.minimum.toString()} ${sizing.unit ?? "prvků"}`;
}
return `Hodnota je příliš malá: ${issue.origin ?? "hodnota"} musí být ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Neplatný řetězec: musí začínat na "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Neplatný řetězec: musí končit na "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Neplatný řetězec: musí obsahovat "${_issue.includes}"`;
if (_issue.format === "regex")
return `Neplatný řetězec: musí odpovídat vzoru ${_issue.pattern}`;
return `Neplatný formát ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Neplatné číslo: musí být násobkem ${issue.divisor}`;
case "unrecognized_keys":
return `Neznámé klíče: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Neplatný klíč v ${issue.origin}`;
case "invalid_union":
return "Neplatný vstup";
case "invalid_element":
return `Neplatná hodnota v ${issue.origin}`;
default:
return `Neplatný vstup`;
}
};
};
export default function () {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1,127 @@
/*
@license
Rollup.js v4.58.0
Fri, 20 Feb 2026 12:44:20 GMT - commit 33f39c1f205ea2eadaf4b589e493453e2baa3662
https://github.com/rollup/rollup
Released under the MIT License.
*/
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const rollup = require('./shared/rollup.js');
const parseAst_js = require('./shared/parseAst.js');
const fseventsImporter = require('./shared/fsevents-importer.js');
require('node:process');
require('node:path');
require('path');
require('./native.js');
require('node:perf_hooks');
require('node:fs/promises');
class WatchEmitter {
constructor() {
this.currentHandlers = Object.create(null);
this.persistentHandlers = Object.create(null);
}
// Will be overwritten by Rollup
async close() { }
emit(event, ...parameters) {
return Promise.all([...this.getCurrentHandlers(event), ...this.getPersistentHandlers(event)].map(handler => handler(...parameters)));
}
off(event, listener) {
const listeners = this.persistentHandlers[event];
if (listeners) {
// A hack stolen from "mitt": ">>> 0" does not change numbers >= 0, but -1
// (which would remove the last array element if used unchanged) is turned
// into max_int, which is outside the array and does not change anything.
listeners.splice(listeners.indexOf(listener) >>> 0, 1);
}
return this;
}
on(event, listener) {
this.getPersistentHandlers(event).push(listener);
return this;
}
onCurrentRun(event, listener) {
this.getCurrentHandlers(event).push(listener);
return this;
}
once(event, listener) {
const selfRemovingListener = (...parameters) => {
this.off(event, selfRemovingListener);
return listener(...parameters);
};
this.on(event, selfRemovingListener);
return this;
}
removeAllListeners() {
this.removeListenersForCurrentRun();
this.persistentHandlers = Object.create(null);
return this;
}
removeListenersForCurrentRun() {
this.currentHandlers = Object.create(null);
return this;
}
getCurrentHandlers(event) {
return this.currentHandlers[event] || (this.currentHandlers[event] = []);
}
getPersistentHandlers(event) {
return this.persistentHandlers[event] || (this.persistentHandlers[event] = []);
}
}
function watch(configs) {
const emitter = new WatchEmitter();
watchInternal(configs, emitter).catch(error => {
rollup.handleError(error);
});
return emitter;
}
function ensureTrailingSlash(path) {
if (path[path.length - 1] !== '/') {
return `${path}/`;
}
return path;
}
function checkWatchConfig(config) {
for (const item of config) {
if (typeof item.watch !== 'boolean' && item.watch?.allowInputInsideOutputPath) {
break;
}
if (item.input && item.output) {
const input = typeof item.input === 'string' ? rollup.ensureArray(item.input) : item.input;
const outputs = rollup.ensureArray(item.output);
for (const index in input) {
const inputPath = input[index];
if (typeof inputPath !== 'string') {
continue;
}
const outputWithInputAsSubPath = outputs.find(({ dir }) => dir && ensureTrailingSlash(inputPath).startsWith(ensureTrailingSlash(dir)));
if (outputWithInputAsSubPath) {
parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, `the input "${inputPath}" is a subpath of the output "${outputWithInputAsSubPath.dir}"`));
}
}
}
}
}
async function watchInternal(configs, emitter) {
const optionsList = await Promise.all(rollup.ensureArray(configs).map(config => rollup.mergeOptions(config, true)));
const watchOptionsList = optionsList.filter(config => config.watch !== false);
if (watchOptionsList.length === 0) {
return parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, 'there must be at least one config where "watch" is not set to "false"'));
}
checkWatchConfig(watchOptionsList);
await fseventsImporter.loadFsEvents();
const { Watcher } = await Promise.resolve().then(() => require('./shared/watch.js'));
new Watcher(watchOptionsList, emitter);
}
exports.VERSION = rollup.version;
exports.defineConfig = rollup.defineConfig;
exports.rollup = rollup.rollup;
exports.watch = watch;
//# sourceMappingURL=rollup.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"propagationContext.js","sources":["../../../src/utils/propagationContext.ts"],"sourcesContent":["import { uuid4 } from './misc';\n\n/**\n * Generate a random, valid trace ID.\n */\nexport function generateTraceId(): string {\n return uuid4();\n}\n\n/**\n * Generate a random, valid span ID.\n */\nexport function generateSpanId(): string {\n return uuid4().substring(16);\n}\n"],"names":["uuid4"],"mappings":";;;;AAEA;AACA;AACA;AACO,SAAS,eAAe,GAAW;AAC1C,EAAE,OAAOA,UAAK,EAAE;AAChB;;AAEA;AACA;AACA;AACO,SAAS,cAAc,GAAW;AACzC,EAAE,OAAOA,UAAK,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;AAC9B;;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"names":["_index","require","removeComments","node","COMMENT_KEYS","forEach","key"],"sources":["../../src/comments/removeComments.ts"],"sourcesContent":["import { COMMENT_KEYS } from \"../constants/index.ts\";\nimport type * as t from \"../index.ts\";\n\n/**\n * Remove comment properties from a node.\n */\nexport default function removeComments<T extends t.Node>(node: T): T {\n COMMENT_KEYS.forEach(key => {\n node[key] = null;\n });\n\n return node;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMe,SAASC,cAAcA,CAAmBC,IAAO,EAAK;EACnEC,mBAAY,CAACC,OAAO,CAACC,GAAG,IAAI;IAC1BH,IAAI,CAACG,GAAG,CAAC,GAAG,IAAI;EAClB,CAAC,CAAC;EAEF,OAAOH,IAAI;AACb","ignoreList":[]}

View File

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

View File

@@ -0,0 +1,272 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var session_exports = {};
__export(session_exports, {
MySql2PreparedQuery: () => MySql2PreparedQuery,
MySql2Session: () => MySql2Session,
MySql2Transaction: () => MySql2Transaction
});
module.exports = __toCommonJS(session_exports);
var import_node_events = require("node:events");
var import_core = require("../cache/core/index.cjs");
var import_column = require("../column.cjs");
var import_entity = require("../entity.cjs");
var import_logger = require("../logger.cjs");
var import_session = require("../mysql-core/session.cjs");
var import_sql = require("../sql/sql.cjs");
var import_utils = require("../utils.cjs");
class MySql2PreparedQuery extends import_session.MySqlPreparedQuery {
constructor(client, queryString, params, logger, cache, queryMetadata, cacheConfig, fields, customResultMapper, generatedIds, returningIds) {
super(cache, queryMetadata, cacheConfig);
this.client = client;
this.params = params;
this.logger = logger;
this.fields = fields;
this.customResultMapper = customResultMapper;
this.generatedIds = generatedIds;
this.returningIds = returningIds;
this.rawQuery = {
sql: queryString,
// rowsAsArray: true,
typeCast: function(field, next) {
if (field.type === "TIMESTAMP" || field.type === "DATETIME" || field.type === "DATE") {
return field.string();
}
return next();
}
};
this.query = {
sql: queryString,
rowsAsArray: true,
typeCast: function(field, next) {
if (field.type === "TIMESTAMP" || field.type === "DATETIME" || field.type === "DATE") {
return field.string();
}
return next();
}
};
}
static [import_entity.entityKind] = "MySql2PreparedQuery";
rawQuery;
query;
async execute(placeholderValues = {}) {
const params = (0, import_sql.fillPlaceholders)(this.params, placeholderValues);
this.logger.logQuery(this.rawQuery.sql, params);
const { fields, client, rawQuery, query, joinsNotNullableMap, customResultMapper, returningIds, generatedIds } = this;
if (!fields && !customResultMapper) {
const res = await this.queryWithCache(rawQuery.sql, params, async () => {
return await client.query(rawQuery, params);
});
const insertId = res[0].insertId;
const affectedRows = res[0].affectedRows;
if (returningIds) {
const returningResponse = [];
let j = 0;
for (let i = insertId; i < insertId + affectedRows; i++) {
for (const column of returningIds) {
const key = returningIds[0].path[0];
if ((0, import_entity.is)(column.field, import_column.Column)) {
if (column.field.primary && column.field.autoIncrement) {
returningResponse.push({ [key]: i });
}
if (column.field.defaultFn && generatedIds) {
returningResponse.push({ [key]: generatedIds[j][key] });
}
}
}
j++;
}
return returningResponse;
}
return res;
}
const result = await this.queryWithCache(query.sql, params, async () => {
return await client.query(query, params);
});
const rows = result[0];
if (customResultMapper) {
return customResultMapper(rows);
}
return rows.map((row) => (0, import_utils.mapResultRow)(fields, row, joinsNotNullableMap));
}
async *iterator(placeholderValues = {}) {
const params = (0, import_sql.fillPlaceholders)(this.params, placeholderValues);
const conn = (isPool(this.client) ? await this.client.getConnection() : this.client).connection;
const { fields, query, rawQuery, joinsNotNullableMap, client, customResultMapper } = this;
const hasRowsMapper = Boolean(fields || customResultMapper);
const driverQuery = hasRowsMapper ? conn.query(query, params) : conn.query(rawQuery, params);
const stream = driverQuery.stream();
function dataListener() {
stream.pause();
}
stream.on("data", dataListener);
try {
const onEnd = (0, import_node_events.once)(stream, "end");
const onError = (0, import_node_events.once)(stream, "error");
while (true) {
stream.resume();
const row = await Promise.race([onEnd, onError, new Promise((resolve) => stream.once("data", resolve))]);
if (row === void 0 || Array.isArray(row) && row.length === 0) {
break;
} else if (row instanceof Error) {
throw row;
} else {
if (hasRowsMapper) {
if (customResultMapper) {
const mappedRow = customResultMapper([row]);
yield Array.isArray(mappedRow) ? mappedRow[0] : mappedRow;
} else {
yield (0, import_utils.mapResultRow)(fields, row, joinsNotNullableMap);
}
} else {
yield row;
}
}
}
} finally {
stream.off("data", dataListener);
if (isPool(client)) {
conn.end();
}
}
}
}
class MySql2Session extends import_session.MySqlSession {
constructor(client, dialect, schema, options) {
super(dialect);
this.client = client;
this.schema = schema;
this.options = options;
this.logger = options.logger ?? new import_logger.NoopLogger();
this.cache = options.cache ?? new import_core.NoopCache();
this.mode = options.mode;
}
static [import_entity.entityKind] = "MySql2Session";
logger;
mode;
cache;
prepareQuery(query, fields, customResultMapper, generatedIds, returningIds, queryMetadata, cacheConfig) {
return new MySql2PreparedQuery(
this.client,
query.sql,
query.params,
this.logger,
this.cache,
queryMetadata,
cacheConfig,
fields,
customResultMapper,
generatedIds,
returningIds
);
}
/**
* @internal
* What is its purpose?
*/
async query(query, params) {
this.logger.logQuery(query, params);
const result = await this.client.query({
sql: query,
values: params,
rowsAsArray: true,
typeCast: function(field, next) {
if (field.type === "TIMESTAMP" || field.type === "DATETIME" || field.type === "DATE") {
return field.string();
}
return next();
}
});
return result;
}
all(query) {
const querySql = this.dialect.sqlToQuery(query);
this.logger.logQuery(querySql.sql, querySql.params);
return this.client.execute(querySql.sql, querySql.params).then((result) => result[0]);
}
async transaction(transaction, config) {
const session = isPool(this.client) ? new MySql2Session(
await this.client.getConnection(),
this.dialect,
this.schema,
this.options
) : this;
const tx = new MySql2Transaction(
this.dialect,
session,
this.schema,
0,
this.mode
);
if (config) {
const setTransactionConfigSql = this.getSetTransactionSQL(config);
if (setTransactionConfigSql) {
await tx.execute(setTransactionConfigSql);
}
const startTransactionSql = this.getStartTransactionSQL(config);
await (startTransactionSql ? tx.execute(startTransactionSql) : tx.execute(import_sql.sql`begin`));
} else {
await tx.execute(import_sql.sql`begin`);
}
try {
const result = await transaction(tx);
await tx.execute(import_sql.sql`commit`);
return result;
} catch (err) {
await tx.execute(import_sql.sql`rollback`);
throw err;
} finally {
if (isPool(this.client)) {
session.client.release();
}
}
}
}
class MySql2Transaction extends import_session.MySqlTransaction {
static [import_entity.entityKind] = "MySql2Transaction";
async transaction(transaction) {
const savepointName = `sp${this.nestedIndex + 1}`;
const tx = new MySql2Transaction(
this.dialect,
this.session,
this.schema,
this.nestedIndex + 1,
this.mode
);
await tx.execute(import_sql.sql.raw(`savepoint ${savepointName}`));
try {
const result = await transaction(tx);
await tx.execute(import_sql.sql.raw(`release savepoint ${savepointName}`));
return result;
} catch (err) {
await tx.execute(import_sql.sql.raw(`rollback to savepoint ${savepointName}`));
throw err;
}
}
}
function isPool(client) {
return "getConnection" in client;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
MySql2PreparedQuery,
MySql2Session,
MySql2Transaction
});
//# sourceMappingURL=session.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"stackframe.d.ts","sourceRoot":"","sources":["../../../src/types-hoist/stackframe.ts"],"names":[],"mappings":"AAAA,YAAY;AACZ,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,eAAe,CAAC,EAAE,GAAG,CAAC;CACvB"}

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 AlarmClockOff = createLucideIcon("AlarmClockOff", [
["path", { d: "M6.87 6.87a8 8 0 1 0 11.26 11.26", key: "3on8tj" }],
["path", { d: "M19.9 14.25a8 8 0 0 0-9.15-9.15", key: "15ghsc" }],
["path", { d: "m22 6-3-3", key: "1opdir" }],
["path", { d: "M6.26 18.67 4 21", key: "yzmioq" }],
["path", { d: "m2 2 20 20", key: "1ooewy" }],
["path", { d: "M4 4 2 6", key: "1ycko6" }]
]);
export { AlarmClockOff as default };
//# sourceMappingURL=alarm-clock-off.js.map

View File

@@ -0,0 +1,20 @@
import type { Match } from "../../../locale/types.js";
import { Parser } from "../Parser.js";
import type { ParseFlags, ParseResult, ParserOptions } from "../types.js";
export declare class LocalDayParser extends Parser<number> {
priority: number;
parse(
dateString: string,
token: string,
match: Match,
options: ParserOptions,
): ParseResult<number>;
validate<DateType extends Date>(_date: DateType, value: number): boolean;
set<DateType extends Date>(
date: DateType,
_flags: ParseFlags,
value: number,
options: ParserOptions,
): DateType;
incompatibleTokens: string[];
}

View File

@@ -0,0 +1,44 @@
var baseDifference = require('./_baseDifference'),
baseFlatten = require('./_baseFlatten'),
baseIteratee = require('./_baseIteratee'),
baseRest = require('./_baseRest'),
isArrayLikeObject = require('./isArrayLikeObject'),
last = require('./last');
/**
* This method is like `_.difference` except that it accepts `iteratee` which
* is invoked for each element of `array` and `values` to generate the criterion
* by which they're compared. The order and references of result values are
* determined by the first array. The iteratee is invoked with one argument:
* (value).
*
* **Note:** Unlike `_.pullAllBy`, this method returns a new array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
* // => [1.2]
*
* // The `_.property` iteratee shorthand.
* _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
* // => [{ 'x': 2 }]
*/
var differenceBy = baseRest(function(array, values) {
var iteratee = last(values);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2))
: [];
});
module.exports = differenceBy;

View File

@@ -0,0 +1,75 @@
import * as core from "../core/index.js";
import { $ZodError } from "../core/index.js";
/** @deprecated Use `z.core.$ZodIssue` from `@zod/core` instead, especially if you are building a library on top of Zod. */
export type ZodIssue = core.$ZodIssue;
/** An Error-like class used to store Zod validation issues. */
export interface ZodError<T = unknown> extends $ZodError<T> {
/** @deprecated Use the `z.treeifyError(err)` function instead. */
format(): core.$ZodFormattedError<T>;
format<U>(mapper: (issue: core.$ZodIssue) => U): core.$ZodFormattedError<T, U>;
/** @deprecated Use the `z.treeifyError(err)` function instead. */
flatten(): core.$ZodFlattenedError<T>;
flatten<U>(mapper: (issue: core.$ZodIssue) => U): core.$ZodFlattenedError<T, U>;
/** @deprecated Push directly to `.issues` instead. */
addIssue(issue: core.$ZodIssue): void;
/** @deprecated Push directly to `.issues` instead. */
addIssues(issues: core.$ZodIssue[]): void;
/** @deprecated Check `err.issues.length === 0` instead. */
isEmpty: boolean;
}
const initializer = (inst: ZodError, issues: core.$ZodIssue[]) => {
$ZodError.init(inst, issues);
inst.name = "ZodError";
Object.defineProperties(inst, {
format: {
value: (mapper: any) => core.formatError(inst, mapper),
// enumerable: false,
},
flatten: {
value: (mapper: any) => core.flattenError(inst, mapper),
// enumerable: false,
},
addIssue: {
value: (issue: any) => inst.issues.push(issue),
// enumerable: false,
},
addIssues: {
value: (issues: any) => inst.issues.push(...issues),
// enumerable: false,
},
isEmpty: {
get() {
return inst.issues.length === 0;
},
// enumerable: false,
},
});
// Object.defineProperty(inst, "isEmpty", {
// get() {
// return inst.issues.length === 0;
// },
// });
};
export const ZodError: core.$constructor<ZodError> = core.$constructor("ZodError", initializer);
export const ZodRealError: core.$constructor<ZodError> = core.$constructor("ZodError", initializer, {
Parent: Error,
});
export type {
/** @deprecated Use `z.core.$ZodFlattenedError` instead. */
$ZodFlattenedError as ZodFlattenedError,
/** @deprecated Use `z.core.$ZodFormattedError` instead. */
$ZodFormattedError as ZodFormattedError,
/** @deprecated Use `z.core.$ZodErrorMap` instead. */
$ZodErrorMap as ZodErrorMap,
} from "../core/index.js";
/** @deprecated Use `z.core.$ZodRawIssue` instead. */
export type IssueData = core.$ZodRawIssue;
// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */
// export type ErrorMapCtx = core.$ZodErrorMapCtx;

View File

@@ -0,0 +1,27 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link getMinutes} function options.
*/
export interface GetMinutesOptions extends ContextOptions<Date> {}
/**
* @name getMinutes
* @category Minute Helpers
* @summary Get the minutes of the given date.
*
* @description
* Get the minutes of the given date.
*
* @param date - The given date
* @param options - The options
*
* @returns The minutes
*
* @example
* // Get the minutes of 29 February 2012 11:45:05:
* const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))
* //=> 45
*/
export declare function getMinutes(
date: DateArg<Date> & {},
options?: GetMinutesOptions | undefined,
): number;

View File

@@ -0,0 +1,52 @@
import type { ReplayRecordingData } from '@sentry/core';
import type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* Event buffer that uses a web worker to compress events.
* Exported only for testing.
*/
export declare class EventBufferCompressionWorker implements EventBuffer {
/** @inheritdoc */
hasCheckout: boolean;
/** @inheritdoc */
waitForCheckout: boolean;
private _worker;
private _earliestTimestamp;
private _totalSize;
constructor(worker: Worker);
/** @inheritdoc */
get hasEvents(): boolean;
/** @inheritdoc */
get type(): EventBufferType;
/**
* Ensure the worker is ready (or not).
* This will either resolve when the worker is ready, or reject if an error occurred.
*/
ensureReady(): Promise<void>;
/**
* Destroy the event buffer.
*/
destroy(): void;
/**
* Add an event to the event buffer.
*
* Returns true if event was successfully received and processed by worker.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/**
* Finish the event buffer and return the compressed data.
*/
finish(): Promise<ReplayRecordingData>;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
/**
* Send the event to the worker.
*/
private _sendEventToWorker;
/**
* Finish the request and return the compressed data from the worker.
*/
private _finishRequest;
}
//# sourceMappingURL=EventBufferCompressionWorker.d.ts.map

View File

@@ -0,0 +1,55 @@
import type { CollectionSlug, Payload, RequestContext, TypedLocale } from '../../../index.js';
import type { Document, PayloadRequest, Where } from '../../../types/index.js';
export type CountOptions<TSlug extends CollectionSlug> = {
/**
* the Collection slug to operate against.
*/
collection: TSlug;
/**
* [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,
* which can be read by hooks. Useful if you want to pass additional information to the hooks which
* shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook
* to determine if it should run or not.
*/
context?: RequestContext;
/**
* When set to `true`, errors will not be thrown.
*/
disableErrors?: boolean;
/**
* Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.
*/
locale?: TypedLocale;
/**
* Skip access control.
* Set to `false` if you want to respect Access Control for the operation, for example when fetching data for the front-end.
* @default true
*/
overrideAccess?: boolean;
/**
* The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.
* Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.
*/
req?: Partial<PayloadRequest>;
/**
* When set to `true`, the query will include both normal and trashed documents.
* To query only trashed documents, pass `trash: true` and combine with a `where` clause filtering by `deletedAt`.
* By default (`false`), the query will only include normal documents and exclude those with a `deletedAt` field.
*
* This argument has no effect unless `trash` is enabled on the collection.
* @default false
*/
trash?: boolean;
/**
* If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.
*/
user?: Document;
/**
* A filter [query](https://payloadcms.com/docs/queries/overview)
*/
where?: Where;
};
export declare function countLocal<TSlug extends CollectionSlug>(payload: Payload, options: CountOptions<TSlug>): Promise<{
totalDocs: number;
}>;
//# sourceMappingURL=count.d.ts.map

View File

@@ -0,0 +1,7 @@
import { IPropertyValueDescriptor } from '../IPropertyDescriptor';
interface zIndex {
order: number;
auto: boolean;
}
export declare const zIndex: IPropertyValueDescriptor<zIndex>;
export {};

View File

@@ -0,0 +1,87 @@
{
"name": "prismjs",
"version": "1.29.0",
"description": "Lightweight, robust, elegant syntax highlighting. A spin-off project from Dabblet.",
"main": "prism.js",
"style": "themes/prism.css",
"engines": {
"node": ">=6"
},
"scripts": {
"benchmark": "node benchmark/benchmark.js",
"build": "gulp",
"start": "http-server -c-1",
"lint": "eslint . --cache",
"lint:fix": "npm run lint -- --fix",
"lint:ci": "eslint . --max-warnings 0",
"regex-coverage": "mocha tests/coverage.js",
"test:aliases": "mocha tests/aliases-test.js",
"test:core": "mocha tests/core/**/*.js",
"test:dependencies": "mocha tests/dependencies-test.js",
"test:examples": "mocha tests/examples-test.js",
"test:identifiers": "mocha tests/identifier-test.js",
"test:languages": "mocha tests/run.js",
"test:patterns": "mocha tests/pattern-tests.js",
"test:plugins": "mocha tests/plugins/**/*.js",
"test:runner": "mocha tests/testrunner-tests.js",
"test": "npm-run-all test:*"
},
"repository": {
"type": "git",
"url": "https://github.com/PrismJS/prism.git"
},
"keywords": [
"prism",
"highlight"
],
"author": "Lea Verou",
"license": "MIT",
"readmeFilename": "README.md",
"devDependencies": {
"@types/node-fetch": "^2.5.5",
"benchmark": "^2.1.4",
"chai": "^4.2.0",
"danger": "^10.5.0",
"del": "^4.1.1",
"docdash": "^1.2.0",
"eslint": "^7.22.0",
"eslint-plugin-jsdoc": "^32.3.0",
"eslint-plugin-regexp": "^1.6.0",
"gulp": "^4.0.2",
"gulp-clean-css": "^4.3.0",
"gulp-concat": "^2.3.4",
"gulp-header": "^2.0.7",
"gulp-jsdoc3": "^3.0.0",
"gulp-rename": "^1.2.0",
"gulp-replace": "^1.0.0",
"gulp-terser": "^2.1.0",
"gzip-size": "^5.1.1",
"htmlparser2": "^4.0.0",
"http-server": "^0.12.3",
"jsdom": "^16.7.0",
"mocha": "^9.2.2",
"node-fetch": "^3.1.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.4.1",
"pump": "^3.0.0",
"refa": "^0.9.1",
"regexp-ast-analysis": "^0.2.4",
"regexpp": "^3.2.0",
"scslre": "^0.1.6",
"simple-git": "^3.3.0",
"webfont": "^9.0.0",
"yargs": "^13.2.2"
},
"jspm": {
"main": "prism",
"registry": "jspm",
"jspmPackage": true,
"format": "global",
"files": [
"components/**/*.js",
"plugins/**/*",
"themes/*.css",
"prism.js"
]
}
}

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 ThermometerSun = createLucideIcon("ThermometerSun", [
["path", { d: "M12 9a4 4 0 0 0-2 7.5", key: "1jvsq6" }],
["path", { d: "M12 3v2", key: "1w22ol" }],
["path", { d: "m6.6 18.4-1.4 1.4", key: "w2yidj" }],
["path", { d: "M20 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z", key: "iof6y5" }],
["path", { d: "M4 13H2", key: "118le4" }],
["path", { d: "M6.34 7.34 4.93 5.93", key: "1brd51" }]
]);
export { ThermometerSun as default };
//# sourceMappingURL=thermometer-sun.js.map

View File

@@ -0,0 +1,575 @@
'use strict'
const { bufferToLowerCasedHeaderName } = require('../../core/util')
const { HTTP_TOKEN_CODEPOINTS } = require('./data-url')
const { makeEntry } = require('./formdata')
const { webidl } = require('../webidl')
const assert = require('node:assert')
const { isomorphicDecode } = require('../infra')
const { utf8DecodeBytes } = require('../../encoding')
const dd = Buffer.from('--')
const decoder = new TextDecoder()
/**
* @param {string} chars
*/
function isAsciiString (chars) {
for (let i = 0; i < chars.length; ++i) {
if ((chars.charCodeAt(i) & ~0x7F) !== 0) {
return false
}
}
return true
}
/**
* @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-boundary
* @param {string} boundary
*/
function validateBoundary (boundary) {
const length = boundary.length
// - its length is greater or equal to 27 and lesser or equal to 70, and
if (length < 27 || length > 70) {
return false
}
// - it is composed by bytes in the ranges 0x30 to 0x39, 0x41 to 0x5A, or
// 0x61 to 0x7A, inclusive (ASCII alphanumeric), or which are 0x27 ('),
// 0x2D (-) or 0x5F (_).
for (let i = 0; i < length; ++i) {
const cp = boundary.charCodeAt(i)
if (!(
(cp >= 0x30 && cp <= 0x39) ||
(cp >= 0x41 && cp <= 0x5a) ||
(cp >= 0x61 && cp <= 0x7a) ||
cp === 0x27 ||
cp === 0x2d ||
cp === 0x5f
)) {
return false
}
}
return true
}
/**
* @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-parser
* @param {Buffer} input
* @param {ReturnType<import('./data-url')['parseMIMEType']>} mimeType
*/
function multipartFormDataParser (input, mimeType) {
// 1. Assert: mimeTypes essence is "multipart/form-data".
assert(mimeType !== 'failure' && mimeType.essence === 'multipart/form-data')
const boundaryString = mimeType.parameters.get('boundary')
// 2. If mimeTypes parameters["boundary"] does not exist, return failure.
// Otherwise, let boundary be the result of UTF-8 decoding mimeTypes
// parameters["boundary"].
if (boundaryString === undefined) {
throw parsingError('missing boundary in content-type header')
}
const boundary = Buffer.from(`--${boundaryString}`, 'utf8')
// 3. Let entry list be an empty entry list.
const entryList = []
// 4. Let position be a pointer to a byte in input, initially pointing at
// the first byte.
const position = { position: 0 }
// Note: Per RFC 2046 Section 5.1.1, we must ignore anything before the
// first boundary delimiter line (preamble). Search for the first boundary.
const firstBoundaryIndex = input.indexOf(boundary)
if (firstBoundaryIndex === -1) {
throw parsingError('no boundary found in multipart body')
}
// Start parsing from the first boundary, ignoring any preamble
position.position = firstBoundaryIndex
// 5. While true:
while (true) {
// 5.1. If position points to a sequence of bytes starting with 0x2D 0x2D
// (`--`) followed by boundary, advance position by 2 + the length of
// boundary. Otherwise, return failure.
// Note: boundary is padded with 2 dashes already, no need to add 2.
if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) {
position.position += boundary.length
} else {
throw parsingError('expected a value starting with -- and the boundary')
}
// 5.2. If position points to the sequence of bytes 0x2D 0x2D 0x0D 0x0A
// (`--` followed by CR LF) followed by the end of input, return entry list.
// Note: Per RFC 2046 Section 5.1.1, we must ignore anything after the
// final boundary delimiter (epilogue). Check for -- or --CRLF and return
// regardless of what follows.
if (bufferStartsWith(input, dd, position)) {
// Found closing boundary delimiter (--), ignore any epilogue
return entryList
}
// 5.3. If position does not point to a sequence of bytes starting with 0x0D
// 0x0A (CR LF), return failure.
if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {
throw parsingError('expected CRLF')
}
// 5.4. Advance position by 2. (This skips past the newline.)
position.position += 2
// 5.5. Let name, filename and contentType be the result of parsing
// multipart/form-data headers on input and position, if the result
// is not failure. Otherwise, return failure.
const result = parseMultipartFormDataHeaders(input, position)
let { name, filename, contentType, encoding } = result
// 5.6. Advance position by 2. (This skips past the empty line that marks
// the end of the headers.)
position.position += 2
// 5.7. Let body be the empty byte sequence.
let body
// 5.8. Body loop: While position is not past the end of input:
// TODO: the steps here are completely wrong
{
const boundaryIndex = input.indexOf(boundary.subarray(2), position.position)
if (boundaryIndex === -1) {
throw parsingError('expected boundary after body')
}
body = input.subarray(position.position, boundaryIndex - 4)
position.position += body.length
// Note: position must be advanced by the body's length before being
// decoded, otherwise the parsing will fail.
if (encoding === 'base64') {
body = Buffer.from(body.toString(), 'base64')
}
}
// 5.9. If position does not point to a sequence of bytes starting with
// 0x0D 0x0A (CR LF), return failure. Otherwise, advance position by 2.
if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {
throw parsingError('expected CRLF')
} else {
position.position += 2
}
// 5.10. If filename is not null:
let value
if (filename !== null) {
// 5.10.1. If contentType is null, set contentType to "text/plain".
contentType ??= 'text/plain'
// 5.10.2. If contentType is not an ASCII string, set contentType to the empty string.
// Note: `buffer.isAscii` can be used at zero-cost, but converting a string to a buffer is a high overhead.
// Content-Type is a relatively small string, so it is faster to use `String#charCodeAt`.
if (!isAsciiString(contentType)) {
contentType = ''
}
// 5.10.3. Let value be a new File object with name filename, type contentType, and body body.
value = new File([body], filename, { type: contentType })
} else {
// 5.11. Otherwise:
// 5.11.1. Let value be the UTF-8 decoding without BOM of body.
value = utf8DecodeBytes(Buffer.from(body))
}
// 5.12. Assert: name is a scalar value string and value is either a scalar value string or a File object.
assert(webidl.is.USVString(name))
assert((typeof value === 'string' && webidl.is.USVString(value)) || webidl.is.File(value))
// 5.13. Create an entry with name and value, and append it to entry list.
entryList.push(makeEntry(name, value, filename))
}
}
/**
* Parses content-disposition attributes (e.g., name="value" or filename*=utf-8''encoded)
* @param {Buffer} input
* @param {{ position: number }} position
* @returns {{ name: string, value: string }}
*/
function parseContentDispositionAttribute (input, position) {
// Skip leading semicolon and whitespace
if (input[position.position] === 0x3b /* ; */) {
position.position++
}
// Skip whitespace
collectASequenceOfBytes(
(char) => char === 0x20 || char === 0x09,
input,
position
)
// Collect attribute name (token characters)
const attributeName = collectASequenceOfBytes(
(char) => isToken(char) && char !== 0x3d && char !== 0x2a, // not = or *
input,
position
)
if (attributeName.length === 0) {
return null
}
const attrNameStr = attributeName.toString('ascii').toLowerCase()
// Check for extended notation (attribute*)
const isExtended = input[position.position] === 0x2a /* * */
if (isExtended) {
position.position++ // skip *
}
// Expect = sign
if (input[position.position] !== 0x3d /* = */) {
return null
}
position.position++ // skip =
// Skip whitespace
collectASequenceOfBytes(
(char) => char === 0x20 || char === 0x09,
input,
position
)
let value
if (isExtended) {
// Extended attribute format: charset'language'encoded-value
const headerValue = collectASequenceOfBytes(
(char) => char !== 0x20 && char !== 0x0d && char !== 0x0a && char !== 0x3b, // not space, CRLF, or ;
input,
position
)
// Check for utf-8'' prefix (case insensitive)
if (
(headerValue[0] !== 0x75 && headerValue[0] !== 0x55) || // u or U
(headerValue[1] !== 0x74 && headerValue[1] !== 0x54) || // t or T
(headerValue[2] !== 0x66 && headerValue[2] !== 0x46) || // f or F
headerValue[3] !== 0x2d || // -
headerValue[4] !== 0x38 // 8
) {
throw parsingError('unknown encoding, expected utf-8\'\'')
}
// Skip utf-8'' and decode the rest
value = decodeURIComponent(decoder.decode(headerValue.subarray(7)))
} else if (input[position.position] === 0x22 /* " */) {
// Quoted string
position.position++ // skip opening quote
const quotedValue = collectASequenceOfBytes(
(char) => char !== 0x0a && char !== 0x0d && char !== 0x22, // not LF, CR, or "
input,
position
)
if (input[position.position] !== 0x22) {
throw parsingError('Closing quote not found')
}
position.position++ // skip closing quote
value = decoder.decode(quotedValue)
.replace(/%0A/ig, '\n')
.replace(/%0D/ig, '\r')
.replace(/%22/g, '"')
} else {
// Token value (no quotes)
const tokenValue = collectASequenceOfBytes(
(char) => isToken(char) && char !== 0x3b, // not ;
input,
position
)
value = decoder.decode(tokenValue)
}
return { name: attrNameStr, value }
}
/**
* @see https://andreubotella.github.io/multipart-form-data/#parse-multipart-form-data-headers
* @param {Buffer} input
* @param {{ position: number }} position
*/
function parseMultipartFormDataHeaders (input, position) {
// 1. Let name, filename and contentType be null.
let name = null
let filename = null
let contentType = null
let encoding = null
// 2. While true:
while (true) {
// 2.1. If position points to a sequence of bytes starting with 0x0D 0x0A (CR LF):
if (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {
// 2.1.1. If name is null, return failure.
if (name === null) {
throw parsingError('header name is null')
}
// 2.1.2. Return name, filename and contentType.
return { name, filename, contentType, encoding }
}
// 2.2. Let header name be the result of collecting a sequence of bytes that are
// not 0x0A (LF), 0x0D (CR) or 0x3A (:), given position.
let headerName = collectASequenceOfBytes(
(char) => char !== 0x0a && char !== 0x0d && char !== 0x3a,
input,
position
)
// 2.3. Remove any HTTP tab or space bytes from the start or end of header name.
headerName = removeChars(headerName, true, true, (char) => char === 0x9 || char === 0x20)
// 2.4. If header name does not match the field-name token production, return failure.
if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {
throw parsingError('header name does not match the field-name token production')
}
// 2.5. If the byte at position is not 0x3A (:), return failure.
if (input[position.position] !== 0x3a) {
throw parsingError('expected :')
}
// 2.6. Advance position by 1.
position.position++
// 2.7. Collect a sequence of bytes that are HTTP tab or space bytes given position.
// (Do nothing with those bytes.)
collectASequenceOfBytes(
(char) => char === 0x20 || char === 0x09,
input,
position
)
// 2.8. Byte-lowercase header name and switch on the result:
switch (bufferToLowerCasedHeaderName(headerName)) {
case 'content-disposition': {
name = filename = null
// Collect the disposition type (should be "form-data")
const dispositionType = collectASequenceOfBytes(
(char) => isToken(char),
input,
position
)
if (dispositionType.toString('ascii').toLowerCase() !== 'form-data') {
throw parsingError('expected form-data for content-disposition header')
}
// Parse attributes recursively until CRLF
while (
position.position < input.length &&
input[position.position] !== 0x0d &&
input[position.position + 1] !== 0x0a
) {
const attribute = parseContentDispositionAttribute(input, position)
if (!attribute) {
break
}
if (attribute.name === 'name') {
name = attribute.value
} else if (attribute.name === 'filename') {
filename = attribute.value
}
}
if (name === null) {
throw parsingError('name attribute is required in content-disposition header')
}
break
}
case 'content-type': {
// 1. Let header value be the result of collecting a sequence of bytes that are
// not 0x0A (LF) or 0x0D (CR), given position.
let headerValue = collectASequenceOfBytes(
(char) => char !== 0x0a && char !== 0x0d,
input,
position
)
// 2. Remove any HTTP tab or space bytes from the end of header value.
headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)
// 3. Set contentType to the isomorphic decoding of header value.
contentType = isomorphicDecode(headerValue)
break
}
case 'content-transfer-encoding': {
let headerValue = collectASequenceOfBytes(
(char) => char !== 0x0a && char !== 0x0d,
input,
position
)
headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)
encoding = isomorphicDecode(headerValue)
break
}
default: {
// Collect a sequence of bytes that are not 0x0A (LF) or 0x0D (CR), given position.
// (Do nothing with those bytes.)
collectASequenceOfBytes(
(char) => char !== 0x0a && char !== 0x0d,
input,
position
)
}
}
// 2.9. If position does not point to a sequence of bytes starting with 0x0D 0x0A
// (CR LF), return failure. Otherwise, advance position by 2 (past the newline).
if (input[position.position] !== 0x0d && input[position.position + 1] !== 0x0a) {
throw parsingError('expected CRLF')
} else {
position.position += 2
}
}
}
/**
* @param {(char: number) => boolean} condition
* @param {Buffer} input
* @param {{ position: number }} position
*/
function collectASequenceOfBytes (condition, input, position) {
let start = position.position
while (start < input.length && condition(input[start])) {
++start
}
return input.subarray(position.position, (position.position = start))
}
/**
* @param {Buffer} buf
* @param {boolean} leading
* @param {boolean} trailing
* @param {(charCode: number) => boolean} predicate
* @returns {Buffer}
*/
function removeChars (buf, leading, trailing, predicate) {
let lead = 0
let trail = buf.length - 1
if (leading) {
while (lead < buf.length && predicate(buf[lead])) lead++
}
if (trailing) {
while (trail > 0 && predicate(buf[trail])) trail--
}
return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1)
}
/**
* Checks if {@param buffer} starts with {@param start}
* @param {Buffer} buffer
* @param {Buffer} start
* @param {{ position: number }} position
*/
function bufferStartsWith (buffer, start, position) {
if (buffer.length < start.length) {
return false
}
for (let i = 0; i < start.length; i++) {
if (start[i] !== buffer[position.position + i]) {
return false
}
}
return true
}
function parsingError (cause) {
return new TypeError('Failed to parse body as FormData.', { cause: new TypeError(cause) })
}
/**
* CTL = <any US-ASCII control character
* (octets 0 - 31) and DEL (127)>
* @param {number} char
*/
function isCTL (char) {
return char <= 0x1f || char === 0x7f
}
/**
* tspecials := "(" / ")" / "<" / ">" / "@" /
* "," / ";" / ":" / "\" / <">
* "/" / "[" / "]" / "?" / "="
* ; Must be in quoted-string,
* ; to use within parameter values
* @param {number} char
*/
function isTSpecial (char) {
return (
char === 0x28 || // (
char === 0x29 || // )
char === 0x3c || // <
char === 0x3e || // >
char === 0x40 || // @
char === 0x2c || // ,
char === 0x3b || // ;
char === 0x3a || // :
char === 0x5c || // \
char === 0x22 || // "
char === 0x2f || // /
char === 0x5b || // [
char === 0x5d || // ]
char === 0x3f || // ?
char === 0x3d // +
)
}
/**
* token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
* or tspecials>
* @param {number} char
*/
function isToken (char) {
return (
char <= 0x7f && // ascii
char !== 0x20 && // space
char !== 0x09 &&
!isCTL(char) &&
!isTSpecial(char)
)
}
module.exports = {
multipartFormDataParser,
validateBoundary
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"handleTaskError.d.ts","sourceRoot":"","sources":["../../../src/queues/errors/handleTaskError.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAU,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAA;AAC7F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAQ3C,wBAAsB,eAAe,CAAC,EACpC,KAAK,EACL,GAAG,EACH,MAAc,EACd,SAAS,GACV,EAAE;IACD,KAAK,EAAE,SAAS,CAAA;IAChB,GAAG,EAAE,cAAc,CAAA;IACnB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,SAAS,EAAE,iBAAiB,CAAA;CAC7B,GAAG,OAAO,CAAC;IACV,aAAa,EAAE,OAAO,CAAA;CACvB,CAAC,CA0JD"}

View File

@@ -0,0 +1,3 @@
import * as z from "./external.cjs";
export * from "./external.cjs";
export { z };

View File

@@ -0,0 +1,131 @@
# proxy-from-env
[![Build Status](https://travis-ci.org/Rob--W/proxy-from-env.svg?branch=master)](https://travis-ci.org/Rob--W/proxy-from-env)
[![Coverage Status](https://coveralls.io/repos/github/Rob--W/proxy-from-env/badge.svg?branch=master)](https://coveralls.io/github/Rob--W/proxy-from-env?branch=master)
`proxy-from-env` is a Node.js package that exports a function (`getProxyForUrl`)
that takes an input URL (a string or
[`url.parse`](https://nodejs.org/docs/latest/api/url.html#url_url_parsing)'s
return value) and returns the desired proxy URL (also a string) based on
standard proxy environment variables. If no proxy is set, an empty string is
returned.
It is your responsibility to actually proxy the request using the given URL.
Installation:
```sh
npm install proxy-from-env
```
## Example
This example shows how the data for a URL can be fetched via the
[`http` module](https://nodejs.org/api/http.html), in a proxy-aware way.
```javascript
var http = require('http');
var parseUrl = require('url').parse;
var getProxyForUrl = require('proxy-from-env').getProxyForUrl;
var some_url = 'http://example.com/something';
// // Example, if there is a proxy server at 10.0.0.1:1234, then setting the
// // http_proxy environment variable causes the request to go through a proxy.
// process.env.http_proxy = 'http://10.0.0.1:1234';
//
// // But if the host to be proxied is listed in NO_PROXY, then the request is
// // not proxied (but a direct request is made).
// process.env.no_proxy = 'example.com';
var proxy_url = getProxyForUrl(some_url); // <-- Our magic.
if (proxy_url) {
// Should be proxied through proxy_url.
var parsed_some_url = parseUrl(some_url);
var parsed_proxy_url = parseUrl(proxy_url);
// A HTTP proxy is quite simple. It is similar to a normal request, except the
// path is an absolute URL, and the proxied URL's host is put in the header
// instead of the server's actual host.
httpOptions = {
protocol: parsed_proxy_url.protocol,
hostname: parsed_proxy_url.hostname,
port: parsed_proxy_url.port,
path: parsed_some_url.href,
headers: {
Host: parsed_some_url.host, // = host name + optional port.
},
};
} else {
// Direct request.
httpOptions = some_url;
}
http.get(httpOptions, function(res) {
var responses = [];
res.on('data', function(chunk) { responses.push(chunk); });
res.on('end', function() { console.log(responses.join('')); });
});
```
## Environment variables
The environment variables can be specified in lowercase or uppercase, with the
lowercase name having precedence over the uppercase variant. A variable that is
not set has the same meaning as a variable that is set but has no value.
### NO\_PROXY
`NO_PROXY` is a list of host names (optionally with a port). If the input URL
matches any of the entries in `NO_PROXY`, then the input URL should be fetched
by a direct request (i.e. without a proxy).
Matching follows the following rules:
- `NO_PROXY=*` disables all proxies.
- Space and commas may be used to separate the entries in the `NO_PROXY` list.
- If `NO_PROXY` does not contain any entries, then proxies are never disabled.
- If a port is added after the host name, then the ports must match. If the URL
does not have an explicit port name, the protocol's default port is used.
- Generally, the proxy is only disabled if the host name is an exact match for
an entry in the `NO_PROXY` list. The only exceptions are entries that start
with a dot or with a wildcard; then the proxy is disabled if the host name
ends with the entry.
See `test.js` for examples of what should match and what does not.
### \*\_PROXY
The environment variable used for the proxy depends on the protocol of the URL.
For example, `https://example.com` uses the "https" protocol, and therefore the
proxy to be used is `HTTPS_PROXY` (_NOT_ `HTTP_PROXY`, which is _only_ used for
http:-URLs).
The library is not limited to http(s), other schemes such as
`FTP_PROXY` (ftp:),
`WSS_PROXY` (wss:),
`WS_PROXY` (ws:)
are also supported.
If present, `ALL_PROXY` is used as fallback if there is no other match.
## External resources
The exact way of parsing the environment variables is not codified in any
standard. This library is designed to be compatible with formats as expected by
existing software.
The following resources were used to determine the desired behavior:
- cURL:
https://curl.haxx.se/docs/manpage.html#ENVIRONMENT
https://github.com/curl/curl/blob/4af40b3646d3b09f68e419f7ca866ff395d1f897/lib/url.c#L4446-L4514
https://github.com/curl/curl/blob/4af40b3646d3b09f68e419f7ca866ff395d1f897/lib/url.c#L4608-L4638
- wget:
https://www.gnu.org/software/wget/manual/wget.html#Proxies
http://git.savannah.gnu.org/cgit/wget.git/tree/src/init.c?id=636a5f9a1c508aa39e35a3a8e9e54520a284d93d#n383
http://git.savannah.gnu.org/cgit/wget.git/tree/src/retr.c?id=93c1517c4071c4288ba5a4b038e7634e4c6b5482#n1278
- W3:
https://www.w3.org/Daemon/User/Proxies/ProxyClients.html
- Python's urllib:
https://github.com/python/cpython/blob/936135bb97fe04223aa30ca6e98eac8f3ed6b349/Lib/urllib/request.py#L755-L782
https://github.com/python/cpython/blob/936135bb97fe04223aa30ca6e98eac8f3ed6b349/Lib/urllib/request.py#L2444-L2479

View File

@@ -0,0 +1 @@
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/baggage/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;AAEhC;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,UAAwC,EAAE;IAE1C,OAAO,IAAI,WAAW,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAC5C,GAAW;IAEX,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,IAAI,CAAC,KAAK,CACR,qDAAqD,OAAO,GAAG,EAAE,CAClE,CAAC;QACF,GAAG,GAAG,EAAE,CAAC;KACV;IAED,OAAO;QACL,QAAQ,EAAE,0BAA0B;QACpC,QAAQ;YACN,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DiagAPI } from '../api/diag';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\nimport { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';\n\nconst diag = DiagAPI.instance();\n\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nexport function createBaggage(\n entries: Record<string, BaggageEntry> = {}\n): Baggage {\n return new BaggageImpl(new Map(Object.entries(entries)));\n}\n\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n */\nexport function baggageEntryMetadataFromString(\n str: string\n): BaggageEntryMetadata {\n if (typeof str !== 'string') {\n diag.error(\n `Cannot create baggage metadata from unknown type: ${typeof str}`\n );\n str = '';\n }\n\n return {\n __TYPE__: baggageEntryMetadataSymbol,\n toString() {\n return str;\n },\n };\n}\n"]}

View File

@@ -0,0 +1,55 @@
/**
* 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 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.
*
*/
// Do not require this module directly! Use normal `invariant` calls.
function formatDevErrorMessage(message) {
throw new Error(message);
}
const LexicalComposerContext = /*#__PURE__*/react.createContext(null);
function createLexicalComposerContext(parent, theme) {
let parentContext = null;
if (parent != null) {
parentContext = parent[1];
}
function getTheme() {
if (theme != null) {
return theme;
}
return parentContext != null ? parentContext.getTheme() : null;
}
return {
getTheme
};
}
function useLexicalComposerContext() {
const composerContext = react.useContext(LexicalComposerContext);
if (composerContext == null) {
{
formatDevErrorMessage(`LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext`);
}
}
return composerContext;
}
exports.LexicalComposerContext = LexicalComposerContext;
exports.createLexicalComposerContext = createLexicalComposerContext;
exports.useLexicalComposerContext = useLexicalComposerContext;

View File

@@ -0,0 +1 @@
{"version":3,"file":"pickaxe.js","sources":["../../../src/icons/pickaxe.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Pickaxe\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTQuNTMxIDEyLjQ2OSA2LjYxOSAyMC4zOGExIDEgMCAxIDEtMy0zbDcuOTEyLTcuOTEyIiAvPgogIDxwYXRoIGQ9Ik0xNS42ODYgNC4zMTRBMTIuNSAxMi41IDAgMCAwIDUuNDYxIDIuOTU4IDEgMSAwIDAgMCA1LjU4IDQuNzFhMjIgMjIgMCAwIDEgNi4zMTggMy4zOTMiIC8+CiAgPHBhdGggZD0iTTE3LjcgMy43YTEgMSAwIDAgMC0xLjQgMGwtNC42IDQuNmExIDEgMCAwIDAgMCAxLjRsMi42IDIuNmExIDEgMCAwIDAgMS40IDBsNC42LTQuNmExIDEgMCAwIDAgMC0xLjR6IiAvPgogIDxwYXRoIGQ9Ik0xOS42ODYgOC4zMTRhMTIuNTAxIDEyLjUwMSAwIDAgMSAxLjM1NiAxMC4yMjUgMSAxIDAgMCAxLTEuNzUxLS4xMTkgMjIgMjIgMCAwIDAtMy4zOTMtNi4zMTkiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/pickaxe\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 Pickaxe = createLucideIcon('Pickaxe', [\n ['path', { d: 'M14.531 12.469 6.619 20.38a1 1 0 1 1-3-3l7.912-7.912', key: 'we99rg' }],\n [\n 'path',\n {\n d: 'M15.686 4.314A12.5 12.5 0 0 0 5.461 2.958 1 1 0 0 0 5.58 4.71a22 22 0 0 1 6.318 3.393',\n key: '1w6hck',\n },\n ],\n [\n 'path',\n {\n d: 'M17.7 3.7a1 1 0 0 0-1.4 0l-4.6 4.6a1 1 0 0 0 0 1.4l2.6 2.6a1 1 0 0 0 1.4 0l4.6-4.6a1 1 0 0 0 0-1.4z',\n key: '15hgfx',\n },\n ],\n [\n 'path',\n {\n d: 'M19.686 8.314a12.501 12.501 0 0 1 1.356 10.225 1 1 0 0 1-1.751-.119 22 22 0 0 0-3.393-6.319',\n key: '452b4h',\n },\n ],\n]);\n\nexport default Pickaxe;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACrF,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;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,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;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,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;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,16 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Terminal = createLucideIcon("Terminal", [
["polyline", { points: "4 17 10 11 4 5", key: "akl6gq" }],
["line", { x1: "12", x2: "20", y1: "19", y2: "19", key: "q2wloq" }]
]);
export { Terminal as default };
//# sourceMappingURL=terminal.js.map

View File

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

View File

@@ -0,0 +1,74 @@
"use strict";
exports.setDefaultOptions = setDefaultOptions;
var _index = require("./_lib/defaultOptions.cjs");
/**
* @name setDefaultOptions
* @category Common Helpers
* @summary Set default options including locale.
* @pure false
*
* @description
* Sets the defaults for
* `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
* arguments for all functions.
*
* @param options - An object with options
*
* @example
* // Set global locale:
* import { es } from 'date-fns/locale'
* setDefaultOptions({ locale: es })
* const result = format(new Date(2014, 8, 2), 'PPPP')
* //=> 'martes, 2 de septiembre de 2014'
*
* @example
* // Start of the week for 2 September 2014:
* const result = startOfWeek(new Date(2014, 8, 2))
* //=> Sun Aug 31 2014 00:00:00
*
* @example
* // Start of the week for 2 September 2014,
* // when we set that week starts on Monday by default:
* setDefaultOptions({ weekStartsOn: 1 })
* const result = startOfWeek(new Date(2014, 8, 2))
* //=> Mon Sep 01 2014 00:00:00
*
* @example
* // Manually set options take priority over default options:
* setDefaultOptions({ weekStartsOn: 1 })
* const result = startOfWeek(new Date(2014, 8, 2), { weekStartsOn: 0 })
* //=> Sun Aug 31 2014 00:00:00
*
* @example
* // Remove the option by setting it to `undefined`:
* setDefaultOptions({ weekStartsOn: 1 })
* setDefaultOptions({ weekStartsOn: undefined })
* const result = startOfWeek(new Date(2014, 8, 2))
* //=> Sun Aug 31 2014 00:00:00
*/
function setDefaultOptions(options) {
const result = {};
const defaultOptions = (0, _index.getDefaultOptions)();
for (const property in defaultOptions) {
if (Object.prototype.hasOwnProperty.call(defaultOptions, property)) {
// [TODO] I challenge you to fix the type
result[property] = defaultOptions[property];
}
}
for (const property in options) {
if (Object.prototype.hasOwnProperty.call(options, property)) {
if (options[property] === undefined) {
// [TODO] I challenge you to fix the type
delete result[property];
} else {
// [TODO] I challenge you to fix the type
result[property] = options[property];
}
}
}
(0, _index.setDefaultOptions)(result);
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,QAAA,YAAY,GAAG,yCAAyC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const PACKAGE_VERSION = '0.57.0';\nexport const PACKAGE_NAME = '@opentelemetry/instrumentation-mongoose';\n"]}

View File

@@ -0,0 +1,137 @@
'use strict'
const {
PoolBase,
kClients,
kNeedDrain,
kAddClient,
kGetDispatcher,
kRemoveClient
} = require('./pool-base')
const Client = require('./client')
const {
InvalidArgumentError
} = require('../core/errors')
const util = require('../core/util')
const { kUrl } = require('../core/symbols')
const buildConnector = require('../core/connect')
const kOptions = Symbol('options')
const kConnections = Symbol('connections')
const kFactory = Symbol('factory')
const kIndex = Symbol('index')
function defaultFactory (origin, opts) {
return new Client(origin, opts)
}
class RoundRobinPool extends PoolBase {
constructor (origin, {
connections,
factory = defaultFactory,
connect,
connectTimeout,
tls,
maxCachedSessions,
socketPath,
autoSelectFamily,
autoSelectFamilyAttemptTimeout,
allowH2,
clientTtl,
...options
} = {}) {
if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
throw new InvalidArgumentError('invalid connections')
}
if (typeof factory !== 'function') {
throw new InvalidArgumentError('factory must be a function.')
}
if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
throw new InvalidArgumentError('connect must be a function or an object')
}
if (typeof connect !== 'function') {
connect = buildConnector({
...tls,
maxCachedSessions,
allowH2,
socketPath,
timeout: connectTimeout,
...(typeof autoSelectFamily === 'boolean' ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
...connect
})
}
super()
this[kConnections] = connections || null
this[kUrl] = util.parseOrigin(origin)
this[kOptions] = { ...util.deepClone(options), connect, allowH2, clientTtl }
this[kOptions].interceptors = options.interceptors
? { ...options.interceptors }
: undefined
this[kFactory] = factory
this[kIndex] = -1
this.on('connect', (origin, targets) => {
if (clientTtl != null && clientTtl > 0) {
for (const target of targets) {
Object.assign(target, { ttl: Date.now() })
}
}
})
this.on('connectionError', (origin, targets, error) => {
for (const target of targets) {
const idx = this[kClients].indexOf(target)
if (idx !== -1) {
this[kClients].splice(idx, 1)
}
}
})
}
[kGetDispatcher] () {
const clientTtlOption = this[kOptions].clientTtl
const clientsLength = this[kClients].length
// If we have no clients yet, create one
if (clientsLength === 0) {
const dispatcher = this[kFactory](this[kUrl], this[kOptions])
this[kAddClient](dispatcher)
return dispatcher
}
// Round-robin through existing clients
let checked = 0
while (checked < clientsLength) {
this[kIndex] = (this[kIndex] + 1) % clientsLength
const client = this[kClients][this[kIndex]]
// Check if client is stale (TTL expired)
if (clientTtlOption != null && clientTtlOption > 0 && client.ttl && ((Date.now() - client.ttl) > clientTtlOption)) {
this[kRemoveClient](client)
checked++
continue
}
// Return client if it's not draining
if (!client[kNeedDrain]) {
return client
}
checked++
}
// All clients are busy, create a new one if we haven't reached the limit
if (!this[kConnections] || clientsLength < this[kConnections]) {
const dispatcher = this[kFactory](this[kUrl], this[kOptions])
this[kAddClient](dispatcher)
return dispatcher
}
}
}
module.exports = RoundRobinPool

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/versions/defaults.ts"],"sourcesContent":["export const versionDefaults = {\n autosaveInterval: 2000,\n}\n"],"names":["versionDefaults","autosaveInterval"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB;IAC7BC,kBAAkB;AACpB,EAAC"}

View File

@@ -0,0 +1 @@
module.exports={C:{"5":0.06287,"52":0.01143,"78":0.00572,"108":0.00572,"115":0.1143,"124":0.00572,"128":0.00572,"134":0.00572,"136":0.00572,"140":0.01715,"143":0.00572,"144":0.01143,"145":0.30861,"146":0.50292,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 109 110 111 112 113 114 116 117 118 119 120 121 122 123 125 126 127 129 130 131 132 133 135 137 138 139 141 142 147 148 149 3.5 3.6"},D:{"39":0.00572,"47":0.00572,"48":0.01143,"49":0.00572,"50":0.00572,"56":0.02286,"62":0.00572,"63":0.00572,"64":0.00572,"65":0.01715,"66":0.00572,"68":0.01143,"69":0.06858,"70":0.01143,"71":0.00572,"72":0.00572,"73":0.01143,"74":0.00572,"75":0.00572,"78":0.00572,"79":0.01715,"81":0.00572,"83":0.01143,"85":0.01143,"86":0.01143,"87":0.03429,"88":0.00572,"89":0.00572,"90":0.00572,"91":0.00572,"95":0.00572,"98":0.01143,"99":0.00572,"102":0.01715,"103":0.3029,"104":0.30861,"105":0.28575,"106":0.3029,"107":0.29718,"108":0.29718,"109":2.02311,"110":0.31433,"111":0.36005,"112":14.00747,"114":0.01715,"116":0.61151,"117":0.29147,"119":0.04001,"120":0.30861,"121":0.01715,"122":0.09144,"123":0.01143,"124":0.30861,"125":0.36005,"126":4.62915,"127":0.01715,"128":0.03429,"129":0.01715,"130":0.01143,"131":0.66294,"132":0.09716,"133":0.60579,"134":0.04001,"135":0.04001,"136":0.04001,"137":0.05144,"138":0.1143,"139":0.37719,"140":0.08573,"141":0.17717,"142":5.73786,"143":9.4469,"144":0.00572,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 40 41 42 43 44 45 46 51 52 53 54 55 57 58 59 60 61 67 76 77 80 84 92 93 94 96 97 100 101 113 115 118 145 146"},F:{"40":0.00572,"46":0.00572,"79":0.00572,"82":0.00572,"85":0.00572,"93":0.02858,"95":0.0743,"122":0.00572,"123":0.01715,"124":1.49733,"125":0.52578,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 83 84 86 87 88 89 90 91 92 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00572,"92":0.01715,"100":0.00572,"109":0.01715,"115":0.00572,"122":0.00572,"125":0.00572,"129":0.00572,"131":0.00572,"132":0.00572,"134":0.00572,"135":0.00572,"136":0.00572,"137":0.00572,"138":0.01143,"139":0.00572,"140":0.01143,"141":0.05144,"142":0.61151,"143":1.93167,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 114 116 117 118 119 120 121 123 124 126 127 128 130 133"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 12.1 13.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.2 17.4 18.0 18.2 26.3","11.1":0.00572,"14.1":0.00572,"15.6":0.01715,"16.6":0.02286,"17.1":0.00572,"17.3":0.00572,"17.5":0.00572,"17.6":0.02858,"18.1":0.00572,"18.3":0.00572,"18.4":0.00572,"18.5-18.6":0.01143,"26.0":0.00572,"26.1":0.05144,"26.2":0.01715},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00085,"5.0-5.1":0,"6.0-6.1":0.0017,"7.0-7.1":0.00127,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00339,"10.0-10.2":0.00042,"10.3":0.00593,"11.0-11.2":0.07289,"11.3-11.4":0.00212,"12.0-12.1":0.0017,"12.2-12.5":0.01907,"13.0-13.1":0.00042,"13.2":0.00297,"13.3":0.00085,"13.4-13.7":0.00297,"14.0-14.4":0.00593,"14.5-14.8":0.00636,"15.0-15.1":0.00678,"15.2-15.3":0.00509,"15.4":0.00551,"15.5":0.00593,"15.6-15.8":0.09196,"16.0":0.01059,"16.1":0.02034,"16.2":0.01059,"16.3":0.01907,"16.4":0.00466,"16.5":0.00805,"16.6-16.7":0.11951,"17.0":0.00678,"17.1":0.01102,"17.2":0.00805,"17.3":0.01229,"17.4":0.02077,"17.5":0.04068,"17.6-17.7":0.09408,"18.0":0.02119,"18.1":0.04407,"18.2":0.02331,"18.3":0.07586,"18.4":0.03899,"18.5-18.7":2.79953,"26.0":0.05467,"26.1":0.45472,"26.2":0.08645,"26.3":0.00381},P:{"4":0.07176,"20":0.01025,"21":0.01025,"22":0.01025,"23":0.01025,"24":0.01025,"25":0.03076,"26":0.03076,"27":0.03076,"28":0.10252,"29":0.69713,_:"5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 18.0 19.0","7.2-7.4":0.07176,"17.0":0.01025},I:{"0":0.03423,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00003},A:{"8":0.06644,"9":0.01107,"10":0.02215,"11":0.25467,_:"6 7 5.5"},K:{"0":0.12712,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{"0":0.03428},H:{"0":0.01},L:{"0":43.40324},R:{_:"0"},M:{"0":0.07285}};

View File

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

View File

@@ -0,0 +1,134 @@
const formatDistanceLocale = {
lessThanXSeconds: {
one: "أقل من ثانية",
two: "أقل من زوز ثواني",
threeToTen: "أقل من {{count}} ثواني",
other: "أقل من {{count}} ثانية",
},
xSeconds: {
one: "ثانية",
two: "زوز ثواني",
threeToTen: "{{count}} ثواني",
other: "{{count}} ثانية",
},
halfAMinute: "نص دقيقة",
lessThanXMinutes: {
one: "أقل من دقيقة",
two: "أقل من دقيقتين",
threeToTen: "أقل من {{count}} دقايق",
other: "أقل من {{count}} دقيقة",
},
xMinutes: {
one: "دقيقة",
two: "دقيقتين",
threeToTen: "{{count}} دقايق",
other: "{{count}} دقيقة",
},
aboutXHours: {
one: "ساعة تقريب",
two: "ساعتين تقريب",
threeToTen: "{{count}} سوايع تقريب",
other: "{{count}} ساعة تقريب",
},
xHours: {
one: "ساعة",
two: "ساعتين",
threeToTen: "{{count}} سوايع",
other: "{{count}} ساعة",
},
xDays: {
one: "نهار",
two: "نهارين",
threeToTen: "{{count}} أيام",
other: "{{count}} يوم",
},
aboutXWeeks: {
one: "جمعة تقريب",
two: "جمعتين تقريب",
threeToTen: "{{count}} جماع تقريب",
other: "{{count}} جمعة تقريب",
},
xWeeks: {
one: "جمعة",
two: "جمعتين",
threeToTen: "{{count}} جماع",
other: "{{count}} جمعة",
},
aboutXMonths: {
one: "شهر تقريب",
two: "شهرين تقريب",
threeToTen: "{{count}} أشهرة تقريب",
other: "{{count}} شهر تقريب",
},
xMonths: {
one: "شهر",
two: "شهرين",
threeToTen: "{{count}} أشهرة",
other: "{{count}} شهر",
},
aboutXYears: {
one: "عام تقريب",
two: "عامين تقريب",
threeToTen: "{{count}} أعوام تقريب",
other: "{{count}} عام تقريب",
},
xYears: {
one: "عام",
two: "عامين",
threeToTen: "{{count}} أعوام",
other: "{{count}} عام",
},
overXYears: {
one: "أكثر من عام",
two: "أكثر من عامين",
threeToTen: "أكثر من {{count}} أعوام",
other: "أكثر من {{count}} عام",
},
almostXYears: {
one: "عام تقريب",
two: "عامين تقريب",
threeToTen: "{{count}} أعوام تقريب",
other: "{{count}} عام تقريب",
},
};
export const formatDistance = (token, count, options) => {
const usageGroup = formatDistanceLocale[token];
let result;
if (typeof usageGroup === "string") {
result = usageGroup;
} else if (count === 1) {
result = usageGroup.one;
} else if (count === 2) {
result = usageGroup.two;
} else if (count <= 10) {
result = usageGroup.threeToTen.replace("{{count}}", String(count));
} else {
result = usageGroup.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "في " + result;
} else {
return "عندو " + result;
}
}
return result;
};

View File

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

View File

@@ -0,0 +1,2 @@
var EventEmitter = require("events");
module.exports = new EventEmitter();

View File

@@ -0,0 +1,92 @@
{
"name": "parseley",
"version": "0.12.1",
"description": "CSS selectors parser",
"keywords": [
"CSS",
"selectors",
"parser",
"AST",
"serializer",
"specificity"
],
"repository": {
"type": "git",
"url": "git+https://github.com/mxxii/parseley.git"
},
"bugs": {
"url": "https://github.com/mxxii/parseley/issues"
},
"homepage": "https://github.com/mxxii/parseley",
"author": "KillyMXI",
"funding": "https://ko-fi.com/killymxi",
"license": "MIT",
"exports": {
"import": "./lib/parseley.mjs",
"require": "./lib/parseley.cjs"
},
"type": "module",
"main": "./lib/parseley.cjs",
"module": "./lib/parseley.mjs",
"types": "./lib/parseley.d.ts",
"files": [
"lib"
],
"sideEffects": false,
"scripts": {
"build:deno": "denoify",
"build:docs": "typedoc --plugin typedoc-plugin-markdown",
"build:rollup": "rollup -c",
"build:types": "tsc --declaration --emitDeclarationOnly",
"build": "npm run clean && npm run build:rollup && npm run build:types && npm run build:docs && npm run build:deno",
"checkAll": "npm run lint && npm test",
"clean": "rimraf lib",
"example": "node ./example/example.mjs",
"lint:eslint": "eslint .",
"lint:md": "markdownlint-cli2",
"lint": "npm run lint:eslint && npm run lint:md",
"prepublishOnly": "npm run build && npm run checkAll",
"test": "ava --timeout=20s"
},
"dependencies": {
"leac": "^0.6.0",
"peberminta": "^0.9.0"
},
"devDependencies": {
"@rollup/plugin-typescript": "^11.1.0",
"@tsconfig/node14": "^1.0.3",
"@types/node": "^14.18.42",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"ava": "^5.2.0",
"denoify": "^1.5.3",
"eslint": "^8.39.0",
"eslint-plugin-jsonc": "^2.7.0",
"eslint-plugin-tsdoc": "^0.2.17",
"markdownlint-cli2": "^0.7.0",
"rimraf": "^5.0.0",
"rollup": "^2.79.1",
"rollup-plugin-cleanup": "^3.2.1",
"ts-node": "^10.9.1",
"tslib": "^2.5.0",
"typedoc": "~0.23.28",
"typedoc-plugin-markdown": "~3.14.0",
"typescript": "~4.9.5"
},
"ava": {
"extensions": {
"ts": "module"
},
"files": [
"test/**/*"
],
"nodeArguments": [
"--loader=ts-node/esm",
"--experimental-specifier-resolution=node"
],
"verbose": true
},
"denoify": {
"out": "./deno"
}
}

View File

@@ -0,0 +1,48 @@
import { entityKind } from "../entity.js";
import type { AnyPgColumn, PgColumn } from "./columns/index.js";
import type { PgTable } from "./table.js";
export type UpdateDeleteAction = 'cascade' | 'restrict' | 'no action' | 'set null' | 'set default';
export type Reference = () => {
readonly name?: string;
readonly columns: PgColumn[];
readonly foreignTable: PgTable;
readonly foreignColumns: PgColumn[];
};
export declare class ForeignKeyBuilder {
static readonly [entityKind]: string;
constructor(config: () => {
name?: string;
columns: PgColumn[];
foreignColumns: PgColumn[];
}, actions?: {
onUpdate?: UpdateDeleteAction;
onDelete?: UpdateDeleteAction;
} | undefined);
onUpdate(action: UpdateDeleteAction): this;
onDelete(action: UpdateDeleteAction): this;
}
export type AnyForeignKeyBuilder = ForeignKeyBuilder;
export declare class ForeignKey {
readonly table: PgTable;
static readonly [entityKind]: string;
readonly reference: Reference;
readonly onUpdate: UpdateDeleteAction | undefined;
readonly onDelete: UpdateDeleteAction | undefined;
constructor(table: PgTable, builder: ForeignKeyBuilder);
getName(): string;
}
type ColumnsWithTable<TTableName extends string, TColumns extends PgColumn[]> = {
[Key in keyof TColumns]: AnyPgColumn<{
tableName: TTableName;
}>;
};
export declare function foreignKey<TTableName extends string, TForeignTableName extends string, TColumns extends [AnyPgColumn<{
tableName: TTableName;
}>, ...AnyPgColumn<{
tableName: TTableName;
}>[]]>(config: {
name?: string;
columns: TColumns;
foreignColumns: ColumnsWithTable<TForeignTableName, TColumns>;
}): ForeignKeyBuilder;
export {};

View File

@@ -0,0 +1,107 @@
import { escapeSQLValue } from '../../utilities/escapeSQLValue.js';
const fromArray = ({ isRoot, operator, pathSegments, table, treatAsArray, value })=>{
const newPathSegments = pathSegments.slice(1);
const alias = `${pathSegments[isRoot ? 0 : 1]}_alias_${newPathSegments.length}`;
return `EXISTS (
SELECT 1
FROM json_each(${table}.${pathSegments[0]}) AS ${alias}
WHERE ${createJSONQuery({
operator,
pathSegments: newPathSegments,
table: alias,
treatAsArray,
value
})}
)`;
};
const createConstraint = ({ alias, operator, pathSegments, value })=>{
const newAlias = `${pathSegments[0]}_alias_${pathSegments.length - 1}`;
if (operator === 'exists' && value === false) {
operator = 'not_exists';
value = true;
} else if (operator === 'not_exists' && value === false) {
operator = 'exists';
value = true;
}
if (operator === 'exists') {
if (pathSegments.length === 1) {
return `EXISTS (SELECT 1 FROM json_each("${pathSegments[0]}") AS ${newAlias})`;
}
return `EXISTS (
SELECT 1
FROM json_each(${alias}.value -> '${pathSegments[0]}') AS ${newAlias}
WHERE ${newAlias}.key = '${pathSegments[1]}'
)`;
}
if (operator === 'not_exists') {
if (pathSegments.length === 1) {
return `NOT EXISTS (SELECT 1 FROM json_each("${pathSegments[0]}") AS ${newAlias})`;
}
return `NOT EXISTS (
SELECT 1
FROM json_each(${alias}.value -> '${pathSegments[0]}') AS ${newAlias}
WHERE ${newAlias}.key = '${pathSegments[1]}'
)`;
}
let formattedValue = escapeSQLValue(value);
let formattedOperator = operator;
if ([
'contains',
'like'
].includes(operator)) {
formattedOperator = 'like';
formattedValue = `%${value}%`;
} else if ([
'not_like',
'notlike'
].includes(operator)) {
formattedOperator = 'not like';
formattedValue = `%${value}%`;
} else if (operator === 'equals') {
formattedOperator = '=';
}
if (pathSegments.length === 1) {
return `EXISTS (SELECT 1 FROM json_each("${pathSegments[0]}") AS ${newAlias} WHERE ${newAlias}.value ${formattedOperator} '${formattedValue}')`;
}
return `EXISTS (
SELECT 1
FROM json_each(${alias}.value -> '${pathSegments[0]}') AS ${newAlias}
WHERE COALESCE(${newAlias}.value ->> '${pathSegments[1]}', '') ${formattedOperator} '${formattedValue}'
)`;
};
export const createJSONQuery = ({ column, operator, pathSegments, rawColumn, table, treatAsArray, treatRootAsArray, value })=>{
if ((operator === 'in' || operator === 'not_in') && Array.isArray(value)) {
let sql = '';
for (const [i, v] of value.entries()){
sql = `${sql}${createJSONQuery({
column,
operator: operator === 'in' ? 'equals' : 'not_equals',
pathSegments,
rawColumn,
table,
treatAsArray,
treatRootAsArray,
value: v
})} ${i === value.length - 1 ? '' : ` ${operator === 'in' ? 'OR' : 'AND'} `}`;
}
return sql;
}
if (treatAsArray?.includes(pathSegments[1]) && table) {
return fromArray({
operator,
pathSegments,
table,
treatAsArray,
value: value
});
}
return createConstraint({
alias: table,
operator,
pathSegments,
treatAsArray,
value: value
});
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,30 @@
import type { JWTPayload, KeyLike, DecryptOptions, JWTClaimVerificationOptions, GetKeyFunction, CompactJWEHeaderParameters, FlattenedJWE, JWTDecryptResult, ResolvedKey } from '../types';
/** Combination of JWE Decryption options and JWT Claims Set verification options. */
export interface JWTDecryptOptions extends DecryptOptions, JWTClaimVerificationOptions {
}
/**
* Interface for JWT Decryption dynamic key resolution. No token components have been verified at
* the time of this function call.
*/
export interface JWTDecryptGetKey extends GetKeyFunction<CompactJWEHeaderParameters, FlattenedJWE> {
}
/**
* Verifies the JWT format (to be a JWE Compact format), decrypts the ciphertext, validates the JWT
* Claims Set.
*
* This function is exported (as a named export) from the main `'jose'` module entry point as well
* as from its subpath export `'jose/jwt/decrypt'`.
*
* @param jwt JSON Web Token value (encoded as JWE).
* @param key Private Key or Secret to decrypt and verify the JWT with. See
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
* @param options JWT Decryption and JWT Claims Set validation options.
*/
export declare function jwtDecrypt<PayloadType = JWTPayload>(jwt: string | Uint8Array, key: KeyLike | Uint8Array, options?: JWTDecryptOptions): Promise<JWTDecryptResult<PayloadType>>;
/**
* @param jwt JSON Web Token value (encoded as JWE).
* @param getKey Function resolving Private Key or Secret to decrypt and verify the JWT with. See
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
* @param options JWT Decryption and JWT Claims Set validation options.
*/
export declare function jwtDecrypt<PayloadType = JWTPayload, KeyLikeType extends KeyLike = KeyLike>(jwt: string | Uint8Array, getKey: JWTDecryptGetKey, options?: JWTDecryptOptions): Promise<JWTDecryptResult<PayloadType> & ResolvedKey<KeyLikeType>>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sources":["../../../../src/tracing/google-genai/constants.ts"],"sourcesContent":["export const GOOGLE_GENAI_INTEGRATION_NAME = 'Google_GenAI';\n\n// https://ai.google.dev/api/rest/v1/models/generateContent\n// https://ai.google.dev/api/rest/v1/chats/sendMessage\n// https://googleapis.github.io/js-genai/release_docs/classes/models.Models.html#generatecontentstream\n// https://googleapis.github.io/js-genai/release_docs/classes/chats.Chat.html#sendmessagestream\nexport const GOOGLE_GENAI_INSTRUMENTED_METHODS = [\n 'models.generateContent',\n 'models.generateContentStream',\n 'chats.create',\n 'sendMessage',\n 'sendMessageStream',\n] as const;\n\n// Constants for internal use\nexport const GOOGLE_GENAI_SYSTEM_NAME = 'google_genai';\nexport const CHATS_CREATE_METHOD = 'chats.create';\nexport const CHAT_PATH = 'chat';\n"],"names":[],"mappings":";;AAAO,MAAM,6BAAA,GAAgC;;AAE7C;AACA;AACA;AACA;AACO,MAAM,oCAAoC;AACjD,EAAE,wBAAwB;AAC1B,EAAE,8BAA8B;AAChC,EAAE,cAAc;AAChB,EAAE,aAAa;AACf,EAAE,mBAAmB;AACrB,CAAA;;AAEA;AACO,MAAM,wBAAA,GAA2B;AACjC,MAAM,mBAAA,GAAsB;AAC5B,MAAM,SAAA,GAAY;;;;;;;;"}

View File

@@ -0,0 +1,35 @@
import type { GoogleGenAIIstrumentedMethod } from './types';
/**
* Check if a method path should be instrumented
*/
export declare function shouldInstrument(methodPath: string): methodPath is GoogleGenAIIstrumentedMethod;
/**
* Check if a method is a streaming method
*/
export declare function isStreamingMethod(methodPath: string): boolean;
export type ContentListUnion = Content | Content[] | PartListUnion;
export type ContentUnion = Content | PartUnion[] | PartUnion;
export type Content = {
parts?: Part[];
role?: string;
};
export type PartUnion = Part | string;
export type Part = Record<string, unknown> & {
inlineData?: {
data?: string;
displayName?: string;
mimeType?: string;
};
text?: string;
};
export type PartListUnion = PartUnion[] | PartUnion;
export type Message = Record<string, unknown> & {
role: string;
content?: PartListUnion;
parts?: PartListUnion;
};
/**
*
*/
export declare function contentUnionToMessages(content: ContentListUnion, role?: string): Message[];
//# sourceMappingURL=utils.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/getSafeRedirect.ts"],"sourcesContent":["export const getSafeRedirect = ({\n allowAbsoluteUrls = false,\n fallbackTo = '/',\n redirectTo,\n}: {\n allowAbsoluteUrls?: boolean\n fallbackTo?: string\n redirectTo: string | string[]\n}): string => {\n if (typeof redirectTo !== 'string') {\n return fallbackTo\n }\n\n // Normalize and decode the path\n let redirectPath: string\n try {\n redirectPath = decodeURIComponent(redirectTo.trim())\n } catch {\n return fallbackTo // invalid encoding\n }\n\n const isSafeRedirect =\n // Must start with a single forward slash (e.g., \"/admin\")\n redirectPath.startsWith('/') &&\n // Prevent protocol-relative URLs (e.g., \"//example.com\")\n !redirectPath.startsWith('//') &&\n // Prevent encoded slashes that could resolve to protocol-relative\n !redirectPath.startsWith('/%2F') &&\n // Prevent backslash-based escape attempts (e.g., \"/\\\\/example.com\", \"/\\\\\\\\example.com\", \"/\\\\example.com\")\n !redirectPath.startsWith('/\\\\/') &&\n !redirectPath.startsWith('/\\\\\\\\') &&\n !redirectPath.startsWith('/\\\\') &&\n // Prevent javascript-based schemes (e.g., \"/javascript:alert(1)\")\n !redirectPath.toLowerCase().startsWith('/javascript:') &&\n // Prevent attempts to redirect to full URLs using \"/http:\" or \"/https:\"\n !redirectPath.toLowerCase().startsWith('/http')\n\n const isAbsoluteSafeRedirect =\n allowAbsoluteUrls &&\n // Must be a valid absolute URL with http or https\n /^https?:\\/\\/\\S+$/i.test(redirectPath)\n\n return isSafeRedirect || isAbsoluteSafeRedirect ? redirectPath : fallbackTo\n}\n"],"names":["getSafeRedirect","allowAbsoluteUrls","fallbackTo","redirectTo","redirectPath","decodeURIComponent","trim","isSafeRedirect","startsWith","toLowerCase","isAbsoluteSafeRedirect","test"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB,CAAC,EAC9BC,oBAAoB,KAAK,EACzBC,aAAa,GAAG,EAChBC,UAAU,EAKX;IACC,IAAI,OAAOA,eAAe,UAAU;QAClC,OAAOD;IACT;IAEA,gCAAgC;IAChC,IAAIE;IACJ,IAAI;QACFA,eAAeC,mBAAmBF,WAAWG,IAAI;IACnD,EAAE,OAAM;QACN,OAAOJ,WAAW,mBAAmB;;IACvC;IAEA,MAAMK,iBACJ,0DAA0D;IAC1DH,aAAaI,UAAU,CAAC,QACxB,yDAAyD;IACzD,CAACJ,aAAaI,UAAU,CAAC,SACzB,kEAAkE;IAClE,CAACJ,aAAaI,UAAU,CAAC,WACzB,0GAA0G;IAC1G,CAACJ,aAAaI,UAAU,CAAC,WACzB,CAACJ,aAAaI,UAAU,CAAC,YACzB,CAACJ,aAAaI,UAAU,CAAC,UACzB,kEAAkE;IAClE,CAACJ,aAAaK,WAAW,GAAGD,UAAU,CAAC,mBACvC,wEAAwE;IACxE,CAACJ,aAAaK,WAAW,GAAGD,UAAU,CAAC;IAEzC,MAAME,yBACJT,qBACA,kDAAkD;IAClD,oBAAoBU,IAAI,CAACP;IAE3B,OAAOG,kBAAkBG,yBAAyBN,eAAeF;AACnE,EAAC"}

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