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,33 @@
import { nextDay } from "./nextDay.js";
/**
* The {@link nextWednesday} function options.
*/
/**
* @name nextWednesday
* @category Weekday Helpers
* @summary When is the next Wednesday?
*
* @description
* When is the next Wednesday?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to start counting from
* @param options - An object with options
*
* @returns The next Wednesday
*
* @example
* // When is the next Wednesday after Mar, 22, 2020?
* const result = nextWednesday(new Date(2020, 2, 22))
* //=> Wed Mar 25 2020 00:00:00
*/
export function nextWednesday(date, options) {
return nextDay(date, 3, options);
}
// Fallback for modularized imports:
export default nextWednesday;

View File

@@ -0,0 +1,62 @@
(function () {
if (typeof Prism === 'undefined' || typeof document === 'undefined') {
return;
}
// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
if (!Element.prototype.matches) {
Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
}
Prism.plugins.UnescapedMarkup = true;
Prism.hooks.add('before-highlightall', function (env) {
env.selector += ', [class*="lang-"] script[type="text/plain"]'
+ ', [class*="language-"] script[type="text/plain"]'
+ ', script[type="text/plain"][class*="lang-"]'
+ ', script[type="text/plain"][class*="language-"]';
});
Prism.hooks.add('before-sanity-check', function (env) {
/** @type {HTMLElement} */
var element = env.element;
if (element.matches('script[type="text/plain"]')) {
// found a <script type="text/plain" ...> element
// we convert this element to a regular <pre><code> code block
var code = document.createElement('code');
var pre = document.createElement('pre');
// copy class name
pre.className = code.className = element.className;
// copy all "data-" attributes
var dataset = element.dataset;
Object.keys(dataset || {}).forEach(function (key) {
if (Object.prototype.hasOwnProperty.call(dataset, key)) {
pre.dataset[key] = dataset[key];
}
});
code.textContent = env.code = env.code.replace(/&lt;\/script(?:>|&gt;)/gi, '</scri' + 'pt>');
// change DOM
pre.appendChild(code);
element.parentNode.replaceChild(pre, element);
env.element = code;
return;
}
if (!env.code) {
// no code
var childNodes = element.childNodes;
if (childNodes.length === 1 && childNodes[0].nodeName == '#comment') {
// the only child is a comment -> use the comment's text
element.textContent = env.code = childNodes[0].textContent;
}
}
});
}());

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 Reply = createLucideIcon("Reply", [
["polyline", { points: "9 17 4 12 9 7", key: "hvgpf2" }],
["path", { d: "M20 18v-2a4 4 0 0 0-4-4H4", key: "5vmcpk" }]
]);
export { Reply as default };
//# sourceMappingURL=reply.js.map

View File

@@ -0,0 +1,62 @@
"use strict";
exports.DayOfYearParser = void 0;
var _constants = require("../constants.js");
var _Parser = require("../Parser.js");
var _utils = require("../utils.js");
class DayOfYearParser extends _Parser.Parser {
priority = 90;
subpriority = 1;
parse(dateString, token, match) {
switch (token) {
case "D":
case "DD":
return (0, _utils.parseNumericPattern)(
_constants.numericPatterns.dayOfYear,
dateString,
);
case "Do":
return match.ordinalNumber(dateString, { unit: "date" });
default:
return (0, _utils.parseNDigits)(token.length, dateString);
}
}
validate(date, value) {
const year = date.getFullYear();
const isLeapYear = (0, _utils.isLeapYearIndex)(year);
if (isLeapYear) {
return value >= 1 && value <= 366;
} else {
return value >= 1 && value <= 365;
}
}
set(date, _flags, value) {
date.setMonth(0, value);
date.setHours(0, 0, 0, 0);
return date;
}
incompatibleTokens = [
"Y",
"R",
"q",
"Q",
"M",
"L",
"w",
"I",
"d",
"E",
"i",
"e",
"c",
"t",
"T",
];
}
exports.DayOfYearParser = DayOfYearParser;

View File

@@ -0,0 +1,50 @@
# events [![Build Status](https://travis-ci.org/Gozala/events.png?branch=master)](https://travis-ci.org/Gozala/events)
> Node's event emitter for all engines.
This implements the Node.js [`events`][node.js docs] module for environments that do not have it, like browsers.
> `events` currently matches the **Node.js 11.13.0** API.
Note that the `events` module uses ES5 features. If you need to support very old browsers like IE8, use a shim like [`es5-shim`](https://www.npmjs.com/package/es5-shim). You need both the shim and the sham versions of `es5-shim`.
This module is maintained, but only by very few people. If you'd like to help, let us know in the [Maintainer Needed](https://github.com/Gozala/events/issues/43) issue!
## Install
You usually do not have to install `events` yourself! If your code runs in Node.js, `events` is built in. If your code runs in the browser, bundlers like [browserify](https://github.com/browserify/browserify) or [webpack](https://github.com/webpack/webpack) also include the `events` module.
But if none of those apply, with npm do:
```
npm install events
```
## Usage
```javascript
var EventEmitter = require('events')
var ee = new EventEmitter()
ee.on('message', function (text) {
console.log(text)
})
ee.emit('message', 'hello world')
```
## API
See the [Node.js EventEmitter docs][node.js docs]. `events` currently matches the Node.js 11.13.0 API.
## Contributing
PRs are very welcome! The main way to contribute to `events` is by porting features, bugfixes and tests from Node.js. Ideally, code contributions to this module are copy-pasted from Node.js and transpiled to ES5, rather than reimplemented from scratch. Matching the Node.js code as closely as possible makes maintenance simpler when new changes land in Node.js.
This module intends to provide exactly the same API as Node.js, so features that are not available in the core `events` module will not be accepted. Feature requests should instead be directed at [nodejs/node](https://github.com/nodejs/node) and will be added to this module once they are implemented in Node.js.
If there is a difference in behaviour between Node.js's `events` module and this module, please open an issue!
## License
[MIT](./LICENSE)
[node.js docs]: https://nodejs.org/dist/v11.13.0/docs/api/events.html

View File

@@ -0,0 +1 @@
!function(e){var n={pattern:/((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:null}}};e.languages.groovy=e.languages.extend("clike",{string:{pattern:/'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/,greedy:!0},keyword:/\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),e.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment",greedy:!0},"interpolation-string":{pattern:/"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}}}),e.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(?:and|cleanup|expect|given|setup|then|when|where):/}),e.languages.insertBefore("groovy","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),n.inside.expression.inside=e.languages.groovy}(Prism);

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 TrendingDown = createLucideIcon("TrendingDown", [
["polyline", { points: "22 17 13.5 8.5 8.5 13.5 2 7", key: "1r2t7k" }],
["polyline", { points: "16 17 22 17 22 11", key: "11uiuu" }]
]);
export { TrendingDown as default };
//# sourceMappingURL=trending-down.js.map

View File

@@ -0,0 +1,60 @@
import type { ClientRequest, IncomingMessage, ServerResponse } from 'node:http';
import type { Event, Integration, Span } from '@sentry/core';
import type { NodeClient } from '../../sdk/client';
export interface HttpServerSpansIntegrationOptions {
/**
* Do not capture spans for incoming HTTP requests to URLs where the given callback returns `true`.
* Spans will be non recording if tracing is disabled.
*
* The `urlPath` param consists of the URL path and query string (if any) of the incoming request.
* For example: `'/users/details?id=123'`
*
* The `request` param contains the original {@type IncomingMessage} object of the incoming request.
* You can use it to filter on additional properties like method, headers, etc.
*/
ignoreIncomingRequests?: (urlPath: string, request: IncomingMessage) => boolean;
/**
* Whether to automatically ignore common static asset requests like favicon.ico, robots.txt, etc.
* This helps reduce noise in your transactions.
*
* @default `true`
*/
ignoreStaticAssets?: boolean;
/**
* Do not capture spans for incoming HTTP requests with the given status codes.
* By default, spans with some 3xx and 4xx status codes are ignored (see @default).
* Expects an array of status codes or a range of status codes, e.g. [[300,399], 404] would ignore 3xx and 404 status codes.
*
* @default `[[401, 404], [301, 303], [305, 399]]`
*/
ignoreStatusCodes?: (number | [number, number])[];
/**
* @deprecated This is deprecated in favor of `incomingRequestSpanHook`.
*/
instrumentation?: {
requestHook?: (span: Span, req: ClientRequest | IncomingMessage) => void;
responseHook?: (span: Span, response: IncomingMessage | ServerResponse) => void;
applyCustomAttributesOnSpan?: (span: Span, request: ClientRequest | IncomingMessage, response: IncomingMessage | ServerResponse) => void;
};
/**
* A hook that can be used to mutate the span for incoming requests.
* This is triggered after the span is created, but before it is recorded.
*/
onSpanCreated?: (span: Span, request: IncomingMessage, response: ServerResponse) => void;
}
/**
* This integration emits spans for incoming requests handled via the node `http` module.
* It requires the `httpServerIntegration` to be present.
*/
export declare const httpServerSpansIntegration: (options?: HttpServerSpansIntegrationOptions) => Integration & {
name: "HttpServerSpans";
setup: (client: NodeClient) => void;
processEvent: (event: Event) => Event | null;
};
/**
* Check if a request is for a common static asset that should be ignored by default.
*
* Only exported for tests.
*/
export declare function isStaticAssetRequest(urlPath: string): boolean;
//# sourceMappingURL=httpServerSpansIntegration.d.ts.map

View File

@@ -0,0 +1,2 @@
export * from "./driver.js";
export * from "./session.js";

View File

@@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validate = void 0;
const utils_1 = require("./utils");
const rules = new Map();
rules.set('Enum members and tsEnumNames must be of the same length', schema => {
if (schema.enum && schema.tsEnumNames && schema.enum.length !== schema.tsEnumNames.length) {
return false;
}
});
rules.set('tsEnumNames must be an array of strings', schema => {
if (schema.tsEnumNames && schema.tsEnumNames.some(_ => typeof _ !== 'string')) {
return false;
}
});
rules.set('When both maxItems and minItems are present, maxItems >= minItems', schema => {
const { maxItems, minItems } = schema;
if (typeof maxItems === 'number' && typeof minItems === 'number') {
return maxItems >= minItems;
}
});
rules.set('When maxItems exists, maxItems >= 0', schema => {
const { maxItems } = schema;
if (typeof maxItems === 'number') {
return maxItems >= 0;
}
});
rules.set('When minItems exists, minItems >= 0', schema => {
const { minItems } = schema;
if (typeof minItems === 'number') {
return minItems >= 0;
}
});
rules.set('deprecated must be a boolean', schema => {
const typeOfDeprecated = typeof schema.deprecated;
return typeOfDeprecated === 'boolean' || typeOfDeprecated === 'undefined';
});
function validate(schema, filename) {
const errors = [];
rules.forEach((rule, ruleName) => {
(0, utils_1.traverse)(schema, (schema, key) => {
if (rule(schema) === false) {
errors.push(`Error at key "${key}" in file "${filename}": ${ruleName}`);
}
return schema;
});
});
return errors;
}
exports.validate = validate;
//# sourceMappingURL=validator.js.map

View File

@@ -0,0 +1,165 @@
/*
Copyright (C) 2012-2014 Yusuke Suzuki <utatane.tea@gmail.com>
Copyright (C) 2013 Alex Seville <hi@alexanderseville.com>
Copyright (C) 2014 Thiago de Arruda <tpadilha84@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* Escope (<a href="http://github.com/estools/escope">escope</a>) is an <a
* href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMAScript</a>
* scope analyzer extracted from the <a
* href="http://github.com/estools/esmangle">esmangle project</a/>.
* <p>
* <em>escope</em> finds lexical scopes in a source program, i.e. areas of that
* program where different occurrences of the same identifier refer to the same
* variable. With each scope the contained variables are collected, and each
* identifier reference in code is linked to its corresponding variable (if
* possible).
* <p>
* <em>escope</em> works on a syntax tree of the parsed source code which has
* to adhere to the <a
* href="https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API">
* Mozilla Parser API</a>. E.g. <a href="https://github.com/eslint/espree">espree</a> is a parser
* that produces such syntax trees.
* <p>
* The main interface is the {@link analyze} function.
* @module escope
*/
"use strict";
/* eslint no-underscore-dangle: ["error", { "allow": ["__currentScope"] }] */
const assert = require("assert");
const ScopeManager = require("./scope-manager");
const Referencer = require("./referencer");
const Reference = require("./reference");
const Variable = require("./variable");
const Scope = require("./scope").Scope;
const version = require("../package.json").version;
/**
* Set the default options
* @returns {Object} options
*/
function defaultOptions() {
return {
optimistic: false,
directive: false,
nodejsScope: false,
impliedStrict: false,
sourceType: "script", // one of ['script', 'module']
ecmaVersion: 5,
childVisitorKeys: null,
fallback: "iteration"
};
}
/**
* Preform deep update on option object
* @param {Object} target - Options
* @param {Object} override - Updates
* @returns {Object} Updated options
*/
function updateDeeply(target, override) {
/**
* Is hash object
* @param {Object} value - Test value
* @returns {boolean} Result
*/
function isHashObject(value) {
return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp);
}
for (const key in override) {
if (Object.prototype.hasOwnProperty.call(override, key)) {
const val = override[key];
if (isHashObject(val)) {
if (isHashObject(target[key])) {
updateDeeply(target[key], val);
} else {
target[key] = updateDeeply({}, val);
}
} else {
target[key] = val;
}
}
}
return target;
}
/**
* Main interface function. Takes an Espree syntax tree and returns the
* analyzed scopes.
* @function analyze
* @param {espree.Tree} tree - Abstract Syntax Tree
* @param {Object} providedOptions - Options that tailor the scope analysis
* @param {boolean} [providedOptions.optimistic=false] - the optimistic flag
* @param {boolean} [providedOptions.directive=false]- the directive flag
* @param {boolean} [providedOptions.ignoreEval=false]- whether to check 'eval()' calls
* @param {boolean} [providedOptions.nodejsScope=false]- whether the whole
* script is executed under node.js environment. When enabled, escope adds
* a function scope immediately following the global scope.
* @param {boolean} [providedOptions.impliedStrict=false]- implied strict mode
* (if ecmaVersion >= 5).
* @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module'
* @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered
* @param {Object} [providedOptions.childVisitorKeys=null] - Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option.
* @param {string} [providedOptions.fallback='iteration'] - A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option.
* @returns {ScopeManager} ScopeManager
*/
function analyze(tree, providedOptions) {
const options = updateDeeply(defaultOptions(), providedOptions);
const scopeManager = new ScopeManager(options);
const referencer = new Referencer(options, scopeManager);
referencer.visit(tree);
assert(scopeManager.__currentScope === null, "currentScope should be null.");
return scopeManager;
}
module.exports = {
/** @name module:escope.version */
version,
/** @name module:escope.Reference */
Reference,
/** @name module:escope.Variable */
Variable,
/** @name module:escope.Scope */
Scope,
/** @name module:escope.ScopeManager */
ScopeManager,
analyze
};
/* vim: set sw=4 ts=4 et tw=80 : */

View File

@@ -0,0 +1,28 @@
/**
* @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 FolderPen = createLucideIcon("FolderPen", [
[
"path",
{
d: "M2 11.5V5a2 2 0 0 1 2-2h3.9c.7 0 1.3.3 1.7.9l.8 1.2c.4.6 1 .9 1.7.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-9.5",
key: "a8xqs0"
}
],
[
"path",
{
d: "M11.378 13.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",
key: "1saktj"
}
]
]);
export { FolderPen as default };
//# sourceMappingURL=folder-pen.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hoist-non-react-statics.d.ts","sourceRoot":"","sources":["../../src/hoist-non-react-statics.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAmGpC;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAElC,CAAC,SAAS,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EAElC,CAAC,SAAS,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EAClC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACzD,eAAe,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,CA4C5D"}

View File

@@ -0,0 +1,380 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ModuleNotFoundError = require("../ModuleNotFoundError");
const RuntimeGlobals = require("../RuntimeGlobals");
const WebpackError = require("../WebpackError");
const { parseOptions } = require("../container/options");
const LazySet = require("../util/LazySet");
const createSchemaValidation = require("../util/create-schema-validation");
const { parseRange } = require("../util/semver");
const ConsumeSharedFallbackDependency = require("./ConsumeSharedFallbackDependency");
const ConsumeSharedModule = require("./ConsumeSharedModule");
const ConsumeSharedRuntimeModule = require("./ConsumeSharedRuntimeModule");
const ProvideForSharedDependency = require("./ProvideForSharedDependency");
const { resolveMatchedConfigs } = require("./resolveMatchedConfigs");
const {
getDescriptionFile,
getRequiredVersionFromDescriptionFile,
isRequiredVersion
} = require("./utils");
/** @typedef {import("enhanced-resolve").ResolveContext} ResolveContext */
/** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumeSharedPluginOptions} ConsumeSharedPluginOptions */
/** @typedef {import("../Compiler")} Compiler */
/** @typedef {import("../Compilation").FileSystemDependencies} FileSystemDependencies */
/** @typedef {import("../ResolverFactory").ResolveOptionsWithDependencyType} ResolveOptionsWithDependencyType */
/** @typedef {import("../util/semver").SemVerRange} SemVerRange */
/** @typedef {import("./ConsumeSharedModule").ConsumeOptions} ConsumeOptions */
/** @typedef {import("./utils").DescriptionFile} DescriptionFile */
const validate = createSchemaValidation(
require("../../schemas/plugins/sharing/ConsumeSharedPlugin.check"),
() => require("../../schemas/plugins/sharing/ConsumeSharedPlugin.json"),
{
name: "Consume Shared Plugin",
baseDataPath: "options"
}
);
/** @type {ResolveOptionsWithDependencyType} */
const RESOLVE_OPTIONS = { dependencyType: "esm" };
const PLUGIN_NAME = "ConsumeSharedPlugin";
class ConsumeSharedPlugin {
/**
* @param {ConsumeSharedPluginOptions} options options
*/
constructor(options) {
if (typeof options !== "string") {
validate(options);
}
/** @type {[string, ConsumeOptions][]} */
this._consumes = parseOptions(
options.consumes,
(item, key) => {
if (Array.isArray(item)) throw new Error("Unexpected array in options");
/** @type {ConsumeOptions} */
const result =
item === key || !isRequiredVersion(item)
? // item is a request/key
{
import: key,
shareScope: options.shareScope || "default",
shareKey: key,
requiredVersion: undefined,
packageName: undefined,
strictVersion: false,
singleton: false,
eager: false
}
: // key is a request/key
// item is a version
{
import: key,
shareScope: options.shareScope || "default",
shareKey: key,
requiredVersion: parseRange(item),
strictVersion: true,
packageName: undefined,
singleton: false,
eager: false
};
return result;
},
(item, key) => ({
import: item.import === false ? undefined : item.import || key,
shareScope: item.shareScope || options.shareScope || "default",
shareKey: item.shareKey || key,
requiredVersion:
typeof item.requiredVersion === "string"
? parseRange(item.requiredVersion)
: item.requiredVersion,
strictVersion:
typeof item.strictVersion === "boolean"
? item.strictVersion
: item.import !== false && !item.singleton,
packageName: item.packageName,
singleton: Boolean(item.singleton),
eager: Boolean(item.eager)
})
);
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.thisCompilation.tap(
PLUGIN_NAME,
(compilation, { normalModuleFactory }) => {
compilation.dependencyFactories.set(
ConsumeSharedFallbackDependency,
normalModuleFactory
);
/** @typedef {Map<string, ConsumeOptions>} Consumes */
/** @type {Consumes} */
let unresolvedConsumes;
/** @type {Consumes} */
let resolvedConsumes;
/** @type {Consumes} */
let prefixedConsumes;
const promise = resolveMatchedConfigs(compilation, this._consumes).then(
({ resolved, unresolved, prefixed }) => {
resolvedConsumes = resolved;
unresolvedConsumes = unresolved;
prefixedConsumes = prefixed;
}
);
const resolver = compilation.resolverFactory.get(
"normal",
RESOLVE_OPTIONS
);
/**
* @param {string} context issuer directory
* @param {string} request request
* @param {ConsumeOptions} config options
* @returns {Promise<ConsumeSharedModule>} create module
*/
const createConsumeSharedModule = (context, request, config) => {
/**
* @param {string} details details
*/
const requiredVersionWarning = (details) => {
const error = new WebpackError(
`No required version specified and unable to automatically determine one. ${details}`
);
error.file = `shared module ${request}`;
compilation.warnings.push(error);
};
const directFallback =
config.import &&
/^(?:\.\.?(?:\/|$)|\/|[A-Z]:|\\\\)/i.test(config.import);
return Promise.all([
new Promise(
/**
* @param {(value?: string) => void} resolve resolve
*/
(resolve) => {
if (!config.import) {
resolve();
return;
}
/** @type {ResolveContext & { fileDependencies: FileSystemDependencies, contextDependencies: FileSystemDependencies, missingDependencies: FileSystemDependencies }} */
const resolveContext = {
fileDependencies: new LazySet(),
contextDependencies: new LazySet(),
missingDependencies: new LazySet()
};
resolver.resolve(
{},
directFallback ? compiler.context : context,
config.import,
resolveContext,
(err, result) => {
compilation.contextDependencies.addAll(
resolveContext.contextDependencies
);
compilation.fileDependencies.addAll(
resolveContext.fileDependencies
);
compilation.missingDependencies.addAll(
resolveContext.missingDependencies
);
if (err) {
compilation.errors.push(
new ModuleNotFoundError(null, err, {
name: `resolving fallback for shared module ${request}`
})
);
return resolve();
}
resolve(/** @type {string} */ (result));
}
);
}
),
new Promise(
/**
* @param {(value?: SemVerRange) => void} resolve resolve
*/
(resolve) => {
if (config.requiredVersion !== undefined) {
resolve(/** @type {SemVerRange} */ (config.requiredVersion));
return;
}
let packageName = config.packageName;
if (packageName === undefined) {
if (/^(?:\/|[A-Z]:|\\\\)/i.test(request)) {
// For relative or absolute requests we don't automatically use a packageName.
// If wished one can specify one with the packageName option.
resolve();
return;
}
const match = /^(?:@[^\\/]+[\\/])?[^\\/]+/.exec(request);
if (!match) {
requiredVersionWarning(
"Unable to extract the package name from request."
);
resolve();
return;
}
packageName = match[0];
}
getDescriptionFile(
compilation.inputFileSystem,
context,
["package.json"],
(err, result, checkedDescriptionFilePaths) => {
if (err) {
requiredVersionWarning(
`Unable to read description file: ${err}`
);
return resolve();
}
const { data } =
/** @type {DescriptionFile} */
(result || {});
if (!data) {
if (checkedDescriptionFilePaths) {
requiredVersionWarning(
[
`Unable to find required version for "${packageName}" in description file/s`,
checkedDescriptionFilePaths.join("\n"),
"It need to be in dependencies, devDependencies or peerDependencies."
].join("\n")
);
} else {
requiredVersionWarning(
`Unable to find description file in ${context}.`
);
}
return resolve();
}
if (data.name === packageName) {
// Package self-referencing
return resolve();
}
const requiredVersion =
getRequiredVersionFromDescriptionFile(data, packageName);
if (requiredVersion) {
return resolve(parseRange(requiredVersion));
}
resolve();
},
(result) => {
if (!result) return false;
const maybeRequiredVersion =
getRequiredVersionFromDescriptionFile(
result.data,
packageName
);
return (
result.data.name === packageName ||
typeof maybeRequiredVersion === "string"
);
}
);
}
)
]).then(
([importResolved, requiredVersion]) =>
new ConsumeSharedModule(
directFallback ? compiler.context : context,
{
...config,
importResolved,
import: importResolved ? config.import : undefined,
requiredVersion
}
)
);
};
normalModuleFactory.hooks.factorize.tapPromise(
PLUGIN_NAME,
({ context, request, dependencies }) =>
// wait for resolving to be complete
promise.then(() => {
if (
dependencies[0] instanceof ConsumeSharedFallbackDependency ||
dependencies[0] instanceof ProvideForSharedDependency
) {
return;
}
const match = unresolvedConsumes.get(request);
if (match !== undefined) {
return createConsumeSharedModule(context, request, match);
}
for (const [prefix, options] of prefixedConsumes) {
if (request.startsWith(prefix)) {
const remainder = request.slice(prefix.length);
return createConsumeSharedModule(context, request, {
...options,
import: options.import
? options.import + remainder
: undefined,
shareKey: options.shareKey + remainder
});
}
}
})
);
normalModuleFactory.hooks.createModule.tapPromise(
PLUGIN_NAME,
({ resource }, { context, dependencies }) => {
if (
dependencies[0] instanceof ConsumeSharedFallbackDependency ||
dependencies[0] instanceof ProvideForSharedDependency
) {
return Promise.resolve();
}
const options = resolvedConsumes.get(
/** @type {string} */ (resource)
);
if (options !== undefined) {
return createConsumeSharedModule(
context,
/** @type {string} */ (resource),
options
);
}
return Promise.resolve();
}
);
compilation.hooks.additionalTreeRuntimeRequirements.tap(
PLUGIN_NAME,
(chunk, set) => {
set.add(RuntimeGlobals.module);
set.add(RuntimeGlobals.moduleCache);
set.add(RuntimeGlobals.moduleFactoriesAddOnly);
set.add(RuntimeGlobals.shareScopeMap);
set.add(RuntimeGlobals.initializeSharing);
set.add(RuntimeGlobals.hasOwnProperty);
compilation.addRuntimeModule(
chunk,
new ConsumeSharedRuntimeModule(set)
);
}
);
}
);
}
}
module.exports = ConsumeSharedPlugin;

View File

@@ -0,0 +1 @@
{"version":3,"file":"bolt.js","sources":["../../../src/icons/bolt.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Bolt\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTZWOGEyIDIgMCAwIDAtMS0xLjczbC03LTRhMiAyIDAgMCAwLTIgMGwtNyA0QTIgMiAwIDAgMCAzIDh2OGEyIDIgMCAwIDAgMSAxLjczbDcgNGEyIDIgMCAwIDAgMiAwbDctNEEyIDIgMCAwIDAgMjEgMTZ6IiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/bolt\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 Bolt = createLucideIcon('Bolt', [\n [\n 'path',\n {\n d: 'M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z',\n key: 'yt0hxn',\n },\n ],\n ['circle', { cx: '12', cy: '12', r: '4', key: '4exip2' }],\n]);\n\nexport default Bolt;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CACpC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AAC1D,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"names":["_arrayWithoutHoles","require","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","_toConsumableArray","arr","arrayWithoutHoles","iterableToArray","unsupportedIterableToArray","nonIterableSpread"],"sources":["../../src/helpers/toConsumableArray.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport arrayWithoutHoles from \"./arrayWithoutHoles.ts\";\nimport iterableToArray from \"./iterableToArray.ts\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.ts\";\n// @ts-expect-error nonIterableSpread is still being converted to TS.\nimport nonIterableSpread from \"./nonIterableSpread.ts\";\n\nexport default function _toConsumableArray<T>(arr: any): T[] {\n return (\n arrayWithoutHoles<T>(arr) ||\n iterableToArray<T>(arr) ||\n unsupportedIterableToArray<T>(arr) ||\n nonIterableSpread()\n );\n}\n"],"mappings":";;;;;;AAEA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,kBAAA,GAAAH,OAAA;AAEe,SAASI,kBAAkBA,CAAIC,GAAQ,EAAO;EAC3D,OACE,IAAAC,0BAAiB,EAAID,GAAG,CAAC,IACzB,IAAAE,wBAAe,EAAIF,GAAG,CAAC,IACvB,IAAAG,mCAA0B,EAAIH,GAAG,CAAC,IAClC,IAAAI,0BAAiB,EAAC,CAAC;AAEvB","ignoreList":[]}

View File

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

View File

@@ -0,0 +1,6 @@
.drawer-content-container {
padding: calc(var(--base) * 2) var(--gutter-h);
display: flex;
flex-direction: column;
overflow: auto;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"functiontostring.js","sources":["../../../src/integrations/functiontostring.ts"],"sourcesContent":["import type { Client } from '../client';\nimport { getClient } from '../currentScopes';\nimport { defineIntegration } from '../integration';\nimport type { IntegrationFn } from '../types-hoist/integration';\nimport type { WrappedFunction } from '../types-hoist/wrappedfunction';\nimport { getOriginalFunction } from '../utils/object';\n\nlet originalFunctionToString: () => void;\n\nconst INTEGRATION_NAME = 'FunctionToString';\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _functionToStringIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n originalFunctionToString = Function.prototype.toString;\n\n // intrinsics (like Function.prototype) might be immutable in some environments\n // e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal)\n try {\n Function.prototype.toString = function (this: WrappedFunction, ...args: unknown[]): string {\n const originalFunction = getOriginalFunction(this);\n const context =\n SETUP_CLIENTS.has(getClient() as Client) && originalFunction !== undefined ? originalFunction : this;\n return originalFunctionToString.apply(context, args);\n };\n } catch {\n // ignore errors here, just don't patch this\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Patch toString calls to return proper name for wrapped functions.\n *\n * ```js\n * Sentry.init({\n * integrations: [\n * functionToStringIntegration(),\n * ],\n * });\n * ```\n */\nexport const functionToStringIntegration = defineIntegration(_functionToStringIntegration);\n"],"names":["getOriginalFunction","getClient","defineIntegration"],"mappings":";;;;;;AAOA,IAAI,wBAAwB;;AAE5B,MAAM,gBAAA,GAAmB,kBAAkB;;AAE3C,MAAM,aAAA,GAAgB,IAAI,OAAO,EAAmB;;AAEpD,MAAM,4BAAA,IAAgC,MAAM;AAC5C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB;AACA,MAAM,2BAA2B,QAAQ,CAAC,SAAS,CAAC,QAAQ;;AAE5D;AACA;AACA,MAAM,IAAI;AACV,QAAQ,QAAQ,CAAC,SAAS,CAAC,QAAA,GAAW,WAAiC,GAAG,IAAI,EAAqB;AACnG,UAAU,MAAM,gBAAA,GAAmBA,0BAAmB,CAAC,IAAI,CAAC;AAC5D,UAAU,MAAM,OAAA;AAChB,YAAY,aAAa,CAAC,GAAG,CAACC,uBAAS,EAAC,EAAE,IAAc,qBAAqB,SAAA,GAAY,gBAAA,GAAmB,IAAI;AAChH,UAAU,OAAO,wBAAwB,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AAC9D,QAAQ,CAAC;AACT,MAAM,EAAE,MAAM;AACd;AACA,MAAM;AACN,IAAI,CAAC;AACL,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;AACrC,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,2BAAA,GAA8BC,6BAAiB,CAAC,4BAA4B;;;;"}

View File

@@ -0,0 +1,63 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const {
JAVASCRIPT_MODULE_TYPE_AUTO,
JAVASCRIPT_MODULE_TYPE_DYNAMIC
} = require("../ModuleTypeConstants");
const RequireIncludeDependency = require("./RequireIncludeDependency");
const RequireIncludeDependencyParserPlugin = require("./RequireIncludeDependencyParserPlugin");
/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */
/** @typedef {import("../Compiler")} Compiler */
/** @typedef {import("../javascript/JavascriptParser")} Parser */
const PLUGIN_NAME = "RequireIncludePlugin";
class RequireIncludePlugin {
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.compilation.tap(
PLUGIN_NAME,
(compilation, { normalModuleFactory }) => {
compilation.dependencyFactories.set(
RequireIncludeDependency,
normalModuleFactory
);
compilation.dependencyTemplates.set(
RequireIncludeDependency,
new RequireIncludeDependency.Template()
);
/**
* @param {Parser} parser parser parser
* @param {JavascriptParserOptions} parserOptions parserOptions
* @returns {void}
*/
const handler = (parser, parserOptions) => {
if (parserOptions.requireInclude === false) return;
const warn = parserOptions.requireInclude === undefined;
new RequireIncludeDependencyParserPlugin(warn).apply(parser);
};
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_AUTO)
.tap(PLUGIN_NAME, handler);
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_DYNAMIC)
.tap(PLUGIN_NAME, handler);
}
);
}
}
module.exports = RequireIncludePlugin;

View File

@@ -0,0 +1,4 @@
import type { MigrationConfig } from "../migrator.cjs";
import type { MySqlRemoteDatabase } from "./driver.cjs";
export type ProxyMigrator = (migrationQueries: string[]) => Promise<void>;
export declare function migrate<TSchema extends Record<string, unknown>>(db: MySqlRemoteDatabase<TSchema>, callback: ProxyMigrator, config: MigrationConfig): Promise<void>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"SaveButton.d.ts","sourceRoot":"","sources":["../../../src/admin/elements/SaveButton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,EAAE,GAAG,WAAW,CAAA;AAExD,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,GAAG,yBAAyB,CAAA"}

View File

@@ -0,0 +1,30 @@
import { VercelCronsConfig } from '../../common/types';
import { RouteManifest } from '../manifest/types';
import { NextConfigObject, SentryBuildOptions, TurbopackMatcherWithRule, TurbopackOptions } from '../types';
/**
* Construct a Turbopack config object from a Next.js config object and a Turbopack options object.
*
* @param userNextConfig - The Next.js config object.
* @param userSentryOptions - The Sentry build options object.
* @param routeManifest - The route manifest object.
* @param nextJsVersion - The Next.js version.
* @param vercelCronsConfig - The Vercel crons configuration from vercel.json.
* @returns The Turbopack config object.
*/
export declare function constructTurbopackConfig({ userNextConfig, userSentryOptions, routeManifest, nextJsVersion, vercelCronsConfig, }: {
userNextConfig: NextConfigObject;
userSentryOptions?: SentryBuildOptions;
routeManifest?: RouteManifest;
nextJsVersion?: string;
vercelCronsConfig?: VercelCronsConfig;
}): TurbopackOptions;
/**
* Safely add a Turbopack rule to the existing rules.
*
* @param existingRules - The existing rules.
* @param matcher - The matcher for the rule.
* @param rule - The rule to add.
* @returns The updated rules object.
*/
export declare function safelyAddTurbopackRule(existingRules: TurbopackOptions['rules'], { matcher, rule }: TurbopackMatcherWithRule): TurbopackOptions['rules'];
//# sourceMappingURL=constructTurbopackConfig.d.ts.map

View File

@@ -0,0 +1,7 @@
Prism.languages.jsonp = Prism.languages.extend('json', {
'punctuation': /[{}[\]();,.]/
});
Prism.languages.insertBefore('jsonp', 'punctuation', {
'function': /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*\()/
});

View File

@@ -0,0 +1,31 @@
import { MetricAttributes, Observable } from './Metric';
/**
* Interface that is being used in callback function for Observable Metric.
*/
export interface ObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
/**
* Observe a measurement of the value associated with the given attributes.
*
* @param value The value to be observed.
* @param attributes The attributes associated with the value. If more than
* one values associated with the same attributes values, SDK may pick the
* last one or simply drop the entire observable result.
*/
observe(this: ObservableResult<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
}
/**
* Interface that is being used in batch observable callback function.
*/
export interface BatchObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
/**
* Observe a measurement of the value associated with the given attributes.
*
* @param metric The observable metric to be observed.
* @param value The value to be observed.
* @param attributes The attributes associated with the value. If more than
* one values associated with the same attributes values, SDK may pick the
* last one or simply drop the entire observable result.
*/
observe(this: BatchObservableResult<AttributesTypes>, metric: Observable<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
}
//# sourceMappingURL=ObservableResult.d.ts.map

View File

@@ -0,0 +1,169 @@
/**
* prism.js Twilight theme
* Based (more or less) on the Twilight theme originally of Textmate fame.
* @author Remy Bach
*/
code[class*="language-"],
pre[class*="language-"] {
color: white;
background: none;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
font-size: 1em;
text-align: left;
text-shadow: 0 -.1em .2em black;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"],
:not(pre) > code[class*="language-"] {
background: hsl(0, 0%, 8%); /* #141414 */
}
/* Code blocks */
pre[class*="language-"] {
border-radius: .5em;
border: .3em solid hsl(0, 0%, 33%); /* #282A2B */
box-shadow: 1px 1px .5em black inset;
margin: .5em 0;
overflow: auto;
padding: 1em;
}
pre[class*="language-"]::-moz-selection {
/* Firefox */
background: hsl(200, 4%, 16%); /* #282A2B */
}
pre[class*="language-"]::selection {
/* Safari */
background: hsl(200, 4%, 16%); /* #282A2B */
}
/* Text Selection colour */
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: hsla(0, 0%, 93%, 0.15); /* #EDEDED */
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: hsla(0, 0%, 93%, 0.15); /* #EDEDED */
}
/* Inline code */
:not(pre) > code[class*="language-"] {
border-radius: .3em;
border: .13em solid hsl(0, 0%, 33%); /* #545454 */
box-shadow: 1px 1px .3em -.1em black inset;
padding: .15em .2em .05em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: hsl(0, 0%, 47%); /* #777777 */
}
.token.punctuation {
opacity: .7;
}
.token.namespace {
opacity: .7;
}
.token.tag,
.token.boolean,
.token.number,
.token.deleted {
color: hsl(14, 58%, 55%); /* #CF6A4C */
}
.token.keyword,
.token.property,
.token.selector,
.token.constant,
.token.symbol,
.token.builtin {
color: hsl(53, 89%, 79%); /* #F9EE98 */
}
.token.attr-name,
.token.attr-value,
.token.string,
.token.char,
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable,
.token.inserted {
color: hsl(76, 21%, 52%); /* #8F9D6A */
}
.token.atrule {
color: hsl(218, 22%, 55%); /* #7587A6 */
}
.token.regex,
.token.important {
color: hsl(42, 75%, 65%); /* #E9C062 */
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
/* Markup */
.language-markup .token.tag,
.language-markup .token.attr-name,
.language-markup .token.punctuation {
color: hsl(33, 33%, 52%); /* #AC885B */
}
/* Make the tokens sit above the line highlight so the colours don't look faded. */
.token {
position: relative;
z-index: 1;
}
.line-highlight.line-highlight {
background: hsla(0, 0%, 33%, 0.25); /* #545454 */
background: linear-gradient(to right, hsla(0, 0%, 33%, .1) 70%, hsla(0, 0%, 33%, 0)); /* #545454 */
border-bottom: 1px dashed hsl(0, 0%, 33%); /* #545454 */
border-top: 1px dashed hsl(0, 0%, 33%); /* #545454 */
margin-top: 0.75em; /* Same as .prisms padding-top */
z-index: 0;
}
.line-highlight.line-highlight:before,
.line-highlight.line-highlight[data-end]:after {
background-color: hsl(215, 15%, 59%); /* #8794A6 */
color: hsl(24, 20%, 95%); /* #F5F2F0 */
}

View File

@@ -0,0 +1,29 @@
"use strict";
exports.isLastDayOfMonth = isLastDayOfMonth;
var _index = require("./endOfDay.js");
var _index2 = require("./endOfMonth.js");
var _index3 = require("./toDate.js");
/**
* @name isLastDayOfMonth
* @category Month Helpers
* @summary Is the given date the last day of a month?
*
* @description
* Is the given date the last day of a month?
*
* @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 the last day of a month
*
* @example
* // Is 28 February 2014 the last day of a month?
* const result = isLastDayOfMonth(new Date(2014, 1, 28))
* //=> true
*/
function isLastDayOfMonth(date) {
const _date = (0, _index3.toDate)(date);
return +(0, _index.endOfDay)(_date) === +(0, _index2.endOfMonth)(_date);
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/Version/RenderFieldsToDiff/fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAarF,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,UAAU,EACV,KAAK,CAAC,aAAa,CAAC,oBAAoB,GAAG,oBAAoB,CAAC,CAwBjE,CAAA"}

View File

@@ -0,0 +1,18 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Sam Chen @chenxsan
*/
"use strict";
/**
* @param {string} urlAndGlobal the script request
* @returns {string[]} script url and its global variable
*/
module.exports = function extractUrlAndGlobal(urlAndGlobal) {
const index = urlAndGlobal.indexOf("@");
if (index <= 0 || index === urlAndGlobal.length - 1) {
throw new Error(`Invalid request "${urlAndGlobal}"`);
}
return [urlAndGlobal.slice(index + 1), urlAndGlobal.slice(0, index)];
};

View File

@@ -0,0 +1,4 @@
import type { Config } from '../config/types.js';
import type { Field } from '../fields/config/types.js';
export declare const getConstraints: (config: Config) => Field;
//# sourceMappingURL=constraints.d.ts.map

View File

@@ -0,0 +1,26 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { KlassConstructor } from '../LexicalEditor';
import type { DOMConversionMap, NodeKey, SerializedLexicalNode } from '../LexicalNode';
import { LexicalNode } from '../LexicalNode';
export type SerializedLineBreakNode = SerializedLexicalNode;
/** @noInheritDoc */
export declare class LineBreakNode extends LexicalNode {
['constructor']: KlassConstructor<typeof LineBreakNode>;
static getType(): string;
static clone(node: LineBreakNode): LineBreakNode;
constructor(key?: NodeKey);
getTextContent(): '\n';
createDOM(): HTMLElement;
updateDOM(): false;
isInline(): true;
static importDOM(): DOMConversionMap | null;
static importJSON(serializedLineBreakNode: SerializedLineBreakNode): LineBreakNode;
}
export declare function $createLineBreakNode(): LineBreakNode;
export declare function $isLineBreakNode(node: LexicalNode | null | undefined): node is LineBreakNode;

View File

@@ -0,0 +1,5 @@
import assertClassBrand from "./assertClassBrand.js";
function _classPrivateFieldSet2(s, a, r) {
return s.set(assertClassBrand(s, a), r), r;
}
export { _classPrivateFieldSet2 as default };

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F zC","129":"A B"},B:{"1":"0 1 2 3 4 5 6 7 8 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","129":"C L M"},C:{"1":"0 1 2 3 4 5 6 7 8 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 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","2":"0C VC 4C 5C"},D:{"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 S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"J bB K D","33":"9 E F A B C L M G N O P cB AB BB"},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","33":"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","33":"QD"},H:{"2":"mD"},I:{"1":"I rD sD","2":"VC nD oD pD","33":"J qD yC"},J:{"1":"A","2":"D"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"1":"B","2":"A"},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:5,C:"Blob URLs",D:true};

View File

@@ -0,0 +1 @@
{"version":3,"file":"tag.js","sources":["../../../src/icons/tag.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Tag\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIuNTg2IDIuNTg2QTIgMiAwIDAgMCAxMS4xNzIgMkg0YTIgMiAwIDAgMC0yIDJ2Ny4xNzJhMiAyIDAgMCAwIC41ODYgMS40MTRsOC43MDQgOC43MDRhMi40MjYgMi40MjYgMCAwIDAgMy40MiAwbDYuNTgtNi41OGEyLjQyNiAyLjQyNiAwIDAgMCAwLTMuNDJ6IiAvPgogIDxjaXJjbGUgY3g9IjcuNSIgY3k9IjcuNSIgcj0iLjUiIGZpbGw9ImN1cnJlbnRDb2xvciIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/tag\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 Tag = createLucideIcon('Tag', [\n [\n 'path',\n {\n d: 'M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z',\n key: 'vktsd0',\n },\n ],\n ['circle', { cx: '7.5', cy: '7.5', r: '.5', fill: 'currentColor', key: 'kqv944' }],\n]);\n\nexport default Tag;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,iBAAiB,KAAO,CAAA,CAAA,CAAA;AAAA,CAClC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAE,CAAA,CAAA,CAAA,EAAI,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,39 @@
{
"name": "@babel/generator",
"version": "7.29.1",
"description": "Turns an AST into code.",
"author": "The Babel Team (https://babel.dev/team)",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-generator"
},
"homepage": "https://babel.dev/docs/en/next/babel-generator",
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen",
"main": "./lib/index.js",
"files": [
"lib"
],
"dependencies": {
"@babel/parser": "^7.29.0",
"@babel/types": "^7.29.0",
"@jridgewell/gen-mapping": "^0.3.12",
"@jridgewell/trace-mapping": "^0.3.28",
"jsesc": "^3.0.2"
},
"devDependencies": {
"@babel/core": "^7.29.0",
"@babel/helper-fixtures": "^7.28.6",
"@babel/plugin-transform-typescript": "^7.28.6",
"@jridgewell/sourcemap-codec": "^1.5.3",
"charcodes": "^0.2.0"
},
"engines": {
"node": ">=6.9.0"
},
"type": "commonjs"
}

View File

@@ -0,0 +1,5 @@
import type { CodeKeywordDefinition, SchemaObject } from "../../types";
import { _JTDTypeError } from "./error";
export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject>;
declare const def: CodeKeywordDefinition;
export default def;

View File

@@ -0,0 +1,35 @@
import _extends from '@babel/runtime/helpers/esm/extends';
import * as React from 'react';
import { forwardRef } from 'react';
import { S as Select } from '../../dist/Select-aab027f3.esm.js';
import { u as useStateManager } from '../../dist/useStateManager-7e1e8489.esm.js';
import { u as useAsync } from '../../dist/useAsync-c64f5536.esm.js';
export { u as useAsync } from '../../dist/useAsync-c64f5536.esm.js';
import '@babel/runtime/helpers/objectSpread2';
import '@babel/runtime/helpers/classCallCheck';
import '@babel/runtime/helpers/createClass';
import '@babel/runtime/helpers/inherits';
import '@babel/runtime/helpers/createSuper';
import '@babel/runtime/helpers/toConsumableArray';
import '../../dist/index-641ee5b8.esm.js';
import '@emotion/react';
import '@babel/runtime/helpers/slicedToArray';
import '@babel/runtime/helpers/objectWithoutProperties';
import '@babel/runtime/helpers/typeof';
import '@babel/runtime/helpers/taggedTemplateLiteral';
import '@babel/runtime/helpers/defineProperty';
import 'react-dom';
import '@floating-ui/dom';
import 'use-isomorphic-layout-effect';
import 'memoize-one';
var AsyncSelect = /*#__PURE__*/forwardRef(function (props, ref) {
var stateManagedProps = useAsync(props);
var selectProps = useStateManager(stateManagedProps);
return /*#__PURE__*/React.createElement(Select, _extends({
ref: ref
}, selectProps));
});
var AsyncSelect$1 = AsyncSelect;
export { AsyncSelect$1 as default };

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"1":"0 1 2 3 4 5 6 7 8 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 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 uB vB wB xB yB zB 4C 5C","194":"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","1218":"H R YC S T U V W X Y Z a b c d e f g"},D:{"1":"0 1 2 3 4 5 6 7 8 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 DB EB FB GB HB IB dB eB","322":"fB gB hB iB jB"},E:{"1":"eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J bB K D E F A B C L M G 6C bC 7C 8C 9C AD cC PC QC BD CD DD dC"},F:{"1":"0 1 2 3 4 5 6 7 8 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 G N O P JD KD LD MD PC xC ND QC","578":"9 cB AB BB CB"},G:{"1":"eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"E bC OD yC PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC"},H:{"2":"mD"},I:{"1":"I","2":"VC J nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"2":"A B"},O:{"1":"RC"},P:{"1":"9 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:{"2":"6D 7D"}},B:1,C:"Dialog element",D:true};

View File

@@ -0,0 +1,59 @@
//#region src/auth/types.d.ts
type AuthenticationMode = 'json' | 'cookie' | 'session';
type LocalLoginPayload = {
email: string;
password: string;
};
type LDAPLoginPayload = {
identifier: string;
password: string;
};
type LoginPayload = LocalLoginPayload | LDAPLoginPayload;
type LoginOptions = {
/** The user's one-time-password (if MFA is enabled). */
otp?: string;
/** Whether to retrieve the refresh token in the JSON response, or in a httpOnly cookie. One of `json`, `cookie` or `session`. Defaults to `cookie`. */
mode?: AuthenticationMode;
/** Use a specific authentication provider (does not work for SSO that relies on browser redirects). */
provider?: string;
};
type LogoutOptions = {
refresh_token?: string;
mode?: AuthenticationMode;
};
type RefreshOptions = {
refresh_token?: string;
mode?: AuthenticationMode;
};
interface AuthenticationData {
access_token: string | null;
refresh_token: string | null;
expires: number | null;
expires_at: number | null;
}
interface AuthenticationStorage {
get: () => Promise<AuthenticationData | null> | AuthenticationData | null;
set: (value: AuthenticationData | null) => Promise<unknown> | unknown;
}
interface AuthenticationConfig {
autoRefresh: boolean;
msRefreshBeforeExpires: number;
credentials?: RequestCredentials;
storage?: AuthenticationStorage;
}
interface AuthenticationClient<_Schema> {
login(payload: LocalLoginPayload, options?: LoginOptions): Promise<AuthenticationData>;
login(payload: LDAPLoginPayload, options?: LoginOptions): Promise<AuthenticationData>;
refresh(options?: RefreshOptions): Promise<AuthenticationData>;
logout(options?: LogoutOptions): Promise<void>;
stopRefreshing(): void;
getToken(): Promise<string | null>;
setToken(access_token: string | null): Promise<unknown>;
}
interface StaticTokenClient<_Schema> {
getToken(): Promise<string | null>;
setToken(access_token: string | null): Promise<unknown>;
}
//#endregion
export { AuthenticationClient, AuthenticationConfig, AuthenticationData, AuthenticationMode, AuthenticationStorage, LDAPLoginPayload, LocalLoginPayload, LoginOptions, LoginPayload, LogoutOptions, RefreshOptions, StaticTokenClient };
//# sourceMappingURL=types.d.cts.map

View File

@@ -0,0 +1,84 @@
import { Client, RequestHookInfo, ResponseHookInfo, Span } from '@sentry/core';
/** Options for Request Instrumentation */
export interface RequestInstrumentationOptions {
/**
* List of strings and/or Regular Expressions used to determine which outgoing requests will have `sentry-trace` and `baggage`
* headers attached.
*
* **Default:** If this option is not provided, tracing headers will be attached to all outgoing requests.
* If you are using a browser SDK, by default, tracing headers will only be attached to outgoing requests to the same origin.
*
* **Disclaimer:** Carelessly setting this option in browser environments may result into CORS errors!
* Only attach tracing headers to requests to the same origin, or to requests to services you can control CORS headers of.
* Cross-origin requests, meaning requests to a different domain, for example a request to `https://api.example.com/` while you're on `https://example.com/`, take special care.
* If you are attaching headers to cross-origin requests, make sure the backend handling the request returns a `"Access-Control-Allow-Headers: sentry-trace, baggage"` header to ensure your requests aren't blocked.
*
* If you provide a `tracePropagationTargets` array, the entries you provide will be matched against the entire URL of the outgoing request.
* If you are using a browser SDK, the entries will also be matched against the pathname of the outgoing requests.
* This is so you can have matchers for relative requests, for example, `/^\/api/` if you want to trace requests to your `/api` routes on the same domain.
*
* If any of the two match any of the provided values, tracing headers will be attached to the outgoing request.
* Both, the string values, and the RegExes you provide in the array will match if they partially match the URL or pathname.
*
* Examples:
* - `tracePropagationTargets: [/^\/api/]` and request to `https://same-origin.com/api/posts`:
* - Tracing headers will be attached because the request is sent to the same origin and the regex matches the pathname "/api/posts".
* - `tracePropagationTargets: [/^\/api/]` and request to `https://different-origin.com/api/posts`:
* - Tracing headers will not be attached because the pathname will only be compared when the request target lives on the same origin.
* - `tracePropagationTargets: [/^\/api/, 'https://external-api.com']` and request to `https://external-api.com/v1/data`:
* - Tracing headers will be attached because the request URL matches the string `'https://external-api.com'`.
*/
tracePropagationTargets?: Array<string | RegExp>;
/**
* Flag to disable patching all together for fetch requests.
*
* Default: true
*/
traceFetch: boolean;
/**
* Flag to disable patching all together for xhr requests.
*
* Default: true
*/
traceXHR: boolean;
/**
* Flag to disable tracking of long-lived streams, like server-sent events (SSE) via fetch.
* Do not enable this in case you have live streams or very long running streams.
*
* Disabled by default since it can lead to issues with streams using the `cancel()` api
* (https://github.com/getsentry/sentry-javascript/issues/13950)
*
* Default: false
*/
trackFetchStreamPerformance: boolean;
/**
* If true, Sentry will capture http timings and add them to the corresponding http spans.
*
* Default: true
*/
enableHTTPTimings: boolean;
/**
* This function will be called before creating a span for a request with the given url.
* Return false if you don't want a span for the given url.
*
* Default: (url: string) => true
*/
shouldCreateSpanForRequest?(this: void, url: string): boolean;
/**
* Is called when spans are started for outgoing requests.
*/
onRequestSpanStart?(span: Span, requestInformation: RequestHookInfo): void;
/**
* Is called when spans end for outgoing requests, providing access to response headers.
*/
onRequestSpanEnd?(span: Span, responseInformation: ResponseHookInfo): void;
}
export declare const defaultRequestInstrumentationOptions: RequestInstrumentationOptions;
/** Registers span creators for xhr and fetch requests */
export declare function instrumentOutgoingRequests(client: Client, _options?: Partial<RequestInstrumentationOptions>): void;
/**
* A function that determines whether to attach tracing headers to a request.
* We only export this function for testing purposes.
*/
export declare function shouldAttachHeaders(targetUrl: string, tracePropagationTargets: (string | RegExp)[] | undefined): boolean;
//# sourceMappingURL=request.d.ts.map

View File

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

View File

@@ -0,0 +1,19 @@
/**
* @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 HardDriveUpload = createLucideIcon("HardDriveUpload", [
["path", { d: "m16 6-4-4-4 4", key: "13yo43" }],
["path", { d: "M12 2v8", key: "1q4o3n" }],
["rect", { width: "20", height: "8", x: "2", y: "14", rx: "2", key: "w68u3i" }],
["path", { d: "M6 18h.01", key: "uhywen" }],
["path", { d: "M10 18h.01", key: "h775k" }]
]);
export { HardDriveUpload as default };
//# sourceMappingURL=hard-drive-upload.js.map

View File

@@ -0,0 +1,725 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const types = require('../types.js');
const cls = require('./cls.js');
const instrument = require('./instrument.js');
const lcp = require('./lcp.js');
const resourceTiming = require('./resourceTiming.js');
const utils = require('./utils.js');
const getActivationStart = require('./web-vitals/lib/getActivationStart.js');
const getNavigationEntry = require('./web-vitals/lib/getNavigationEntry.js');
const getVisibilityWatcher = require('./web-vitals/lib/getVisibilityWatcher.js');
const MAX_INT_AS_BYTES = 2147483647;
let _performanceCursor = 0;
let _measurements = {};
let _lcpEntry;
let _clsEntry;
/**
* Start tracking web vitals.
* The callback returned by this function can be used to stop tracking & ensure all measurements are final & captured.
*
* @returns A function that forces web vitals collection
*/
function startTrackingWebVitals({
recordClsStandaloneSpans,
recordLcpStandaloneSpans,
client,
}) {
const performance = utils.getBrowserPerformanceAPI();
if (performance && core.browserPerformanceTimeOrigin()) {
// @ts-expect-error we want to make sure all of these are available, even if TS is sure they are
if (performance.mark) {
types.WINDOW.performance.mark('sentry-tracing-init');
}
const lcpCleanupCallback = recordLcpStandaloneSpans ? lcp.trackLcpAsStandaloneSpan(client) : _trackLCP();
const ttfbCleanupCallback = _trackTtfb();
const clsCleanupCallback = recordClsStandaloneSpans ? cls.trackClsAsStandaloneSpan(client) : _trackCLS();
return () => {
lcpCleanupCallback?.();
ttfbCleanupCallback();
clsCleanupCallback?.();
};
}
return () => undefined;
}
/**
* Start tracking long tasks.
*/
function startTrackingLongTasks() {
instrument.addPerformanceInstrumentationHandler('longtask', ({ entries }) => {
const parent = core.getActiveSpan();
if (!parent) {
return;
}
const { op: parentOp, start_timestamp: parentStartTimestamp } = core.spanToJSON(parent);
for (const entry of entries) {
const startTime = utils.msToSec((core.browserPerformanceTimeOrigin() ) + entry.startTime);
const duration = utils.msToSec(entry.duration);
if (parentOp === 'navigation' && parentStartTimestamp && startTime < parentStartTimestamp) {
// Skip adding a span if the long task started before the navigation started.
// `startAndEndSpan` will otherwise adjust the parent's start time to the span's start
// time, potentially skewing the duration of the actual navigation as reported via our
// routing instrumentations
continue;
}
utils.startAndEndSpan(parent, startTime, startTime + duration, {
name: 'Main UI thread blocked',
op: 'ui.long-task',
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',
},
});
}
});
}
/**
* Start tracking long animation frames.
*/
function startTrackingLongAnimationFrames() {
// NOTE: the current web-vitals version (3.5.2) does not support long-animation-frame, so
// we directly observe `long-animation-frame` events instead of through the web-vitals
// `observe` helper function.
const observer = new PerformanceObserver(list => {
const parent = core.getActiveSpan();
if (!parent) {
return;
}
for (const entry of list.getEntries() ) {
if (!entry.scripts[0]) {
continue;
}
const startTime = utils.msToSec((core.browserPerformanceTimeOrigin() ) + entry.startTime);
const { start_timestamp: parentStartTimestamp, op: parentOp } = core.spanToJSON(parent);
if (parentOp === 'navigation' && parentStartTimestamp && startTime < parentStartTimestamp) {
// Skip adding the span if the long animation frame started before the navigation started.
// `startAndEndSpan` will otherwise adjust the parent's start time to the span's start
// time, potentially skewing the duration of the actual navigation as reported via our
// routing instrumentations
continue;
}
const duration = utils.msToSec(entry.duration);
const attributes = {
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',
};
const initialScript = entry.scripts[0];
const { invoker, invokerType, sourceURL, sourceFunctionName, sourceCharPosition } = initialScript;
attributes['browser.script.invoker'] = invoker;
attributes['browser.script.invoker_type'] = invokerType;
if (sourceURL) {
attributes['code.filepath'] = sourceURL;
}
if (sourceFunctionName) {
attributes['code.function'] = sourceFunctionName;
}
if (sourceCharPosition !== -1) {
attributes['browser.script.source_char_position'] = sourceCharPosition;
}
utils.startAndEndSpan(parent, startTime, startTime + duration, {
name: 'Main UI thread blocked',
op: 'ui.long-animation-frame',
attributes,
});
}
});
observer.observe({ type: 'long-animation-frame', buffered: true });
}
/**
* Start tracking interaction events.
*/
function startTrackingInteractions() {
instrument.addPerformanceInstrumentationHandler('event', ({ entries }) => {
const parent = core.getActiveSpan();
if (!parent) {
return;
}
for (const entry of entries) {
if (entry.name === 'click') {
const startTime = utils.msToSec((core.browserPerformanceTimeOrigin() ) + entry.startTime);
const duration = utils.msToSec(entry.duration);
const spanOptions = {
name: core.htmlTreeAsString(entry.target),
op: `ui.interaction.${entry.name}`,
startTime: startTime,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',
},
};
const componentName = core.getComponentName(entry.target);
if (componentName) {
spanOptions.attributes['ui.component_name'] = componentName;
}
utils.startAndEndSpan(parent, startTime, startTime + duration, spanOptions);
}
}
});
}
/**
* Starts tracking the Cumulative Layout Shift on the current page and collects the value and last entry
* to the `_measurements` object which ultimately is applied to the pageload span's measurements.
*/
function _trackCLS() {
return instrument.addClsInstrumentationHandler(({ metric }) => {
const entry = metric.entries[metric.entries.length - 1] ;
if (!entry) {
return;
}
_measurements['cls'] = { value: metric.value, unit: '' };
_clsEntry = entry;
}, true);
}
/** Starts tracking the Largest Contentful Paint on the current page. */
function _trackLCP() {
return instrument.addLcpInstrumentationHandler(({ metric }) => {
const entry = metric.entries[metric.entries.length - 1];
if (!entry) {
return;
}
_measurements['lcp'] = { value: metric.value, unit: 'millisecond' };
_lcpEntry = entry ;
}, true);
}
function _trackTtfb() {
return instrument.addTtfbInstrumentationHandler(({ metric }) => {
const entry = metric.entries[metric.entries.length - 1];
if (!entry) {
return;
}
_measurements['ttfb'] = { value: metric.value, unit: 'millisecond' };
});
}
/** Add performance related spans to a transaction */
function addPerformanceEntries(span, options) {
const performance = utils.getBrowserPerformanceAPI();
const origin = core.browserPerformanceTimeOrigin();
if (!performance?.getEntries || !origin) {
// Gatekeeper if performance API not available
return;
}
const timeOrigin = utils.msToSec(origin);
const performanceEntries = performance.getEntries();
const { op, start_timestamp: transactionStartTime } = core.spanToJSON(span);
performanceEntries.slice(_performanceCursor).forEach(entry => {
const startTime = utils.msToSec(entry.startTime);
const duration = utils.msToSec(
// Inexplicably, Chrome sometimes emits a negative duration. We need to work around this.
// There is a SO post attempting to explain this, but it leaves one with open questions: https://stackoverflow.com/questions/23191918/peformance-getentries-and-negative-duration-display
// The way we clamp the value is probably not accurate, since we have observed this happen for things that may take a while to load, like for example the replay worker.
// TODO: Investigate why this happens and how to properly mitigate. For now, this is a workaround to prevent transactions being dropped due to negative duration spans.
Math.max(0, entry.duration),
);
if (op === 'navigation' && transactionStartTime && timeOrigin + startTime < transactionStartTime) {
return;
}
switch (entry.entryType) {
case 'navigation': {
_addNavigationSpans(span, entry , timeOrigin);
break;
}
case 'mark':
case 'paint':
case 'measure': {
_addMeasureSpans(span, entry, startTime, duration, timeOrigin, options.ignorePerformanceApiSpans);
// capture web vitals
const firstHidden = getVisibilityWatcher.getVisibilityWatcher();
// Only report if the page wasn't hidden prior to the web vital.
const shouldRecord = entry.startTime < firstHidden.firstHiddenTime;
if (entry.name === 'first-paint' && shouldRecord) {
_measurements['fp'] = { value: entry.startTime, unit: 'millisecond' };
}
if (entry.name === 'first-contentful-paint' && shouldRecord) {
_measurements['fcp'] = { value: entry.startTime, unit: 'millisecond' };
}
break;
}
case 'resource': {
_addResourceSpans(
span,
entry ,
entry.name,
startTime,
duration,
timeOrigin,
options.ignoreResourceSpans,
);
break;
}
// Ignore other entry types.
}
});
_performanceCursor = Math.max(performanceEntries.length - 1, 0);
_trackNavigator(span);
// Measurements are only available for pageload transactions
if (op === 'pageload') {
_addTtfbRequestTimeToMeasurements(_measurements);
// If CLS standalone spans are enabled, don't record CLS as a measurement
if (!options.recordClsOnPageloadSpan) {
delete _measurements.cls;
}
// If LCP standalone spans are enabled, don't record LCP as a measurement
if (!options.recordLcpOnPageloadSpan) {
delete _measurements.lcp;
}
Object.entries(_measurements).forEach(([measurementName, measurement]) => {
core.setMeasurement(measurementName, measurement.value, measurement.unit);
});
// Set timeOrigin which denotes the timestamp which to base the LCP/FCP/FP/TTFB measurements on
span.setAttribute('performance.timeOrigin', timeOrigin);
// In prerendering scenarios, where a page might be prefetched and pre-rendered before the user clicks the link,
// the navigation starts earlier than when the user clicks it. Web Vitals should always be based on the
// user-perceived time, so they are not reported from the actual start of the navigation, but rather from the
// time where the user actively started the navigation, for example by clicking a link.
// This is user action is called "activation" and the time between navigation and activation is stored in
// the `activationStart` attribute of the "navigation" PerformanceEntry.
span.setAttribute('performance.activationStart', getActivationStart.getActivationStart());
_setWebVitalAttributes(span, options);
}
_lcpEntry = undefined;
_clsEntry = undefined;
_measurements = {};
}
/**
* React 19.2+ creates performance.measure entries for component renders.
* We can identify them by the `detail.devtools.track` property being set to 'Components ⚛'.
* see: https://react.dev/reference/dev-tools/react-performance-tracks
* see: https://github.com/facebook/react/blob/06fcc8f380c6a905c7bc18d94453f623cf8cbc81/packages/react-reconciler/src/ReactFiberPerformanceTrack.js#L454-L473
*/
function isReact19MeasureEntry(entry) {
if (entry?.entryType !== 'measure') {
return;
}
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
return (entry ).detail.devtools.track === 'Components ⚛';
} catch {
return;
}
}
/**
* Create measure related spans.
* Exported only for tests.
*/
function _addMeasureSpans(
span,
entry,
startTime,
duration,
timeOrigin,
ignorePerformanceApiSpans,
) {
if (isReact19MeasureEntry(entry)) {
return;
}
if (
['mark', 'measure'].includes(entry.entryType) &&
core.stringMatchesSomePattern(entry.name, ignorePerformanceApiSpans)
) {
return;
}
const navEntry = getNavigationEntry.getNavigationEntry(false);
const requestTime = utils.msToSec(navEntry ? navEntry.requestStart : 0);
// Because performance.measure accepts arbitrary timestamps it can produce
// spans that happen before the browser even makes a request for the page.
//
// An example of this is the automatically generated Next.js-before-hydration
// spans created by the Next.js framework.
//
// To prevent this we will pin the start timestamp to the request start time
// This does make duration inaccurate, so if this does happen, we will add
// an attribute to the span
const measureStartTimestamp = timeOrigin + Math.max(startTime, requestTime);
const startTimeStamp = timeOrigin + startTime;
const measureEndTimestamp = startTimeStamp + duration;
const attributes = {
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics',
};
if (measureStartTimestamp !== startTimeStamp) {
attributes['sentry.browser.measure_happened_before_request'] = true;
attributes['sentry.browser.measure_start_time'] = measureStartTimestamp;
}
_addDetailToSpanAttributes(attributes, entry );
// Measurements from third parties can be off, which would create invalid spans, dropping transactions in the process.
if (measureStartTimestamp <= measureEndTimestamp) {
utils.startAndEndSpan(span, measureStartTimestamp, measureEndTimestamp, {
name: entry.name,
op: entry.entryType,
attributes,
});
}
}
function _addDetailToSpanAttributes(attributes, performanceMeasure) {
try {
// Accessing detail might throw in some browsers (e.g., Firefox) due to security restrictions
const detail = performanceMeasure.detail;
if (!detail) {
return;
}
// Process detail based on its type
if (typeof detail === 'object') {
// Handle object details
for (const [key, value] of Object.entries(detail)) {
if (value && core.isPrimitive(value)) {
attributes[`sentry.browser.measure.detail.${key}`] = value ;
} else if (value !== undefined) {
try {
// This is user defined so we can't guarantee it's serializable
attributes[`sentry.browser.measure.detail.${key}`] = JSON.stringify(value);
} catch {
// Skip values that can't be stringified
}
}
}
return;
}
if (core.isPrimitive(detail)) {
// Handle primitive details
attributes['sentry.browser.measure.detail'] = detail ;
return;
}
try {
attributes['sentry.browser.measure.detail'] = JSON.stringify(detail);
} catch {
// Skip if stringification fails
}
} catch {
// Silently ignore any errors when accessing detail
// This handles the Firefox "Permission denied to access object" error
}
}
/**
* Instrument navigation entries
* exported only for tests
*/
function _addNavigationSpans(span, entry, timeOrigin) {
(['unloadEvent', 'redirect', 'domContentLoadedEvent', 'loadEvent', 'connect'] ).forEach(event => {
_addPerformanceNavigationTiming(span, entry, event, timeOrigin);
});
_addPerformanceNavigationTiming(span, entry, 'secureConnection', timeOrigin, 'TLS/SSL');
_addPerformanceNavigationTiming(span, entry, 'fetch', timeOrigin, 'cache');
_addPerformanceNavigationTiming(span, entry, 'domainLookup', timeOrigin, 'DNS');
_addRequest(span, entry, timeOrigin);
}
/** Create performance navigation related spans */
function _addPerformanceNavigationTiming(
span,
entry,
event,
timeOrigin,
name = event,
) {
const eventEnd = _getEndPropertyNameForNavigationTiming(event) ;
const end = entry[eventEnd];
const start = entry[`${event}Start`];
if (!start || !end) {
return;
}
utils.startAndEndSpan(span, timeOrigin + utils.msToSec(start), timeOrigin + utils.msToSec(end), {
op: `browser.${name}`,
name: entry.name,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',
...(event === 'redirect' && entry.redirectCount != null ? { 'http.redirect_count': entry.redirectCount } : {}),
},
});
}
function _getEndPropertyNameForNavigationTiming(event) {
if (event === 'secureConnection') {
return 'connectEnd';
}
if (event === 'fetch') {
return 'domainLookupStart';
}
return `${event}End`;
}
/** Create request and response related spans */
function _addRequest(span, entry, timeOrigin) {
const requestStartTimestamp = timeOrigin + utils.msToSec(entry.requestStart);
const responseEndTimestamp = timeOrigin + utils.msToSec(entry.responseEnd);
const responseStartTimestamp = timeOrigin + utils.msToSec(entry.responseStart);
if (entry.responseEnd) {
// It is possible that we are collecting these metrics when the page hasn't finished loading yet, for example when the HTML slowly streams in.
// In this case, ie. when the document request hasn't finished yet, `entry.responseEnd` will be 0.
// In order not to produce faulty spans, where the end timestamp is before the start timestamp, we will only collect
// these spans when the responseEnd value is available. The backend (Relay) would drop the entire span if it contained faulty spans.
utils.startAndEndSpan(span, requestStartTimestamp, responseEndTimestamp, {
op: 'browser.request',
name: entry.name,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',
},
});
utils.startAndEndSpan(span, responseStartTimestamp, responseEndTimestamp, {
op: 'browser.response',
name: entry.name,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',
},
});
}
}
/**
* Create resource-related spans.
* Exported only for tests.
*/
function _addResourceSpans(
span,
entry,
resourceUrl,
startTime,
duration,
timeOrigin,
ignoredResourceSpanOps,
) {
// we already instrument based on fetch and xhr, so we don't need to
// duplicate spans here.
if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {
return;
}
const op = entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other';
if (ignoredResourceSpanOps?.includes(op)) {
return;
}
const attributes = {
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics',
};
const parsedUrl = core.parseUrl(resourceUrl);
if (parsedUrl.protocol) {
attributes['url.scheme'] = parsedUrl.protocol.split(':').pop(); // the protocol returned by parseUrl includes a :, but OTEL spec does not, so we remove it.
}
if (parsedUrl.host) {
attributes['server.address'] = parsedUrl.host;
}
attributes['url.same_origin'] = resourceUrl.includes(types.WINDOW.location.origin);
_setResourceRequestAttributes(entry, attributes, [
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/responseStatus
['responseStatus', 'http.response.status_code'],
['transferSize', 'http.response_transfer_size'],
['encodedBodySize', 'http.response_content_length'],
['decodedBodySize', 'http.decoded_response_content_length'],
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/renderBlockingStatus
['renderBlockingStatus', 'resource.render_blocking_status'],
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/deliveryType
['deliveryType', 'http.response_delivery_type'],
]);
const attributesWithResourceTiming = { ...attributes, ...resourceTiming.resourceTimingToSpanAttributes(entry) };
const startTimestamp = timeOrigin + startTime;
const endTimestamp = startTimestamp + duration;
utils.startAndEndSpan(span, startTimestamp, endTimestamp, {
name: resourceUrl.replace(types.WINDOW.location.origin, ''),
op,
attributes: attributesWithResourceTiming,
});
}
/**
* Capture the information of the user agent.
*/
function _trackNavigator(span) {
const navigator = types.WINDOW.navigator ;
if (!navigator) {
return;
}
// track network connectivity
const connection = navigator.connection;
if (connection) {
if (connection.effectiveType) {
span.setAttribute('effectiveConnectionType', connection.effectiveType);
}
if (connection.type) {
span.setAttribute('connectionType', connection.type);
}
if (utils.isMeasurementValue(connection.rtt)) {
_measurements['connection.rtt'] = { value: connection.rtt, unit: 'millisecond' };
}
}
if (utils.isMeasurementValue(navigator.deviceMemory)) {
span.setAttribute('deviceMemory', `${navigator.deviceMemory} GB`);
}
if (utils.isMeasurementValue(navigator.hardwareConcurrency)) {
span.setAttribute('hardwareConcurrency', String(navigator.hardwareConcurrency));
}
}
/** Add LCP / CLS data to span to allow debugging */
function _setWebVitalAttributes(span, options) {
// Only add LCP attributes if LCP is being recorded on the pageload span
if (_lcpEntry && options.recordLcpOnPageloadSpan) {
// Capture Properties of the LCP element that contributes to the LCP.
if (_lcpEntry.element) {
span.setAttribute('lcp.element', core.htmlTreeAsString(_lcpEntry.element));
}
if (_lcpEntry.id) {
span.setAttribute('lcp.id', _lcpEntry.id);
}
if (_lcpEntry.url) {
// Trim URL to the first 200 characters.
span.setAttribute('lcp.url', _lcpEntry.url.trim().slice(0, 200));
}
if (_lcpEntry.loadTime != null) {
// loadTime is the time of LCP that's related to receiving the LCP element response..
span.setAttribute('lcp.loadTime', _lcpEntry.loadTime);
}
if (_lcpEntry.renderTime != null) {
// renderTime is loadTime + rendering time
// it's 0 if the LCP element is loaded from a 3rd party origin that doesn't send the
// `Timing-Allow-Origin` header.
span.setAttribute('lcp.renderTime', _lcpEntry.renderTime);
}
span.setAttribute('lcp.size', _lcpEntry.size);
}
// Only add CLS attributes if CLS is being recorded on the pageload span
if (_clsEntry?.sources && options.recordClsOnPageloadSpan) {
_clsEntry.sources.forEach((source, index) =>
span.setAttribute(`cls.source.${index + 1}`, core.htmlTreeAsString(source.node)),
);
}
}
/**
* Use this to set any attributes we can take directly form the PerformanceResourceTiming entry.
*
* This is just a mapping function for entry->attribute to keep bundle-size minimal.
* Experimental properties are also accepted (see {@link ExperimentalResourceTimingProperty}).
* Assumes that all entry properties might be undefined for browser-specific differences.
* Only accepts string and number values for now and also sets 0-values.
*/
function _setResourceRequestAttributes(
entry,
attributes,
properties,
) {
properties.forEach(([entryKey, attributeKey]) => {
const entryVal = entry[entryKey];
if (
entryVal != null &&
((typeof entryVal === 'number' && entryVal < MAX_INT_AS_BYTES) || typeof entryVal === 'string')
) {
attributes[attributeKey] = entryVal;
}
});
}
/**
* Add ttfb request time information to measurements.
*
* ttfb information is added via vendored web vitals library.
*/
function _addTtfbRequestTimeToMeasurements(_measurements) {
const navEntry = getNavigationEntry.getNavigationEntry(false);
if (!navEntry) {
return;
}
const { responseStart, requestStart } = navEntry;
if (requestStart <= responseStart) {
_measurements['ttfb.requestTime'] = {
value: responseStart - requestStart,
unit: 'millisecond',
};
}
}
exports._addMeasureSpans = _addMeasureSpans;
exports._addNavigationSpans = _addNavigationSpans;
exports._addResourceSpans = _addResourceSpans;
exports._setResourceRequestAttributes = _setResourceRequestAttributes;
exports.addPerformanceEntries = addPerformanceEntries;
exports.startTrackingInteractions = startTrackingInteractions;
exports.startTrackingLongAnimationFrames = startTrackingLongAnimationFrames;
exports.startTrackingLongTasks = startTrackingLongTasks;
exports.startTrackingWebVitals = startTrackingWebVitals;
//# sourceMappingURL=browserMetrics.js.map

View File

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

View File

@@ -0,0 +1,23 @@
/**
* @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 ClipboardCheck = createLucideIcon("ClipboardCheck", [
["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
[
"path",
{
d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",
key: "116196"
}
],
["path", { d: "m9 14 2 2 4-4", key: "df797q" }]
]);
export { ClipboardCheck as default };
//# sourceMappingURL=clipboard-check.js.map

View File

@@ -0,0 +1,3 @@
"use strict";
exports._ = require("tslib").__addDisposableResource;

View File

@@ -0,0 +1,2 @@
import{throwIfEmpty as e}from"../../utils/throw-if-empty.js";const t=(t,n)=>()=>(e(t,`Collection cannot be empty`),e(n,`Field cannot be empty`),{path:`/relations/${t}/${n}`,method:`DELETE`});export{t as deleteRelation};
//# sourceMappingURL=relations.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 './square-dashed-mouse-pointer.js';
//# sourceMappingURL=mouse-pointer-square-dashed.js.map

View File

@@ -0,0 +1,33 @@
var LodashWrapper = require('./_LodashWrapper');
/**
* Executes the chain sequence and returns the wrapped result.
*
* @name commit
* @memberOf _
* @since 3.2.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var array = [1, 2];
* var wrapped = _(array).push(3);
*
* console.log(array);
* // => [1, 2]
*
* wrapped = wrapped.commit();
* console.log(array);
* // => [1, 2, 3]
*
* wrapped.last();
* // => 3
*
* console.log(array);
* // => [1, 2, 3]
*/
function wrapperCommit() {
return new LodashWrapper(this.value(), this.__chain__);
}
module.exports = wrapperCommit;

View File

@@ -0,0 +1,4 @@
import type { CodeKeywordDefinition, AnySchemaObject } from "../../types";
declare const def: CodeKeywordDefinition;
export declare function hasRef(schema: AnySchemaObject): boolean;
export default def;

View File

@@ -0,0 +1,23 @@
/**
* @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 Ghost = createLucideIcon("Ghost", [
["path", { d: "M9 10h.01", key: "qbtxuw" }],
["path", { d: "M15 10h.01", key: "1qmjsl" }],
[
"path",
{
d: "M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z",
key: "uwwb07"
}
]
]);
export { Ghost as default };
//# sourceMappingURL=ghost.js.map

View File

@@ -0,0 +1,12 @@
import type { FormatMessage } from './types.js';
/**
* Compiles and formats an ICU message at runtime using intl-messageformat.
* This is the default implementation used when messages are not precompiled.
*/
declare function formatMessage(
/** The raw ICU message string (or precompiled message, though this implementation ignores precompilation) */
...[key, message, values, options]: Parameters<FormatMessage<string>>): ReturnType<FormatMessage<string>>;
declare namespace formatMessage {
var raw: boolean;
}
export default formatMessage;

View File

@@ -0,0 +1,27 @@
"use strict";
exports.isWeekend = isWeekend;
var _index = require("./toDate.js");
/**
* @name isWeekend
* @category Weekday Helpers
* @summary Does the given date fall on a weekend?
*
* @description
* Does the given date fall on a weekend?
*
* @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 falls on a weekend
*
* @example
* // Does 5 October 2014 fall on a weekend?
* const result = isWeekend(new Date(2014, 9, 5))
* //=> true
*/
function isWeekend(date) {
const day = (0, _index.toDate)(date).getDay();
return day === 0 || day === 6;
}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"background-repeat.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/background-repeat.ts"],"names":[],"mappings":";;;AACA,2CAA2E;AAW9D,QAAA,gBAAgB,GAA8C;IACvE,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,QAAQ;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,OAAO,0BAAiB,CAAC,MAAM,CAAC;aAC3B,GAAG,CAAC,UAAC,MAAM;YACR,OAAA,MAAM;iBACD,MAAM,CAAC,qBAAY,CAAC;iBACpB,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,KAAK,CAAC,KAAK,EAAX,CAAW,CAAC;iBAC3B,IAAI,CAAC,GAAG,CAAC;QAHd,CAGc,CACjB;aACA,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACpC,CAAC;CACJ,CAAC;AAEF,IAAM,qBAAqB,GAAG,UAAC,KAAa;IACxC,QAAQ,KAAK,EAAE;QACX,KAAK,WAAW;YACZ,yBAAmC;QACvC,KAAK,UAAU,CAAC;QAChB,KAAK,kBAAkB;YACnB,wBAAkC;QACtC,KAAK,UAAU,CAAC;QAChB,KAAK,kBAAkB;YACnB,wBAAkC;QACtC,KAAK,QAAQ,CAAC;QACd;YACI,sBAAgC;KACvC;AACL,CAAC,CAAC"}

View File

@@ -0,0 +1,2 @@
const e=require(`../../utils/throw-if-empty.cjs`),t=()=>()=>({path:`/fields`,method:`GET`}),n=t=>()=>(e.throwIfEmpty(t,`Collection cannot be empty`),{path:`/fields/${t}`,method:`GET`}),r=(t,n)=>()=>(e.throwIfEmpty(t,`Collection cannot be empty`),e.throwIfEmpty(n,`Field cannot be empty`),{path:`/fields/${t}/${n}`,method:`GET`});exports.readField=r,exports.readFields=t,exports.readFieldsByCollection=n;
//# sourceMappingURL=fields.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"knex.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/knex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAO1E,eAAO,MAAM,cAAc;;CAG1B,CAAC;AA2BF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,0CAAsC,CAAC"}

View File

@@ -0,0 +1,7 @@
import type {Plugin} from "ajv"
import getDef from "../definitions/transform"
const transform: Plugin<undefined> = (ajv) => ajv.addKeyword(getDef())
export default transform
module.exports = transform

View File

@@ -0,0 +1,332 @@
# Tapable
The tapable package exposes many Hook classes, which can be used to create hooks for plugins.
```javascript
const {
AsyncParallelBailHook,
AsyncParallelHook,
AsyncSeriesBailHook,
AsyncSeriesHook,
AsyncSeriesWaterfallHook,
SyncBailHook,
SyncHook,
SyncLoopHook,
SyncWaterfallHook
} = require("tapable");
```
## Installation
```shell
npm install --save tapable
```
## Usage
All Hook constructors take one optional argument, which is a list of argument names as strings.
```js
const hook = new SyncHook(["arg1", "arg2", "arg3"]);
```
The best practice is to expose all hooks of a class in a `hooks` property:
```js
class Car {
constructor() {
this.hooks = {
accelerate: new SyncHook(["newSpeed"]),
brake: new SyncHook(),
calculateRoutes: new AsyncParallelHook(["source", "target", "routesList"])
};
}
/* ... */
}
```
Other people can now use these hooks:
```js
const myCar = new Car();
// Use the tap method to add a consument
myCar.hooks.brake.tap("WarningLampPlugin", () => warningLamp.on());
```
It's required to pass a name to identify the plugin/reason.
You may receive arguments:
```js
myCar.hooks.accelerate.tap("LoggerPlugin", (newSpeed) =>
console.log(`Accelerating to ${newSpeed}`)
);
```
For sync hooks, `tap` is the only valid method to add a plugin. Async hooks also support async plugins:
```js
myCar.hooks.calculateRoutes.tapPromise(
"GoogleMapsPlugin",
(source, target, routesList) =>
// return a promise
google.maps.findRoute(source, target).then((route) => {
routesList.add(route);
})
);
myCar.hooks.calculateRoutes.tapAsync(
"BingMapsPlugin",
(source, target, routesList, callback) => {
bing.findRoute(source, target, (err, route) => {
if (err) return callback(err);
routesList.add(route);
// call the callback
callback();
});
}
);
// You can still use sync plugins
myCar.hooks.calculateRoutes.tap(
"CachedRoutesPlugin",
(source, target, routesList) => {
const cachedRoute = cache.get(source, target);
if (cachedRoute) routesList.add(cachedRoute);
}
);
```
The class declaring these hooks needs to call them:
```js
class Car {
/**
* You won't get returned value from SyncHook or AsyncParallelHook,
* to do that, use SyncWaterfallHook and AsyncSeriesWaterfallHook respectively
*/
setSpeed(newSpeed) {
// following call returns undefined even when you returned values
this.hooks.accelerate.call(newSpeed);
}
useNavigationSystemPromise(source, target) {
const routesList = new List();
return this.hooks.calculateRoutes
.promise(source, target, routesList)
.then((res) =>
// res is undefined for AsyncParallelHook
routesList.getRoutes()
);
}
useNavigationSystemAsync(source, target, callback) {
const routesList = new List();
this.hooks.calculateRoutes.callAsync(source, target, routesList, (err) => {
if (err) return callback(err);
callback(null, routesList.getRoutes());
});
}
}
```
The Hook will compile a method with the most efficient way of running your plugins. It generates code depending on:
- The number of registered plugins (none, one, many)
- The kind of registered plugins (sync, async, promise)
- The used call method (sync, async, promise)
- The number of arguments
- Whether interception is used
This ensures fastest possible execution.
## Hook types
Each hook can be tapped with one or several functions. How they are executed depends on the hook type:
- Basic hook (without “Waterfall”, “Bail” or “Loop” in its name). This hook simply calls every function it tapped in a row.
- **Waterfall**. A waterfall hook also calls each tapped function in a row. Unlike the basic hook, it passes a return value from each function to the next function.
- **Bail**. A bail hook allows exiting early. When any of the tapped function returns anything, the bail hook will stop executing the remaining ones.
- **Loop**. When a plugin in a loop hook returns a non-undefined value the hook will restart from the first plugin. It will loop until all plugins return undefined.
Additionally, hooks can be synchronous or asynchronous. To reflect this, therere “Sync”, “AsyncSeries”, and “AsyncParallel” hook classes:
- **Sync**. A sync hook can only be tapped with synchronous functions (using `myHook.tap()`).
- **AsyncSeries**. An async-series hook can be tapped with synchronous, callback-based and promise-based functions (using `myHook.tap()`, `myHook.tapAsync()` and `myHook.tapPromise()`). They call each async method in a row.
- **AsyncParallel**. An async-parallel hook can also be tapped with synchronous, callback-based and promise-based functions (using `myHook.tap()`, `myHook.tapAsync()` and `myHook.tapPromise()`). However, they run each async method in parallel.
The hook type is reflected in its class name. E.g., `AsyncSeriesWaterfallHook` allows asynchronous functions and runs them in series, passing each functions return value into the next function.
## Interception
All Hooks offer an additional interception API:
```js
myCar.hooks.calculateRoutes.intercept({
call: (source, target, routesList) => {
console.log("Starting to calculate routes");
},
register: (tapInfo) => {
// tapInfo = { type: "promise", name: "GoogleMapsPlugin", fn: ... }
console.log(`${tapInfo.name} is doing its job`);
return tapInfo; // may return a new tapInfo object
}
});
```
**call**: `(...args) => void` Adding `call` to your interceptor will trigger when hooks are triggered. You have access to the hooks arguments.
**tap**: `(tap: Tap) => void` Adding `tap` to your interceptor will trigger when a plugin taps into a hook. Provided is the `Tap` object. `Tap` object can't be changed.
**loop**: `(...args) => void` Adding `loop` to your interceptor will trigger for each loop of a looping hook.
**register**: `(tap: Tap) => Tap | undefined` Adding `register` to your interceptor will trigger for each added `Tap` and allows to modify it.
## Context
Plugins and interceptors can opt-in to access an optional `context` object, which can be used to pass arbitrary values to subsequent plugins and interceptors.
```js
myCar.hooks.accelerate.intercept({
context: true,
tap: (context, tapInfo) => {
// tapInfo = { type: "sync", name: "NoisePlugin", fn: ... }
console.log(`${tapInfo.name} is doing it's job`);
// `context` starts as an empty object if at least one plugin uses `context: true`.
// If no plugins use `context: true`, then `context` is undefined.
if (context) {
// Arbitrary properties can be added to `context`, which plugins can then access.
context.hasMuffler = true;
}
}
});
myCar.hooks.accelerate.tap(
{
name: "NoisePlugin",
context: true
},
(context, newSpeed) => {
if (context && context.hasMuffler) {
console.log("Silence...");
} else {
console.log("Vroom!");
}
}
);
```
## HookMap
A HookMap is a helper class for a Map with Hooks
```js
const keyedHook = new HookMap((key) => new SyncHook(["arg"]));
```
```js
keyedHook.for("some-key").tap("MyPlugin", (arg) => {
/* ... */
});
keyedHook.for("some-key").tapAsync("MyPlugin", (arg, callback) => {
/* ... */
});
keyedHook.for("some-key").tapPromise("MyPlugin", (arg) => {
/* ... */
});
```
```js
const hook = keyedHook.get("some-key");
if (hook !== undefined) {
hook.callAsync("arg", (err) => {
/* ... */
});
}
```
## Hook/HookMap interface
Public:
```ts
interface Hook {
tap: (name: string | Tap, fn: (context?, ...args) => Result) => void;
tapAsync: (
name: string | Tap,
fn: (
context?,
...args,
callback: (err: Error | null, result: Result) => void
) => void
) => void;
tapPromise: (
name: string | Tap,
fn: (context?, ...args) => Promise<Result>
) => void;
intercept: (interceptor: HookInterceptor) => void;
}
interface HookInterceptor {
call: (context?, ...args) => void;
loop: (context?, ...args) => void;
tap: (context?, tap: Tap) => void;
register: (tap: Tap) => Tap;
context: boolean;
}
interface HookMap {
for: (key: any) => Hook;
intercept: (interceptor: HookMapInterceptor) => void;
}
interface HookMapInterceptor {
factory: (key: any, hook: Hook) => Hook;
}
interface Tap {
name: string;
type: string;
fn: Function;
stage: number;
context: boolean;
before?: string | Array;
}
```
Protected (only for the class containing the hook):
```ts
interface Hook {
isUsed: () => boolean;
call: (...args) => Result;
promise: (...args) => Promise<Result>;
callAsync: (
...args,
callback: (err: Error | null, result: Result) => void
) => void;
}
interface HookMap {
get: (key: any) => Hook | undefined;
for: (key: any) => Hook;
}
```
## MultiHook
A helper Hook-like class to redirect taps to multiple other hooks:
```js
const { MultiHook } = require("tapable");
this.hooks.allHooks = new MultiHook([this.hooks.hookA, this.hooks.hookB]);
```

View File

@@ -0,0 +1,471 @@
import {Syntax} from './options';
import {PromiseOr} from './util/promise_or';
/**
* Contextual information passed to {@link Importer.canonicalize} and {@link
* FileImporter.findFileUrl}. Not all importers will need this information to
* resolve loads, but some may find it useful.
*/
export interface CanonicalizeContext {
/**
* Whether this is being invoked because of a Sass
* `@import` rule, as opposed to a `@use` or `@forward` rule.
*
* This should *only* be used for determining whether or not to load
* [import-only files](https://sass-lang.com/documentation/at-rules/import#import-only-files).
*/
fromImport: boolean;
/**
* The canonical URL of the file that contains the load, if that information
* is available.
*
* For an {@link Importer}, this is only passed when the `url` parameter is a
* relative URL _or_ when its [URL scheme] is included in {@link
* Importer.nonCanonicalScheme}. This ensures that canonical URLs are always
* resolved the same way regardless of context.
*
* [URL scheme]: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL#scheme
*
* For a {@link FileImporter}, this is always available as long as Sass knows
* the canonical URL of the containing file.
*/
containingUrl: URL | null;
}
/**
* A special type of importer that redirects all loads to existing files on
* disk. Although this is less powerful than a full {@link Importer}, it
* automatically takes care of Sass features like resolving partials and file
* extensions and of loading the file from disk.
*
* Like all importers, this implements custom Sass loading logic for [`@use`
* rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
* to {@link Options.importers} or {@link StringOptions.importer}.
*
* @typeParam sync - A `FileImporter<'sync'>`'s {@link findFileUrl} must return
* synchronously, but in return it can be passed to {@link compile} and {@link
* compileString} in addition to {@link compileAsync} and {@link
* compileStringAsync}.
*
* A `FileImporter<'async'>`'s {@link findFileUrl} may either return
* synchronously or asynchronously, but it can only be used with {@link
* compileAsync} and {@link compileStringAsync}.
*
* @example
*
* ```js
* const {pathToFileURL} = require('url');
*
* sass.compile('style.scss', {
* importers: [{
* // An importer that redirects relative URLs starting with "~" to
* // `node_modules`.
* findFileUrl(url) {
* if (!url.startsWith('~')) return null;
* return new URL(url.substring(1), pathToFileURL('node_modules'));
* }
* }]
* });
* ```
*
* @category Importer
*/
export interface FileImporter<
sync extends 'sync' | 'async' = 'sync' | 'async'
> {
/**
* A callback that's called to partially resolve a load (such as
* [`@use`](https://sass-lang.com/documentation/at-rules/use) or
* [`@import`](https://sass-lang.com/documentation/at-rules/import)) to a file
* on disk.
*
* Unlike an {@link Importer}, the compiler will automatically handle relative
* loads for a {@link FileImporter}. See {@link Options.importers} for more
* details on the way loads are resolved.
*
* @param url - The loaded URL. Since this might be relative, it's represented
* as a string rather than a {@link URL} object.
*
* @returns An absolute `file:` URL if this importer recognizes the `url`.
* This may be only partially resolved: the compiler will automatically look
* for [partials](https://sass-lang.com/documentation/at-rules/use#partials),
* [index files](https://sass-lang.com/documentation/at-rules/use#index-files),
* and file extensions based on the returned URL. An importer may also return
* a fully resolved URL if it so chooses.
*
* If this importer doesn't recognize the URL, it should return `null` instead
* to allow other importers or {@link Options.loadPaths | load paths} to
* handle it.
*
* This may also return a `Promise`, but if it does the importer may only be
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link
* compile} or {@link compileString}.
*
* @throws any - If this importer recognizes `url` but determines that it's
* invalid, it may throw an exception that will be wrapped by Sass. If the
* exception object has a `message` property, it will be used as the wrapped
* exception's message; otherwise, the exception object's `toString()` will be
* used. This means it's safe for importers to throw plain strings.
*/
findFileUrl(
url: string,
context: CanonicalizeContext
): PromiseOr<URL | null, sync>;
/** @hidden */
canonicalize?: never;
}
/**
* An object that implements custom Sass loading logic for [`@use`
* rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
* to {@link Options.importers} or {@link StringOptions.importer}.
*
* Importers that simply redirect to files on disk are encouraged to use the
* {@link FileImporter} interface instead.
*
* ### Resolving a Load
*
* This is the process of resolving a load using a custom importer:
*
* - The compiler encounters `@use "db:foo/bar/baz"`.
* - It calls {@link canonicalize} with `"db:foo/bar/baz"`.
* - {@link canonicalize} returns `new URL("db:foo/bar/baz/_index.scss")`.
* - If the compiler has already loaded a stylesheet with this canonical URL, it
* re-uses the existing module.
* - Otherwise, it calls {@link load} with `new
* URL("db:foo/bar/baz/_index.scss")`.
* - {@link load} returns an {@link ImporterResult} that the compiler uses as
* the contents of the module.
*
* See {@link Options.importers} for more details on the way loads are resolved
* using multiple importers and load paths.
*
* @typeParam sync - An `Importer<'sync'>`'s {@link canonicalize} and {@link
* load} must return synchronously, but in return it can be passed to {@link
* compile} and {@link compileString} in addition to {@link compileAsync} and
* {@link compileStringAsync}.
*
* An `Importer<'async'>`'s {@link canonicalize} and {@link load} may either
* return synchronously or asynchronously, but it can only be used with {@link
* compileAsync} and {@link compileStringAsync}.
*
* @example
*
* ```js
* sass.compile('style.scss', {
* // An importer for URLs like `bgcolor:orange` that generates a
* // stylesheet with the given background color.
* importers: [{
* canonicalize(url) {
* if (!url.startsWith('bgcolor:')) return null;
* return new URL(url);
* },
* load(canonicalUrl) {
* return {
* contents: `body {background-color: ${canonicalUrl.pathname}}`,
* syntax: 'scss'
* };
* }
* }]
* });
* ```
*
* @category Importer
*/
export interface Importer<sync extends 'sync' | 'async' = 'sync' | 'async'> {
/**
* If `url` is recognized by this importer, returns its canonical format.
*
* If Sass has already loaded a stylesheet with the returned canonical URL, it
* re-uses the existing parse tree (and the loaded module for `@use`). This
* means that importers **must ensure** that the same canonical URL always
* refers to the same stylesheet, *even across different importers*. As such,
* importers are encouraged to use unique URL schemes to disambiguate between
* one another.
*
* As much as possible, custom importers should canonicalize URLs the same way
* as the built-in filesystem importer:
*
* - The importer should look for stylesheets by adding the prefix `_` to the
* URL's basename, and by adding the extensions `.sass` and `.scss` if the
* URL doesn't already have one of those extensions. For example, if the
* URL was `foo/bar/baz`, the importer would look for:
* - `foo/bar/baz.sass`
* - `foo/bar/baz.scss`
* - `foo/bar/_baz.sass`
* - `foo/bar/_baz.scss`
*
* If the URL was `foo/bar/baz.scss`, the importer would just look for:
* - `foo/bar/baz.scss`
* - `foo/bar/_baz.scss`
*
* If the importer finds a stylesheet at more than one of these URLs, it
* should throw an exception indicating that the URL is ambiguous. Note that
* if the extension is explicitly specified, a stylesheet with the opposite
* extension is allowed to exist.
*
* - If none of the possible paths is valid, the importer should perform the
* same resolution on the URL followed by `/index`. In the example above,
* it would look for:
* - `foo/bar/baz/index.sass`
* - `foo/bar/baz/index.scss`
* - `foo/bar/baz/_index.sass`
* - `foo/bar/baz/_index.scss`
*
* As above, if the importer finds a stylesheet at more than one of these
* URLs, it should throw an exception indicating that the import is
* ambiguous.
*
* If no stylesheets are found, the importer should return `null`.
*
* Calling {@link canonicalize} multiple times with the same URL must return
* the same result. Calling {@link canonicalize} with a URL returned by a
* previous call to {@link canonicalize} must return that URL.
*
* #### Relative URLs
*
* Relative loads in stylesheets loaded from an importer are first resolved
* relative to the canonical URL of the stylesheet that contains it and passed
* back to the {@link canonicalize} method for the local importer that loaded
* that stylesheet. For example, suppose the "Resolving a Load" example {@link
* Importer | above} returned a stylesheet that contained `@use "mixins"`:
*
* - The compiler resolves the URL `mixins` relative to the current
* stylesheet's canonical URL `db:foo/bar/baz/_index.scss` to get
* `db:foo/bar/baz/mixins`.
* - It calls {@link canonicalize} with `"db:foo/bar/baz/mixins"`.
* - {@link canonicalize} returns `new URL("db:foo/bar/baz/_mixins.scss")`.
*
* Because of this, {@link canonicalize} must return a meaningful result when
* called with a URL relative to one returned by an earlier call to {@link
* canonicalize}.
*
* If the local importer's `canonicalize` method returns `null`, the relative
* URL is then passed to each of {@link Options.importers}' `canonicalize()`
* methods in turn until one returns a canonical URL. If none of them do, the
* load fails.
*
* @param url - The loaded URL. Since this might be relative, it's represented
* as a string rather than a {@link URL} object.
*
* @returns An absolute URL if this importer recognizes the `url`, or `null`
* if it doesn't. If this returns `null`, other importers or {@link
* Options.loadPaths | load paths} may handle the load.
*
* This may also return a `Promise`, but if it does the importer may only be
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link
* compile} or {@link compileString}.
*
* @throws any - If this importer recognizes `url` but determines that it's
* invalid, it may throw an exception that will be wrapped by Sass. If the
* exception object has a `message` property, it will be used as the wrapped
* exception's message; otherwise, the exception object's `toString()` will be
* used. This means it's safe for importers to throw plain strings.
*/
canonicalize(
url: string,
context: CanonicalizeContext
): PromiseOr<URL | null, sync>;
/**
* Loads the Sass text for the given `canonicalUrl`, or returns `null` if this
* importer can't find the stylesheet it refers to.
*
* @param canonicalUrl - The canonical URL of the stylesheet to load. This is
* guaranteed to come from a call to {@link canonicalize}, although not every
* call to {@link canonicalize} will result in a call to {@link load}.
*
* @returns The contents of the stylesheet at `canonicalUrl` if it can be
* loaded, or `null` if it can't.
*
* This may also return a `Promise`, but if it does the importer may only be
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link
* compile} or {@link compileString}.
*
* @throws any - If this importer finds a stylesheet at `url` but it fails to
* load for some reason, or if `url` is uniquely associated with this importer
* but doesn't refer to a real stylesheet, the importer may throw an exception
* that will be wrapped by Sass. If the exception object has a `message`
* property, it will be used as the wrapped exception's message; otherwise,
* the exception object's `toString()` will be used. This means it's safe for
* importers to throw plain strings.
*/
load(canonicalUrl: URL): PromiseOr<ImporterResult | null, sync>;
/** @hidden */
findFileUrl?: never;
/**
* A URL scheme or set of schemes (without the `:`) that this importer
* promises never to use for URLs returned by {@link canonicalize}. If it does
* return a URL with one of these schemes, that's an error.
*
* If this is set, any call to canonicalize for a URL with a non-canonical
* scheme will be passed {@link CanonicalizeContext.containingUrl} if it's
* known.
*
* These schemes may only contain lowercase ASCII letters, ASCII numerals,
* `+`, `-`, and `.`. They may not be empty.
*/
nonCanonicalScheme?: string | string[];
}
declare const nodePackageImporterKey: unique symbol;
/**
* The built-in Node.js package importer. This loads pkg: URLs from node_modules
* according to the standard Node.js resolution algorithm.
*
* A Node.js package importer is exposed as a class that can be added to the
* `importers` option.
*
*```js
* const sass = require('sass');
* sass.compileString('@use "pkg:vuetify', {
* importers: [new sass.NodePackageImporter()]
* });
*```
*
* ## Writing Sass packages
*
* Package authors can control what is exposed to their users through their
* `package.json` manifest. The recommended method is to add a `sass`
* conditional export to `package.json`.
*
* ```json
* // node_modules/uicomponents/package.json
* {
* "exports": {
* ".": {
* "sass": "./src/scss/index.scss",
* "import": "./dist/js/index.mjs",
* "default": "./dist/js/index.js"
* }
* }
* }
* ```
*
* This allows a package user to write `@use "pkg:uicomponents"` to load the
* file at `node_modules/uicomponents/src/scss/index.scss`.
*
* The Node.js package importer supports the variety of formats supported by
* Node.js [package entry points], allowing authors to expose multiple subpaths.
*
* [package entry points]:
* https://nodejs.org/api/packages.html#package-entry-points
*
* ```json
* // node_modules/uicomponents/package.json
* {
* "exports": {
* ".": {
* "sass": "./src/scss/index.scss",
* },
* "./colors.scss": {
* "sass": "./src/scss/_colors.scss",
* },
* "./theme/*.scss": {
* "sass": "./src/scss/theme/*.scss",
* },
* }
* }
* ```
*
* This allows a package user to write:
*
* - `@use "pkg:uicomponents";` to import the root export.
* - `@use "pkg:uicomponents/colors";` to import the colors partial.
* - `@use "pkg:uicomponents/theme/purple";` to import a purple theme.
*
* Note that while library users can rely on the importer to resolve
* [partials](https://sass-lang.com/documentation/at-rules/use#partials), [index
* files](https://sass-lang.com/documentation/at-rules/use#index-files), and
* extensions, library authors must specify the entire file path in `exports`.
*
* In addition to the `sass` condition, the `style` condition is also
* acceptable. Sass will match the `default` condition if it's a relevant file
* type, but authors are discouraged from relying on this. Notably, the key
* order matters, and the importer will resolve to the first value with a key
* that is `sass`, `style`, or `default`, so you should always put `default`
* last.
*
* To help package authors who haven't transitioned to package entry points
* using the `exports` field, the Node.js package importer provides several
* fallback options. If the `pkg:` URL does not have a subpath, the Node.js
* package importer will look for a `sass` or `style` key at the root of
* `package.json`.
*
* ```json
* // node_modules/uicomponents/package.json
* {
* "sass": "./src/scss/index.scss",
* }
* ```
*
* This allows a user to write `@use "pkg:uicomponents";` to import the
* `index.scss` file.
*
* Finally, the Node.js package importer will look for an `index` file at the
* package root, resolving partials and extensions. For example, if the file
* `_index.scss` exists in the package root of `uicomponents`, a user can import
* that with `@use "pkg:uicomponents";`.
*
* If a `pkg:` URL includes a subpath that doesn't have a match in package entry
* points, the Node.js importer will attempt to find that file relative to the
* package root, resolving for file extensions, partials and index files. For
* example, if the file `src/sass/_colors.scss` exists in the `uicomponents`
* package, a user can import that file using `@use
* "pkg:uicomponents/src/sass/colors";`.
*
* @compatibility dart: "1.71.0", node: false
* @category Importer
*/
export class NodePackageImporter {
/** Used to distinguish this type from any arbitrary object. */
private readonly [nodePackageImporterKey]: true;
/**
* The NodePackageImporter has an optional `entryPointDirectory` option, which
* is the directory where the Node Package Importer should start when
* resolving `pkg:` URLs in sources other than files on disk. This will be
* used as the `parentURL` in the [Node Module
* Resolution](https://nodejs.org/api/esm.html#resolution-algorithm-specification)
* algorithm.
*
* In order to be found by the Node Package Importer, a package will need to
* be inside a node_modules folder located in the `entryPointDirectory`, or
* one of its parent directories, up to the filesystem root.
*
* Relative paths will be resolved relative to the current working directory.
* If a path is not provided, this defaults to the parent directory of the
* Node.js entrypoint. If that's not available, this will throw an error.
*/
constructor(entryPointDirectory?: string);
}
/**
* The result of successfully loading a stylesheet with an {@link Importer}.
*
* @category Importer
*/
export interface ImporterResult {
/** The contents of the stylesheet. */
contents: string;
/** The syntax with which to parse {@link contents}. */
syntax: Syntax;
/**
* The URL to use to link to the loaded stylesheet's source code in source
* maps. A `file:` URL is ideal because it's accessible to both browsers and
* other build tools, but an `http:` URL is also acceptable.
*
* If this isn't set, it defaults to a `data:` URL that contains the contents
* of the loaded stylesheet.
*/
sourceMapUrl?: URL;
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/uploads/getRangeRequestInfo.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport { parseRangeHeader } from './parseRangeHeader.js'\n\nexport type RangeRequestResult =\n | {\n headers: {\n 'Accept-Ranges': string\n 'Content-Length': string\n 'Content-Range'?: string\n }\n rangeEnd: number\n rangeStart: number\n status: 206\n type: 'partial'\n }\n | {\n headers: {\n 'Accept-Ranges': string\n 'Content-Length': string\n }\n status: 200\n type: 'full'\n }\n | {\n headers: {\n 'Content-Range': string\n }\n status: 416\n type: 'invalid'\n }\n\n/**\n * Gets HTTP Range request information according to RFC 7233\n *\n * @param fileSize - The total size of the file in bytes\n * @param rangeHeader - The Range header value from the request (e.g., \"bytes=0-1023\")\n * @returns Result object with headers and status code for the response\n */\nexport function getRangeRequestInfo({\n fileSize,\n rangeHeader,\n}: {\n fileSize: number\n rangeHeader: null | string\n}): RangeRequestResult {\n // Parse the Range header\n const rangeResult = parseRangeHeader({\n fileSize,\n rangeHeader,\n })\n\n // Handle invalid range\n if (rangeResult.type === 'invalid') {\n return {\n type: 'invalid',\n headers: {\n 'Content-Range': `bytes */${fileSize}`,\n },\n status: httpStatus.REQUESTED_RANGE_NOT_SATISFIABLE,\n }\n }\n\n // Handle partial range request\n if (rangeResult.type === 'partial' && rangeResult.range) {\n const { end, start } = rangeResult.range\n const contentLength = end - start + 1\n\n return {\n type: 'partial',\n headers: {\n 'Accept-Ranges': 'bytes',\n 'Content-Length': String(contentLength),\n 'Content-Range': `bytes ${start}-${end}/${fileSize}`,\n },\n rangeEnd: end,\n rangeStart: start,\n status: httpStatus.PARTIAL_CONTENT,\n }\n }\n\n // Handle full file request (no range or invalid)\n return {\n type: 'full',\n headers: {\n 'Accept-Ranges': 'bytes',\n 'Content-Length': String(fileSize),\n },\n status: httpStatus.OK,\n }\n}\n"],"names":["status","httpStatus","parseRangeHeader","getRangeRequestInfo","fileSize","rangeHeader","rangeResult","type","headers","REQUESTED_RANGE_NOT_SATISFIABLE","range","end","start","contentLength","String","rangeEnd","rangeStart","PARTIAL_CONTENT","OK"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAElD,SAASC,gBAAgB,QAAQ,wBAAuB;AA8BxD;;;;;;CAMC,GACD,OAAO,SAASC,oBAAoB,EAClCC,QAAQ,EACRC,WAAW,EAIZ;IACC,yBAAyB;IACzB,MAAMC,cAAcJ,iBAAiB;QACnCE;QACAC;IACF;IAEA,uBAAuB;IACvB,IAAIC,YAAYC,IAAI,KAAK,WAAW;QAClC,OAAO;YACLA,MAAM;YACNC,SAAS;gBACP,iBAAiB,CAAC,QAAQ,EAAEJ,UAAU;YACxC;YACAJ,QAAQC,WAAWQ,+BAA+B;QACpD;IACF;IAEA,+BAA+B;IAC/B,IAAIH,YAAYC,IAAI,KAAK,aAAaD,YAAYI,KAAK,EAAE;QACvD,MAAM,EAAEC,GAAG,EAAEC,KAAK,EAAE,GAAGN,YAAYI,KAAK;QACxC,MAAMG,gBAAgBF,MAAMC,QAAQ;QAEpC,OAAO;YACLL,MAAM;YACNC,SAAS;gBACP,iBAAiB;gBACjB,kBAAkBM,OAAOD;gBACzB,iBAAiB,CAAC,MAAM,EAAED,MAAM,CAAC,EAAED,IAAI,CAAC,EAAEP,UAAU;YACtD;YACAW,UAAUJ;YACVK,YAAYJ;YACZZ,QAAQC,WAAWgB,eAAe;QACpC;IACF;IAEA,iDAAiD;IACjD,OAAO;QACLV,MAAM;QACNC,SAAS;YACP,iBAAiB;YACjB,kBAAkBM,OAAOV;QAC3B;QACAJ,QAAQC,WAAWiB,EAAE;IACvB;AACF"}

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 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 CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 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 DB EB FB GB HB IB dB eB fB gB hB iB"},E:{"1":"C L M G 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 6C bC 7C 8C 9C AD","132":"A B cC PC"},F:{"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 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 JD KD LD MD PC xC ND QC"},G:{"1":"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":"E bC OD yC PD QD RD SD TD UD"},H:{"2":"mD"},I:{"1":"I","2":"VC J nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"2":"A B"},O:{"1":"RC"},P:{"1":"9 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:2,C:"WOFF 2.0 - Web Open Font Format",D:true};

View File

@@ -0,0 +1,19 @@
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import './index.scss';
const baseClass = 'no-results';
export function NoListResults({
Actions,
Message
}) {
return /*#__PURE__*/_jsxs("div", {
className: baseClass,
children: [Message, Actions && Actions.length > 0 && /*#__PURE__*/_jsx("div", {
className: `${baseClass}__actions`,
children: Actions.map((action, index) => /*#__PURE__*/_jsx(React.Fragment, {
children: action
}, index))
})]
});
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,771 @@
import ObjectIdImport from 'bson-objectid';
import { getBlockSelect, stripUnselectedFields, validateBlocksFilterOptions } from 'payload';
import { deepCopyObjectSimple, fieldAffectsData, fieldHasSubFields, fieldIsHiddenOrDisabled, fieldIsID, fieldIsLocalized, tabHasName } from 'payload/shared';
import { resolveFilterOptions } from '../../utilities/resolveFilterOptions.js';
import { isRowCollapsed } from './isRowCollapsed.js';
import { iterateFields } from './iterateFields.js';
const ObjectId = 'default' in ObjectIdImport ? ObjectIdImport.default : ObjectIdImport;
/**
* Flattens the fields schema and fields data.
* The output is the field path (e.g. array.0.name) mapped to a FormField object.
*/
export const addFieldStatePromise = async args => {
const {
id,
addErrorPathToParent: addErrorPathToParentArg,
anyParentLocalized = false,
blockData,
clientFieldSchemaMap,
collectionSlug,
data,
field,
fieldSchemaMap,
filter,
forceFullValue = false,
fullData,
includeSchema = false,
indexPath,
mockRSCs,
omitParents = false,
operation,
parentPath,
parentPermissions,
parentSchemaPath,
passesCondition,
path,
preferences,
previousFormState,
readOnly,
renderAllFields,
renderFieldFn,
req,
schemaPath,
select,
selectMode,
skipConditionChecks = false,
skipValidation = false,
state
} = args;
if (!args.clientFieldSchemaMap && args.renderFieldFn) {
// eslint-disable-next-line no-console
console.warn('clientFieldSchemaMap is not passed to addFieldStatePromise - this will reduce performance');
}
let fieldPermissions = true;
const fieldState = {};
const lastRenderedPath = previousFormState?.[path]?.lastRenderedPath;
// Append only if true to avoid sending '$undefined' through the network
if (lastRenderedPath) {
fieldState.lastRenderedPath = lastRenderedPath;
}
// If we're rendering all fields, no need to flag this as added by server
const addedByServer = !renderAllFields && !previousFormState?.[path];
// Append only if true to avoid sending '$undefined' through the network
if (addedByServer) {
fieldState.addedByServer = true;
}
// Append only if true to avoid sending '$undefined' through the network
if (passesCondition === false) {
fieldState.passesCondition = false;
}
// Append only if true to avoid sending '$undefined' through the network
if (includeSchema) {
fieldState.fieldSchema = field;
}
if (fieldAffectsData(field) && !fieldIsHiddenOrDisabled(field) && field.type !== 'tab') {
fieldPermissions = parentPermissions === true ? parentPermissions : deepCopyObjectSimple(parentPermissions?.[field.name]);
let hasPermission = fieldPermissions === true || deepCopyObjectSimple(fieldPermissions?.read);
if (typeof field?.access?.read === 'function') {
hasPermission = await field.access.read({
id,
blockData,
data: fullData,
req,
siblingData: data
});
} else {
hasPermission = true;
}
if (!hasPermission) {
return;
}
const validate = 'validate' in field ? field.validate : undefined;
let validationResult = true;
if (typeof validate === 'function' && !skipValidation && passesCondition) {
let jsonError;
if (field.type === 'json' && typeof data[field.name] === 'string') {
try {
JSON.parse(data[field.name]);
} catch (e) {
jsonError = e;
}
}
try {
validationResult = await validate(data?.[field.name], {
...field,
id,
blockData,
collectionSlug,
data: fullData,
event: 'onChange',
// @AlessioGr added `jsonError` in https://github.com/payloadcms/payload/commit/c7ea62a39473408c3ea912c4fbf73e11be4b538d
// @ts-expect-error-next-line
jsonError,
operation,
preferences,
previousValue: previousFormState?.[path]?.initialValue,
req,
siblingData: data
});
} catch (err) {
validationResult = `Error validating field at path: ${path}`;
req.payload.logger.error({
err,
msg: validationResult
});
}
}
/**
* This function adds the error **path** to the current field and all its parents. If a field is invalid, all its parents are also invalid.
* It does not add the error **message** to the current field, as that shouldn't apply to all parents.
* This is done separately below.
*/
const addErrorPathToParent = errorPath => {
if (typeof addErrorPathToParentArg === 'function') {
addErrorPathToParentArg(errorPath);
}
if (!fieldState.errorPaths) {
fieldState.errorPaths = [];
}
if (!fieldState.errorPaths.includes(errorPath)) {
fieldState.errorPaths.push(errorPath);
fieldState.valid = false;
}
};
if (typeof validationResult === 'string') {
fieldState.errorMessage = validationResult;
fieldState.valid = false;
addErrorPathToParent(path);
}
switch (field.type) {
case 'array':
{
const arrayValue = Array.isArray(data[field.name]) ? data[field.name] : [];
const arraySelect = select?.[field.name];
const {
promises,
rows
} = arrayValue.reduce((acc, row, rowIndex) => {
const rowPath = path + '.' + rowIndex;
row.id = row?.id || new ObjectId().toHexString();
if (!omitParents && (!filter || filter(args))) {
const idKey = rowPath + '.id';
state[idKey] = {
initialValue: row.id,
value: row.id
};
if (includeSchema) {
state[idKey].fieldSchema = field.fields.find(field => fieldIsID(field));
}
}
acc.promises.push(iterateFields({
id,
addErrorPathToParent,
anyParentLocalized: field.localized || anyParentLocalized,
blockData,
clientFieldSchemaMap,
collectionSlug,
data: row,
fields: field.fields,
fieldSchemaMap,
filter,
forceFullValue,
fullData,
includeSchema,
mockRSCs,
omitParents,
operation,
parentIndexPath: '',
parentPassesCondition: passesCondition,
parentPath: rowPath,
parentSchemaPath: schemaPath,
permissions: fieldPermissions === true ? fieldPermissions : fieldPermissions?.fields || {},
preferences,
previousFormState,
readOnly,
renderAllFields,
renderFieldFn,
req,
select: typeof arraySelect === 'object' ? arraySelect : undefined,
selectMode,
skipConditionChecks,
skipValidation,
state
}));
if (!acc.rows) {
acc.rows = [];
}
// First, check if `previousFormState` has a matching row
const previousRow = (previousFormState?.[path]?.rows || []).find(prevRow => prevRow.id === row.id);
const newRow = {
id: row.id,
isLoading: false
};
if (previousRow?.lastRenderedPath) {
newRow.lastRenderedPath = previousRow.lastRenderedPath;
}
// add addedByServer flag
if (!previousRow) {
newRow.addedByServer = true;
}
const isCollapsed = isRowCollapsed({
collapsedPrefs: preferences?.fields?.[path]?.collapsed,
field,
previousRow,
row
});
if (isCollapsed) {
newRow.collapsed = true;
}
acc.rows.push(newRow);
return acc;
}, {
promises: [],
rows: []
});
// Wait for all promises and update fields with the results
await Promise.all(promises);
if (rows) {
fieldState.rows = rows;
}
// Add values to field state
if (data[field.name] !== null) {
fieldState.value = forceFullValue ? arrayValue : arrayValue.length;
fieldState.initialValue = forceFullValue ? arrayValue : arrayValue.length;
if (arrayValue.length > 0) {
fieldState.disableFormData = true;
}
}
// Add field to state
if (!omitParents && (!filter || filter(args))) {
state[path] = fieldState;
}
break;
}
case 'blocks':
{
const blocksValue = Array.isArray(data[field.name]) ? data[field.name] : [];
// Handle blocks filterOptions
let filterOptionsValidationResult = null;
if (field.filterOptions) {
filterOptionsValidationResult = await validateBlocksFilterOptions({
id,
data: fullData,
filterOptions: field.filterOptions,
req,
siblingData: data,
value: data[field.name]
});
fieldState.blocksFilterOptions = filterOptionsValidationResult.allowedBlockSlugs;
}
const {
promises,
rowMetadata
} = blocksValue.reduce((acc, row, i) => {
const blockTypeToMatch = row.blockType;
const block = req.payload.blocks[blockTypeToMatch] ?? (field.blockReferences ?? field.blocks).find(blockType => typeof blockType !== 'string' && blockType.slug === blockTypeToMatch);
if (!block) {
throw new Error(`Block with type "${row.blockType}" was found in block data, but no block with that type is defined in the config for field with schema path ${schemaPath}.`);
}
const {
blockSelect,
blockSelectMode
} = getBlockSelect({
block,
select: select?.[field.name],
selectMode
});
const rowPath = path + '.' + i;
if (block) {
row.id = row?.id || new ObjectId().toHexString();
if (!omitParents && (!filter || filter(args))) {
// Handle block `id` field
const idKey = rowPath + '.id';
state[idKey] = {
initialValue: row.id,
value: row.id
};
// If the blocks field fails filterOptions validation, add error paths to the individual blocks that are no longer allowed
if (filterOptionsValidationResult?.invalidBlockSlugs?.length && filterOptionsValidationResult.invalidBlockSlugs.includes(row.blockType)) {
state[idKey].errorMessage = req.t('validation:invalidBlock', {
block: row.blockType
});
state[idKey].valid = false;
addErrorPathToParent(idKey);
// If the error is due to block filterOptions, we want the blocks field (fieldState) to include all the filterOptions-related
// error paths for each sub-block, not for the validation result of the block itself. Otherwise, say there are 2 invalid blocks,
// the blocks field will have 3 instead of 2 error paths - one for itself, and one for each invalid block.
// Instead, we want only the 2 error paths for the individual, invalid blocks.
fieldState.errorPaths = fieldState.errorPaths.filter(errorPath => errorPath !== path);
}
if (includeSchema) {
state[idKey].fieldSchema = includeSchema ? block.fields.find(blockField => fieldIsID(blockField)) : undefined;
}
// Handle `blockType` field
const fieldKey = rowPath + '.blockType';
state[fieldKey] = {
initialValue: row.blockType,
value: row.blockType
};
if (addedByServer) {
state[fieldKey].addedByServer = addedByServer;
}
if (includeSchema) {
state[fieldKey].fieldSchema = block.fields.find(blockField => 'name' in blockField && blockField.name === 'blockType');
}
// Handle `blockName` field
const blockNameKey = rowPath + '.blockName';
state[blockNameKey] = {};
if (row.blockName) {
state[blockNameKey].initialValue = row.blockName;
state[blockNameKey].value = row.blockName;
}
if (includeSchema) {
state[blockNameKey].fieldSchema = block.fields.find(blockField => 'name' in blockField && blockField.name === 'blockName');
}
}
acc.promises.push(iterateFields({
id,
addErrorPathToParent,
anyParentLocalized: field.localized || anyParentLocalized,
blockData: row,
clientFieldSchemaMap,
collectionSlug,
data: row,
fields: block.fields,
fieldSchemaMap,
filter,
forceFullValue,
fullData,
includeSchema,
mockRSCs,
omitParents,
operation,
parentIndexPath: '',
parentPassesCondition: passesCondition,
parentPath: rowPath,
parentSchemaPath: schemaPath + '.' + block.slug,
permissions: fieldPermissions === true ? fieldPermissions : parentPermissions?.[field.name]?.blocks?.[block.slug] === true ? true : parentPermissions?.[field.name]?.blocks?.[block.slug]?.fields || {},
preferences,
previousFormState,
readOnly,
renderAllFields,
renderFieldFn,
req,
select: typeof blockSelect === 'object' ? blockSelect : undefined,
selectMode: blockSelectMode,
skipConditionChecks,
skipValidation,
state
}));
// First, check if `previousFormState` has a matching row
const previousRow = (previousFormState?.[path]?.rows || []).find(prevRow => prevRow.id === row.id);
const newRow = {
id: row.id,
blockType: row.blockType,
isLoading: false
};
if (previousRow?.lastRenderedPath) {
newRow.lastRenderedPath = previousRow.lastRenderedPath;
}
acc.rowMetadata.push(newRow);
const isCollapsed = isRowCollapsed({
collapsedPrefs: preferences?.fields?.[path]?.collapsed,
field,
previousRow,
row
});
if (isCollapsed) {
acc.rowMetadata[acc.rowMetadata.length - 1].collapsed = true;
}
}
return acc;
}, {
promises: [],
rowMetadata: []
});
await Promise.all(promises);
// Add values to field state
if (data[field.name] === null) {
fieldState.value = null;
fieldState.initialValue = null;
} else {
fieldState.value = forceFullValue ? blocksValue : blocksValue.length;
fieldState.initialValue = forceFullValue ? blocksValue : blocksValue.length;
if (blocksValue.length > 0) {
fieldState.disableFormData = true;
}
}
fieldState.rows = rowMetadata;
// Add field to state
if (!omitParents && (!filter || filter(args))) {
state[path] = fieldState;
}
break;
}
case 'group':
{
if (!filter || filter(args)) {
fieldState.disableFormData = true;
state[path] = fieldState;
}
const groupSelect = select?.[field.name];
await iterateFields({
id,
addErrorPathToParent,
anyParentLocalized: field.localized || anyParentLocalized,
blockData,
clientFieldSchemaMap,
collectionSlug,
data: data?.[field.name] || {},
fields: field.fields,
fieldSchemaMap,
filter,
forceFullValue,
fullData,
includeSchema,
mockRSCs,
omitParents,
operation,
parentIndexPath: '',
parentPassesCondition: passesCondition,
parentPath: path,
parentSchemaPath: schemaPath,
permissions: typeof fieldPermissions === 'boolean' ? fieldPermissions : fieldPermissions?.fields,
preferences,
previousFormState,
readOnly,
renderAllFields,
renderFieldFn,
req,
select: typeof groupSelect === 'object' ? groupSelect : undefined,
selectMode,
skipConditionChecks,
skipValidation,
state
});
break;
}
case 'relationship':
case 'upload':
{
if (field.filterOptions) {
if (typeof field.filterOptions === 'object') {
if (typeof field.relationTo === 'string') {
fieldState.filterOptions = {
[field.relationTo]: field.filterOptions
};
} else {
fieldState.filterOptions = field.relationTo.reduce((acc, relation) => {
acc[relation] = field.filterOptions;
return acc;
}, {});
}
}
if (typeof field.filterOptions === 'function') {
const query = await resolveFilterOptions(field.filterOptions, {
id,
blockData,
data: fullData,
relationTo: field.relationTo,
req,
siblingData: data,
user: req.user
});
fieldState.filterOptions = query;
}
}
if (field.hasMany) {
const relationshipValue = Array.isArray(data[field.name]) ? data[field.name].map(relationship => {
if (Array.isArray(field.relationTo)) {
return {
relationTo: relationship.relationTo,
value: relationship.value && typeof relationship.value === 'object' ? relationship.value?.id : relationship.value
};
}
if (typeof relationship === 'object' && relationship !== null) {
return relationship.id;
}
return relationship;
}) : undefined;
fieldState.value = relationshipValue;
fieldState.initialValue = relationshipValue;
} else if (Array.isArray(field.relationTo)) {
if (data[field.name] && typeof data[field.name] === 'object' && 'relationTo' in data[field.name] && 'value' in data[field.name]) {
const value = typeof data[field.name]?.value === 'object' && data[field.name]?.value && 'id' in data[field.name].value ? data[field.name].value.id : data[field.name].value;
const relationshipValue = {
relationTo: data[field.name]?.relationTo,
value
};
fieldState.value = relationshipValue;
fieldState.initialValue = relationshipValue;
}
} else {
const relationshipValue = data[field.name] && typeof data[field.name] === 'object' && 'id' in data[field.name] ? data[field.name].id : data[field.name];
fieldState.value = relationshipValue;
fieldState.initialValue = relationshipValue;
}
if (!filter || filter(args)) {
state[path] = fieldState;
}
break;
}
case 'select':
{
if (typeof field.filterOptions === 'function') {
fieldState.selectFilterOptions = field.filterOptions({
data: fullData,
options: field.options,
req,
siblingData: data
});
}
if (data[field.name] !== undefined) {
fieldState.value = data[field.name];
fieldState.initialValue = data[field.name];
}
if (!filter || filter(args)) {
state[path] = fieldState;
}
break;
}
default:
{
if (data[field.name] !== undefined) {
fieldState.value = data[field.name];
fieldState.initialValue = data[field.name];
}
// Add field to state
if (!filter || filter(args)) {
state[path] = fieldState;
}
break;
}
}
} else if (fieldHasSubFields(field) && !fieldAffectsData(field)) {
// Handle field types that do not use names (row, collapsible, unnamed group etc)
if (!filter || filter(args)) {
state[path] = {
disableFormData: true
};
if (passesCondition === false) {
state[path].passesCondition = false;
}
}
await iterateFields({
id,
mockRSCs,
select,
selectMode,
// passthrough parent functionality
addErrorPathToParent: addErrorPathToParentArg,
anyParentLocalized: fieldIsLocalized(field) || anyParentLocalized,
blockData,
clientFieldSchemaMap,
collectionSlug,
data,
fields: field.fields,
fieldSchemaMap,
filter,
forceFullValue,
fullData,
includeSchema,
omitParents,
operation,
parentIndexPath: indexPath,
parentPassesCondition: passesCondition,
parentPath: path,
parentSchemaPath: schemaPath,
permissions: parentPermissions,
preferences,
previousFormState,
readOnly,
renderAllFields,
renderFieldFn,
req,
skipConditionChecks,
skipValidation,
state
});
} else if (field.type === 'tab') {
const isNamedTab = tabHasName(field);
let tabSelect;
const tabField = {
...field,
type: 'tab'
};
let childPermissions = undefined;
if (isNamedTab) {
const shouldContinue = stripUnselectedFields({
field: tabField,
select,
selectMode,
siblingDoc: data?.[field.name] || {}
});
if (!shouldContinue) {
return;
}
if (parentPermissions === true) {
childPermissions = true;
} else {
const tabPermissions = parentPermissions?.[field.name];
if (tabPermissions === true) {
childPermissions = true;
} else {
childPermissions = tabPermissions?.fields;
}
}
if (typeof select?.[field.name] === 'object') {
tabSelect = select?.[field.name];
}
} else {
childPermissions = parentPermissions;
tabSelect = select;
}
const pathSegments = path ? path.split('.') : [];
// If passesCondition is false then this should always result to false
// If the tab has no admin.condition provided then fallback to passesCondition and let that decide the result
let tabPassesCondition = passesCondition;
if (passesCondition && typeof field.admin?.condition === 'function') {
tabPassesCondition = field.admin.condition(fullData, data, {
blockData,
operation,
path: pathSegments,
user: req.user
});
}
if (field?.id) {
state[field.id] = {
passesCondition: tabPassesCondition
};
}
return iterateFields({
id,
addErrorPathToParent: addErrorPathToParentArg,
anyParentLocalized: field.localized || anyParentLocalized,
blockData,
clientFieldSchemaMap,
collectionSlug,
data: isNamedTab ? data?.[field.name] || {} : data,
fields: field.fields,
fieldSchemaMap,
filter,
forceFullValue,
fullData,
includeSchema,
mockRSCs,
omitParents,
operation,
parentIndexPath: indexPath,
parentPassesCondition: tabPassesCondition,
parentPath: path,
parentSchemaPath: schemaPath,
permissions: childPermissions,
preferences,
previousFormState,
readOnly,
renderAllFields,
renderFieldFn,
req,
select: tabSelect,
selectMode,
skipConditionChecks,
skipValidation,
state
});
} else if (field.type === 'tabs') {
return iterateFields({
id,
addErrorPathToParent: addErrorPathToParentArg,
anyParentLocalized: fieldIsLocalized(field) || anyParentLocalized,
blockData,
clientFieldSchemaMap,
collectionSlug,
data,
fields: field.tabs.map(tab => ({
...tab,
type: 'tab'
})),
fieldSchemaMap,
filter,
forceFullValue,
fullData,
includeSchema,
omitParents,
operation,
parentIndexPath: indexPath,
parentPassesCondition: passesCondition,
parentPath: path,
parentSchemaPath: schemaPath,
permissions: parentPermissions,
preferences,
previousFormState,
renderAllFields,
renderFieldFn,
req,
select,
selectMode,
skipConditionChecks,
skipValidation,
state
});
} else if (field.type === 'ui') {
if (!filter || filter(args)) {
state[path] = fieldState;
state[path].disableFormData = true;
}
}
if (renderFieldFn && !fieldIsHiddenOrDisabled(field)) {
const fieldConfig = fieldSchemaMap.get(schemaPath);
if (!fieldConfig && !mockRSCs) {
if (schemaPath.endsWith('.blockType')) {
return;
} else {
throw new Error(`Field config not found for ${schemaPath}`);
}
}
if (!state[path]) {
// Some fields (ie `Tab`) do not live in form state
// therefore we cannot attach customComponents to them
return;
}
if (addedByServer) {
state[path].addedByServer = addedByServer;
}
renderFieldFn({
id,
clientFieldSchemaMap,
collectionSlug,
data: fullData,
fieldConfig: fieldConfig,
fieldSchemaMap,
fieldState: state[path],
formState: state,
indexPath,
lastRenderedPath,
mockRSCs,
operation,
parentPath,
parentSchemaPath,
path,
permissions: fieldPermissions,
preferences,
previousFieldState: previousFormState?.[path],
readOnly,
renderAllFields,
req,
schemaPath,
siblingData: data
});
}
};
//# sourceMappingURL=addFieldStatePromise.js.map

View File

@@ -0,0 +1,105 @@
"use strict";
exports.formatDistance = void 0;
const formatDistanceLocale = {
lessThanXSeconds: {
one: "minder as 1 sekonde",
other: "minder as {{count}} sekonden",
},
xSeconds: {
one: "1 sekonde",
other: "{{count}} sekonden",
},
halfAMinute: "oardel minút",
lessThanXMinutes: {
one: "minder as 1 minút",
other: "minder as {{count}} minuten",
},
xMinutes: {
one: "1 minút",
other: "{{count}} minuten",
},
aboutXHours: {
one: "sawat 1 oere",
other: "sawat {{count}} oere",
},
xHours: {
one: "1 oere",
other: "{{count}} oere",
},
xDays: {
one: "1 dei",
other: "{{count}} dagen",
},
aboutXWeeks: {
one: "sawat 1 wike",
other: "sawat {{count}} wiken",
},
xWeeks: {
one: "1 wike",
other: "{{count}} wiken",
},
aboutXMonths: {
one: "sawat 1 moanne",
other: "sawat {{count}} moannen",
},
xMonths: {
one: "1 moanne",
other: "{{count}} moannen",
},
aboutXYears: {
one: "sawat 1 jier",
other: "sawat {{count}} jier",
},
xYears: {
one: "1 jier",
other: "{{count}} jier",
},
overXYears: {
one: "mear as 1 jier",
other: "mear as {{count}}s jier",
},
almostXYears: {
one: "hast 1 jier",
other: "hast {{count}} jier",
},
};
const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "oer " + result;
} else {
return result + " lyn";
}
}
return result;
};
exports.formatDistance = formatDistance;

View File

@@ -0,0 +1,60 @@
"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 uuid_exports = {};
__export(uuid_exports, {
PgUUID: () => PgUUID,
PgUUIDBuilder: () => PgUUIDBuilder,
uuid: () => uuid
});
module.exports = __toCommonJS(uuid_exports);
var import_entity = require("../../entity.cjs");
var import_sql = require("../../sql/sql.cjs");
var import_common = require("./common.cjs");
class PgUUIDBuilder extends import_common.PgColumnBuilder {
static [import_entity.entityKind] = "PgUUIDBuilder";
constructor(name) {
super(name, "string", "PgUUID");
}
/**
* Adds `default gen_random_uuid()` to the column definition.
*/
defaultRandom() {
return this.default(import_sql.sql`gen_random_uuid()`);
}
/** @internal */
build(table) {
return new PgUUID(table, this.config);
}
}
class PgUUID extends import_common.PgColumn {
static [import_entity.entityKind] = "PgUUID";
getSQLType() {
return "uuid";
}
}
function uuid(name) {
return new PgUUIDBuilder(name ?? "");
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PgUUID,
PgUUIDBuilder,
uuid
});
//# sourceMappingURL=uuid.cjs.map

View File

@@ -0,0 +1,7 @@
'use strict';
if (process.env.NODE_ENV === "production") {
module.exports = require("./react-select-async-creatable.cjs.prod.js");
} else {
module.exports = require("./react-select-async-creatable.cjs.dev.js");
}

View File

@@ -0,0 +1,134 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const debugBuild = require('../common/debug-build.js');
// Attribute keys for storing cron check-in data on spans
const ATTR_SENTRY_CRON_CHECK_IN_ID = 'sentry.cron.checkInId';
const ATTR_SENTRY_CRON_MONITOR_SLUG = 'sentry.cron.monitorSlug';
const ATTR_SENTRY_CRON_START_TIME = 'sentry.cron.startTime';
const ATTR_SENTRY_CRON_SCHEDULE = 'sentry.cron.schedule';
/**
* Gets the Vercel crons configuration that was injected at build time.
*/
function getVercelCronsConfig() {
const globalWithCronsConfig = globalThis
;
if (!globalWithCronsConfig._sentryVercelCronsConfig) {
return undefined;
}
try {
return JSON.parse(globalWithCronsConfig._sentryVercelCronsConfig) ;
} catch {
debugBuild.DEBUG_BUILD && core.debug.log('[@sentry/nextjs] Failed to parse Vercel crons config');
return undefined;
}
}
/**
* Checks if the request is a Vercel cron request and starts a check-in if it matches a configured cron.
*/
function maybeStartCronCheckIn(span, route) {
const vercelCronsConfig = getVercelCronsConfig();
if (!vercelCronsConfig || !route) {
return;
}
// The strategy here is to check if the request is a Vercel cron
// request by checking the user agent, vercel always sets the user agent to 'vercel-cron/1.0'
const headers = core.getIsolationScope().getScopeData().sdkProcessingMetadata?.normalizedRequest?.headers
;
if (!headers) {
return;
}
const userAgent = Array.isArray(headers['user-agent']) ? headers['user-agent'][0] : headers['user-agent'];
if (!userAgent?.includes('vercel-cron')) {
return;
}
const matchedCron = vercelCronsConfig.find(cron => cron.path === route);
if (!matchedCron?.path || !matchedCron.schedule) {
return;
}
// Use raw path as monitor slug to match legacy wrapApiHandlerWithSentryVercelCrons behavior,
// so migration from automaticVercelMonitors to vercelCronsMonitoring keeps the same monitors.
const monitorSlug = matchedCron.path;
const startTime = core._INTERNAL_safeDateNow() / 1000;
const checkInId = core.captureCheckIn(
{ monitorSlug, status: 'in_progress' },
{
maxRuntime: 60 * 12,
schedule: { type: 'crontab', value: matchedCron.schedule },
},
);
debugBuild.DEBUG_BUILD && core.debug.log(`[Cron] Started check-in for "${monitorSlug}" with ID "${checkInId}"`);
// Store marking attributes on the span so we can complete the check-in later
span.setAttribute(ATTR_SENTRY_CRON_CHECK_IN_ID, checkInId);
span.setAttribute(ATTR_SENTRY_CRON_MONITOR_SLUG, monitorSlug);
span.setAttribute(ATTR_SENTRY_CRON_START_TIME, startTime);
span.setAttribute(ATTR_SENTRY_CRON_SCHEDULE, matchedCron.schedule);
}
/**
* Completes a Vercel cron check-in when a span ends.
* Should be called from the spanEnd event handler.
*/
function maybeCompleteCronCheckIn(span) {
const spanData = core.spanToJSON(span).data;
const checkInId = spanData?.[ATTR_SENTRY_CRON_CHECK_IN_ID];
const monitorSlug = spanData?.[ATTR_SENTRY_CRON_MONITOR_SLUG];
const startTime = spanData?.[ATTR_SENTRY_CRON_START_TIME];
const schedule = spanData?.[ATTR_SENTRY_CRON_SCHEDULE];
if (!checkInId || !monitorSlug || typeof startTime !== 'number') {
return;
}
const duration = core._INTERNAL_safeDateNow() / 1000 - startTime;
const spanStatus = core.spanToJSON(span).status;
// Span status is 'ok' for success, undefined for unset, or an error message like 'internal_error'
const checkInStatus = spanStatus && spanStatus !== 'ok' ? 'error' : 'ok';
// Include monitor_config for upsert in case the in_progress check-in was lost
const monitorConfig =
typeof schedule === 'string'
? {
maxRuntime: 60 * 12,
schedule: { type: 'crontab' , value: schedule },
}
: undefined;
core.captureCheckIn(
{
checkInId: checkInId ,
monitorSlug: monitorSlug ,
status: checkInStatus,
duration,
},
monitorConfig,
);
// Cleanup marking attributes so they don't pollute user span data
span.setAttribute(ATTR_SENTRY_CRON_CHECK_IN_ID, undefined);
span.setAttribute(ATTR_SENTRY_CRON_MONITOR_SLUG, undefined);
span.setAttribute(ATTR_SENTRY_CRON_START_TIME, undefined);
span.setAttribute(ATTR_SENTRY_CRON_SCHEDULE, undefined);
debugBuild.DEBUG_BUILD && core.debug.log(`[Cron] Completed check-in for "${monitorSlug}" with status "${checkInStatus}"`);
}
exports.maybeCompleteCronCheckIn = maybeCompleteCronCheckIn;
exports.maybeStartCronCheckIn = maybeStartCronCheckIn;
//# sourceMappingURL=vercelCronsMonitoring.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"redux.d.ts","sourceRoot":"","sources":["../../src/redux.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG1C,UAAU,MAAM,CAAC,CAAC,GAAG,GAAG;IACtB,IAAI,EAAE,CAAC,CAAC;CACT;AAED,UAAU,SAAU,SAAQ,MAAM;IAChC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAC;CAC3B;AAwCD,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,GAAG;IAC5C;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,gBAAgB,CAAC,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC;IACzD;;;;OAIG;IACH,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC;IACvD;;OAEG;IACH,uBAAuB,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;CACxD;AAWD;;;;GAIG;AACH,iBAAS,mBAAmB,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,GAAG,CAoFlF;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}

View File

@@ -0,0 +1,20 @@
import type { Locale } from 'payload';
import React from 'react';
export declare const LocaleLoadingContext: React.Context<{
localeIsLoading: boolean;
setLocaleIsLoading: (_: boolean) => any;
}>;
export declare const LocaleProvider: React.FC<{
children?: React.ReactNode;
locale?: Locale['code'];
}>;
export declare const useLocaleLoading: () => {
localeIsLoading: boolean;
setLocaleIsLoading: (_: boolean) => any;
};
/**
* TODO: V4
* The return type of the `useLocale` hook will change in v4. It will return `null | Locale` instead of `false | {} | Locale`.
*/
export declare const useLocale: () => Locale;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,52 @@
"use strict";
exports.differenceInISOWeekYears = differenceInISOWeekYears;
var _index = require("./compareAsc.js");
var _index2 = require("./differenceInCalendarISOWeekYears.js");
var _index3 = require("./subISOWeekYears.js");
var _index4 = require("./toDate.js");
/**
* @name differenceInISOWeekYears
* @category ISO Week-Numbering Year Helpers
* @summary Get the number of full ISO week-numbering years between the given dates.
*
* @description
* Get the number of full ISO week-numbering years between the given dates.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param dateLeft - The later date
* @param dateRight - The earlier date
*
* @returns The number of full ISO week-numbering years
*
* @example
* // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012?
* const result = differenceInISOWeekYears(
* new Date(2012, 0, 1),
* new Date(2010, 0, 1)
* )
* //=> 1
*/
function differenceInISOWeekYears(dateLeft, dateRight) {
let _dateLeft = (0, _index4.toDate)(dateLeft);
const _dateRight = (0, _index4.toDate)(dateRight);
const sign = (0, _index.compareAsc)(_dateLeft, _dateRight);
const difference = Math.abs(
(0, _index2.differenceInCalendarISOWeekYears)(_dateLeft, _dateRight),
);
_dateLeft = (0, _index3.subISOWeekYears)(_dateLeft, sign * difference);
// Math.abs(diff in full ISO years - diff in calendar ISO years) === 1
// if last calendar ISO year is not full
// If so, result must be decreased by 1 in absolute value
const isLastISOWeekYearNotFull = Number(
(0, _index.compareAsc)(_dateLeft, _dateRight) === -sign,
);
const result = sign * (difference - isLastISOWeekYearNotFull);
// Prevent negative zero
return result === 0 ? 0 : result;
}

View File

@@ -0,0 +1,7 @@
/**
* Copyright 2013-2014, Facebook, Inc.
* All rights reserved.
* https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/hyphenateStyleName.js
*/
import { Property } from './types';
export default function hyphenateStyleName(string: Property): Property;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Versions/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,uBAAuB,EAAkC,MAAM,SAAS,CAAA;AAEtF,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,cAAc,CAAA;AAIrB,wBAAsB,YAAY,CAAC,KAAK,EAAE,uBAAuB,8BAqLhE"}

View File

@@ -0,0 +1,136 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const client = require('./client.js');
const breadcrumbs = require('./integrations/breadcrumbs.js');
const browserapierrors = require('./integrations/browserapierrors.js');
const browsersession = require('./integrations/browsersession.js');
const culturecontext = require('./integrations/culturecontext.js');
const globalhandlers = require('./integrations/globalhandlers.js');
const httpcontext = require('./integrations/httpcontext.js');
const linkederrors = require('./integrations/linkederrors.js');
const spotlight = require('./integrations/spotlight.js');
const stackParsers = require('./stack-parsers.js');
const fetch = require('./transports/fetch.js');
const detectBrowserExtension = require('./utils/detectBrowserExtension.js');
/** Get the default integrations for the browser SDK. */
function getDefaultIntegrations(_options) {
/**
* Note: Please make sure this stays in sync with Angular SDK, which re-exports
* `getDefaultIntegrations` but with an adjusted set of integrations.
*/
return [
// TODO(v11): Replace with `eventFiltersIntegration` once we remove the deprecated `inboundFiltersIntegration`
// eslint-disable-next-line deprecation/deprecation
core.inboundFiltersIntegration(),
core.functionToStringIntegration(),
core.conversationIdIntegration(),
browserapierrors.browserApiErrorsIntegration(),
breadcrumbs.breadcrumbsIntegration(),
globalhandlers.globalHandlersIntegration(),
linkederrors.linkedErrorsIntegration(),
core.dedupeIntegration(),
httpcontext.httpContextIntegration(),
culturecontext.cultureContextIntegration(),
browsersession.browserSessionIntegration(),
];
}
/**
* The Sentry Browser SDK Client.
*
* To use this SDK, call the {@link init} function as early as possible when
* loading the web page. To set context information or send manual events, use
* the provided methods.
*
* @example
*
* ```
*
* import { init } from '@sentry/browser';
*
* init({
* dsn: '__DSN__',
* // ...
* });
* ```
*
* @example
* ```
*
* import { addBreadcrumb } from '@sentry/browser';
* addBreadcrumb({
* message: 'My Breadcrumb',
* // ...
* });
* ```
*
* @example
*
* ```
*
* import * as Sentry from '@sentry/browser';
* Sentry.captureMessage('Hello, world!');
* Sentry.captureException(new Error('Good bye'));
* Sentry.captureEvent({
* message: 'Manual',
* stacktrace: [
* // ...
* ],
* });
* ```
*
* @see {@link BrowserOptions} for documentation on configuration options.
*/
function init(options = {}) {
const shouldDisableBecauseIsBrowserExtenstion =
!options.skipBrowserExtensionCheck && detectBrowserExtension.checkAndWarnIfIsEmbeddedBrowserExtension();
let defaultIntegrations =
options.defaultIntegrations == null ? getDefaultIntegrations() : options.defaultIntegrations;
/* rollup-include-development-only */
if (options.spotlight) {
if (!defaultIntegrations) {
defaultIntegrations = [];
}
const args = typeof options.spotlight === 'string' ? { sidecarUrl: options.spotlight } : undefined;
defaultIntegrations.push(spotlight.spotlightBrowserIntegration(args));
}
/* rollup-include-development-only-end */
const clientOptions = {
...options,
enabled: shouldDisableBecauseIsBrowserExtenstion ? false : options.enabled,
stackParser: core.stackParserFromStackParserOptions(options.stackParser || stackParsers.defaultStackParser),
integrations: core.getIntegrationsToSetup({
integrations: options.integrations,
defaultIntegrations,
}),
transport: options.transport || fetch.makeFetchTransport,
};
return core.initAndBind(client.BrowserClient, clientOptions);
}
/**
* This function is here to be API compatible with the loader.
* @hidden
*/
function forceLoad() {
// Noop
}
/**
* This function is here to be API compatible with the loader.
* @hidden
*/
function onLoad(callback) {
callback();
}
exports.forceLoad = forceLoad;
exports.getDefaultIntegrations = getDefaultIntegrations;
exports.init = init;
exports.onLoad = onLoad;
//# sourceMappingURL=sdk.js.map

View File

@@ -0,0 +1,132 @@
import fs from 'fs/promises';
import path from 'path';
import { subscribe } from '@parcel/watcher';
import SourceFileFilter from './SourceFileFilter.js';
import SourceFileScanner from './SourceFileScanner.js';
class SourceFileWatcher {
subscriptions = [];
constructor(roots, onChange) {
this.roots = roots;
this.onChange = onChange;
}
async start() {
if (this.subscriptions.length > 0) {
return;
}
const ignore = SourceFileFilter.IGNORED_DIRECTORIES.map(dir => `**/${dir}/**`);
for (const root of this.roots) {
const sub = await subscribe(root, async (err, events) => {
if (err) {
console.error(err);
return;
}
const filtered = await this.normalizeEvents(events);
if (filtered.length > 0) {
void this.onChange(filtered);
}
}, {
ignore
});
this.subscriptions.push(sub);
}
}
async normalizeEvents(events) {
const directoryCreatePaths = [];
const otherEvents = [];
// We need to expand directory creates because during rename operations,
// @parcel/watcher emits a directory create event but may not emit individual
// file events for the moved files
await Promise.all(events.map(async event => {
if (event.type === 'create') {
try {
const stats = await fs.stat(event.path);
if (stats.isDirectory()) {
directoryCreatePaths.push(event.path);
return;
}
} catch {
// Path doesn't exist or is inaccessible, treat as file
}
}
otherEvents.push(event);
}));
// Expand directory create events to find source files inside
let expandedCreateEvents = [];
if (directoryCreatePaths.length > 0) {
try {
const sourceFiles = await SourceFileScanner.getSourceFiles(directoryCreatePaths);
expandedCreateEvents = Array.from(sourceFiles).map(filePath => ({
type: 'create',
path: filePath
}));
} catch {
// Directories might have been deleted or are inaccessible
}
}
// Combine original events with expanded directory creates.
// Deduplicate by path to avoid processing the same file twice
// in case @parcel/watcher also emitted individual file events.
const allEvents = [...otherEvents, ...expandedCreateEvents];
const seenPaths = new Set();
const deduplicated = [];
for (const event of allEvents) {
const key = `${event.type}:${event.path}`;
if (!seenPaths.has(key)) {
seenPaths.add(key);
deduplicated.push(event);
}
}
return deduplicated.filter(event => {
// Keep all delete events (might be deleted directories that no longer exist)
if (event.type === 'delete') {
return true;
}
// Keep source files
return SourceFileFilter.isSourceFile(event.path);
});
}
async expandDirectoryDeleteEvents(events, prevKnownFiles) {
const expanded = [];
for (const event of events) {
if (event.type === 'delete' && !SourceFileFilter.isSourceFile(event.path)) {
const dirPath = path.resolve(event.path);
const filesInDirectory = [];
for (const filePath of prevKnownFiles) {
if (SourceFileFilter.isWithinPath(filePath, dirPath)) {
filesInDirectory.push(filePath);
}
}
// If we found files within this path, it was a directory
if (filesInDirectory.length > 0) {
for (const filePath of filesInDirectory) {
expanded.push({
type: 'delete',
path: filePath
});
}
} else {
// Not a directory or no files in it, pass through as-is
expanded.push(event);
}
} else {
// Pass through as-is
expanded.push(event);
}
}
return expanded;
}
async stop() {
await Promise.all(this.subscriptions.map(sub => sub.unsubscribe()));
this.subscriptions = [];
}
[Symbol.dispose]() {
void this.stop();
}
}
export { SourceFileWatcher as default };

View File

@@ -0,0 +1 @@
{"version":3,"file":"handleFormStateLocking.d.ts","sourceRoot":"","sources":["../../src/utilities/handleFormStateLocking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExD,KAAK,IAAI,GAAG;IACV,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,SAAS,CAAA;CAChB,CAAA;AAID,eAAO,MAAM,sBAAsB,+DAMhC,IAAI,KAAG,OAAO,CAAC,MAAM,CAsIvB,CAAA"}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/vercel-postgres/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport type { VercelPgDatabase } from './driver.ts';\n\nexport async function migrate<TSchema extends Record<string, unknown>>(\n\tdb: VercelPgDatabase<TSchema>,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\tawait db.dialect.migrate(migrations, db.session, config);\n}\n"],"mappings":"AACA,SAAS,0BAA0B;AAGnC,eAAsB,QACrB,IACA,QACC;AACD,QAAM,aAAa,mBAAmB,MAAM;AAC5C,QAAM,GAAG,QAAQ,QAAQ,YAAY,GAAG,SAAS,MAAM;AACxD;","names":[]}

View File

@@ -0,0 +1,168 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const helpers = require('../helpers.js');
const fetch = require('./fetch.js');
// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being
// modified and simplified: https://github.com/jakearchibald/idb-keyval
//
// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca
// Original license:
// Copyright 2016, Jake Archibald
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// 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.
function promisifyRequest(request) {
return new Promise((resolve, reject) => {
// @ts-expect-error - file size hacks
request.oncomplete = request.onsuccess = () => resolve(request.result);
// @ts-expect-error - file size hacks
request.onabort = request.onerror = () => reject(request.error);
});
}
/** Create or open an IndexedDb store */
function createStore(dbName, storeName) {
const request = indexedDB.open(dbName);
request.onupgradeneeded = () => request.result.createObjectStore(storeName);
const dbp = promisifyRequest(request);
return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));
}
function keys(store) {
return promisifyRequest(store.getAllKeys() );
}
/** Insert into the end of the store */
function push(store, value, maxQueueSize) {
return store(store => {
return keys(store).then(keys => {
if (keys.length >= maxQueueSize) {
return;
}
// We insert with an incremented key so that the entries are popped in order
store.put(value, Math.max(...keys, 0) + 1);
return promisifyRequest(store.transaction);
});
});
}
/** Insert into the front of the store */
function unshift(store, value, maxQueueSize) {
return store(store => {
return keys(store).then(keys => {
if (keys.length >= maxQueueSize) {
return;
}
// We insert with an decremented key so that the entries are popped in order
store.put(value, Math.min(...keys, 0) - 1);
return promisifyRequest(store.transaction);
});
});
}
/** Pop the oldest value from the store */
function shift(store) {
return store(store => {
return keys(store).then(keys => {
const firstKey = keys[0];
if (firstKey == null) {
return undefined;
}
return promisifyRequest(store.get(firstKey)).then(value => {
store.delete(firstKey);
return promisifyRequest(store.transaction).then(() => value);
});
});
});
}
function createIndexedDbStore(options) {
let store;
// Lazily create the store only when it's needed
function getStore() {
if (store == undefined) {
store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');
}
return store;
}
return {
push: async (env) => {
try {
const serialized = await core.serializeEnvelope(env);
await push(getStore(), serialized, options.maxQueueSize || 30);
} catch {
//
}
},
unshift: async (env) => {
try {
const serialized = await core.serializeEnvelope(env);
await unshift(getStore(), serialized, options.maxQueueSize || 30);
} catch {
//
}
},
shift: async () => {
try {
const deserialized = await shift(getStore());
if (deserialized) {
return core.parseEnvelope(deserialized);
}
} catch {
//
}
return undefined;
},
};
}
function makeIndexedDbOfflineTransport(
createTransport,
) {
return options => {
const transport = createTransport({ ...options, createStore: createIndexedDbStore });
helpers.WINDOW.addEventListener('online', async _ => {
await transport.flush();
});
return transport;
};
}
/**
* Creates a transport that uses IndexedDb to store events when offline.
*/
function makeBrowserOfflineTransport(
createTransport = fetch.makeFetchTransport,
) {
return makeIndexedDbOfflineTransport(core.makeOfflineTransport(createTransport));
}
exports.createStore = createStore;
exports.makeBrowserOfflineTransport = makeBrowserOfflineTransport;
exports.push = push;
exports.shift = shift;
exports.unshift = unshift;
//# sourceMappingURL=offline.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"watchdog.d.ts","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAA;AAyBnD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,UAAW,YAAY,iBAc3C,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/database/migrations/templates/localizeStatus.ts"],"sourcesContent":["/**\n * Template for localizeStatus migration\n * Transforms version._status from single value to per-locale object\n */\n\nexport const localizeStatusTemplate = (options: {\n collectionSlug?: string\n dbType: 'mongodb' | 'postgres' | 'sqlite'\n globalSlug?: string\n}): string => {\n const { collectionSlug, dbType, globalSlug } = options\n const entity = collectionSlug\n ? `collectionSlug: '${collectionSlug}'`\n : `globalSlug: '${globalSlug}'`\n\n if (dbType === 'mongodb') {\n return `import { MigrateUpArgs, MigrateDownArgs } from '@payloadcms/db-mongodb'\nimport { localizeStatus } from 'payload'\n\nexport async function up({ payload, req }: MigrateUpArgs): Promise<void> {\n await localizeStatus.up({\n ${entity},\n payload,\n req,\n })\n}\n\nexport async function down({ payload, req }: MigrateDownArgs): Promise<void> {\n await localizeStatus.down({\n ${entity},\n payload,\n req,\n })\n}\n`\n }\n\n // SQL databases (Postgres, SQLite)\n return `import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-${dbType}'\nimport { localizeStatus } from 'payload'\n\nexport async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {\n await localizeStatus.up({\n ${entity},\n db,\n payload,\n req,\n sql,\n })\n}\n\nexport async function down({ db, payload, req }: MigrateDownArgs): Promise<void> {\n await localizeStatus.down({\n ${entity},\n db,\n payload,\n req,\n sql,\n })\n}\n`\n}\n"],"names":["localizeStatusTemplate","options","collectionSlug","dbType","globalSlug","entity"],"mappings":"AAAA;;;CAGC,GAED,OAAO,MAAMA,yBAAyB,CAACC;IAKrC,MAAM,EAAEC,cAAc,EAAEC,MAAM,EAAEC,UAAU,EAAE,GAAGH;IAC/C,MAAMI,SAASH,iBACX,CAAC,iBAAiB,EAAEA,eAAe,CAAC,CAAC,GACrC,CAAC,aAAa,EAAEE,WAAW,CAAC,CAAC;IAEjC,IAAID,WAAW,WAAW;QACxB,OAAO,CAAC;;;;;IAKR,EAAEE,OAAO;;;;;;;;IAQT,EAAEA,OAAO;;;;;AAKb,CAAC;IACC;IAEA,mCAAmC;IACnC,OAAO,CAAC,oEAAoE,EAAEF,OAAO;;;;;IAKnF,EAAEE,OAAO;;;;;;;;;;IAUT,EAAEA,OAAO;;;;;;;AAOb,CAAC;AACD,EAAC"}

View File

@@ -0,0 +1,46 @@
# function-bind <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
<!--[![coverage][codecov-image]][codecov-url]-->
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
Implementation of function.prototype.bind
Old versions of phantomjs, Internet Explorer < 9, and node < 0.6 don't support `Function.prototype.bind`.
## Example
```js
Function.prototype.bind = require("function-bind")
```
## Installation
`npm install function-bind`
## Contributors
- Raynos
## MIT Licenced
[package-url]: https://npmjs.org/package/function-bind
[npm-version-svg]: https://versionbadg.es/Raynos/function-bind.svg
[deps-svg]: https://david-dm.org/Raynos/function-bind.svg
[deps-url]: https://david-dm.org/Raynos/function-bind
[dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg
[dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/function-bind.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/function-bind.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/function-bind.svg
[downloads-url]: https://npm-stat.com/charts.html?package=function-bind
[codecov-image]: https://codecov.io/gh/Raynos/function-bind/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/Raynos/function-bind/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/Raynos/function-bind
[actions-url]: https://github.com/Raynos/function-bind/actions

View File

@@ -0,0 +1 @@
{"version":3,"file":"SpanProcessor.js","sourceRoot":"","sources":["../../src/SpanProcessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","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 { Context } from '@opentelemetry/api';\nimport { ReadableSpan } from './export/ReadableSpan';\nimport { Span } from './Span';\n\n/**\n * SpanProcessor is the interface Tracer SDK uses to allow synchronous hooks\n * for when a {@link Span} is started or when a {@link Span} is ended.\n */\nexport interface SpanProcessor {\n /**\n * Forces to export all finished spans\n */\n forceFlush(): Promise<void>;\n\n /**\n * Called when a {@link Span} is started, if the `span.isRecording()`\n * returns true.\n * @param span the Span that just started.\n */\n onStart(span: Span, parentContext: Context): void;\n\n /**\n * Called when a {@link Span} is ending, if the `span.isRecording()`\n * returns true.\n * @param span the Span that is ending.\n *\n * @experimental This method is experimental and may break in minor versions of this package\n */\n onEnding?(span: Span): void;\n\n /**\n * Called when a {@link ReadableSpan} is ended, if the `span.isRecording()`\n * returns true.\n * @param span the Span that just ended.\n */\n onEnd(span: ReadableSpan): void;\n\n /**\n * Shuts down the processor. Called when SDK is shut down. This is an\n * opportunity for processor to do any cleanup required.\n */\n shutdown(): Promise<void>;\n}\n"]}

View File

@@ -0,0 +1 @@
export declare function isDocumentScrollingElement(element: Element | null): boolean;

View File

@@ -0,0 +1,64 @@
import { toDate } from "./toDate.mjs";
/**
* The {@link eachDayOfInterval} function options.
*/
/**
* @name eachDayOfInterval
* @category Interval Helpers
* @summary Return the array of dates within the specified time interval.
*
* @description
* Return the array of dates within the specified time interval.
*
* @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 interval - The interval.
* @param options - An object with options.
*
* @returns The array with starts of days from the day of the interval start to the day of the interval end
*
* @example
* // Each day between 6 October 2014 and 10 October 2014:
* const result = eachDayOfInterval({
* start: new Date(2014, 9, 6),
* end: new Date(2014, 9, 10)
* })
* //=> [
* // Mon Oct 06 2014 00:00:00,
* // Tue Oct 07 2014 00:00:00,
* // Wed Oct 08 2014 00:00:00,
* // Thu Oct 09 2014 00:00:00,
* // Fri Oct 10 2014 00:00:00
* // ]
*/
export function eachDayOfInterval(interval, options) {
const startDate = toDate(interval.start);
const endDate = toDate(interval.end);
let reversed = +startDate > +endDate;
const endTime = reversed ? +startDate : +endDate;
const currentDate = reversed ? endDate : startDate;
currentDate.setHours(0, 0, 0, 0);
let step = options?.step ?? 1;
if (!step) return [];
if (step < 0) {
step = -step;
reversed = !reversed;
}
const dates = [];
while (+currentDate <= endTime) {
dates.push(toDate(currentDate));
currentDate.setDate(currentDate.getDate() + step);
currentDate.setHours(0, 0, 0, 0);
}
return reversed ? dates.reverse() : dates;
}
// Fallback for modularized imports:
export default eachDayOfInterval;

View File

@@ -0,0 +1,984 @@
/**
* The `node:url` module provides utilities for URL resolution and parsing. It can
* be accessed using:
*
* ```js
* import url from 'node:url';
* ```
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/url.js)
*/
declare module "url" {
import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer";
import { ClientRequestArgs } from "node:http";
import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring";
// Input to `url.format`
interface UrlObject {
auth?: string | null | undefined;
hash?: string | null | undefined;
host?: string | null | undefined;
hostname?: string | null | undefined;
href?: string | null | undefined;
pathname?: string | null | undefined;
protocol?: string | null | undefined;
search?: string | null | undefined;
slashes?: boolean | null | undefined;
port?: string | number | null | undefined;
query?: string | null | ParsedUrlQueryInput | undefined;
}
// Output of `url.parse`
interface Url {
auth: string | null;
hash: string | null;
host: string | null;
hostname: string | null;
href: string;
path: string | null;
pathname: string | null;
protocol: string | null;
search: string | null;
slashes: boolean | null;
port: string | null;
query: string | null | ParsedUrlQuery;
}
interface UrlWithParsedQuery extends Url {
query: ParsedUrlQuery;
}
interface UrlWithStringQuery extends Url {
query: string | null;
}
interface FileUrlToPathOptions {
/**
* `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default.
* @default undefined
* @since v22.1.0
*/
windows?: boolean | undefined;
}
interface PathToFileUrlOptions {
/**
* `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default.
* @default undefined
* @since v22.1.0
*/
windows?: boolean | undefined;
}
/**
* The `url.parse()` method takes a URL string, parses it, and returns a URL
* object.
*
* A `TypeError` is thrown if `urlString` is not a string.
*
* A `URIError` is thrown if the `auth` property is present but cannot be decoded.
*
* `url.parse()` uses a lenient, non-standard algorithm for parsing URL
* strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) and incorrect handling of usernames and passwords. Do not use with untrusted
* input. CVEs are not issued for `url.parse()` vulnerabilities. Use the `WHATWG URL` API instead.
* @since v0.1.25
* @deprecated Use the WHATWG URL API instead.
* @param urlString The URL string to parse.
* @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property
* on the returned URL object will be an unparsed, undecoded string.
* @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the
* result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
*/
function parse(urlString: string): UrlWithStringQuery;
function parse(
urlString: string,
parseQueryString: false | undefined,
slashesDenoteHost?: boolean,
): UrlWithStringQuery;
function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
/**
* The `url.format()` method returns a formatted URL string derived from `urlObject`.
*
* ```js
* import url from 'node:url';
* url.format({
* protocol: 'https',
* hostname: 'example.com',
* pathname: '/some/path',
* query: {
* page: 1,
* format: 'json',
* },
* });
*
* // => 'https://example.com/some/path?page=1&#x26;format=json'
* ```
*
* If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`.
*
* The formatting process operates as follows:
*
* * A new empty string `result` is created.
* * If `urlObject.protocol` is a string, it is appended as-is to `result`.
* * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown.
* * For all string values of `urlObject.protocol` that _do not end_ with an ASCII
* colon (`:`) character, the literal string `:` will be appended to `result`.
* * If either of the following conditions is true, then the literal string `//` will be appended to `result`:
* * `urlObject.slashes` property is true;
* * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or `file`;
* * If the value of the `urlObject.auth` property is truthy, and either `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of `urlObject.auth` will be coerced into a string
* and appended to `result` followed by the literal string `@`.
* * If the `urlObject.host` property is `undefined` then:
* * If the `urlObject.hostname` is a string, it is appended to `result`.
* * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string,
* an `Error` is thrown.
* * If the `urlObject.port` property value is truthy, and `urlObject.hostname` is not `undefined`:
* * The literal string `:` is appended to `result`, and
* * The value of `urlObject.port` is coerced to a string and appended to `result`.
* * Otherwise, if the `urlObject.host` property value is truthy, the value of `urlObject.host` is coerced to a string and appended to `result`.
* * If the `urlObject.pathname` property is a string that is not an empty string:
* * If the `urlObject.pathname` _does not start_ with an ASCII forward slash
* (`/`), then the literal string `'/'` is appended to `result`.
* * The value of `urlObject.pathname` is appended to `result`.
* * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown.
* * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result` followed by the output of calling the
* `querystring` module's `stringify()` method passing the value of `urlObject.query`.
* * Otherwise, if `urlObject.search` is a string:
* * If the value of `urlObject.search` _does not start_ with the ASCII question
* mark (`?`) character, the literal string `?` is appended to `result`.
* * The value of `urlObject.search` is appended to `result`.
* * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown.
* * If the `urlObject.hash` property is a string:
* * If the value of `urlObject.hash` _does not start_ with the ASCII hash (`#`)
* character, the literal string `#` is appended to `result`.
* * The value of `urlObject.hash` is appended to `result`.
* * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a
* string, an `Error` is thrown.
* * `result` is returned.
* @since v0.1.25
* @legacy Use the WHATWG URL API instead.
* @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`.
*/
function format(urlObject: URL, options?: URLFormatOptions): string;
/**
* The `url.format()` method returns a formatted URL string derived from `urlObject`.
*
* ```js
* import url from 'node:url';
* url.format({
* protocol: 'https',
* hostname: 'example.com',
* pathname: '/some/path',
* query: {
* page: 1,
* format: 'json',
* },
* });
*
* // => 'https://example.com/some/path?page=1&#x26;format=json'
* ```
*
* If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`.
*
* The formatting process operates as follows:
*
* * A new empty string `result` is created.
* * If `urlObject.protocol` is a string, it is appended as-is to `result`.
* * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown.
* * For all string values of `urlObject.protocol` that _do not end_ with an ASCII
* colon (`:`) character, the literal string `:` will be appended to `result`.
* * If either of the following conditions is true, then the literal string `//` will be appended to `result`:
* * `urlObject.slashes` property is true;
* * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or `file`;
* * If the value of the `urlObject.auth` property is truthy, and either `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of `urlObject.auth` will be coerced into a string
* and appended to `result` followed by the literal string `@`.
* * If the `urlObject.host` property is `undefined` then:
* * If the `urlObject.hostname` is a string, it is appended to `result`.
* * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string,
* an `Error` is thrown.
* * If the `urlObject.port` property value is truthy, and `urlObject.hostname` is not `undefined`:
* * The literal string `:` is appended to `result`, and
* * The value of `urlObject.port` is coerced to a string and appended to `result`.
* * Otherwise, if the `urlObject.host` property value is truthy, the value of `urlObject.host` is coerced to a string and appended to `result`.
* * If the `urlObject.pathname` property is a string that is not an empty string:
* * If the `urlObject.pathname` _does not start_ with an ASCII forward slash
* (`/`), then the literal string `'/'` is appended to `result`.
* * The value of `urlObject.pathname` is appended to `result`.
* * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown.
* * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result` followed by the output of calling the
* `querystring` module's `stringify()` method passing the value of `urlObject.query`.
* * Otherwise, if `urlObject.search` is a string:
* * If the value of `urlObject.search` _does not start_ with the ASCII question
* mark (`?`) character, the literal string `?` is appended to `result`.
* * The value of `urlObject.search` is appended to `result`.
* * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown.
* * If the `urlObject.hash` property is a string:
* * If the value of `urlObject.hash` _does not start_ with the ASCII hash (`#`)
* character, the literal string `#` is appended to `result`.
* * The value of `urlObject.hash` is appended to `result`.
* * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a
* string, an `Error` is thrown.
* * `result` is returned.
* @since v0.1.25
* @legacy Use the WHATWG URL API instead.
* @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`.
*/
function format(urlObject: UrlObject | string): string;
/**
* The `url.resolve()` method resolves a target URL relative to a base URL in a
* manner similar to that of a web browser resolving an anchor tag.
*
* ```js
* import url from 'node:url';
* url.resolve('/one/two/three', 'four'); // '/one/two/four'
* url.resolve('http://example.com/', '/one'); // 'http://example.com/one'
* url.resolve('http://example.com/one', '/two'); // 'http://example.com/two'
* ```
*
* To achieve the same result using the WHATWG URL API:
*
* ```js
* function resolve(from, to) {
* const resolvedUrl = new URL(to, new URL(from, 'resolve://'));
* if (resolvedUrl.protocol === 'resolve:') {
* // `from` is a relative URL.
* const { pathname, search, hash } = resolvedUrl;
* return pathname + search + hash;
* }
* return resolvedUrl.toString();
* }
*
* resolve('/one/two/three', 'four'); // '/one/two/four'
* resolve('http://example.com/', '/one'); // 'http://example.com/one'
* resolve('http://example.com/one', '/two'); // 'http://example.com/two'
* ```
* @since v0.1.25
* @legacy Use the WHATWG URL API instead.
* @param from The base URL to use if `to` is a relative URL.
* @param to The target URL to resolve.
*/
function resolve(from: string, to: string): string;
/**
* Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an
* invalid domain, the empty string is returned.
*
* It performs the inverse operation to {@link domainToUnicode}.
*
* ```js
* import url from 'node:url';
*
* console.log(url.domainToASCII('español.com'));
* // Prints xn--espaol-zwa.com
* console.log(url.domainToASCII('中文.com'));
* // Prints xn--fiq228c.com
* console.log(url.domainToASCII('xn--iñvalid.com'));
* // Prints an empty string
* ```
* @since v7.4.0, v6.13.0
*/
function domainToASCII(domain: string): string;
/**
* Returns the Unicode serialization of the `domain`. If `domain` is an invalid
* domain, the empty string is returned.
*
* It performs the inverse operation to {@link domainToASCII}.
*
* ```js
* import url from 'node:url';
*
* console.log(url.domainToUnicode('xn--espaol-zwa.com'));
* // Prints español.com
* console.log(url.domainToUnicode('xn--fiq228c.com'));
* // Prints 中文.com
* console.log(url.domainToUnicode('xn--iñvalid.com'));
* // Prints an empty string
* ```
* @since v7.4.0, v6.13.0
*/
function domainToUnicode(domain: string): string;
/**
* This function ensures the correct decodings of percent-encoded characters as
* well as ensuring a cross-platform valid absolute path string.
*
* ```js
* import { fileURLToPath } from 'node:url';
*
* const __filename = fileURLToPath(import.meta.url);
*
* new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/
* fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows)
*
* new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt
* fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows)
*
* new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt
* fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX)
*
* new URL('file:///hello world').pathname; // Incorrect: /hello%20world
* fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX)
* ```
* @since v10.12.0
* @param url The file URL string or URL object to convert to a path.
* @return The fully-resolved platform-specific Node.js file path.
*/
function fileURLToPath(url: string | URL, options?: FileUrlToPathOptions): string;
/**
* Like `url.fileURLToPath(...)` except that instead of returning a string
* representation of the path, a `Buffer` is returned. This conversion is
* helpful when the input URL contains percent-encoded segments that are
* not valid UTF-8 / Unicode sequences.
* @since v22.18.0
* @param url The file URL string or URL object to convert to a path.
* @returns The fully-resolved platform-specific Node.js file path
* as a `Buffer`.
*/
function fileURLToPathBuffer(url: string | URL, options?: FileUrlToPathOptions): NonSharedBuffer;
/**
* This function ensures that `path` is resolved absolutely, and that the URL
* control characters are correctly encoded when converting into a File URL.
*
* ```js
* import { pathToFileURL } from 'node:url';
*
* new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1
* pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX)
*
* new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c
* pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX)
* ```
* @since v10.12.0
* @param path The path to convert to a File URL.
* @return The file URL object.
*/
function pathToFileURL(path: string, options?: PathToFileUrlOptions): URL;
/**
* This utility function converts a URL object into an ordinary options object as
* expected by the `http.request()` and `https.request()` APIs.
*
* ```js
* import { urlToHttpOptions } from 'node:url';
* const myURL = new URL('https://a:b@測試?abc#foo');
*
* console.log(urlToHttpOptions(myURL));
* /*
* {
* protocol: 'https:',
* hostname: 'xn--g6w251d',
* hash: '#foo',
* search: '?abc',
* pathname: '/',
* path: '/?abc',
* href: 'https://a:b@xn--g6w251d/?abc#foo',
* auth: 'a:b'
* }
*
* ```
* @since v15.7.0, v14.18.0
* @param url The `WHATWG URL` object to convert to an options object.
* @return Options object
*/
function urlToHttpOptions(url: URL): ClientRequestArgs;
interface URLFormatOptions {
/**
* `true` if the serialized URL string should include the username and password, `false` otherwise.
* @default true
*/
auth?: boolean | undefined;
/**
* `true` if the serialized URL string should include the fragment, `false` otherwise.
* @default true
*/
fragment?: boolean | undefined;
/**
* `true` if the serialized URL string should include the search query, `false` otherwise.
* @default true
*/
search?: boolean | undefined;
/**
* `true` if Unicode characters appearing in the host component of the URL string should be encoded directly as opposed to
* being Punycode encoded.
* @default false
*/
unicode?: boolean | undefined;
}
/**
* Browser-compatible `URL` class, implemented by following the WHATWG URL
* Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself.
* The `URL` class is also available on the global object.
*
* In accordance with browser conventions, all properties of `URL` objects
* are implemented as getters and setters on the class prototype, rather than as
* data properties on the object itself. Thus, unlike `legacy urlObject`s,
* using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still
* return `true`.
* @since v7.0.0, v6.13.0
*/
class URL {
/**
* Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later.
*
* ```js
* import {
* Blob,
* resolveObjectURL,
* } from 'node:buffer';
*
* const blob = new Blob(['hello']);
* const id = URL.createObjectURL(blob);
*
* // later...
*
* const otherBlob = resolveObjectURL(id);
* console.log(otherBlob.size);
* ```
*
* The data stored by the registered `Blob` will be retained in memory until `URL.revokeObjectURL()` is called to remove it.
*
* `Blob` objects are registered within the current thread. If using Worker
* Threads, `Blob` objects registered within one Worker will not be available
* to other workers or the main thread.
* @since v16.7.0
*/
static createObjectURL(blob: NodeBlob): string;
/**
* Removes the stored `Blob` identified by the given ID. Attempting to revoke a
* ID that isn't registered will silently fail.
* @since v16.7.0
* @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
*/
static revokeObjectURL(id: string): void;
/**
* Checks if an `input` relative to the `base` can be parsed to a `URL`.
*
* ```js
* const isValid = URL.canParse('/foo', 'https://example.org/'); // true
*
* const isNotValid = URL.canParse('/foo'); // false
* ```
* @since v19.9.0
* @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is
* `converted to a string` first.
* @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first.
*/
static canParse(input: string, base?: string): boolean;
/**
* Parses a string as a URL. If `base` is provided, it will be used as the base
* URL for the purpose of resolving non-absolute `input` URLs. Returns `null`
* if the parameters can't be resolved to a valid URL.
* @since v22.1.0
* @param input The absolute or relative input URL to parse. If `input`
* is relative, then `base` is required. If `input` is absolute, the `base`
* is ignored. If `input` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
* @param base The base URL to resolve against if the `input` is not
* absolute. If `base` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
*/
static parse(input: string, base?: string): URL | null;
constructor(input: string | { toString: () => string }, base?: string | URL);
/**
* Gets and sets the fragment portion of the URL.
*
* ```js
* const myURL = new URL('https://example.org/foo#bar');
* console.log(myURL.hash);
* // Prints #bar
*
* myURL.hash = 'baz';
* console.log(myURL.href);
* // Prints https://example.org/foo#baz
* ```
*
* Invalid URL characters included in the value assigned to the `hash` property
* are `percent-encoded`. The selection of which characters to
* percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
*/
hash: string;
/**
* Gets and sets the host portion of the URL.
*
* ```js
* const myURL = new URL('https://example.org:81/foo');
* console.log(myURL.host);
* // Prints example.org:81
*
* myURL.host = 'example.com:82';
* console.log(myURL.href);
* // Prints https://example.com:82/foo
* ```
*
* Invalid host values assigned to the `host` property are ignored.
*/
host: string;
/**
* Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the
* port.
*
* ```js
* const myURL = new URL('https://example.org:81/foo');
* console.log(myURL.hostname);
* // Prints example.org
*
* // Setting the hostname does not change the port
* myURL.hostname = 'example.com';
* console.log(myURL.href);
* // Prints https://example.com:81/foo
*
* // Use myURL.host to change the hostname and port
* myURL.host = 'example.org:82';
* console.log(myURL.href);
* // Prints https://example.org:82/foo
* ```
*
* Invalid host name values assigned to the `hostname` property are ignored.
*/
hostname: string;
/**
* Gets and sets the serialized URL.
*
* ```js
* const myURL = new URL('https://example.org/foo');
* console.log(myURL.href);
* // Prints https://example.org/foo
*
* myURL.href = 'https://example.com/bar';
* console.log(myURL.href);
* // Prints https://example.com/bar
* ```
*
* Getting the value of the `href` property is equivalent to calling {@link toString}.
*
* Setting the value of this property to a new value is equivalent to creating a
* new `URL` object using `new URL(value)`. Each of the `URL` object's properties will be modified.
*
* If the value assigned to the `href` property is not a valid URL, a `TypeError` will be thrown.
*/
href: string;
/**
* Gets the read-only serialization of the URL's origin.
*
* ```js
* const myURL = new URL('https://example.org/foo/bar?baz');
* console.log(myURL.origin);
* // Prints https://example.org
* ```
*
* ```js
* const idnURL = new URL('https://測試');
* console.log(idnURL.origin);
* // Prints https://xn--g6w251d
*
* console.log(idnURL.hostname);
* // Prints xn--g6w251d
* ```
*/
readonly origin: string;
/**
* Gets and sets the password portion of the URL.
*
* ```js
* const myURL = new URL('https://abc:xyz@example.com');
* console.log(myURL.password);
* // Prints xyz
*
* myURL.password = '123';
* console.log(myURL.href);
* // Prints https://abc:123@example.com/
* ```
*
* Invalid URL characters included in the value assigned to the `password` property
* are `percent-encoded`. The selection of which characters to
* percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
*/
password: string;
/**
* Gets and sets the path portion of the URL.
*
* ```js
* const myURL = new URL('https://example.org/abc/xyz?123');
* console.log(myURL.pathname);
* // Prints /abc/xyz
*
* myURL.pathname = '/abcdef';
* console.log(myURL.href);
* // Prints https://example.org/abcdef?123
* ```
*
* Invalid URL characters included in the value assigned to the `pathname` property are `percent-encoded`. The selection of which characters
* to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
*/
pathname: string;
/**
* Gets and sets the port portion of the URL.
*
* The port value may be a number or a string containing a number in the range `0` to `65535` (inclusive). Setting the value to the default port of the `URL` objects given `protocol` will
* result in the `port` value becoming
* the empty string (`''`).
*
* The port value can be an empty string in which case the port depends on
* the protocol/scheme:
*
* <omitted>
*
* Upon assigning a value to the port, the value will first be converted to a
* string using `.toString()`.
*
* If that string is invalid but it begins with a number, the leading number is
* assigned to `port`.
* If the number lies outside the range denoted above, it is ignored.
*
* ```js
* const myURL = new URL('https://example.org:8888');
* console.log(myURL.port);
* // Prints 8888
*
* // Default ports are automatically transformed to the empty string
* // (HTTPS protocol's default port is 443)
* myURL.port = '443';
* console.log(myURL.port);
* // Prints the empty string
* console.log(myURL.href);
* // Prints https://example.org/
*
* myURL.port = 1234;
* console.log(myURL.port);
* // Prints 1234
* console.log(myURL.href);
* // Prints https://example.org:1234/
*
* // Completely invalid port strings are ignored
* myURL.port = 'abcd';
* console.log(myURL.port);
* // Prints 1234
*
* // Leading numbers are treated as a port number
* myURL.port = '5678abcd';
* console.log(myURL.port);
* // Prints 5678
*
* // Non-integers are truncated
* myURL.port = 1234.5678;
* console.log(myURL.port);
* // Prints 1234
*
* // Out-of-range numbers which are not represented in scientific notation
* // will be ignored.
* myURL.port = 1e10; // 10000000000, will be range-checked as described below
* console.log(myURL.port);
* // Prints 1234
* ```
*
* Numbers which contain a decimal point,
* such as floating-point numbers or numbers in scientific notation,
* are not an exception to this rule.
* Leading numbers up to the decimal point will be set as the URL's port,
* assuming they are valid:
*
* ```js
* myURL.port = 4.567e21;
* console.log(myURL.port);
* // Prints 4 (because it is the leading number in the string '4.567e21')
* ```
*/
port: string;
/**
* Gets and sets the protocol portion of the URL.
*
* ```js
* const myURL = new URL('https://example.org');
* console.log(myURL.protocol);
* // Prints https:
*
* myURL.protocol = 'ftp';
* console.log(myURL.href);
* // Prints ftp://example.org/
* ```
*
* Invalid URL protocol values assigned to the `protocol` property are ignored.
*/
protocol: string;
/**
* Gets and sets the serialized query portion of the URL.
*
* ```js
* const myURL = new URL('https://example.org/abc?123');
* console.log(myURL.search);
* // Prints ?123
*
* myURL.search = 'abc=xyz';
* console.log(myURL.href);
* // Prints https://example.org/abc?abc=xyz
* ```
*
* Any invalid URL characters appearing in the value assigned the `search` property will be `percent-encoded`. The selection of which
* characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
*/
search: string;
/**
* Gets the `URLSearchParams` object representing the query parameters of the
* URL. This property is read-only but the `URLSearchParams` object it provides
* can be used to mutate the URL instance; to replace the entirety of query
* parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details.
*
* Use care when using `.searchParams` to modify the `URL` because,
* per the WHATWG specification, the `URLSearchParams` object uses
* different rules to determine which characters to percent-encode. For
* instance, the `URL` object will not percent encode the ASCII tilde (`~`)
* character, while `URLSearchParams` will always encode it:
*
* ```js
* const myURL = new URL('https://example.org/abc?foo=~bar');
*
* console.log(myURL.search); // prints ?foo=~bar
*
* // Modify the URL via searchParams...
* myURL.searchParams.sort();
*
* console.log(myURL.search); // prints ?foo=%7Ebar
* ```
*/
readonly searchParams: URLSearchParams;
/**
* Gets and sets the username portion of the URL.
*
* ```js
* const myURL = new URL('https://abc:xyz@example.com');
* console.log(myURL.username);
* // Prints abc
*
* myURL.username = '123';
* console.log(myURL.href);
* // Prints https://123:xyz@example.com/
* ```
*
* Any invalid URL characters appearing in the value assigned the `username` property will be `percent-encoded`. The selection of which
* characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
*/
username: string;
/**
* The `toString()` method on the `URL` object returns the serialized URL. The
* value returned is equivalent to that of {@link href} and {@link toJSON}.
*/
toString(): string;
/**
* The `toJSON()` method on the `URL` object returns the serialized URL. The
* value returned is equivalent to that of {@link href} and {@link toString}.
*
* This method is automatically called when an `URL` object is serialized
* with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify).
*
* ```js
* const myURLs = [
* new URL('https://www.example.com'),
* new URL('https://test.example.org'),
* ];
* console.log(JSON.stringify(myURLs));
* // Prints ["https://www.example.com/","https://test.example.org/"]
* ```
*/
toJSON(): string;
}
interface URLSearchParamsIterator<T> extends NodeJS.Iterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
[Symbol.iterator](): URLSearchParamsIterator<T>;
}
/**
* The `URLSearchParams` API provides read and write access to the query of a `URL`. The `URLSearchParams` class can also be used standalone with one of the
* four following constructors.
* The `URLSearchParams` class is also available on the global object.
*
* The WHATWG `URLSearchParams` interface and the `querystring` module have
* similar purpose, but the purpose of the `querystring` module is more
* general, as it allows the customization of delimiter characters (`&#x26;` and `=`).
* On the other hand, this API is designed purely for URL query strings.
*
* ```js
* const myURL = new URL('https://example.org/?abc=123');
* console.log(myURL.searchParams.get('abc'));
* // Prints 123
*
* myURL.searchParams.append('abc', 'xyz');
* console.log(myURL.href);
* // Prints https://example.org/?abc=123&#x26;abc=xyz
*
* myURL.searchParams.delete('abc');
* myURL.searchParams.set('a', 'b');
* console.log(myURL.href);
* // Prints https://example.org/?a=b
*
* const newSearchParams = new URLSearchParams(myURL.searchParams);
* // The above is equivalent to
* // const newSearchParams = new URLSearchParams(myURL.search);
*
* newSearchParams.append('a', 'c');
* console.log(myURL.href);
* // Prints https://example.org/?a=b
* console.log(newSearchParams.toString());
* // Prints a=b&#x26;a=c
*
* // newSearchParams.toString() is implicitly called
* myURL.search = newSearchParams;
* console.log(myURL.href);
* // Prints https://example.org/?a=b&#x26;a=c
* newSearchParams.delete('a');
* console.log(myURL.href);
* // Prints https://example.org/?a=b&#x26;a=c
* ```
* @since v7.5.0, v6.13.0
*/
class URLSearchParams implements Iterable<[string, string]> {
constructor(
init?:
| URLSearchParams
| string
| Record<string, string | readonly string[]>
| Iterable<[string, string]>
| ReadonlyArray<[string, string]>,
);
/**
* Append a new name-value pair to the query string.
*/
append(name: string, value: string): void;
/**
* If `value` is provided, removes all name-value pairs
* where name is `name` and value is `value`.
*
* If `value` is not provided, removes all name-value pairs whose name is `name`.
*/
delete(name: string, value?: string): void;
/**
* Returns an ES6 `Iterator` over each of the name-value pairs in the query.
* Each item of the iterator is a JavaScript `Array`. The first item of the `Array` is the `name`, the second item of the `Array` is the `value`.
*
* Alias for `urlSearchParams[Symbol.iterator]()`.
*/
entries(): URLSearchParamsIterator<[string, string]>;
/**
* Iterates over each name-value pair in the query and invokes the given function.
*
* ```js
* const myURL = new URL('https://example.org/?a=b&#x26;c=d');
* myURL.searchParams.forEach((value, name, searchParams) => {
* console.log(name, value, myURL.searchParams === searchParams);
* });
* // Prints:
* // a b true
* // c d true
* ```
* @param fn Invoked for each name-value pair in the query
* @param thisArg To be used as `this` value for when `fn` is called
*/
forEach<TThis = this>(
fn: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void,
thisArg?: TThis,
): void;
/**
* Returns the value of the first name-value pair whose name is `name`. If there
* are no such pairs, `null` is returned.
* @return or `null` if there is no name-value pair with the given `name`.
*/
get(name: string): string | null;
/**
* Returns the values of all name-value pairs whose name is `name`. If there are
* no such pairs, an empty array is returned.
*/
getAll(name: string): string[];
/**
* Checks if the `URLSearchParams` object contains key-value pair(s) based on `name` and an optional `value` argument.
*
* If `value` is provided, returns `true` when name-value pair with
* same `name` and `value` exists.
*
* If `value` is not provided, returns `true` if there is at least one name-value
* pair whose name is `name`.
*/
has(name: string, value?: string): boolean;
/**
* Returns an ES6 `Iterator` over the names of each name-value pair.
*
* ```js
* const params = new URLSearchParams('foo=bar&#x26;foo=baz');
* for (const name of params.keys()) {
* console.log(name);
* }
* // Prints:
* // foo
* // foo
* ```
*/
keys(): URLSearchParamsIterator<string>;
/**
* Sets the value in the `URLSearchParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`,
* set the first such pair's value to `value` and remove all others. If not,
* append the name-value pair to the query string.
*
* ```js
* const params = new URLSearchParams();
* params.append('foo', 'bar');
* params.append('foo', 'baz');
* params.append('abc', 'def');
* console.log(params.toString());
* // Prints foo=bar&#x26;foo=baz&#x26;abc=def
*
* params.set('foo', 'def');
* params.set('xyz', 'opq');
* console.log(params.toString());
* // Prints foo=def&#x26;abc=def&#x26;xyz=opq
* ```
*/
set(name: string, value: string): void;
/**
* The total number of parameter entries.
* @since v19.8.0
*/
readonly size: number;
/**
* Sort all existing name-value pairs in-place by their names. Sorting is done
* with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs
* with the same name is preserved.
*
* This method can be used, in particular, to increase cache hits.
*
* ```js
* const params = new URLSearchParams('query[]=abc&#x26;type=search&#x26;query[]=123');
* params.sort();
* console.log(params.toString());
* // Prints query%5B%5D=abc&#x26;query%5B%5D=123&#x26;type=search
* ```
* @since v7.7.0, v6.13.0
*/
sort(): void;
/**
* Returns the search parameters serialized as a string, with characters
* percent-encoded where necessary.
*/
toString(): string;
/**
* Returns an ES6 `Iterator` over the values of each name-value pair.
*/
values(): URLSearchParamsIterator<string>;
[Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
}
import { URL as _URL, URLSearchParams as _URLSearchParams } from "url";
global {
interface URLSearchParams extends _URLSearchParams {}
interface URL extends _URL {}
interface Global {
URL: typeof _URL;
URLSearchParams: typeof _URLSearchParams;
}
/**
* `URL` class is a global reference for `import { URL } from 'url'`
* https://nodejs.org/api/url.html#the-whatwg-url-api
* @since v10.0.0
*/
var URL: typeof globalThis extends {
onmessage: any;
URL: infer T;
} ? T
: typeof _URL;
/**
* `URLSearchParams` class is a global reference for `import { URLSearchParams } from 'node:url'`
* https://nodejs.org/api/url.html#class-urlsearchparams
* @since v10.0.0
*/
var URLSearchParams: typeof globalThis extends {
onmessage: any;
URLSearchParams: infer T;
} ? T
: typeof _URLSearchParams;
}
}
declare module "node:url" {
export * from "url";
}

View File

@@ -0,0 +1,4 @@
# Code of Conduct
The Code of Conduct, which applies to this project, can be found at
https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md

View File

@@ -0,0 +1,29 @@
var capitalize = require('./capitalize'),
createCompounder = require('./_createCompounder');
/**
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the camel cased string.
* @example
*
* _.camelCase('Foo Bar');
* // => 'fooBar'
*
* _.camelCase('--foo-bar--');
* // => 'fooBar'
*
* _.camelCase('__FOO_BAR__');
* // => 'fooBar'
*/
var camelCase = createCompounder(function(result, word, index) {
word = word.toLowerCase();
return result + (index ? capitalize(word) : word);
});
module.exports = camelCase;

View File

@@ -0,0 +1 @@
{"version":3,"file":"throw-if-empty.js","names":[],"sources":["../../../src/rest/utils/throw-if-empty.ts"],"sourcesContent":["/**\n *\n * @param value\n * @param message\n * @throws Throws an error if an empty array or string is provided\n */\nexport const throwIfEmpty = (value: string | unknown[], message: string) => {\n\tif (value.length === 0) {\n\t\tthrow new Error(message);\n\t}\n};\n"],"mappings":"AAMA,MAAa,GAAgB,EAA2B,IAAoB,CAC3E,GAAI,EAAM,SAAW,EACpB,MAAU,MAAM,EAAQ"}

View File

@@ -0,0 +1 @@
import e from"../server/react-server/getDefaultNow.js";import o from"./useConfig.js";function t(t){null!=t?.updateInterval&&console.error("`useNow` doesn't support the `updateInterval` option in Server Components, the value will be ignored. If you need the value to update, you can convert the component to a Client Component.");return o("useNow").now??e()}export{t as default};

View File

@@ -0,0 +1,364 @@
/**
* @license React
* scheduler.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
function performWorkUntilDeadline() {
needsPaint = !1;
if (isMessageLoopRunning) {
var currentTime = exports.unstable_now();
startTime = currentTime;
var hasMoreWork = !0;
try {
a: {
isHostCallbackScheduled = !1;
isHostTimeoutScheduled &&
((isHostTimeoutScheduled = !1),
localClearTimeout(taskTimeoutID),
(taskTimeoutID = -1));
isPerformingWork = !0;
var previousPriorityLevel = currentPriorityLevel;
try {
b: {
advanceTimers(currentTime);
for (
currentTask = peek(taskQueue);
null !== currentTask &&
!(
currentTask.expirationTime > currentTime &&
shouldYieldToHost()
);
) {
var callback = currentTask.callback;
if ("function" === typeof callback) {
currentTask.callback = null;
currentPriorityLevel = currentTask.priorityLevel;
var continuationCallback = callback(
currentTask.expirationTime <= currentTime
);
currentTime = exports.unstable_now();
if ("function" === typeof continuationCallback) {
currentTask.callback = continuationCallback;
advanceTimers(currentTime);
hasMoreWork = !0;
break b;
}
currentTask === peek(taskQueue) && pop(taskQueue);
advanceTimers(currentTime);
} else pop(taskQueue);
currentTask = peek(taskQueue);
}
if (null !== currentTask) hasMoreWork = !0;
else {
var firstTimer = peek(timerQueue);
null !== firstTimer &&
requestHostTimeout(
handleTimeout,
firstTimer.startTime - currentTime
);
hasMoreWork = !1;
}
}
break a;
} finally {
(currentTask = null),
(currentPriorityLevel = previousPriorityLevel),
(isPerformingWork = !1);
}
hasMoreWork = void 0;
}
} finally {
hasMoreWork
? schedulePerformWorkUntilDeadline()
: (isMessageLoopRunning = !1);
}
}
}
function push(heap, node) {
var index = heap.length;
heap.push(node);
a: for (; 0 < index; ) {
var parentIndex = (index - 1) >>> 1,
parent = heap[parentIndex];
if (0 < compare(parent, node))
(heap[parentIndex] = node),
(heap[index] = parent),
(index = parentIndex);
else break a;
}
}
function peek(heap) {
return 0 === heap.length ? null : heap[0];
}
function pop(heap) {
if (0 === heap.length) return null;
var first = heap[0],
last = heap.pop();
if (last !== first) {
heap[0] = last;
a: for (
var index = 0, length = heap.length, halfLength = length >>> 1;
index < halfLength;
) {
var leftIndex = 2 * (index + 1) - 1,
left = heap[leftIndex],
rightIndex = leftIndex + 1,
right = heap[rightIndex];
if (0 > compare(left, last))
rightIndex < length && 0 > compare(right, left)
? ((heap[index] = right),
(heap[rightIndex] = last),
(index = rightIndex))
: ((heap[index] = left),
(heap[leftIndex] = last),
(index = leftIndex));
else if (rightIndex < length && 0 > compare(right, last))
(heap[index] = right),
(heap[rightIndex] = last),
(index = rightIndex);
else break a;
}
}
return first;
}
function compare(a, b) {
var diff = a.sortIndex - b.sortIndex;
return 0 !== diff ? diff : a.id - b.id;
}
function advanceTimers(currentTime) {
for (var timer = peek(timerQueue); null !== timer; ) {
if (null === timer.callback) pop(timerQueue);
else if (timer.startTime <= currentTime)
pop(timerQueue),
(timer.sortIndex = timer.expirationTime),
push(taskQueue, timer);
else break;
timer = peek(timerQueue);
}
}
function handleTimeout(currentTime) {
isHostTimeoutScheduled = !1;
advanceTimers(currentTime);
if (!isHostCallbackScheduled)
if (null !== peek(taskQueue))
(isHostCallbackScheduled = !0),
isMessageLoopRunning ||
((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline());
else {
var firstTimer = peek(timerQueue);
null !== firstTimer &&
requestHostTimeout(
handleTimeout,
firstTimer.startTime - currentTime
);
}
}
function shouldYieldToHost() {
return needsPaint
? !0
: exports.unstable_now() - startTime < frameInterval
? !1
: !0;
}
function requestHostTimeout(callback, ms) {
taskTimeoutID = localSetTimeout(function () {
callback(exports.unstable_now());
}, ms);
}
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
exports.unstable_now = void 0;
if (
"object" === typeof performance &&
"function" === typeof performance.now
) {
var localPerformance = performance;
exports.unstable_now = function () {
return localPerformance.now();
};
} else {
var localDate = Date,
initialTime = localDate.now();
exports.unstable_now = function () {
return localDate.now() - initialTime;
};
}
var taskQueue = [],
timerQueue = [],
taskIdCounter = 1,
currentTask = null,
currentPriorityLevel = 3,
isPerformingWork = !1,
isHostCallbackScheduled = !1,
isHostTimeoutScheduled = !1,
needsPaint = !1,
localSetTimeout = "function" === typeof setTimeout ? setTimeout : null,
localClearTimeout =
"function" === typeof clearTimeout ? clearTimeout : null,
localSetImmediate =
"undefined" !== typeof setImmediate ? setImmediate : null,
isMessageLoopRunning = !1,
taskTimeoutID = -1,
frameInterval = 5,
startTime = -1;
if ("function" === typeof localSetImmediate)
var schedulePerformWorkUntilDeadline = function () {
localSetImmediate(performWorkUntilDeadline);
};
else if ("undefined" !== typeof MessageChannel) {
var channel = new MessageChannel(),
port = channel.port2;
channel.port1.onmessage = performWorkUntilDeadline;
schedulePerformWorkUntilDeadline = function () {
port.postMessage(null);
};
} else
schedulePerformWorkUntilDeadline = function () {
localSetTimeout(performWorkUntilDeadline, 0);
};
exports.unstable_IdlePriority = 5;
exports.unstable_ImmediatePriority = 1;
exports.unstable_LowPriority = 4;
exports.unstable_NormalPriority = 3;
exports.unstable_Profiling = null;
exports.unstable_UserBlockingPriority = 2;
exports.unstable_cancelCallback = function (task) {
task.callback = null;
};
exports.unstable_forceFrameRate = function (fps) {
0 > fps || 125 < fps
? console.error(
"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"
)
: (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5);
};
exports.unstable_getCurrentPriorityLevel = function () {
return currentPriorityLevel;
};
exports.unstable_next = function (eventHandler) {
switch (currentPriorityLevel) {
case 1:
case 2:
case 3:
var priorityLevel = 3;
break;
default:
priorityLevel = currentPriorityLevel;
}
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = priorityLevel;
try {
return eventHandler();
} finally {
currentPriorityLevel = previousPriorityLevel;
}
};
exports.unstable_requestPaint = function () {
needsPaint = !0;
};
exports.unstable_runWithPriority = function (priorityLevel, eventHandler) {
switch (priorityLevel) {
case 1:
case 2:
case 3:
case 4:
case 5:
break;
default:
priorityLevel = 3;
}
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = priorityLevel;
try {
return eventHandler();
} finally {
currentPriorityLevel = previousPriorityLevel;
}
};
exports.unstable_scheduleCallback = function (
priorityLevel,
callback,
options
) {
var currentTime = exports.unstable_now();
"object" === typeof options && null !== options
? ((options = options.delay),
(options =
"number" === typeof options && 0 < options
? currentTime + options
: currentTime))
: (options = currentTime);
switch (priorityLevel) {
case 1:
var timeout = -1;
break;
case 2:
timeout = 250;
break;
case 5:
timeout = 1073741823;
break;
case 4:
timeout = 1e4;
break;
default:
timeout = 5e3;
}
timeout = options + timeout;
priorityLevel = {
id: taskIdCounter++,
callback: callback,
priorityLevel: priorityLevel,
startTime: options,
expirationTime: timeout,
sortIndex: -1
};
options > currentTime
? ((priorityLevel.sortIndex = options),
push(timerQueue, priorityLevel),
null === peek(taskQueue) &&
priorityLevel === peek(timerQueue) &&
(isHostTimeoutScheduled
? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))
: (isHostTimeoutScheduled = !0),
requestHostTimeout(handleTimeout, options - currentTime)))
: ((priorityLevel.sortIndex = timeout),
push(taskQueue, priorityLevel),
isHostCallbackScheduled ||
isPerformingWork ||
((isHostCallbackScheduled = !0),
isMessageLoopRunning ||
((isMessageLoopRunning = !0),
schedulePerformWorkUntilDeadline())));
return priorityLevel;
};
exports.unstable_shouldYield = shouldYieldToHost;
exports.unstable_wrapCallback = function (callback) {
var parentPriorityLevel = currentPriorityLevel;
return function () {
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = parentPriorityLevel;
try {
return callback.apply(this, arguments);
} finally {
currentPriorityLevel = previousPriorityLevel;
}
};
};
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
})();

View File

@@ -0,0 +1 @@
{"version":3,"file":"TraceIdRatioBasedSampler.js","sourceRoot":"","sources":["../../../src/sampler/TraceIdRatioBasedSampler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAW,gBAAgB,EAAkB,MAAM,YAAY,CAAC;AAEvE,2FAA2F;AAC3F,MAAM,OAAO,wBAAwB;IAClB,MAAM,CAAC;IAChB,WAAW,CAAS;IAE5B,YAAY,KAAK,GAAG,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;IAC1D,CAAC;IAED,YAAY,CAAC,OAAgB,EAAE,OAAe;QAC5C,OAAO;YACL,QAAQ,EACN,cAAc,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW;gBACrE,CAAC,CAAC,gBAAgB,CAAC,kBAAkB;gBACrC,CAAC,CAAC,gBAAgB,CAAC,UAAU;SAClC,CAAC;IACJ,CAAC;IAED,QAAQ;QACN,OAAO,qBAAqB,IAAI,CAAC,MAAM,GAAG,CAAC;IAC7C,CAAC;IAEO,UAAU,CAAC,KAAa;QAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,CAAC;QACxD,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACjD,CAAC;IAEO,WAAW,CAAC,OAAe;QACjC,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YAC3C,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;YAClB,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACvD,YAAY,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;SAC5C;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF","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 { isValidTraceId } from '@opentelemetry/api';\nimport { Sampler, SamplingDecision, SamplingResult } from '../Sampler';\n\n/** Sampler that samples a given fraction of traces based of trace id deterministically. */\nexport class TraceIdRatioBasedSampler implements Sampler {\n private readonly _ratio;\n private _upperBound: number;\n\n constructor(ratio = 0) {\n this._ratio = this._normalize(ratio);\n this._upperBound = Math.floor(this._ratio * 0xffffffff);\n }\n\n shouldSample(context: unknown, traceId: string): SamplingResult {\n return {\n decision:\n isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound\n ? SamplingDecision.RECORD_AND_SAMPLED\n : SamplingDecision.NOT_RECORD,\n };\n }\n\n toString(): string {\n return `TraceIdRatioBased{${this._ratio}}`;\n }\n\n private _normalize(ratio: number): number {\n if (typeof ratio !== 'number' || isNaN(ratio)) return 0;\n return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio;\n }\n\n private _accumulate(traceId: string): number {\n let accumulation = 0;\n for (let i = 0; i < traceId.length / 8; i++) {\n const pos = i * 8;\n const part = parseInt(traceId.slice(pos, pos + 8), 16);\n accumulation = (accumulation ^ part) >>> 0;\n }\n return accumulation;\n }\n}\n"]}

View File

@@ -0,0 +1,10 @@
{
"main": "dist/emotion-react-_isolated-hnrs.cjs.js",
"module": "dist/emotion-react-_isolated-hnrs.esm.js",
"umd:main": "dist/emotion-react-_isolated-hnrs.umd.min.js",
"types": "dist/emotion-react-_isolated-hnrs.cjs.d.ts",
"sideEffects": false,
"preconstruct": {
"umdName": "emotionHoistNonReactStatics"
}
}

View File

@@ -0,0 +1,27 @@
name: publish
on:
release:
types: [published]
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm test
- name: Publish beta version to npm
if: "github.event.release.prerelease"
run: npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to npm
if: "!github.event.release.prerelease"
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@@ -0,0 +1,240 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
import { useLayoutEffect, useEffect, forwardRef, useState, useCallback, useMemo } from 'react';
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
import { $canShowPlaceholderCurry } from '@lexical/text';
import { mergeRegister } from '@lexical/utils';
/**
* 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 CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
/**
* 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.
*
*/
// This workaround is no longer necessary in React 19,
// but we currently support React >=17.x
// https://github.com/facebook/react/pull/26395
const useLayoutEffectImpl = CAN_USE_DOM ? useLayoutEffect : useEffect;
/**
* 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.
*
*/
// Source: https://github.com/gregberge/react-merge-refs/blob/main/src/index.tsx
function mergeRefs(...refs) {
return value => {
refs.forEach(ref => {
if (typeof ref === 'function') {
ref(value);
} else if (ref != null) {
ref.current = value;
}
});
};
}
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
function ContentEditableElementImpl({
editor,
ariaActiveDescendant,
ariaAutoComplete,
ariaControls,
ariaDescribedBy,
ariaErrorMessage,
ariaExpanded,
ariaInvalid,
ariaLabel,
ariaLabelledBy,
ariaMultiline,
ariaOwns,
ariaRequired,
autoCapitalize,
className,
id,
role = 'textbox',
spellCheck = true,
style,
tabIndex,
'data-testid': testid,
...rest
}, ref) {
const [isEditable, setEditable] = useState(editor.isEditable());
const handleRef = useCallback(rootElement => {
// defaultView is required for a root element.
// In multi-window setups, the defaultView may not exist at certain points.
if (rootElement && rootElement.ownerDocument && rootElement.ownerDocument.defaultView) {
editor.setRootElement(rootElement);
} else {
editor.setRootElement(null);
}
}, [editor]);
const mergedRefs = useMemo(() => mergeRefs(ref, handleRef), [handleRef, ref]);
useLayoutEffectImpl(() => {
setEditable(editor.isEditable());
return editor.registerEditableListener(currentIsEditable => {
setEditable(currentIsEditable);
});
}, [editor]);
return /*#__PURE__*/jsx("div", {
"aria-activedescendant": isEditable ? ariaActiveDescendant : undefined,
"aria-autocomplete": isEditable ? ariaAutoComplete : 'none',
"aria-controls": isEditable ? ariaControls : undefined,
"aria-describedby": ariaDescribedBy
// for compat, only override aria-errormessage if ariaErrorMessage is defined
,
...(ariaErrorMessage != null ? {
'aria-errormessage': ariaErrorMessage
} : {}),
"aria-expanded": isEditable && role === 'combobox' ? !!ariaExpanded : undefined
// for compat, only override aria-invalid if ariaInvalid is defined
,
...(ariaInvalid != null ? {
'aria-invalid': ariaInvalid
} : {}),
"aria-label": ariaLabel,
"aria-labelledby": ariaLabelledBy,
"aria-multiline": ariaMultiline,
"aria-owns": isEditable ? ariaOwns : undefined,
"aria-readonly": isEditable ? undefined : true,
"aria-required": ariaRequired,
autoCapitalize: autoCapitalize,
className: className,
contentEditable: isEditable,
"data-testid": testid,
id: id,
ref: mergedRefs,
role: role,
spellCheck: spellCheck,
style: style,
tabIndex: tabIndex,
...rest
});
}
const ContentEditableElement = /*#__PURE__*/forwardRef(ContentEditableElementImpl);
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
function canShowPlaceholderFromCurrentEditorState(editor) {
const currentCanShowPlaceholder = editor.getEditorState().read($canShowPlaceholderCurry(editor.isComposing()));
return currentCanShowPlaceholder;
}
function useCanShowPlaceholder(editor) {
const [canShowPlaceholder, setCanShowPlaceholder] = useState(() => canShowPlaceholderFromCurrentEditorState(editor));
useLayoutEffectImpl(() => {
function resetCanShowPlaceholder() {
const currentCanShowPlaceholder = canShowPlaceholderFromCurrentEditorState(editor);
setCanShowPlaceholder(currentCanShowPlaceholder);
}
resetCanShowPlaceholder();
return mergeRegister(editor.registerUpdateListener(() => {
resetCanShowPlaceholder();
}), editor.registerEditableListener(() => {
resetCanShowPlaceholder();
}));
}, [editor]);
return canShowPlaceholder;
}
/**
* 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.
*
*/
/**
* @deprecated This type has been renamed to `ContentEditableProps` to provide a clearer and more descriptive name.
* For backward compatibility, this type is still exported as `Props`, but it is recommended to migrate to using `ContentEditableProps` instead.
*
* @note This alias is maintained for compatibility purposes but may be removed in future versions.
* Please update your codebase to use `ContentEditableProps` to ensure long-term maintainability.
*/
const ContentEditable = /*#__PURE__*/forwardRef(ContentEditableImpl);
function ContentEditableImpl(props, ref) {
const {
placeholder,
...rest
} = props;
const [editor] = useLexicalComposerContext();
return /*#__PURE__*/jsxs(Fragment, {
children: [/*#__PURE__*/jsx(ContentEditableElement, {
editor: editor,
...rest,
ref: ref
}), placeholder != null && /*#__PURE__*/jsx(Placeholder, {
editor: editor,
content: placeholder
})]
});
}
function Placeholder({
content,
editor
}) {
const showPlaceholder = useCanShowPlaceholder(editor);
const [isEditable, setEditable] = useState(editor.isEditable());
useLayoutEffect(() => {
setEditable(editor.isEditable());
return editor.registerEditableListener(currentIsEditable => {
setEditable(currentIsEditable);
});
}, [editor]);
if (!showPlaceholder) {
return null;
}
let placeholder = null;
if (typeof content === 'function') {
placeholder = content(isEditable);
} else if (content !== null) {
placeholder = content;
}
if (placeholder === null) {
return null;
}
return /*#__PURE__*/jsx("div", {
"aria-hidden": true,
children: placeholder
});
}
export { ContentEditable, ContentEditableElement };

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