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,5 @@
import { IImage } from './interface.mjs';
declare const KTX: IImage;
export { KTX };

View File

@@ -0,0 +1,16 @@
import { LCPMetric, MetricRatingThresholds, ReportOpts } from './types';
/** Thresholds for LCP. See https://web.dev/articles/lcp#what_is_a_good_lcp_score */
export declare const LCPThresholds: MetricRatingThresholds;
/**
* Calculates the [LCP](https://web.dev/articles/lcp) value for the current page and
* calls the `callback` function once the value is ready (along with the
* relevant `largest-contentful-paint` performance entry used to determine the
* value). The reported value is a `DOMHighResTimeStamp`.
*
* If the `reportAllChanges` configuration option is set to `true`, the
* `callback` function will be called any time a new `largest-contentful-paint`
* performance entry is dispatched, or once the final value of the metric has
* been determined.
*/
export declare const onLCP: (onReport: (metric: LCPMetric) => void, opts?: ReportOpts) => void;
//# sourceMappingURL=getLCP.d.ts.map

View File

@@ -0,0 +1,95 @@
import { BestFitMatcher } from "./BestFitMatcher.js";
import { CanonicalizeUValue } from "./CanonicalizeUValue.js";
import { InsertUnicodeExtensionAndCanonicalize } from "./InsertUnicodeExtensionAndCanonicalize.js";
import { LookupMatcher } from "./LookupMatcher.js";
import { UnicodeExtensionComponents } from "./UnicodeExtensionComponents.js";
import { invariant } from "./utils.js";
/**
* https://tc39.es/ecma402/#sec-resolvelocale
*/
export function ResolveLocale(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
const matcher = options.localeMatcher;
let r;
if (matcher === "lookup") {
r = LookupMatcher(Array.from(availableLocales), requestedLocales, getDefaultLocale);
} else {
r = BestFitMatcher(Array.from(availableLocales), requestedLocales, getDefaultLocale);
}
if (r == null) {
r = {
locale: getDefaultLocale(),
extension: ""
};
}
let foundLocale = r.locale;
let foundLocaleData = localeData[foundLocale];
// TODO: We can't really guarantee that the locale data is available
// invariant(
// foundLocaleData !== undefined,
// `Missing locale data for ${foundLocale}`
// )
const result = {
locale: "en",
dataLocale: foundLocale
};
let components;
let keywords;
if (r.extension) {
components = UnicodeExtensionComponents(r.extension);
keywords = components.keywords;
} else {
keywords = [];
}
let supportedKeywords = [];
for (const key of relevantExtensionKeys) {
// TODO: Shouldn't default to empty array, see TODO above
let keyLocaleData = foundLocaleData?.[key] ?? [];
invariant(Array.isArray(keyLocaleData), `keyLocaleData for ${key} must be an array`);
let value = keyLocaleData[0];
invariant(value === undefined || typeof value === "string", `value must be a string or undefined`);
let supportedKeyword;
let entry = keywords.find((k) => k.key === key);
if (entry) {
let requestedValue = entry.value;
if (requestedValue !== "") {
if (keyLocaleData.indexOf(requestedValue) > -1) {
value = requestedValue;
supportedKeyword = {
key,
value
};
}
} else if (keyLocaleData.indexOf("true") > -1) {
value = "true";
supportedKeyword = {
key,
value
};
}
}
let optionsValue = options[key];
invariant(optionsValue == null || typeof optionsValue === "string", `optionsValue must be a string or undefined`);
if (typeof optionsValue === "string") {
let ukey = key.toLowerCase();
optionsValue = CanonicalizeUValue(ukey, optionsValue);
if (optionsValue === "") {
optionsValue = "true";
}
}
if (optionsValue !== value && keyLocaleData.indexOf(optionsValue) > -1) {
value = optionsValue;
supportedKeyword = undefined;
}
if (supportedKeyword) {
supportedKeywords.push(supportedKeyword);
}
result[key] = value;
}
let supportedAttributes = [];
if (supportedKeywords.length > 0) {
supportedAttributes = [];
foundLocale = InsertUnicodeExtensionAndCanonicalize(foundLocale, supportedAttributes, supportedKeywords);
}
result.locale = foundLocale;
return result;
}

View File

@@ -0,0 +1,28 @@
"use strict";
exports.enNZ = void 0;
var _index = require("./en-US/_lib/formatDistance.cjs");
var _index2 = require("./en-US/_lib/formatRelative.cjs");
var _index3 = require("./en-US/_lib/localize.cjs");
var _index4 = require("./en-US/_lib/match.cjs");
var _index5 = require("./en-NZ/_lib/formatLong.cjs");
/**
* @category Locales
* @summary English locale (New Zealand).
* @language English
* @iso-639-2 eng
* @author Murray Lucas [@muntact](https://github.com/muntact)
*/
const enNZ = (exports.enNZ = {
code: "en-NZ",
formatDistance: _index.formatDistance,
formatLong: _index5.formatLong,
formatRelative: _index2.formatRelative,
localize: _index3.localize,
match: _index4.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
});

View File

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

View File

@@ -0,0 +1,35 @@
# Class: PoolStats
Aggregate stats for a [Pool](/docs/docs/api/Pool.md) or [BalancedPool](/docs/docs/api/BalancedPool.md).
## `new PoolStats(pool)`
Arguments:
* **pool** `Pool` - Pool or BalancedPool from which to return stats.
## Instance Properties
### `PoolStats.connected`
Number of open socket connections in this pool.
### `PoolStats.free`
Number of open socket connections in this pool that do not have an active request.
### `PoolStats.pending`
Number of pending requests across all clients in this pool.
### `PoolStats.queued`
Number of queued requests across all clients in this pool.
### `PoolStats.running`
Number of currently active requests across all clients in this pool.
### `PoolStats.size`
Number of active, pending, or queued requests across all clients in this pool.

View File

@@ -0,0 +1,52 @@
import type * as core from "./core.cjs";
import * as schemas from "./schemas.cjs";
import { $ZodTuple } from "./schemas.cjs";
import type * as util from "./util.cjs";
export interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodFunctionOut = $ZodFunctionOut> {
type: "function";
input: In;
output: Out;
}
export type $ZodFunctionArgs = schemas.$ZodType<unknown[], unknown[]>;
export type $ZodFunctionIn = $ZodFunctionArgs;
export type $ZodFunctionOut = schemas.$ZodType;
export type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.output<Args>) => core.input<Returns>;
export type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.output<Args>) => util.MaybeAsync<core.input<Returns>>;
export type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.input<Args>) => core.output<Returns>;
export type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.input<Args>) => util.MaybeAsync<core.output<Returns>>;
export declare class $ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> {
def: $ZodFunctionDef<Args, Returns>;
/** @deprecated */
_def: $ZodFunctionDef<Args, Returns>;
_input: $InferInnerFunctionType<Args, Returns>;
_output: $InferOuterFunctionType<Args, Returns>;
constructor(def: $ZodFunctionDef<Args, Returns>);
implement<F extends $InferInnerFunctionType<Args, Returns>>(func: F): (...args: Parameters<this["_output"]>) => ReturnType<F> extends ReturnType<this["_output"]> ? ReturnType<F> : ReturnType<this["_output"]>;
implementAsync<F extends $InferInnerFunctionTypeAsync<Args, Returns>>(func: F): F extends $InferOuterFunctionTypeAsync<Args, Returns> ? F : $InferOuterFunctionTypeAsync<Args, Returns>;
input<const Items extends util.TupleItems, const Rest extends $ZodFunctionOut = $ZodFunctionOut>(args: Items, rest?: Rest): $ZodFunction<schemas.$ZodTuple<Items, Rest>, Returns>;
input<NewArgs extends $ZodFunctionIn>(args: NewArgs): $ZodFunction<NewArgs, Returns>;
output<NewReturns extends schemas.$ZodType>(output: NewReturns): $ZodFunction<Args, NewReturns>;
}
export interface $ZodFunctionParams<I extends $ZodFunctionIn, O extends schemas.$ZodType> {
input?: I;
output?: O;
}
declare function _function(): $ZodFunction;
declare function _function<const In extends Array<schemas.$ZodType> = Array<schemas.$ZodType>>(params: {
input: In;
}): $ZodFunction<$ZodTuple<In, null>, $ZodFunctionOut>;
declare function _function<const In extends Array<schemas.$ZodType> = Array<schemas.$ZodType>, const Out extends $ZodFunctionOut = $ZodFunctionOut>(params: {
input: In;
output: Out;
}): $ZodFunction<$ZodTuple<In, null>, Out>;
declare function _function<const In extends $ZodFunctionIn = $ZodFunctionIn>(params: {
input: In;
}): $ZodFunction<In, $ZodFunctionOut>;
declare function _function<const Out extends $ZodFunctionOut = $ZodFunctionOut>(params: {
output: Out;
}): $ZodFunction<$ZodFunctionIn, Out>;
declare function _function<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends schemas.$ZodType = schemas.$ZodType>(params?: {
input: In;
output: Out;
}): $ZodFunction<In, Out>;
export { _function as function };

View File

@@ -0,0 +1,26 @@
function asyncGeneratorStep(n, t, e, r, o, a, c) {
try {
var i = n[a](c),
u = i.value;
} catch (n) {
return void e(n);
}
i.done ? t(u) : Promise.resolve(u).then(r, o);
}
function _asyncToGenerator(n) {
return function () {
var t = this,
e = arguments;
return new Promise(function (r, o) {
var a = n.apply(t, e);
function _next(n) {
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
}
function _throw(n) {
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
}
_next(void 0);
});
};
}
module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;

View File

@@ -0,0 +1,5 @@
import checkPrivateRedeclaration from "./checkPrivateRedeclaration.js";
function _classPrivateMethodInitSpec(e, a) {
checkPrivateRedeclaration(e, a), a.add(e);
}
export { _classPrivateMethodInitSpec as default };

View File

@@ -0,0 +1,10 @@
import type { Locale } from "./types.js";
/**
* @category Locales
* @summary Belarusian locale.
* @language Belarusian
* @iso-639-2 bel
* @author Kiryl Anokhin [@alyrik](https://github.com/alyrik)
* @author Martin Wind [@arvigeus](https://github.com/mawi12345)
*/
export declare const be: Locale;

View File

@@ -0,0 +1,86 @@
"use strict";
exports.formatDistance = void 0;
const translations = {
about: "körülbelül",
over: "több mint",
almost: "majdnem",
lessthan: "kevesebb mint",
};
const withoutSuffixes = {
xseconds: " másodperc",
halfaminute: "fél perc",
xminutes: " perc",
xhours: " óra",
xdays: " nap",
xweeks: " hét",
xmonths: " hónap",
xyears: " év",
};
const withSuffixes = {
xseconds: {
"-1": " másodperccel ezelőtt",
1: " másodperc múlva",
0: " másodperce",
},
halfaminute: {
"-1": "fél perccel ezelőtt",
1: "fél perc múlva",
0: "fél perce",
},
xminutes: {
"-1": " perccel ezelőtt",
1: " perc múlva",
0: " perce",
},
xhours: {
"-1": " órával ezelőtt",
1: " óra múlva",
0: " órája",
},
xdays: {
"-1": " nappal ezelőtt",
1: " nap múlva",
0: " napja",
},
xweeks: {
"-1": " héttel ezelőtt",
1: " hét múlva",
0: " hete",
},
xmonths: {
"-1": " hónappal ezelőtt",
1: " hónap múlva",
0: " hónapja",
},
xyears: {
"-1": " évvel ezelőtt",
1: " év múlva",
0: " éve",
},
};
const formatDistance = (token, count, options) => {
const adverb = token.match(/about|over|almost|lessthan/i);
const unit = adverb ? token.replace(adverb[0], "") : token;
const addSuffix = options?.addSuffix === true;
const key = unit.toLowerCase();
const comparison = options?.comparison || 0;
const translated = addSuffix
? withSuffixes[key][comparison]
: withoutSuffixes[key];
let result = key === "halfaminute" ? translated : count + translated;
if (adverb) {
const adv = adverb[0].toLowerCase();
result = translations[adv] + " " + result;
}
return result;
};
exports.formatDistance = formatDistance;

View File

@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Presentation = createLucideIcon("Presentation", [
["path", { d: "M2 3h20", key: "91anmk" }],
["path", { d: "M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3", key: "2k9sn8" }],
["path", { d: "m7 21 5-5 5 5", key: "bip4we" }]
]);
export { Presentation as default };
//# sourceMappingURL=presentation.js.map

View File

@@ -0,0 +1,492 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const createHash = require("../util/createHash");
const { makePathsRelative } = require("../util/identifier");
const numberHash = require("../util/numberHash");
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../ChunkGraph")} ChunkGraph */
/** @typedef {import("../Compilation")} Compilation */
/** @typedef {import("../Module")} Module */
/** @typedef {import("../util/Hash").HashFunction} HashFunction */
/** @typedef {import("../util/identifier").AssociatedObjectForCache} AssociatedObjectForCache */
/** @typedef {import("../Module").BuildMeta} BuildMeta */
/**
* @param {string} str string to hash
* @param {number} len max length of the hash
* @param {HashFunction} hashFunction hash function to use
* @returns {string} hash
*/
const getHash = (str, len, hashFunction) => {
const hash = createHash(hashFunction);
hash.update(str);
const digest = hash.digest("hex");
return digest.slice(0, len);
};
/**
* @param {string} str the string
* @returns {string} string prefixed by an underscore if it is a number
*/
const avoidNumber = (str) => {
// max length of a number is 21 chars, bigger numbers a written as "...e+xx"
if (str.length > 21) return str;
const firstChar = str.charCodeAt(0);
// skip everything that doesn't look like a number
// charCodes: "-": 45, "1": 49, "9": 57
if (firstChar < 49) {
if (firstChar !== 45) return str;
} else if (firstChar > 57) {
return str;
}
if (str === String(Number(str))) {
return `_${str}`;
}
return str;
};
/**
* @param {string} request the request
* @returns {string} id representation
*/
const requestToId = (request) =>
request.replace(/^(\.\.?\/)+/, "").replace(/(^[.-]|[^a-z0-9_-])+/gi, "_");
/**
* @param {string} string the string
* @param {string} delimiter separator for string and hash
* @param {HashFunction} hashFunction hash function to use
* @returns {string} string with limited max length to 100 chars
*/
const shortenLongString = (string, delimiter, hashFunction) => {
if (string.length < 100) return string;
return (
string.slice(0, 100 - 6 - delimiter.length) +
delimiter +
getHash(string, 6, hashFunction)
);
};
/**
* @param {Module} module the module
* @param {string} context context directory
* @param {AssociatedObjectForCache=} associatedObjectForCache an object to which the cache will be attached
* @returns {string} short module name
*/
const getShortModuleName = (module, context, associatedObjectForCache) => {
const libIdent = module.libIdent({ context, associatedObjectForCache });
if (libIdent) return avoidNumber(libIdent);
const nameForCondition = module.nameForCondition();
if (nameForCondition) {
return avoidNumber(
makePathsRelative(context, nameForCondition, associatedObjectForCache)
);
}
return "";
};
/**
* @param {string} shortName the short name
* @param {Module} module the module
* @param {string} context context directory
* @param {HashFunction} hashFunction hash function to use
* @param {AssociatedObjectForCache=} associatedObjectForCache an object to which the cache will be attached
* @returns {string} long module name
*/
const getLongModuleName = (
shortName,
module,
context,
hashFunction,
associatedObjectForCache
) => {
const fullName = getFullModuleName(module, context, associatedObjectForCache);
return `${shortName}?${getHash(fullName, 4, hashFunction)}`;
};
/**
* @param {Module} module the module
* @param {string} context context directory
* @param {AssociatedObjectForCache=} associatedObjectForCache an object to which the cache will be attached
* @returns {string} full module name
*/
const getFullModuleName = (module, context, associatedObjectForCache) =>
makePathsRelative(context, module.identifier(), associatedObjectForCache);
/**
* @param {Chunk} chunk the chunk
* @param {ChunkGraph} chunkGraph the chunk graph
* @param {string} context context directory
* @param {string} delimiter delimiter for names
* @param {HashFunction} hashFunction hash function to use
* @param {AssociatedObjectForCache=} associatedObjectForCache an object to which the cache will be attached
* @returns {string} short chunk name
*/
const getShortChunkName = (
chunk,
chunkGraph,
context,
delimiter,
hashFunction,
associatedObjectForCache
) => {
const modules = chunkGraph.getChunkRootModules(chunk);
const shortModuleNames = modules.map((m) =>
requestToId(getShortModuleName(m, context, associatedObjectForCache))
);
chunk.idNameHints.sort();
const chunkName = [...chunk.idNameHints, ...shortModuleNames]
.filter(Boolean)
.join(delimiter);
return shortenLongString(chunkName, delimiter, hashFunction);
};
/**
* @param {Chunk} chunk the chunk
* @param {ChunkGraph} chunkGraph the chunk graph
* @param {string} context context directory
* @param {string} delimiter delimiter for names
* @param {HashFunction} hashFunction hash function to use
* @param {AssociatedObjectForCache=} associatedObjectForCache an object to which the cache will be attached
* @returns {string} short chunk name
*/
const getLongChunkName = (
chunk,
chunkGraph,
context,
delimiter,
hashFunction,
associatedObjectForCache
) => {
const modules = chunkGraph.getChunkRootModules(chunk);
const shortModuleNames = modules.map((m) =>
requestToId(getShortModuleName(m, context, associatedObjectForCache))
);
const longModuleNames = modules.map((m) =>
requestToId(
getLongModuleName("", m, context, hashFunction, associatedObjectForCache)
)
);
chunk.idNameHints.sort();
const chunkName = [
...chunk.idNameHints,
...shortModuleNames,
...longModuleNames
]
.filter(Boolean)
.join(delimiter);
return shortenLongString(chunkName, delimiter, hashFunction);
};
/**
* @param {Chunk} chunk the chunk
* @param {ChunkGraph} chunkGraph the chunk graph
* @param {string} context context directory
* @param {AssociatedObjectForCache=} associatedObjectForCache an object to which the cache will be attached
* @returns {string} full chunk name
*/
const getFullChunkName = (
chunk,
chunkGraph,
context,
associatedObjectForCache
) => {
if (chunk.name) return chunk.name;
const modules = chunkGraph.getChunkRootModules(chunk);
const fullModuleNames = modules.map((m) =>
makePathsRelative(context, m.identifier(), associatedObjectForCache)
);
return fullModuleNames.join();
};
/**
* @template K
* @template V
* @param {Map<K, V[]>} map a map from key to values
* @param {K} key key
* @param {V} value value
* @returns {void}
*/
const addToMapOfItems = (map, key, value) => {
let array = map.get(key);
if (array === undefined) {
array = [];
map.set(key, array);
}
array.push(value);
};
/** @typedef {Set<string>} UsedModuleIds */
/**
* @param {Compilation} compilation the compilation
* @param {((module: Module) => boolean)=} filter filter modules
* @returns {[UsedModuleIds, Module[]]} used module ids as strings and modules without id matching the filter
*/
const getUsedModuleIdsAndModules = (compilation, filter) => {
const chunkGraph = compilation.chunkGraph;
/** @type {Module[]} */
const modules = [];
/** @type {UsedModuleIds} */
const usedIds = new Set();
if (compilation.usedModuleIds) {
for (const id of compilation.usedModuleIds) {
usedIds.add(String(id));
}
}
for (const module of compilation.modules) {
if (!module.needId) continue;
const moduleId = chunkGraph.getModuleId(module);
if (moduleId !== null) {
usedIds.add(String(moduleId));
} else if (
(!filter || filter(module)) &&
(chunkGraph.getNumberOfModuleChunks(module) !== 0 ||
// CSS modules need IDs even when not in chunks, for generating CSS class names(i.e. [id]-[local])
/** @type {BuildMeta} */ (module.buildMeta).isCSSModule)
) {
modules.push(module);
}
}
return [usedIds, modules];
};
/** @typedef {Set<string>} UsedChunkIds */
/**
* @param {Compilation} compilation the compilation
* @returns {UsedChunkIds} used chunk ids as strings
*/
const getUsedChunkIds = (compilation) => {
/** @type {UsedChunkIds} */
const usedIds = new Set();
if (compilation.usedChunkIds) {
for (const id of compilation.usedChunkIds) {
usedIds.add(String(id));
}
}
for (const chunk of compilation.chunks) {
const chunkId = chunk.id;
if (chunkId !== null) {
usedIds.add(String(chunkId));
}
}
return usedIds;
};
/**
* @template T
* @param {Iterable<T>} items list of items to be named
* @param {(item: T) => string} getShortName get a short name for an item
* @param {(item: T, name: string) => string} getLongName get a long name for an item
* @param {(a: T, b: T) => -1 | 0 | 1} comparator order of items
* @param {Set<string>} usedIds already used ids, will not be assigned
* @param {(item: T, name: string) => void} assignName assign a name to an item
* @returns {T[]} list of items without a name
*/
const assignNames = (
items,
getShortName,
getLongName,
comparator,
usedIds,
assignName
) => {
/**
* @template T
* @typedef {Map<string, T[]>} MapToItem
*/
/** @type {MapToItem<T>} */
const nameToItems = new Map();
for (const item of items) {
const name = getShortName(item);
addToMapOfItems(nameToItems, name, item);
}
/** @type {MapToItem<T>} */
const nameToItems2 = new Map();
for (const [name, items] of nameToItems) {
if (items.length > 1 || !name) {
for (const item of items) {
const longName = getLongName(item, name);
addToMapOfItems(nameToItems2, longName, item);
}
} else {
addToMapOfItems(nameToItems2, name, items[0]);
}
}
/** @type {T[]} */
const unnamedItems = [];
for (const [name, items] of nameToItems2) {
if (!name) {
for (const item of items) {
unnamedItems.push(item);
}
} else if (items.length === 1 && !usedIds.has(name)) {
assignName(items[0], name);
usedIds.add(name);
} else {
items.sort(comparator);
let i = 0;
for (const item of items) {
while (nameToItems2.has(name + i) && usedIds.has(name + i)) i++;
assignName(item, name + i);
usedIds.add(name + i);
i++;
}
}
}
unnamedItems.sort(comparator);
return unnamedItems;
};
/**
* @template T
* @param {T[]} items list of items to be named
* @param {(item: T) => string} getName get a name for an item
* @param {(a: T, n: T) => -1 | 0 | 1} comparator order of items
* @param {(item: T, id: number) => boolean} assignId assign an id to an item
* @param {number[]} ranges usable ranges for ids
* @param {number} expandFactor factor to create more ranges
* @param {number} extraSpace extra space to allocate, i. e. when some ids are already used
* @param {number} salt salting number to initialize hashing
* @returns {void}
*/
const assignDeterministicIds = (
items,
getName,
comparator,
assignId,
ranges = [10],
expandFactor = 10,
extraSpace = 0,
salt = 0
) => {
items.sort(comparator);
// max 5% fill rate
const optimalRange = Math.min(
items.length * 20 + extraSpace,
Number.MAX_SAFE_INTEGER
);
let i = 0;
let range = ranges[i];
while (range < optimalRange) {
i++;
if (i < ranges.length) {
range = Math.min(ranges[i], Number.MAX_SAFE_INTEGER);
} else if (expandFactor) {
range = Math.min(range * expandFactor, Number.MAX_SAFE_INTEGER);
} else {
break;
}
}
for (const item of items) {
const ident = getName(item);
/** @type {number} */
let id;
let i = salt;
do {
id = numberHash(ident + i++, range);
} while (!assignId(item, id));
}
};
/**
* @param {UsedModuleIds} usedIds used ids
* @param {Iterable<Module>} modules the modules
* @param {Compilation} compilation the compilation
* @returns {void}
*/
const assignAscendingModuleIds = (usedIds, modules, compilation) => {
const chunkGraph = compilation.chunkGraph;
let nextId = 0;
/** @type {(mod: Module) => void} */
let assignId;
if (usedIds.size > 0) {
/**
* @param {Module} module the module
*/
assignId = (module) => {
if (chunkGraph.getModuleId(module) === null) {
while (usedIds.has(String(nextId))) nextId++;
chunkGraph.setModuleId(module, nextId++);
}
};
} else {
/**
* @param {Module} module the module
*/
assignId = (module) => {
if (chunkGraph.getModuleId(module) === null) {
chunkGraph.setModuleId(module, nextId++);
}
};
}
for (const module of modules) {
assignId(module);
}
};
/**
* @param {Iterable<Chunk>} chunks the chunks
* @param {Compilation} compilation the compilation
* @returns {void}
*/
const assignAscendingChunkIds = (chunks, compilation) => {
const usedIds = getUsedChunkIds(compilation);
let nextId = 0;
if (usedIds.size > 0) {
for (const chunk of chunks) {
if (chunk.id === null) {
while (usedIds.has(String(nextId))) nextId++;
chunk.id = nextId;
chunk.ids = [nextId];
nextId++;
}
}
} else {
for (const chunk of chunks) {
if (chunk.id === null) {
chunk.id = nextId;
chunk.ids = [nextId];
nextId++;
}
}
}
};
module.exports.assignAscendingChunkIds = assignAscendingChunkIds;
module.exports.assignAscendingModuleIds = assignAscendingModuleIds;
module.exports.assignDeterministicIds = assignDeterministicIds;
module.exports.assignNames = assignNames;
module.exports.getFullChunkName = getFullChunkName;
module.exports.getFullModuleName = getFullModuleName;
module.exports.getLongChunkName = getLongChunkName;
module.exports.getLongModuleName = getLongModuleName;
module.exports.getShortChunkName = getShortChunkName;
module.exports.getShortModuleName = getShortModuleName;
module.exports.getUsedChunkIds = getUsedChunkIds;
module.exports.getUsedModuleIdsAndModules = getUsedModuleIdsAndModules;
module.exports.requestToId = requestToId;

View File

@@ -0,0 +1 @@
module.exports={C:{"5":0.0049,"90":0.0049,"113":0.02941,"114":0.0049,"115":0.11762,"125":0.0049,"126":0.0049,"127":0.0098,"130":0.0049,"133":0.0049,"134":0.0049,"135":0.0098,"136":0.0098,"137":0.0049,"138":0.0196,"139":0.0098,"140":0.03431,"141":0.0098,"142":0.02451,"143":0.02941,"144":0.03921,"145":0.9949,"146":1.27426,"147":0.0098,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 116 117 118 119 120 121 122 123 124 128 129 131 132 148 149 3.5 3.6"},D:{"39":0.0049,"40":0.0049,"41":0.0049,"42":0.0049,"43":0.0049,"44":0.0049,"45":0.0049,"46":0.0049,"47":0.0049,"48":0.0049,"49":0.0049,"50":0.0049,"51":0.0049,"52":0.0049,"53":0.0049,"54":0.0049,"55":0.0049,"56":0.0049,"57":0.0049,"58":0.0049,"59":0.0049,"60":0.0049,"69":0.0049,"85":0.0147,"87":0.0049,"89":0.0049,"95":0.0049,"98":0.0049,"103":0.02451,"104":0.0196,"105":0.0196,"106":0.0147,"107":0.0147,"108":0.0147,"109":0.61263,"110":0.0147,"111":0.0196,"112":0.0147,"114":0.0196,"115":0.0049,"116":0.07842,"117":0.04901,"118":0.0049,"119":0.0098,"120":0.05391,"121":0.02451,"122":0.05391,"123":0.02451,"124":0.03921,"125":0.19604,"126":0.14703,"127":0.02451,"128":0.09802,"129":0.02451,"130":0.02941,"131":0.12253,"132":0.06371,"133":0.07842,"134":0.04411,"135":0.07842,"136":0.06371,"137":0.06861,"138":0.25485,"139":0.16173,"140":0.14213,"141":0.35287,"142":13.87963,"143":18.09939,"144":0.0098,"145":0.0049,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 61 62 63 64 65 66 67 68 70 71 72 73 74 75 76 77 78 79 80 81 83 84 86 88 90 91 92 93 94 96 97 99 100 101 102 113 146"},F:{"92":0.0049,"93":0.0196,"95":0.0098,"123":0.0049,"124":0.24505,"125":0.08332,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.0049,"92":0.0049,"109":0.0098,"114":0.0049,"122":0.0049,"131":0.0049,"133":0.0049,"135":0.0049,"136":0.0049,"137":0.0049,"138":0.0049,"139":0.0049,"140":0.0098,"141":0.0147,"142":1.34778,"143":3.68555,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119 120 121 123 124 125 126 127 128 129 130 132 134"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 15.2-15.3 16.0 26.3","5.1":0.0049,"13.1":0.0049,"14.1":0.0049,"15.1":0.0049,"15.4":0.0049,"15.5":0.0049,"15.6":0.04411,"16.1":0.0147,"16.2":0.0098,"16.3":0.0098,"16.4":0.0098,"16.5":0.0196,"16.6":0.06371,"17.0":0.0098,"17.1":0.0147,"17.2":0.0147,"17.3":0.0098,"17.4":0.0196,"17.5":0.03921,"17.6":0.10292,"18.0":0.0196,"18.1":0.02941,"18.2":0.0196,"18.3":0.05881,"18.4":0.02941,"18.5-18.6":0.13233,"26.0":0.07842,"26.1":0.23035,"26.2":0.03921},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00119,"5.0-5.1":0,"6.0-6.1":0.00237,"7.0-7.1":0.00178,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00475,"10.0-10.2":0.00059,"10.3":0.00831,"11.0-11.2":0.10209,"11.3-11.4":0.00297,"12.0-12.1":0.00237,"12.2-12.5":0.02671,"13.0-13.1":0.00059,"13.2":0.00415,"13.3":0.00119,"13.4-13.7":0.00415,"14.0-14.4":0.00831,"14.5-14.8":0.0089,"15.0-15.1":0.0095,"15.2-15.3":0.00712,"15.4":0.00772,"15.5":0.00831,"15.6-15.8":0.12879,"16.0":0.01484,"16.1":0.02849,"16.2":0.01484,"16.3":0.02671,"16.4":0.00653,"16.5":0.01128,"16.6-16.7":0.16737,"17.0":0.0095,"17.1":0.01543,"17.2":0.01128,"17.3":0.01721,"17.4":0.02908,"17.5":0.05698,"17.6-17.7":0.13176,"18.0":0.02968,"18.1":0.06173,"18.2":0.03264,"18.3":0.10624,"18.4":0.0546,"18.5-18.7":3.92082,"26.0":0.07656,"26.1":0.63685,"26.2":0.12108,"26.3":0.00534},P:{"21":0.01034,"22":0.01034,"23":0.01034,"24":0.01034,"25":0.02067,"26":0.02067,"27":0.03101,"28":0.11371,"29":0.89932,_:"4 20 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.01034},I:{"0":0.056,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00004},A:{"11":0.14213,_:"6 7 8 9 10 5.5"},K:{"0":0.4946,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{"14.9":0.0051},O:{"0":0.07139},H:{"0":0},L:{"0":46.84854},R:{_:"0"},M:{"0":0.07139}};

View File

@@ -0,0 +1 @@
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/screenshot/components/Toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,CAAC,IAAI,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,UAAU,aAAa;IACrB,CAAC,EAAE,OAAO,KAAK,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,CAAC,GACF,EAAE,aAAa,IACU,iCAIrB;IACD,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,EAAE,CAAC;IAClC,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC;IACzD,OAAO,EAAE,uBAAuB,CAAC;CAClC,KAAG,KAAK,CA0BV"}

View File

@@ -0,0 +1,38 @@
{
"name": "semver",
"version": "6.3.1",
"description": "The semantic version parser used by npm.",
"main": "semver.js",
"scripts": {
"test": "tap test/ --100 --timeout=30",
"lint": "echo linting disabled",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"snap": "tap test/ --100 --timeout=30",
"posttest": "npm run lint"
},
"devDependencies": {
"@npmcli/template-oss": "4.17.0",
"tap": "^12.7.0"
},
"license": "ISC",
"repository": {
"type": "git",
"url": "https://github.com/npm/node-semver.git"
},
"bin": {
"semver": "./bin/semver.js"
},
"files": [
"bin",
"range.bnf",
"semver.js"
],
"author": "GitHub Inc.",
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"content": "./scripts/template-oss",
"version": "4.17.0"
}
}

View File

@@ -0,0 +1,118 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr
*/
"use strict";
const createSchemaValidation = require("../util/create-schema-validation");
const memoize = require("../util/memoize");
const ContainerEntryDependency = require("./ContainerEntryDependency");
const ContainerEntryModuleFactory = require("./ContainerEntryModuleFactory");
const ContainerExposedDependency = require("./ContainerExposedDependency");
const { parseOptions } = require("./options");
/** @typedef {import("../../declarations/plugins/container/ContainerPlugin").ContainerPluginOptions} ContainerPluginOptions */
/** @typedef {import("../Compiler")} Compiler */
/** @typedef {import("./ContainerEntryModule").ExposesList} ExposesList */
const getModuleFederationPlugin = memoize(() =>
require("./ModuleFederationPlugin")
);
const validate = createSchemaValidation(
require("../../schemas/plugins/container/ContainerPlugin.check"),
() => require("../../schemas/plugins/container/ContainerPlugin.json"),
{
name: "Container Plugin",
baseDataPath: "options"
}
);
const PLUGIN_NAME = "ContainerPlugin";
class ContainerPlugin {
/**
* @param {ContainerPluginOptions} options options
*/
constructor(options) {
validate(options);
this._options = {
name: options.name,
shareScope: options.shareScope || "default",
library: options.library || {
type: "var",
name: options.name
},
runtime: options.runtime,
filename: options.filename || undefined,
exposes: /** @type {ExposesList} */ (
parseOptions(
options.exposes,
(item) => ({
import: Array.isArray(item) ? item : [item],
name: undefined
}),
(item) => ({
import: Array.isArray(item.import) ? item.import : [item.import],
name: item.name || undefined
})
)
)
};
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
const { name, exposes, shareScope, filename, library, runtime } =
this._options;
if (!compiler.options.output.enabledLibraryTypes.includes(library.type)) {
compiler.options.output.enabledLibraryTypes.push(library.type);
}
compiler.hooks.make.tapAsync(PLUGIN_NAME, (compilation, callback) => {
const hooks =
getModuleFederationPlugin().getCompilationHooks(compilation);
const dep = new ContainerEntryDependency(name, exposes, shareScope);
dep.loc = { name };
compilation.addEntry(
compilation.options.context,
dep,
{
name,
filename,
runtime,
library
},
(error) => {
if (error) return callback(error);
hooks.addContainerEntryDependency.call(dep);
callback();
}
);
});
compiler.hooks.thisCompilation.tap(
PLUGIN_NAME,
(compilation, { normalModuleFactory }) => {
compilation.dependencyFactories.set(
ContainerEntryDependency,
new ContainerEntryModuleFactory()
);
compilation.dependencyFactories.set(
ContainerExposedDependency,
normalModuleFactory
);
}
);
}
}
module.exports = ContainerPlugin;

View File

@@ -0,0 +1,228 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.cjs");
const eraValues = {
narrow: ["да н.э.", "н.э."],
abbreviated: ["да н. э.", "н. э."],
wide: ["да нашай эры", "нашай эры"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-ы кв.", "2-і кв.", "3-і кв.", "4-ы кв."],
wide: ["1-ы квартал", "2-і квартал", "3-і квартал", "4-ы квартал"],
};
const monthValues = {
narrow: ["С", "Л", "С", "К", "М", "Ч", "Л", "Ж", "В", "К", "Л", "С"],
abbreviated: [
"студз.",
"лют.",
"сак.",
"крас.",
"май",
"чэрв.",
"ліп.",
"жн.",
"вер.",
"кастр.",
"ліст.",
"снеж.",
],
wide: [
"студзень",
"люты",
"сакавік",
"красавік",
"май",
"чэрвень",
"ліпень",
"жнівень",
"верасень",
"кастрычнік",
"лістапад",
"снежань",
],
};
const formattingMonthValues = {
narrow: ["С", "Л", "С", "К", "М", "Ч", "Л", "Ж", "В", "К", "Л", "С"],
abbreviated: [
"студз.",
"лют.",
"сак.",
"крас.",
"мая",
"чэрв.",
"ліп.",
"жн.",
"вер.",
"кастр.",
"ліст.",
"снеж.",
],
wide: [
"студзеня",
"лютага",
"сакавіка",
"красавіка",
"мая",
"чэрвеня",
"ліпеня",
"жніўня",
"верасня",
"кастрычніка",
"лістапада",
"снежня",
],
};
const dayValues = {
narrow: ["Н", "П", "А", "С", "Ч", "П", "С"],
short: ["нд", "пн", "аў", "ср", "чц", "пт", "сб"],
abbreviated: ["нядз", "пан", "аўт", "сер", "чац", "пят", "суб"],
wide: [
"нядзеля",
"панядзелак",
"аўторак",
"серада",
"чацвер",
"пятніца",
"субота",
],
};
const dayPeriodValues = {
narrow: {
am: "ДП",
pm: "ПП",
midnight: "поўн.",
noon: "поўд.",
morning: "ран.",
afternoon: "дзень",
evening: "веч.",
night: "ноч",
},
abbreviated: {
am: "ДП",
pm: "ПП",
midnight: "поўн.",
noon: "поўд.",
morning: "ран.",
afternoon: "дзень",
evening: "веч.",
night: "ноч",
},
wide: {
am: "ДП",
pm: "ПП",
midnight: "поўнач",
noon: "поўдзень",
morning: "раніца",
afternoon: "дзень",
evening: "вечар",
night: "ноч",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ДП",
pm: "ПП",
midnight: "поўн.",
noon: "поўд.",
morning: "ран.",
afternoon: "дня",
evening: "веч.",
night: "ночы",
},
abbreviated: {
am: "ДП",
pm: "ПП",
midnight: "поўн.",
noon: "поўд.",
morning: "ран.",
afternoon: "дня",
evening: "веч.",
night: "ночы",
},
wide: {
am: "ДП",
pm: "ПП",
midnight: "поўнач",
noon: "поўдзень",
morning: "раніцы",
afternoon: "дня",
evening: "вечара",
night: "ночы",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const unit = String(options?.unit);
const number = Number(dirtyNumber);
let suffix;
/** Though it's an incorrect ordinal form of a date we use it here for consistency with other similar locales (ru, uk)
* For date-month combinations should be used `d` formatter.
* Correct: `d MMMM` (4 верасня)
* Incorrect: `do MMMM` (4-га верасня)
*
* But following the consistency leads to mistakes for literal uses of `do` formatter (ordinal day of month).
* So for phrase "5th day of month" (`do дзень месяца`)
* library will produce: `5-га дзень месяца`
* but correct spelling should be: `5-ы дзень месяца`
*
* So I guess there should be a stand-alone and a formatting version of "day of month" formatters
*/
if (unit === "date") {
suffix = "-га";
} else if (unit === "hour" || unit === "minute" || unit === "second") {
suffix = "-я";
} else {
suffix =
(number % 10 === 2 || number % 10 === 3) &&
number % 100 !== 12 &&
number % 100 !== 13
? "-і"
: "-ы";
}
return number + suffix;
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "any",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1,243 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
import { ZodNullable, ZodOptional } from "zod/v3";
import { util } from "../helpers/util.js";
const nested = z.object({
name: z.string(),
age: z.number(),
outer: z.object({
inner: z.string(),
}),
array: z.array(z.object({ asdf: z.string() })),
});
test("shallow inference", () => {
const shallow = nested.partial();
type shallow = z.infer<typeof shallow>;
type correct = {
name?: string | undefined;
age?: number | undefined;
outer?: { inner: string } | undefined;
array?: { asdf: string }[];
};
util.assertEqual<shallow, correct>(true);
});
test("shallow partial parse", () => {
const shallow = nested.partial();
shallow.parse({});
shallow.parse({
name: "asdf",
age: 23143,
});
});
test("deep partial inference", () => {
const deep = nested.deepPartial();
const asdf = deep.shape.array.unwrap().element.shape.asdf.unwrap();
asdf.parse("asdf");
type deep = z.infer<typeof deep>;
type correct = {
array?: { asdf?: string }[];
name?: string | undefined;
age?: number | undefined;
outer?: { inner?: string | undefined } | undefined;
};
util.assertEqual<deep, correct>(true);
});
test("deep partial parse", () => {
const deep = nested.deepPartial();
expect(deep.shape.name instanceof z.ZodOptional).toBe(true);
expect(deep.shape.outer instanceof z.ZodOptional).toBe(true);
expect(deep.shape.outer._def.innerType instanceof z.ZodObject).toBe(true);
expect(deep.shape.outer._def.innerType.shape.inner instanceof z.ZodOptional).toBe(true);
expect(deep.shape.outer._def.innerType.shape.inner._def.innerType instanceof z.ZodString).toBe(true);
});
test("deep partial runtime tests", () => {
const deep = nested.deepPartial();
deep.parse({});
deep.parse({
outer: {},
});
deep.parse({
name: "asdf",
age: 23143,
outer: {
inner: "adsf",
},
});
});
test("deep partial optional/nullable", () => {
const schema = z
.object({
name: z.string().optional(),
age: z.number().nullable(),
})
.deepPartial();
expect(schema.shape.name.unwrap()).toBeInstanceOf(ZodOptional);
expect(schema.shape.age.unwrap()).toBeInstanceOf(ZodNullable);
});
test("deep partial tuple", () => {
const schema = z
.object({
tuple: z.tuple([
z.object({
name: z.string().optional(),
age: z.number().nullable(),
}),
]),
})
.deepPartial();
expect(schema.shape.tuple.unwrap().items[0].shape.name).toBeInstanceOf(ZodOptional);
});
test("deep partial inference", () => {
const mySchema = z.object({
name: z.string(),
array: z.array(z.object({ asdf: z.string() })),
tuple: z.tuple([z.object({ value: z.string() })]),
});
const partialed = mySchema.deepPartial();
type partialed = z.infer<typeof partialed>;
type expected = {
name?: string | undefined;
array?:
| {
asdf?: string | undefined;
}[]
| undefined;
tuple?: [{ value?: string }] | undefined;
};
util.assertEqual<expected, partialed>(true);
});
test("required", () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
nullableField: z.number().nullable(),
nullishField: z.string().nullish(),
});
const requiredObject = object.required();
expect(requiredObject.shape.name).toBeInstanceOf(z.ZodString);
expect(requiredObject.shape.age).toBeInstanceOf(z.ZodNumber);
expect(requiredObject.shape.field).toBeInstanceOf(z.ZodDefault);
expect(requiredObject.shape.nullableField).toBeInstanceOf(z.ZodNullable);
expect(requiredObject.shape.nullishField).toBeInstanceOf(z.ZodNullable);
});
test("required inference", () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
nullableField: z.number().nullable(),
nullishField: z.string().nullish(),
});
const requiredObject = object.required();
type required = z.infer<typeof requiredObject>;
type expected = {
name: string;
age: number;
field: string;
nullableField: number | null;
nullishField: string | null;
};
util.assertEqual<expected, required>(true);
});
test("required with mask", () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
country: z.string().optional(),
});
const requiredObject = object.required({ age: true });
expect(requiredObject.shape.name).toBeInstanceOf(z.ZodString);
expect(requiredObject.shape.age).toBeInstanceOf(z.ZodNumber);
expect(requiredObject.shape.field).toBeInstanceOf(z.ZodDefault);
expect(requiredObject.shape.country).toBeInstanceOf(z.ZodOptional);
});
test("required with mask -- ignore falsy values", () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
country: z.string().optional(),
});
// @ts-expect-error
const requiredObject = object.required({ age: true, country: false });
expect(requiredObject.shape.name).toBeInstanceOf(z.ZodString);
expect(requiredObject.shape.age).toBeInstanceOf(z.ZodNumber);
expect(requiredObject.shape.field).toBeInstanceOf(z.ZodDefault);
expect(requiredObject.shape.country).toBeInstanceOf(z.ZodOptional);
});
test("partial with mask", async () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
country: z.string(),
});
const masked = object.partial({ age: true, field: true, name: true }).strict();
expect(masked.shape.name).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.age).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.field).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.country).toBeInstanceOf(z.ZodString);
masked.parse({ country: "US" });
await masked.parseAsync({ country: "US" });
});
test("partial with mask -- ignore falsy values", async () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
country: z.string(),
});
// @ts-expect-error
const masked = object.partial({ name: true, country: false }).strict();
expect(masked.shape.name).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.age).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.field).toBeInstanceOf(z.ZodDefault);
expect(masked.shape.country).toBeInstanceOf(z.ZodString);
masked.parse({ country: "US" });
await masked.parseAsync({ country: "US" });
});
test("deeppartial array", () => {
const schema = z.object({ array: z.string().array().min(42) }).deepPartial();
// works as expected
schema.parse({});
// should be false, but is true
expect(schema.safeParse({ array: [] }).success).toBe(false);
});

View File

@@ -0,0 +1,5 @@
'use strict'
const compareBuild = require('./compare-build')
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
module.exports = rsort

View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PLACEHOLDERS_FLIPPED_ALIAS = exports.PLACEHOLDERS_ALIAS = exports.PLACEHOLDERS = void 0;
var _utils = require("./utils.js");
const PLACEHOLDERS = exports.PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"];
const PLACEHOLDERS_ALIAS = exports.PLACEHOLDERS_ALIAS = {
Declaration: ["Statement"],
Pattern: ["PatternLike", "LVal"]
};
for (const type of PLACEHOLDERS) {
const alias = _utils.ALIAS_KEYS[type];
if (alias != null && alias.length) PLACEHOLDERS_ALIAS[type] = alias;
}
const PLACEHOLDERS_FLIPPED_ALIAS = exports.PLACEHOLDERS_FLIPPED_ALIAS = {};
Object.keys(PLACEHOLDERS_ALIAS).forEach(type => {
PLACEHOLDERS_ALIAS[type].forEach(alias => {
if (!hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {
PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];
}
PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);
});
});
//# sourceMappingURL=placeholders.js.map

View File

@@ -0,0 +1,315 @@
var path = require('path');
var test = require('tape');
var resolve = require('../');
test('mock', function (t) {
t.plan(8);
var files = {};
files[path.resolve('/foo/bar/baz.js')] = 'beep';
var dirs = {};
dirs[path.resolve('/foo/bar')] = true;
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
isDirectory: function (dir, cb) {
cb(null, !!dirs[path.resolve(dir)]);
},
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
},
realpath: function (file, cb) {
cb(null, file);
}
};
}
resolve('./baz', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg, undefined);
});
resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg, undefined);
});
resolve('baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
resolve('../baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
});
test('mock from package', function (t) {
t.plan(8);
var files = {};
files[path.resolve('/foo/bar/baz.js')] = 'beep';
var dirs = {};
dirs[path.resolve('/foo/bar')] = true;
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, file));
},
isDirectory: function (dir, cb) {
cb(null, !!dirs[path.resolve(dir)]);
},
'package': { main: 'bar' },
readFile: function (file, cb) {
cb(null, files[file]);
},
realpath: function (file, cb) {
cb(null, file);
}
};
}
resolve('./baz', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg && pkg.main, 'bar');
});
resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg && pkg.main, 'bar');
});
resolve('baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
resolve('../baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
});
test('mock package', function (t) {
t.plan(2);
var files = {};
files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep';
files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({
main: './baz.js'
});
var dirs = {};
dirs[path.resolve('/foo')] = true;
dirs[path.resolve('/foo/node_modules')] = true;
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
isDirectory: function (dir, cb) {
cb(null, !!dirs[path.resolve(dir)]);
},
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
},
realpath: function (file, cb) {
cb(null, file);
}
};
}
resolve('bar', opts('/foo'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/node_modules/bar/baz.js'));
t.equal(pkg && pkg.main, './baz.js');
});
});
test('mock package from package', function (t) {
t.plan(2);
var files = {};
files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep';
files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({
main: './baz.js'
});
var dirs = {};
dirs[path.resolve('/foo')] = true;
dirs[path.resolve('/foo/node_modules')] = true;
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
isDirectory: function (dir, cb) {
cb(null, !!dirs[path.resolve(dir)]);
},
'package': { main: 'bar' },
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
},
realpath: function (file, cb) {
cb(null, file);
}
};
}
resolve('bar', opts('/foo'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/node_modules/bar/baz.js'));
t.equal(pkg && pkg.main, './baz.js');
});
});
test('symlinked', function (t) {
t.plan(4);
var files = {};
files[path.resolve('/foo/bar/baz.js')] = 'beep';
files[path.resolve('/foo/bar/symlinked/baz.js')] = 'beep';
var dirs = {};
dirs[path.resolve('/foo/bar')] = true;
dirs[path.resolve('/foo/bar/symlinked')] = true;
function opts(basedir) {
return {
preserveSymlinks: false,
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
isDirectory: function (dir, cb) {
cb(null, !!dirs[path.resolve(dir)]);
},
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
},
realpath: function (file, cb) {
var resolved = path.resolve(file);
if (resolved.indexOf('symlinked') >= 0) {
cb(null, resolved);
return;
}
var ext = path.extname(resolved);
if (ext) {
var dir = path.dirname(resolved);
var base = path.basename(resolved);
cb(null, path.join(dir, 'symlinked', base));
} else {
cb(null, path.join(resolved, 'symlinked'));
}
}
};
}
resolve('./baz', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/symlinked/baz.js'));
t.equal(pkg, undefined);
});
resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/symlinked/baz.js'));
t.equal(pkg, undefined);
});
});
test('readPackage', function (t) {
t.plan(3);
var files = {};
files[path.resolve('/foo/node_modules/bar/something-else.js')] = 'beep';
files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({
main: './baz.js'
});
files[path.resolve('/foo/node_modules/bar/baz.js')] = 'boop';
var dirs = {};
dirs[path.resolve('/foo')] = true;
dirs[path.resolve('/foo/node_modules')] = true;
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
isDirectory: function (dir, cb) {
cb(null, !!dirs[path.resolve(dir)]);
},
'package': { main: 'bar' },
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
},
realpath: function (file, cb) {
cb(null, file);
}
};
}
t.test('with readFile', function (st) {
st.plan(3);
resolve('bar', opts('/foo'), function (err, res, pkg) {
st.error(err);
st.equal(res, path.resolve('/foo/node_modules/bar/baz.js'));
st.equal(pkg && pkg.main, './baz.js');
});
});
var readPackage = function (readFile, file, cb) {
var barPackage = path.join('bar', 'package.json');
if (file.slice(-barPackage.length) === barPackage) {
cb(null, { main: './something-else.js' });
} else {
cb(null, JSON.parse(files[path.resolve(file)]));
}
};
t.test('with readPackage', function (st) {
st.plan(3);
var options = opts('/foo');
delete options.readFile;
options.readPackage = readPackage;
resolve('bar', options, function (err, res, pkg) {
st.error(err);
st.equal(res, path.resolve('/foo/node_modules/bar/something-else.js'));
st.equal(pkg && pkg.main, './something-else.js');
});
});
t.test('with readFile and readPackage', function (st) {
st.plan(1);
var options = opts('/foo');
options.readPackage = readPackage;
resolve('bar', options, function (err) {
st.throws(function () { throw err; }, TypeError, 'errors when both readFile and readPackage are provided');
});
});
});

View File

@@ -0,0 +1,530 @@
(() => {
var _window$dateFns;function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/en-US/_lib/formatDistance.js
var formatDistanceLocale = {
lessThanXSeconds: {
one: "less than a second",
other: "less than {{count}} seconds"
},
xSeconds: {
one: "1 second",
other: "{{count}} seconds"
},
halfAMinute: "half a minute",
lessThanXMinutes: {
one: "less than a minute",
other: "less than {{count}} minutes"
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes"
},
aboutXHours: {
one: "about 1 hour",
other: "about {{count}} hours"
},
xHours: {
one: "1 hour",
other: "{{count}} hours"
},
xDays: {
one: "1 day",
other: "{{count}} days"
},
aboutXWeeks: {
one: "about 1 week",
other: "about {{count}} weeks"
},
xWeeks: {
one: "1 week",
other: "{{count}} weeks"
},
aboutXMonths: {
one: "about 1 month",
other: "about {{count}} months"
},
xMonths: {
one: "1 month",
other: "{{count}} months"
},
aboutXYears: {
one: "about 1 year",
other: "about {{count}} years"
},
xYears: {
one: "1 year",
other: "{{count}} years"
},
overXYears: {
one: "over 1 year",
other: "over {{count}} years"
},
almostXYears: {
one: "almost 1 year",
other: "almost {{count}} years"
}
};
var formatDistance = function formatDistance(token, count, options) {
var result;
var tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", count.toString());
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "in " + result;
} else {
return result + " ago";
}
}
return result;
};
// lib/locale/en-US/_lib/formatRelative.js
var formatRelativeLocale = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P"
};
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
// lib/locale/_lib/buildLocalizeFn.js
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/en-US/_lib/localize.js
var eraValues = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
};
var monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"],
wide: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"]
};
var dayValues = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"]
};
var dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
var number = Number(dirtyNumber);
var rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return number + "st";
case 2:
return number + "nd";
case 3:
return number + "rd";
}
}
return number + "th";
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/_lib/buildMatchFn.js
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
}
function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
}
// lib/locale/_lib/buildMatchPatternFn.js
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/en-US/_lib/match.js
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
wide: /^(before christ|before common era|anno domini|common era)/i
};
var parseEraPatterns = {
any: [/^b/i, /^(a|c)/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
};
var parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i],
any: [
/^ja/i,
/^f/i,
/^mar/i,
/^ap/i,
/^may/i,
/^jun/i,
/^jul/i,
/^au/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i]
};
var matchDayPatterns = {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
};
var parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
};
var matchDayPeriodPatterns = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
};
var parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value, 10);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/_lib/buildFormatLongFn.js
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/en-NZ/_lib/formatLong.js
var dateFormats = {
full: "EEEE, d MMMM yyyy",
long: "d MMMM yyyy",
medium: "d MMM yyyy",
short: "dd/MM/yyyy"
};
var timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a"
};
var dateTimeFormats = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/en-NZ.js
var enNZ = {
code: "en-NZ",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 4
}
};
// lib/locale/en-NZ/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
enNZ: enNZ }) });
//# debugId=A1CCED39C6C1F25F64756E2164756E21
//# sourceMappingURL=cdn.js.map
})();

View File

@@ -0,0 +1,45 @@
type ComponentRouteParams = Record<string, string> | undefined;
type HeadersDict = Record<string, string> | undefined;
/**
* Replaces route parameters in a path template with their values
* @param path - The path template containing parameters in [paramName] format
* @param params - Optional route parameters to replace in the template
* @returns The path with parameters replaced
*/
export declare function substituteRouteParams(path: string, params?: ComponentRouteParams): string;
/**
* Normalizes a path by removing route groups
* @param path - The path to normalize
* @returns The normalized path
*/
export declare function sanitizeRoutePath(path: string): string;
/**
* Constructs a full URL from the component route, parameters, and headers.
*
* @param componentRoute - The route template to construct the URL from
* @param params - Optional route parameters to replace in the template
* @param headersDict - Optional headers containing protocol and host information
* @param pathname - Optional pathname coming from parent span "http.target"
* @returns A sanitized URL string
*/
export declare function buildUrlFromComponentRoute(componentRoute: string, params?: ComponentRouteParams, headersDict?: HeadersDict, pathname?: string): string;
/**
* Returns a sanitized URL string from the referer header if it exists and is valid.
*
* @param headersDict - Optional headers containing the referer
* @returns A sanitized URL string or undefined if referer is missing/invalid
*/
export declare function extractSanitizedUrlFromRefererHeader(headersDict?: HeadersDict): string | undefined;
/**
* Returns a sanitized URL string using the referer header if available,
* otherwise constructs the URL from the component route, params, and headers.
*
* @param componentRoute - The route template to construct the URL from
* @param params - Optional route parameters to replace in the template
* @param headersDict - Optional headers containing protocol, host, and referer
* @param pathname - Optional pathname coming from root span "http.target"
* @returns A sanitized URL string
*/
export declare function getSanitizedRequestUrl(componentRoute: string, params?: ComponentRouteParams, headersDict?: HeadersDict, pathname?: string): string;
export {};
//# sourceMappingURL=urls.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["Modal","useModal"],"sources":["../../../src/elements/Modal/index.tsx"],"sourcesContent":["'use client'\nimport { Modal, useModal } from '@faceless-ui/modal'\nexport { Modal, useModal }\n"],"mappings":"AAAA;;AACA,SAASA,KAAK,EAAEC,QAAQ,QAAQ;AAChC,SAASD,KAAK,EAAEC,QAAQ","ignoreList":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"lcp.d.ts","sourceRoot":"","sources":["../../../src/metrics/lcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,cAAc,CAAC;AAc3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAqB7D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,sBAAsB,GAAG,SAAS,EACzC,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,mBAAmB,QAoDjC"}

View File

@@ -0,0 +1,8 @@
import { APIError } from './APIError.js';
export class TimestampsRequired extends APIError {
constructor(collection){
super(`Timestamps are required in the collection ${collection.slug} because you have opted in to Versions.`);
}
}
//# sourceMappingURL=TimestampsRequired.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/packages/graphql-query-complexity/index.ts"],"sourcesContent":["export { createComplexityRule } from './createComplexityRule.js'\nexport { fieldExtensionsEstimator } from './estimators/fieldExtensions/index.js'\nexport { simpleEstimator } from './estimators/simple/index.js'\n"],"names":["createComplexityRule","fieldExtensionsEstimator","simpleEstimator"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,4BAA2B;AAChE,SAASC,wBAAwB,QAAQ,wCAAuC;AAChF,SAASC,eAAe,QAAQ,+BAA8B"}

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 ArrowDownNarrowWide = createLucideIcon("ArrowDownNarrowWide", [
["path", { d: "m3 16 4 4 4-4", key: "1co6wj" }],
["path", { d: "M7 20V4", key: "1yoxec" }],
["path", { d: "M11 4h4", key: "6d7r33" }],
["path", { d: "M11 8h7", key: "djye34" }],
["path", { d: "M11 12h10", key: "1438ji" }]
]);
export { ArrowDownNarrowWide as default };
//# sourceMappingURL=arrow-down-narrow-wide.js.map

View File

@@ -0,0 +1,103 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("../util/Hash")} Hash */
/**
* StringXor class provides methods for performing
* [XOR operations](https://en.wikipedia.org/wiki/Exclusive_or) on strings. In this context
* we operating on the character codes of two strings, which are represented as
* [Buffer](https://nodejs.org/api/buffer.html) objects.
*
* We use [StringXor in webpack](https://github.com/webpack/webpack/commit/41a8e2ea483a544c4ccd3e6217bdfb80daffca39)
* to create a hash of the current state of the compilation. By XOR'ing the Module hashes, it
* doesn't matter if the Module hashes are sorted or not. This is useful because it allows us to avoid sorting the
* Module hashes.
* @example
* ```js
* const xor = new StringXor();
* xor.add('hello');
* xor.add('world');
* console.log(xor.toString());
* ```
* @example
* ```js
* const xor = new StringXor();
* xor.add('foo');
* xor.add('bar');
* const hash = createHash('sha256');
* hash.update(xor.toString());
* console.log(hash.digest('hex'));
* ```
*/
class StringXor {
constructor() {
/** @type {Buffer | undefined} */
this._value = undefined;
}
/**
* Adds a string to the current StringXor object.
* @param {string} str string
* @returns {void}
*/
add(str) {
const len = str.length;
const value = this._value;
if (value === undefined) {
/**
* We are choosing to use Buffer.allocUnsafe() because it is often faster than Buffer.alloc() because
* it allocates a new buffer of the specified size without initializing the memory.
*/
const newValue = (this._value = Buffer.allocUnsafe(len));
for (let i = 0; i < len; i++) {
newValue[i] = str.charCodeAt(i);
}
return;
}
const valueLen = value.length;
if (valueLen < len) {
const newValue = (this._value = Buffer.allocUnsafe(len));
/** @type {number} */
let i;
for (i = 0; i < valueLen; i++) {
newValue[i] = value[i] ^ str.charCodeAt(i);
}
for (; i < len; i++) {
newValue[i] = str.charCodeAt(i);
}
} else {
for (let i = 0; i < len; i++) {
// eslint-disable-next-line operator-assignment
value[i] = value[i] ^ str.charCodeAt(i);
}
}
}
/**
* Returns a string that represents the current state of the StringXor object. We chose to use "latin1" encoding
* here because "latin1" encoding is a single-byte encoding that can represent all characters in the
* [ISO-8859-1 character set](https://en.wikipedia.org/wiki/ISO/IEC_8859-1). This is useful when working
* with binary data that needs to be represented as a string.
* @returns {string} Returns a string that represents the current state of the StringXor object.
*/
toString() {
const value = this._value;
return value === undefined ? "" : value.toString("latin1");
}
/**
* Updates the hash with the current state of the StringXor object.
* @param {Hash} hash Hash instance
*/
updateHash(hash) {
const value = this._value;
if (value !== undefined) hash.update(value);
}
}
module.exports = StringXor;

View File

@@ -0,0 +1,398 @@
import commonjs from '@rollup/plugin-commonjs';
import { stringMatchesSomePattern } from '@sentry/core';
import * as fs from 'fs';
import * as path from 'path';
import { rollup } from 'rollup';
// Just a simple placeholder to make referencing module consistent
const SENTRY_WRAPPER_MODULE_NAME = 'sentry-wrapper-module';
// Needs to end in .cjs in order for the `commonjs` plugin to pick it up
const WRAPPING_TARGET_MODULE_NAME = '__SENTRY_WRAPPING_TARGET_FILE__.cjs';
const apiWrapperTemplatePath = path.resolve(__dirname, '..', 'templates', 'apiWrapperTemplate.js');
const apiWrapperTemplateCode = fs.readFileSync(apiWrapperTemplatePath, { encoding: 'utf8' });
const pageWrapperTemplatePath = path.resolve(__dirname, '..', 'templates', 'pageWrapperTemplate.js');
const pageWrapperTemplateCode = fs.readFileSync(pageWrapperTemplatePath, { encoding: 'utf8' });
const middlewareWrapperTemplatePath = path.resolve(__dirname, '..', 'templates', 'middlewareWrapperTemplate.js');
const middlewareWrapperTemplateCode = fs.readFileSync(middlewareWrapperTemplatePath, { encoding: 'utf8' });
let showedMissingAsyncStorageModuleWarning = false;
const serverComponentWrapperTemplatePath = path.resolve(
__dirname,
'..',
'templates',
'serverComponentWrapperTemplate.js',
);
const serverComponentWrapperTemplateCode = fs.readFileSync(serverComponentWrapperTemplatePath, { encoding: 'utf8' });
const routeHandlerWrapperTemplatePath = path.resolve(__dirname, '..', 'templates', 'routeHandlerWrapperTemplate.js');
const routeHandlerWrapperTemplateCode = fs.readFileSync(routeHandlerWrapperTemplatePath, { encoding: 'utf8' });
/**
* Replace the loaded file with a wrapped version the original file. In the wrapped version, the original file is loaded,
* any data-fetching functions (`getInitialProps`, `getStaticProps`, and `getServerSideProps`) or API routes it contains
* are wrapped, and then everything is re-exported.
*/
// eslint-disable-next-line complexity
function wrappingLoader(
userCode,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
userModuleSourceMap,
) {
// We know one or the other will be defined, depending on the version of webpack being used
const {
pagesDir,
appDir,
pageExtensionRegex,
excludeServerRoutes = [],
wrappingTargetKind,
vercelCronsConfig,
nextjsRequestAsyncStorageModulePath,
isDev,
} = 'getOptions' in this ? this.getOptions() : this.query;
this.async();
let templateCode;
if (wrappingTargetKind === 'page' || wrappingTargetKind === 'api-route') {
if (pagesDir === undefined) {
this.callback(null, userCode, userModuleSourceMap);
return;
}
// Get the parameterized route name from this page's filepath
const parameterizedPagesRoute = path
// Get the path of the file inside of the pages directory
.relative(pagesDir, this.resourcePath)
// Replace all backslashes with forward slashes (windows)
.replace(/\\/g, '/')
// Add a slash at the beginning
.replace(/(.*)/, '/$1')
// Pull off the file extension
// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor -- not end user input
.replace(new RegExp(`\\.(${pageExtensionRegex})`), '')
// Any page file named `index` corresponds to root of the directory its in, URL-wise, so turn `/xyz/index` into
// just `/xyz`
.replace(/\/index$/, '')
// In case all of the above have left us with an empty string (which will happen if we're dealing with the
// homepage), sub back in the root route
.replace(/^$/, '/');
// Skip explicitly-ignored pages
if (stringMatchesSomePattern(parameterizedPagesRoute, excludeServerRoutes, true)) {
this.callback(null, userCode, userModuleSourceMap);
return;
}
if (wrappingTargetKind === 'page') {
templateCode = pageWrapperTemplateCode;
} else if (wrappingTargetKind === 'api-route') {
templateCode = apiWrapperTemplateCode;
} else {
throw new Error(`Invariant: Could not get template code of unknown kind "${wrappingTargetKind}"`);
}
templateCode = templateCode.replace(/__VERCEL_CRONS_CONFIGURATION__/g, JSON.stringify(vercelCronsConfig));
// Inject the route and the path to the file we're wrapping into the template
templateCode = templateCode.replace(/__ROUTE__/g, parameterizedPagesRoute.replace(/\\/g, '\\\\'));
} else if (wrappingTargetKind === 'server-component' || wrappingTargetKind === 'route-handler') {
if (appDir === undefined) {
this.callback(null, userCode, userModuleSourceMap);
return;
}
// Get the parameterized route name from this page's filepath
const parameterizedPagesRoute = path
// Get the path of the file inside of the app directory
.relative(appDir, this.resourcePath)
// Replace all backslashes with forward slashes (windows)
.replace(/\\/g, '/')
// Add a slash at the beginning
.replace(/(.*)/, '/$1')
// Pull off the file name
.replace(/\/[^/]+\.(js|ts|jsx|tsx)$/, '')
// In case all of the above have left us with an empty string (which will happen if we're dealing with the
// homepage), sub back in the root route
.replace(/^$/, '/');
// Skip explicitly-ignored pages
if (stringMatchesSomePattern(parameterizedPagesRoute, excludeServerRoutes, true)) {
this.callback(null, userCode, userModuleSourceMap);
return;
}
// The following string is what Next.js injects in order to mark client components:
// https://github.com/vercel/next.js/blob/295f9da393f7d5a49b0c2e15a2f46448dbdc3895/packages/next/build/analysis/get-page-static-info.ts#L37
// https://github.com/vercel/next.js/blob/a1c15d84d906a8adf1667332a3f0732be615afa0/packages/next-swc/crates/core/src/react_server_components.rs#L247
// We do not want to wrap client components
if (userCode.includes('__next_internal_client_entry_do_not_use__')) {
this.callback(null, userCode, userModuleSourceMap);
return;
}
if (wrappingTargetKind === 'server-component') {
templateCode = serverComponentWrapperTemplateCode;
} else {
templateCode = routeHandlerWrapperTemplateCode;
}
if (nextjsRequestAsyncStorageModulePath !== undefined) {
templateCode = templateCode.replace(
/__SENTRY_NEXTJS_REQUEST_ASYNC_STORAGE_SHIM__/g,
nextjsRequestAsyncStorageModulePath,
);
} else {
if (!showedMissingAsyncStorageModuleWarning) {
// eslint-disable-next-line no-console
console.warn(
"[@sentry/nextjs] The Sentry SDK could not access the 'RequestAsyncStorage' module. Certain features may not work. There is nothing you can do to fix this yourself, but future SDK updates may resolve this.",
);
showedMissingAsyncStorageModuleWarning = true;
}
templateCode = templateCode.replace(
/__SENTRY_NEXTJS_REQUEST_ASYNC_STORAGE_SHIM__/g,
'@sentry/nextjs/async-storage-shim',
);
}
templateCode = templateCode.replace(/__ROUTE__/g, parameterizedPagesRoute.replace(/\\/g, '\\\\'));
const componentTypeMatch = path.posix
.normalize(path.relative(appDir, this.resourcePath))
// Replace all backslashes with forward slashes (windows)
.replace(/\\/g, '/')
// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor
.match(new RegExp(`(?:^|/)?([^/]+)\\.(?:${pageExtensionRegex})$`));
if (componentTypeMatch?.[1]) {
let componentType;
switch (componentTypeMatch[1]) {
case 'page':
componentType = 'Page';
break;
case 'layout':
componentType = 'Layout';
break;
case 'head':
componentType = 'Head';
break;
case 'not-found':
componentType = 'Not-found';
break;
case 'loading':
componentType = 'Loading';
break;
default:
componentType = 'Unknown';
}
templateCode = templateCode.replace(/__COMPONENT_TYPE__/g, componentType);
} else {
templateCode = templateCode.replace(/__COMPONENT_TYPE__/g, 'Unknown');
}
} else if (wrappingTargetKind === 'middleware') {
templateCode = middlewareWrapperTemplateCode;
} else {
throw new Error(`Invariant: Could not get template code of unknown kind "${wrappingTargetKind}"`);
}
// Replace the import path of the wrapping target in the template with a path that the `wrapUserCode` function will understand.
templateCode = templateCode.replace(/__SENTRY_WRAPPING_TARGET_FILE__/g, WRAPPING_TARGET_MODULE_NAME);
// Run the proxy module code through Rollup, in order to split the `export * from '<wrapped file>'` out into
// individual exports (which nextjs seems to require).
wrapUserCode(templateCode, userCode, userModuleSourceMap, isDev, this.resourcePath)
.then(({ code: wrappedCode, map: wrappedCodeSourceMap }) => {
this.callback(null, wrappedCode, wrappedCodeSourceMap);
})
.catch(err => {
// eslint-disable-next-line no-console
console.warn(
`[@sentry/nextjs] Could not instrument ${this.resourcePath}. An error occurred while auto-wrapping:\n${err}`,
);
this.callback(null, userCode, userModuleSourceMap);
});
}
/**
* Use Rollup to process the proxy module code, in order to split its `export * from '<wrapped file>'` call into
* individual exports (which nextjs seems to need).
*
* Wraps provided user code (located under the import defined via WRAPPING_TARGET_MODULE_NAME) with provided wrapper
* code. Under the hood, this function uses rollup to bundle the modules together. Rollup is convenient for us because
* it turns `export * from '<wrapped file>'` (which Next.js doesn't allow) into individual named exports.
*
* Note: This function may throw in case something goes wrong while bundling.
*
* @param wrapperCode The wrapper module code
* @param userModuleCode The user module code
* @param userModuleSourceMap The source map for the user module
* @param isDev Whether we're in development mode (affects sourcemap generation)
* @param userModulePath The absolute path to the user's original module (for sourcemap accuracy)
* @returns The wrapped user code and a source map that describes the transformations done by this function
*/
async function wrapUserCode(
wrapperCode,
userModuleCode,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
userModuleSourceMap,
isDev,
userModulePath,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
) {
const wrap = (withDefaultExport) =>
rollup({
input: SENTRY_WRAPPER_MODULE_NAME,
plugins: [
// We're using a simple custom plugin that virtualizes our wrapper module and the user module, so we don't have to
// mess around with file paths and so that we can pass the original user module source map to rollup so that
// rollup gives us a bundle with correct source mapping to the original file
{
name: 'virtualize-sentry-wrapper-modules',
resolveId: id => {
if (id === SENTRY_WRAPPER_MODULE_NAME || id === WRAPPING_TARGET_MODULE_NAME) {
return id;
}
return null;
},
load(id) {
if (id === SENTRY_WRAPPER_MODULE_NAME) {
return withDefaultExport ? wrapperCode : wrapperCode.replace('export { default } from', 'export {} from');
}
if (id !== WRAPPING_TARGET_MODULE_NAME) {
return null;
}
// In prod/build, we should not interfere with sourcemaps
if (!isDev || !userModulePath) {
return { code: userModuleCode, map: userModuleSourceMap };
}
// In dev mode, we need to adjust the sourcemap to use absolute paths for the user's file.
// This ensures debugger breakpoints correctly map back to the original file.
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
const userSources = userModuleSourceMap?.sources;
if (Array.isArray(userSources)) {
return {
code: userModuleCode,
map: {
...userModuleSourceMap,
sources: userSources.map((source, index) => (index === 0 ? userModulePath : source)),
},
};
}
// If no sourcemap exists, create a simple identity mapping with the absolute path
return {
code: userModuleCode,
map: {
version: 3,
sources: [userModulePath],
sourcesContent: [userModuleCode],
mappings: '',
},
};
},
},
// People may use `module.exports` in their API routes or page files. Next.js allows that and we also need to
// handle that correctly so we let a plugin to take care of bundling cjs exports for us.
commonjs({
sourceMap: true,
strictRequires: true, // Don't hoist require statements that users may define
ignoreDynamicRequires: true, // Don't break dynamic requires and things like Webpack's `require.context`
ignore() {
// We basically only want to use this plugin for handling the case where users export their handlers with module.exports.
// This plugin would also be able to convert any `require` into something esm compatible but webpack does that anyways so we just skip that part of the plugin.
// (Also, modifying require may break user code)
return true;
},
}),
],
// We only want to bundle our wrapper module and the wrappee module into one, so we mark everything else as external.
external: sourceId => sourceId !== SENTRY_WRAPPER_MODULE_NAME && sourceId !== WRAPPING_TARGET_MODULE_NAME,
// Prevent rollup from stressing out about TS's use of global `this` when polyfilling await. (TS will polyfill if the
// user's tsconfig `target` is set to anything before `es2017`. See https://stackoverflow.com/a/72822340 and
// https://stackoverflow.com/a/60347490.)
context: 'this',
// Rollup's path-resolution logic when handling re-exports can go wrong when wrapping pages which aren't at the root
// level of the `pages` directory. This may be a bug, as it doesn't match the behavior described in the docs, but what
// seems to happen is this:
//
// - We try to wrap `pages/xyz/userPage.js`, which contains `export { helperFunc } from '../../utils/helper'`
// - Rollup converts '../../utils/helper' into an absolute path
// - We mark the helper module as external
// - Rollup then converts it back to a relative path, but relative to `pages/` rather than `pages/xyz/`. (This is
// the part which doesn't match the docs. They say that Rollup will use the common ancestor of all modules in the
// bundle as the basis for the relative path calculation, but both our temporary file and the page being wrapped
// live in `pages/xyz/`, and they're the only two files in the bundle, so `pages/xyz/`` should be used as the
// root. Unclear why it's not.)
// - As a result of the miscalculation, our proxy module will include `export { helperFunc } from '../utils/helper'`
// rather than the expected `export { helperFunc } from '../../utils/helper'`, thereby causing a build error in
// nextjs..
//
// Setting `makeAbsoluteExternalsRelative` to `false` prevents all of the above by causing Rollup to ignore imports of
// externals entirely, with the result that their paths remain untouched (which is what we want).
makeAbsoluteExternalsRelative: false,
onwarn: (_warning, _warn) => {
// Suppress all warnings - we don't want to bother people with this output
// Might be stuff like "you have unused imports"
// _warn(_warning); // uncomment to debug
},
});
// Next.js sometimes complains if you define a default export (e.g. in route handlers in dev mode).
// This is why we want to avoid unnecessarily creating default exports, even if they're just `undefined`.
// For this reason we try to bundle/wrap the user code once including a re-export of `default`.
// If the user code didn't have a default export, rollup will throw.
// We then try bundling/wrapping again, but without including a re-export of `default`.
let rollupBuild;
try {
rollupBuild = await wrap(true);
} catch (e) {
if ((e )?.code === 'MISSING_EXPORT') {
rollupBuild = await wrap(false);
} else {
throw e;
}
}
const finalBundle = await rollupBuild.generate({
format: 'esm',
// In dev mode, use inline sourcemaps so debuggers can map breakpoints back to original source.
// In production, use hidden sourcemaps (no sourceMappingURL comment) to avoid exposing internals.
sourcemap: isDev ? 'inline' : 'hidden',
// In dev mode, preserve absolute paths in sourcemaps so debuggers can correctly resolve breakpoints.
// By default, Rollup converts absolute paths to relative paths, which breaks debugging.
// We only do this in dev mode to avoid interfering with Sentry's sourcemap upload in production.
sourcemapPathTransform: isDev
? relativeSourcePath => {
// If we have userModulePath and this relative path matches the end of it, use the absolute path
if (userModulePath?.endsWith(relativeSourcePath)) {
return userModulePath;
}
// Keep other paths (like sentry-wrapper-module) as-is
return relativeSourcePath;
}
: undefined,
});
// The module at index 0 is always the entrypoint, which in this case is the proxy module.
return finalBundle.output[0];
}
export { wrappingLoader as default };
//# sourceMappingURL=wrappingLoader.js.map

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"withOperators.d.ts","sourceRoot":"","sources":["../../src/schema/withOperators.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAwC,MAAM,SAAS,CAAA;AAEvF,OAAO,EAIL,sBAAsB,EAIvB,MAAM,SAAS,CAAA;AA8OhB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,UACjB,kBAAkB,cACb,MAAM,KACjB,sBAiDF,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"id.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/id.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,IAAI;IACb,IAAI;QACF,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;IACzE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}

View File

@@ -0,0 +1,20 @@
/** @jsx jsx */
import { JSX, ReactNode, Ref } from 'react';
import { jsx } from '@emotion/react';
import { CommonPropsAndClassName, CSSObjectWithLabel, GroupBase } from '../types';
export interface ControlProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends CommonPropsAndClassName<Option, IsMulti, Group> {
/** Children to render. */
children: ReactNode;
innerRef: Ref<HTMLDivElement>;
/** The mouse down event and the innerRef to pass down to the controller element. */
innerProps: JSX.IntrinsicElements['div'];
/** Whether the select is disabled. */
isDisabled: boolean;
/** Whether the select is focused. */
isFocused: boolean;
/** Whether the select is expanded. */
menuIsOpen: boolean;
}
export declare const css: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isDisabled, isFocused, theme: { colors, borderRadius, spacing }, }: ControlProps<Option, IsMulti, Group>, unstyled: boolean) => CSSObjectWithLabel;
declare const Control: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: ControlProps<Option, IsMulti, Group>) => jsx.JSX.Element;
export default Control;

View File

@@ -0,0 +1,54 @@
{
"name": "p-locate",
"version": "5.0.0",
"description": "Get the first fulfilled promise that satisfies the provided testing function",
"license": "MIT",
"repository": "sindresorhus/p-locate",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"promise",
"locate",
"find",
"finder",
"search",
"searcher",
"test",
"array",
"collection",
"iterable",
"iterator",
"race",
"fulfilled",
"fastest",
"async",
"await",
"promises",
"bluebird"
],
"dependencies": {
"p-limit": "^3.0.2"
},
"devDependencies": {
"ava": "^2.4.0",
"delay": "^4.1.0",
"in-range": "^2.0.0",
"time-span": "^4.0.0",
"tsd": "^0.13.1",
"xo": "^0.32.1"
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/icons/Swap/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,cAAc,CAAA;AAErB,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAQ5B,CAAA"}

View File

@@ -0,0 +1,223 @@
#!/usr/bin/env node
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// lib/npm/node-platform.ts
var fs = require("fs");
var os = require("os");
var path = require("path");
var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH;
var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild";
var packageDarwin_arm64 = "@esbuild/darwin-arm64";
var packageDarwin_x64 = "@esbuild/darwin-x64";
var knownWindowsPackages = {
"win32 arm64 LE": "@esbuild/win32-arm64",
"win32 ia32 LE": "@esbuild/win32-ia32",
"win32 x64 LE": "@esbuild/win32-x64"
};
var knownUnixlikePackages = {
"aix ppc64 BE": "@esbuild/aix-ppc64",
"android arm64 LE": "@esbuild/android-arm64",
"darwin arm64 LE": "@esbuild/darwin-arm64",
"darwin x64 LE": "@esbuild/darwin-x64",
"freebsd arm64 LE": "@esbuild/freebsd-arm64",
"freebsd x64 LE": "@esbuild/freebsd-x64",
"linux arm LE": "@esbuild/linux-arm",
"linux arm64 LE": "@esbuild/linux-arm64",
"linux ia32 LE": "@esbuild/linux-ia32",
"linux mips64el LE": "@esbuild/linux-mips64el",
"linux ppc64 LE": "@esbuild/linux-ppc64",
"linux riscv64 LE": "@esbuild/linux-riscv64",
"linux s390x BE": "@esbuild/linux-s390x",
"linux x64 LE": "@esbuild/linux-x64",
"linux loong64 LE": "@esbuild/linux-loong64",
"netbsd arm64 LE": "@esbuild/netbsd-arm64",
"netbsd x64 LE": "@esbuild/netbsd-x64",
"openbsd arm64 LE": "@esbuild/openbsd-arm64",
"openbsd x64 LE": "@esbuild/openbsd-x64",
"sunos x64 LE": "@esbuild/sunos-x64"
};
var knownWebAssemblyFallbackPackages = {
"android arm LE": "@esbuild/android-arm",
"android x64 LE": "@esbuild/android-x64",
"openharmony arm64 LE": "@esbuild/openharmony-arm64"
};
function pkgAndSubpathForCurrentPlatform() {
let pkg;
let subpath;
let isWASM2 = false;
let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`;
if (platformKey in knownWindowsPackages) {
pkg = knownWindowsPackages[platformKey];
subpath = "esbuild.exe";
} else if (platformKey in knownUnixlikePackages) {
pkg = knownUnixlikePackages[platformKey];
subpath = "bin/esbuild";
} else if (platformKey in knownWebAssemblyFallbackPackages) {
pkg = knownWebAssemblyFallbackPackages[platformKey];
subpath = "bin/esbuild";
isWASM2 = true;
} else {
throw new Error(`Unsupported platform: ${platformKey}`);
}
return { pkg, subpath, isWASM: isWASM2 };
}
function pkgForSomeOtherPlatform() {
const libMainJS = require.resolve("esbuild");
const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS)));
if (path.basename(nodeModulesDirectory) === "node_modules") {
for (const unixKey in knownUnixlikePackages) {
try {
const pkg = knownUnixlikePackages[unixKey];
if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
} catch {
}
}
for (const windowsKey in knownWindowsPackages) {
try {
const pkg = knownWindowsPackages[windowsKey];
if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
} catch {
}
}
}
return null;
}
function downloadedBinPath(pkg, subpath) {
const esbuildLibDir = path.dirname(require.resolve("esbuild"));
return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`);
}
function generateBinPath() {
if (isValidBinaryPath(ESBUILD_BINARY_PATH)) {
if (!fs.existsSync(ESBUILD_BINARY_PATH)) {
console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
} else {
return { binPath: ESBUILD_BINARY_PATH, isWASM: false };
}
}
const { pkg, subpath, isWASM: isWASM2 } = pkgAndSubpathForCurrentPlatform();
let binPath2;
try {
binPath2 = require.resolve(`${pkg}/${subpath}`);
} catch (e) {
binPath2 = downloadedBinPath(pkg, subpath);
if (!fs.existsSync(binPath2)) {
try {
require.resolve(pkg);
} catch {
const otherPkg = pkgForSomeOtherPlatform();
if (otherPkg) {
let suggestions = `
Specifically the "${otherPkg}" package is present but this platform
needs the "${pkg}" package instead. People often get into this
situation by installing esbuild on Windows or macOS and copying "node_modules"
into a Docker image that runs Linux, or by copying "node_modules" between
Windows and WSL environments.
If you are installing with npm, you can try not copying the "node_modules"
directory when you copy the files over, and running "npm ci" or "npm install"
on the destination platform after the copy. Or you could consider using yarn
instead of npm which has built-in support for installing a package on multiple
platforms simultaneously.
If you are installing with yarn, you can try listing both this platform and the
other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
Keep in mind that this means multiple copies of esbuild will be present.
`;
if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) {
suggestions = `
Specifically the "${otherPkg}" package is present but this platform
needs the "${pkg}" package instead. People often get into this
situation by installing esbuild with npm running inside of Rosetta 2 and then
trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
2 is Apple's on-the-fly x86_64-to-arm64 translation service).
If you are installing with npm, you can try ensuring that both npm and node are
not running under Rosetta 2 and then reinstalling esbuild. This likely involves
changing how you installed npm and/or node. For example, installing node with
the universal installer here should work: https://nodejs.org/en/download/. Or
you could consider using yarn instead of npm which has built-in support for
installing a package on multiple platforms simultaneously.
If you are installing with yarn, you can try listing both "arm64" and "x64"
in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
Keep in mind that this means multiple copies of esbuild will be present.
`;
}
throw new Error(`
You installed esbuild for another platform than the one you're currently using.
This won't work because esbuild is written with native code and needs to
install a platform-specific binary executable.
${suggestions}
Another alternative is to use the "esbuild-wasm" package instead, which works
the same way on all platforms. But it comes with a heavy performance cost and
can sometimes be 10x slower than the "esbuild" package, so you may also not
want to do that.
`);
}
throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild.
If you are installing esbuild with npm, make sure that you don't specify the
"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
of "package.json" is used by esbuild to install the correct binary executable
for your current platform.`);
}
throw e;
}
}
if (/\.zip\//.test(binPath2)) {
let pnpapi;
try {
pnpapi = require("pnpapi");
} catch (e) {
}
if (pnpapi) {
const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation;
const binTargetPath = path.join(
root,
"node_modules",
".cache",
"esbuild",
`pnpapi-${pkg.replace("/", "-")}-${"0.27.3"}-${path.basename(subpath)}`
);
if (!fs.existsSync(binTargetPath)) {
fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
fs.copyFileSync(binPath2, binTargetPath);
fs.chmodSync(binTargetPath, 493);
}
return { binPath: binTargetPath, isWASM: isWASM2 };
}
}
return { binPath: binPath2, isWASM: isWASM2 };
}
// lib/npm/node-shim.ts
var { binPath, isWASM } = generateBinPath();
if (isWASM) {
require("child_process").execFileSync("node", [binPath].concat(process.argv.slice(2)), { stdio: "inherit" });
} else {
require("child_process").execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
}

View File

@@ -0,0 +1,16 @@
Prism.languages.matlab = {
'comment': [
/%\{[\s\S]*?\}%/,
/%.+/
],
'string': {
pattern: /\B'(?:''|[^'\r\n])*'/,
greedy: true
},
// FIXME We could handle imaginary numbers as a whole
'number': /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?(?:[ij])?|\b[ij]\b/,
'keyword': /\b(?:NaN|break|case|catch|continue|else|elseif|end|for|function|if|inf|otherwise|parfor|pause|pi|return|switch|try|while)\b/,
'function': /\b(?!\d)\w+(?=\s*\()/,
'operator': /\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/,
'punctuation': /\.{3}|[.,;\[\](){}!]/
};

View File

@@ -0,0 +1,6 @@
/**
* Returns the first argument it receives.
*/
export function identityFunc(x) {
return x;
}

View File

@@ -0,0 +1,7 @@
type Options = {
extension?: string;
name?: string;
};
export declare const temporaryFileTask: (callback: (temporaryPath: string) => Promise<any>, options?: Options) => Promise<any>;
export {};
//# sourceMappingURL=tempFile.d.ts.map

View File

@@ -0,0 +1,5 @@
export {
Fragment,
jsx,
jsxs
} from "./emotion-react-jsx-runtime.browser.cjs.js";

View File

@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "EEEE, do MMMM, y", // CLDR #1787
long: "do MMMM, y", // CLDR #1788
medium: "d MMM, y", // CLDR #1789
short: "dd/MM/yyyy", // CLDR #1790
};
const timeFormats = {
full: "h:mm:ss a zzzz", // CLDR #1791
long: "h:mm:ss a z", // CLDR #1792
medium: "h:mm:ss a", // CLDR #1793
short: "h:mm a", // CLDR #1794
};
const dateTimeFormats = {
full: "{{date}} 'को' {{time}}", // CLDR #1795
long: "{{date}} 'को' {{time}}", // CLDR #1796
medium: "{{date}}, {{time}}", // CLDR #1797
short: "{{date}}, {{time}}", // CLDR #1798
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};

View File

@@ -0,0 +1,21 @@
/**
* @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 Omega = createLucideIcon("Omega", [
[
"path",
{
d: "M3 20h4.5a.5.5 0 0 0 .5-.5v-.282a.52.52 0 0 0-.247-.437 8 8 0 1 1 8.494-.001.52.52 0 0 0-.247.438v.282a.5.5 0 0 0 .5.5H21",
key: "1x94xo"
}
]
]);
export { Omega as default };
//# sourceMappingURL=omega.js.map

View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isValidES3Identifier;
var _isValidIdentifier = require("./isValidIdentifier.js");
const RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]);
function isValidES3Identifier(name) {
return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name);
}
//# sourceMappingURL=isValidES3Identifier.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","React","useIntersect","RenderIfInViewport","t0","$","children","className","forceRender","hasRendered","setHasRendered","useState","Boolean","t1","Symbol","for","rootMargin","intersectionRef","entry","isIntersecting","isAboveViewport","boundingClientRect","top","shouldRender","t2","t3","useEffect","t4","t5","_jsx","ref"],"sources":["../../../src/elements/RenderIfInViewport/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientComponentProps } from 'payload'\n\nimport React from 'react'\n\nimport { useIntersect } from '../../hooks/useIntersect.js'\n\nexport const RenderIfInViewport: React.FC<\n {\n children: React.ReactNode\n className?: string\n } & Pick<ClientComponentProps, 'forceRender'>\n> = ({ children, className, forceRender }) => {\n const [hasRendered, setHasRendered] = React.useState(Boolean(forceRender))\n const [intersectionRef, entry] = useIntersect(\n {\n rootMargin: '1000px',\n },\n Boolean(forceRender),\n )\n\n const isIntersecting = Boolean(entry?.isIntersecting)\n const isAboveViewport = entry?.boundingClientRect?.top < 0\n const shouldRender = forceRender || isIntersecting || isAboveViewport\n\n React.useEffect(() => {\n if (shouldRender && !hasRendered) {\n setHasRendered(true)\n }\n }, [shouldRender, hasRendered])\n\n return (\n <div className={className} ref={intersectionRef}>\n {hasRendered ? children : null}\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,OAAOC,KAAA,MAAW;AAElB,SAASC,YAAY,QAAQ;AAE7B,OAAO,MAAMC,kBAAA,GAKTC,EAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EAAC;IAAAM,QAAA;IAAAC,SAAA;IAAAC;EAAA,IAAAJ,EAAoC;EACvC,OAAAK,WAAA,EAAAC,cAAA,IAAsCT,KAAA,CAAAU,QAAA,CAAeC,OAAA,CAAQJ,WAAA;EAAA,IAAAK,EAAA;EAAA,IAAAR,CAAA,QAAAS,MAAA,CAAAC,GAAA;IAE3DF,EAAA;MAAAG,UAAA,EACc;IAAA;IACdX,CAAA,MAAAQ,EAAA;EAAA;IAAAA,EAAA,GAAAR,CAAA;EAAA;EAHF,OAAAY,eAAA,EAAAC,KAAA,IAAiChB,YAAA,CAC/BW,EAEA,EACAD,OAAA,CAAQJ,WAAA;EAGV,MAAAW,cAAA,GAAuBP,OAAA,CAAQM,KAAA,EAAAC,cAAO;EACtC,MAAAC,eAAA,GAAwBF,KAAA,EAAAG,kBAAA,EAAAC,GAAA,IAAiC;EACzD,MAAAC,YAAA,GAAqBf,WAAA,IAAeW,cAAA,IAAkBC,eAAA;EAAA,IAAAI,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAApB,CAAA,QAAAI,WAAA,IAAAJ,CAAA,QAAAkB,YAAA;IAEtCC,EAAA,GAAAA,CAAA;MAAA,IACVD,YAAA,KAAiBd,WAAA;QACnBC,cAAA,KAAe;MAAA;IAAA;IAEhBe,EAAA,IAACF,YAAA,EAAcd,WAAA;IAAYJ,CAAA,MAAAI,WAAA;IAAAJ,CAAA,MAAAkB,YAAA;IAAAlB,CAAA,MAAAmB,EAAA;IAAAnB,CAAA,MAAAoB,EAAA;EAAA;IAAAD,EAAA,GAAAnB,CAAA;IAAAoB,EAAA,GAAApB,CAAA;EAAA;EAJ9BJ,KAAA,CAAAyB,SAAA,CAAgBF,EAIhB,EAAGC,EAA2B;EAIzB,MAAAE,EAAA,GAAAlB,WAAA,GAAcH,QAAA,OAAW;EAAA,IAAAsB,EAAA;EAAA,IAAAvB,CAAA,QAAAE,SAAA,IAAAF,CAAA,QAAAY,eAAA,IAAAZ,CAAA,QAAAsB,EAAA;IAD5BC,EAAA,GAAAC,IAAA,CAAC;MAAAtB,SAAA;MAAAuB,GAAA,EAA+Bb,eAAA;MAAAX,QAAA,EAC7BqB;IAAyB,C;;;;;;;;SAD5BC,E;CAIJ","ignoreList":[]}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A zC","132":"B"},B:{"1":"0 1 2 3 4 5 6 7 8 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","132":"C L M G N O P","513":"Q H R S T"},C:{"1":"W X Y Z a","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 4C 5C","513":"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","2049":"0 1 2 3 4 5 6 7 8 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"},D:{"1":"0 1 2 3 4 5 6 7 8 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","260":"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","513":"XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T"},E:{"2":"J bB K D 6C bC 7C 8C","132":"E F A B 9C AD cC","513":"C PC QC","1025":"G 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","1537":"L M BD CD"},F:{"1":"0 1 2 3 4 5 6 7 8 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","513":"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"},G:{"2":"bC OD yC PD QD RD","132":"E SD TD UD VD WD XD YD","513":"ZD aD bD cD","1025":"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","1537":"dD eD fD gD"},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:{"2049":"OC"},N:{"2":"A B"},O:{"1":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB 1D 2D SC TC UC 3D","2":"J","513":"tD uD vD wD xD cC yD zD 0D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"513":"6D 7D"}},B:4,C:"Referrer Policy",D:true};

View File

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

View File

@@ -0,0 +1,41 @@
import Client from './client'
import TPoolStats from './pool-stats'
import { URL } from 'node:url'
import Dispatcher from './dispatcher'
export default RoundRobinPool
type RoundRobinPoolConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
declare class RoundRobinPool extends Dispatcher {
constructor (url: string | URL, options?: RoundRobinPool.Options)
/** `true` after `pool.close()` has been called. */
closed: boolean
/** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
destroyed: boolean
/** Aggregate stats for a RoundRobinPool. */
readonly stats: TPoolStats
// Override dispatcher APIs.
override connect (
options: RoundRobinPoolConnectOptions
): Promise<Dispatcher.ConnectData>
override connect (
options: RoundRobinPoolConnectOptions,
callback: (err: Error | null, data: Dispatcher.ConnectData) => void
): void
}
declare namespace RoundRobinPool {
export type RoundRobinPoolStats = TPoolStats
export interface Options extends Client.Options {
/** Default: `(origin, opts) => new Client(origin, opts)`. */
factory?(origin: URL, opts: object): Dispatcher;
/** The max number of clients to create. `null` if no limit. Default `null`. */
connections?: number | null;
/** The amount of time before a client is removed from the pool and closed. `null` if no time limit. Default `null` */
clientTtl?: number | null;
interceptors?: { RoundRobinPool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options['interceptors']
}
}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/gel-core/columns/int.common.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnDataType, GeneratedIdentityConfig, IsIdentity } from '~/column-builder.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { GelSequenceOptions } from '../sequence.ts';\nimport { GelColumnBuilder } from './common.ts';\n\nexport abstract class GelIntColumnBaseBuilder<\n\tT extends ColumnBuilderBaseConfig<ColumnDataType, string>,\n> extends GelColumnBuilder<\n\tT,\n\t{ generatedIdentity: GeneratedIdentityConfig }\n> {\n\tstatic override readonly [entityKind]: string = 'GelIntColumnBaseBuilder';\n\n\tgeneratedAlwaysAsIdentity(\n\t\tsequence?: GelSequenceOptions & { name?: string },\n\t): IsIdentity<this, 'always'> {\n\t\tif (sequence) {\n\t\t\tconst { name, ...options } = sequence;\n\t\t\tthis.config.generatedIdentity = {\n\t\t\t\ttype: 'always',\n\t\t\t\tsequenceName: name,\n\t\t\t\tsequenceOptions: options,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.config.generatedIdentity = {\n\t\t\t\ttype: 'always',\n\t\t\t};\n\t\t}\n\n\t\tthis.config.hasDefault = true;\n\t\tthis.config.notNull = true;\n\n\t\treturn this as IsIdentity<this, 'always'>;\n\t}\n\n\tgeneratedByDefaultAsIdentity(\n\t\tsequence?: GelSequenceOptions & { name?: string },\n\t): IsIdentity<this, 'byDefault'> {\n\t\tif (sequence) {\n\t\t\tconst { name, ...options } = sequence;\n\t\t\tthis.config.generatedIdentity = {\n\t\t\t\ttype: 'byDefault',\n\t\t\t\tsequenceName: name,\n\t\t\t\tsequenceOptions: options,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.config.generatedIdentity = {\n\t\t\t\ttype: 'byDefault',\n\t\t\t};\n\t\t}\n\n\t\tthis.config.hasDefault = true;\n\t\tthis.config.notNull = true;\n\n\t\treturn this as IsIdentity<this, 'byDefault'>;\n\t}\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAE3B,SAAS,wBAAwB;AAE1B,MAAe,gCAEZ,iBAGR;AAAA,EACD,QAA0B,UAAU,IAAY;AAAA,EAEhD,0BACC,UAC6B;AAC7B,QAAI,UAAU;AACb,YAAM,EAAE,MAAM,GAAG,QAAQ,IAAI;AAC7B,WAAK,OAAO,oBAAoB;AAAA,QAC/B,MAAM;AAAA,QACN,cAAc;AAAA,QACd,iBAAiB;AAAA,MAClB;AAAA,IACD,OAAO;AACN,WAAK,OAAO,oBAAoB;AAAA,QAC/B,MAAM;AAAA,MACP;AAAA,IACD;AAEA,SAAK,OAAO,aAAa;AACzB,SAAK,OAAO,UAAU;AAEtB,WAAO;AAAA,EACR;AAAA,EAEA,6BACC,UACgC;AAChC,QAAI,UAAU;AACb,YAAM,EAAE,MAAM,GAAG,QAAQ,IAAI;AAC7B,WAAK,OAAO,oBAAoB;AAAA,QAC/B,MAAM;AAAA,QACN,cAAc;AAAA,QACd,iBAAiB;AAAA,MAClB;AAAA,IACD,OAAO;AACN,WAAK,OAAO,oBAAoB;AAAA,QAC/B,MAAM;AAAA,MACP;AAAA,IACD;AAEA,SAAK,OAAO,aAAa;AACzB,SAAK,OAAO,UAAU;AAEtB,WAAO;AAAA,EACR;AACD;","names":[]}

View File

@@ -0,0 +1,10 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const range_1 = __importDefault(require("../definitions/range"));
const range = (ajv) => ajv.addKeyword((0, range_1.default)());
exports.default = range;
module.exports = range;
//# sourceMappingURL=range.js.map

View File

@@ -0,0 +1,8 @@
import arrayWithHoles from "./arrayWithHoles.js";
import iterableToArrayLimit from "./iterableToArrayLimit.js";
import unsupportedIterableToArray from "./unsupportedIterableToArray.js";
import nonIterableRest from "./nonIterableRest.js";
function _slicedToArray(r, e) {
return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();
}
export { _slicedToArray as default };

View File

@@ -0,0 +1,185 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const debugLogger = require('./debug-logger.js');
const baggage = require('./baggage.js');
const dsn = require('./dsn.js');
const parseSampleRate = require('./parseSampleRate.js');
const propagationContext = require('./propagationContext.js');
const randomSafeContext = require('./randomSafeContext.js');
// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor -- RegExp is used for readability here
const TRACEPARENT_REGEXP = new RegExp(
'^[ \\t]*' + // whitespace
'([0-9a-f]{32})?' + // trace_id
'-?([0-9a-f]{16})?' + // span_id
'-?([01])?' + // sampled
'[ \\t]*$', // whitespace
);
/**
* Extract transaction context data from a `sentry-trace` header.
*
* This is terrible naming but the function has nothing to do with the W3C traceparent header.
* It can only parse the `sentry-trace` header and extract the "trace parent" data.
*
* @param traceparent Traceparent string
*
* @returns Object containing data from the header, or undefined if traceparent string is malformed
*/
function extractTraceparentData(traceparent) {
if (!traceparent) {
return undefined;
}
const matches = traceparent.match(TRACEPARENT_REGEXP);
if (!matches) {
return undefined;
}
let parentSampled;
if (matches[3] === '1') {
parentSampled = true;
} else if (matches[3] === '0') {
parentSampled = false;
}
return {
traceId: matches[1],
parentSampled,
parentSpanId: matches[2],
};
}
/**
* Create a propagation context from incoming headers or
* creates a minimal new one if the headers are undefined.
*/
function propagationContextFromHeaders(
sentryTrace,
baggage$1,
) {
const traceparentData = extractTraceparentData(sentryTrace);
const dynamicSamplingContext = baggage.baggageHeaderToDynamicSamplingContext(baggage$1);
if (!traceparentData?.traceId) {
return {
traceId: propagationContext.generateTraceId(),
sampleRand: randomSafeContext.safeMathRandom(),
};
}
const sampleRand = getSampleRandFromTraceparentAndDsc(traceparentData, dynamicSamplingContext);
// The sample_rand on the DSC needs to be generated based on traceparent + baggage.
if (dynamicSamplingContext) {
dynamicSamplingContext.sample_rand = sampleRand.toString();
}
const { traceId, parentSpanId, parentSampled } = traceparentData;
return {
traceId,
parentSpanId,
sampled: parentSampled,
dsc: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it
sampleRand,
};
}
/**
* Create sentry-trace header from span context values.
*/
function generateSentryTraceHeader(
traceId = propagationContext.generateTraceId(),
spanId = propagationContext.generateSpanId(),
sampled,
) {
let sampledString = '';
if (sampled !== undefined) {
sampledString = sampled ? '-1' : '-0';
}
return `${traceId}-${spanId}${sampledString}`;
}
/**
* Creates a W3C traceparent header from the given trace and span ids.
*/
function generateTraceparentHeader(
traceId = propagationContext.generateTraceId(),
spanId = propagationContext.generateSpanId(),
sampled,
) {
return `00-${traceId}-${spanId}-${sampled ? '01' : '00'}`;
}
/**
* Given any combination of an incoming trace, generate a sample rand based on its defined semantics.
*
* Read more: https://develop.sentry.dev/sdk/telemetry/traces/#propagated-random-value
*/
function getSampleRandFromTraceparentAndDsc(
traceparentData,
dsc,
) {
// When there is an incoming sample rand use it.
const parsedSampleRand = parseSampleRate.parseSampleRate(dsc?.sample_rand);
if (parsedSampleRand !== undefined) {
return parsedSampleRand;
}
// Otherwise, if there is an incoming sampling decision + sample rate, generate a sample rand that would lead to the same sampling decision.
const parsedSampleRate = parseSampleRate.parseSampleRate(dsc?.sample_rate);
if (parsedSampleRate && traceparentData?.parentSampled !== undefined) {
return traceparentData.parentSampled
? // Returns a sample rand with positive sampling decision [0, sampleRate)
randomSafeContext.safeMathRandom() * parsedSampleRate
: // Returns a sample rand with negative sampling decision [sampleRate, 1)
parsedSampleRate + randomSafeContext.safeMathRandom() * (1 - parsedSampleRate);
} else {
// If nothing applies, return a random sample rand.
return randomSafeContext.safeMathRandom();
}
}
/**
* Determines whether a new trace should be continued based on the provided baggage org ID and the client's `strictTraceContinuation` option.
* If the trace should not be continued, a new trace will be started.
*
* The result is dependent on the `strictTraceContinuation` option in the client.
* See https://develop.sentry.dev/sdk/telemetry/traces/#stricttracecontinuation
*/
function shouldContinueTrace(client, baggageOrgId) {
const clientOrgId = dsn.extractOrgIdFromClient(client);
// Case: baggage orgID and Client orgID don't match - always start new trace
if (baggageOrgId && clientOrgId && baggageOrgId !== clientOrgId) {
debugLogger.debug.log(
`Won't continue trace because org IDs don't match (incoming baggage: ${baggageOrgId}, SDK options: ${clientOrgId})`,
);
return false;
}
const strictTraceContinuation = client.getOptions().strictTraceContinuation || false; // default for `strictTraceContinuation` is `false`
if (strictTraceContinuation) {
// With strict continuation enabled, don't continue trace if:
// - Baggage has orgID, but Client doesn't have one
// - Client has orgID, but baggage doesn't have one
if ((baggageOrgId && !clientOrgId) || (!baggageOrgId && clientOrgId)) {
debugLogger.debug.log(
`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${baggageOrgId}, Sentry client: ${clientOrgId})`,
);
return false;
}
}
return true;
}
exports.TRACEPARENT_REGEXP = TRACEPARENT_REGEXP;
exports.extractTraceparentData = extractTraceparentData;
exports.generateSentryTraceHeader = generateSentryTraceHeader;
exports.generateTraceparentHeader = generateTraceparentHeader;
exports.propagationContextFromHeaders = propagationContextFromHeaders;
exports.shouldContinueTrace = shouldContinueTrace;
//# sourceMappingURL=tracing.js.map

View File

@@ -0,0 +1,66 @@
export { GraphQLDate } from './iso-date/Date.cjs';
export { GraphQLTime } from './iso-date/Time.cjs';
export { GraphQLDateTime } from './iso-date/DateTime.cjs';
export { GraphQLDateTimeISO } from './iso-date/DateTimeISO.cjs';
export { GraphQLDuration } from './iso-date/Duration.cjs';
export { GraphQLTimestamp } from './Timestamp.cjs';
export { GraphQLTimeZone } from './TimeZone.cjs';
export { GraphQLUtcOffset } from './UtcOffset.cjs';
export { GraphQLISO8601Duration } from './iso-date/Duration.cjs';
export { GraphQLLocalDate } from './LocalDate.cjs';
export { GraphQLLocalTime } from './LocalTime.cjs';
export { GraphQLLocalDateTime } from './LocalDateTime.cjs';
export { GraphQLLocalEndTime } from './LocalEndTime.cjs';
export { GraphQLEmailAddress } from './EmailAddress.cjs';
export { GraphQLNegativeFloat } from './NegativeFloat.cjs';
export { GraphQLNegativeInt } from './NegativeInt.cjs';
export { GraphQLNonEmptyString } from './NonEmptyString.cjs';
export { GraphQLNonNegativeFloat } from './NonNegativeFloat.cjs';
export { GraphQLNonNegativeInt } from './NonNegativeInt.cjs';
export { GraphQLNonPositiveFloat } from './NonPositiveFloat.cjs';
export { GraphQLNonPositiveInt } from './NonPositiveInt.cjs';
export { GraphQLPhoneNumber } from './PhoneNumber.cjs';
export { GraphQLPositiveFloat } from './PositiveFloat.cjs';
export { GraphQLPositiveInt } from './PositiveInt.cjs';
export { GraphQLPostalCode } from './PostalCode.cjs';
export { GraphQLUnsignedFloat } from './UnsignedFloat.cjs';
export { GraphQLUnsignedInt } from './UnsignedInt.cjs';
export { GraphQLURL } from './URL.cjs';
export { GraphQLBigInt } from './BigInt.cjs';
export { GraphQLByte } from './Byte.cjs';
export { GraphQLLong } from './Long.cjs';
export { GraphQLSafeInt } from './SafeInt.cjs';
export { GraphQLUUID } from './UUID.cjs';
export { GraphQLGUID } from './GUID.cjs';
export { GraphQLHexadecimal } from './Hexadecimal.cjs';
export { GraphQLHexColorCode } from './HexColorCode.cjs';
export { GraphQLHSL } from './HSL.cjs';
export { GraphQLHSLA } from './HSLA.cjs';
export { GraphQLIP } from './IP.cjs';
export { GraphQLIPv4 } from './IPv4.cjs';
export { GraphQLIPv6 } from './IPv6.cjs';
export { GraphQLISBN } from './ISBN.cjs';
export { GraphQLJWT } from './JWT.cjs';
export { GraphQLLatitude } from './Latitude.cjs';
export { GraphQLLongitude } from './Longitude.cjs';
export { GraphQLMAC } from './MAC.cjs';
export { GraphQLPort } from './Port.cjs';
export { GraphQLRGB } from './RGB.cjs';
export { GraphQLRGBA } from './RGBA.cjs';
export { GraphQLUSCurrency } from './USCurrency.cjs';
export { GraphQLCurrency } from './Currency.cjs';
export { GraphQLJSON } from './json/JSON.cjs';
export { GraphQLJSONObject } from './json/JSONObject.cjs';
export { GraphQLIBAN } from './IBAN.cjs';
export { GraphQLObjectID } from './ObjectID.cjs';
export { GraphQLVoid } from './Void.cjs';
export { GraphQLDID } from './DID.cjs';
export { GraphQLCountryCode } from './CountryCode.cjs';
export { GraphQLLocale } from './Locale.cjs';
export { GraphQLRoutingNumber } from './RoutingNumber.cjs';
export { GraphQLAccountNumber } from './AccountNumber.cjs';
export { GraphQLCuid } from './Cuid.cjs';
export { GraphQLSemVer } from './SemVer.cjs';
export { GraphQLDeweyDecimal } from './library/DeweyDecimal.cjs';
export { GraphQLLCCSubclass } from './library/LCCSubclass.cjs';
export { GraphQLIPCPatent } from './patent/IPCPatent.cjs';

View File

@@ -0,0 +1,26 @@
"use strict";
exports.previousTuesday = previousTuesday;
var _index = require("./previousDay.js");
/**
* @name previousTuesday
* @category Weekday Helpers
* @summary When is the previous Tuesday?
*
* @description
* When is the previous Tuesday?
*
* @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 start counting from
*
* @returns The previous Tuesday
*
* @example
* // When is the previous Tuesday before Jun, 18, 2021?
* const result = previousTuesday(new Date(2021, 5, 18))
* //=> Tue June 15 2021 00:00:00
*/
function previousTuesday(date) {
return (0, _index.previousDay)(date, 2);
}

View File

@@ -0,0 +1,138 @@
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
const matchOrdinalNumberPattern = /^(\d+)(-?a)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^([ap]k)/i,
abbreviated: /^([ap]\.?\s?k\.?\s?e\.?)/i,
wide: /^((antaǔ |post )?komuna erao)/i,
};
const parseEraPatterns = {
any: [/^a/i, /^[kp]/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^k[1234]/i,
wide: /^[1234](-?a)? kvaronjaro/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|maj|jun|jul|a(ŭ|ux|uh|u)g|sep|okt|nov|dec)/i,
wide: /^(januaro|februaro|marto|aprilo|majo|junio|julio|a(ŭ|ux|uh|u)gusto|septembro|oktobro|novembro|decembro)/i,
};
const parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
any: [
/^ja/i,
/^f/i,
/^mar/i,
/^ap/i,
/^maj/i,
/^jun/i,
/^jul/i,
/^a(u|ŭ)/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
};
const matchDayPatterns = {
narrow: /^[dlmĵjvs]/i,
short: /^(di|lu|ma|me|(ĵ|jx|jh|j)a|ve|sa)/i,
abbreviated: /^(dim|lun|mar|mer|(ĵ|jx|jh|j)a(ŭ|ux|uh|u)|ven|sab)/i,
wide: /^(diman(ĉ|cx|ch|c)o|lundo|mardo|merkredo|(ĵ|jx|jh|j)a(ŭ|ux|uh|u)do|vendredo|sabato)/i,
};
const parseDayPatterns = {
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^(j|ĵ)/i, /^v/i, /^s/i],
any: [/^d/i, /^l/i, /^ma/i, /^me/i, /^(j|ĵ)/i, /^v/i, /^s/i],
};
const matchDayPeriodPatterns = {
narrow: /^([ap]|(posttagmez|noktomez|tagmez|maten|vesper|nokt)[eo])/i,
abbreviated:
/^([ap][.\s]?t[.\s]?m[.\s]?|(posttagmez|noktomez|tagmez|maten|vesper|nokt)[eo])/i,
wide: /^(anta(ŭ|ux)tagmez|posttagmez|noktomez|tagmez|maten|vesper|nokt)[eo]/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^noktom/i,
noon: /^t/i,
morning: /^m/i,
afternoon: /^posttagmeze/i,
evening: /^v/i,
night: /^n/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function (value) {
return parseInt(value, 10);
},
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function (index) {
return index + 1;
},
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};

View File

@@ -0,0 +1,51 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var isBrowser = true;
function getRegisteredStyles(registered, registeredStyles, classNames) {
var rawClassName = '';
classNames.split(' ').forEach(function (className) {
if (registered[className] !== undefined) {
registeredStyles.push(registered[className] + ";");
} else if (className) {
rawClassName += className + " ";
}
});
return rawClassName;
}
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
var className = cache.key + "-" + serialized.name;
if ( // we only need to add the styles to the registered cache if the
// class name could be used further down
// the tree but if it's a string tag, we know it won't
// so we don't have to add it to registered cache.
// this improves memory usage since we can avoid storing the whole style string
(isStringTag === false || // we need to always store it if we're in compat mode and
// in node since emotion-server relies on whether a style is in
// the registered cache to know whether a style is global or not
// also, note that this check will be dead code eliminated in the browser
isBrowser === false ) && cache.registered[className] === undefined) {
cache.registered[className] = serialized.styles;
}
};
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
registerStyles(cache, serialized, isStringTag);
var className = cache.key + "-" + serialized.name;
if (cache.inserted[serialized.name] === undefined) {
var current = serialized;
do {
cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
current = current.next;
} while (current !== undefined);
}
};
exports.getRegisteredStyles = getRegisteredStyles;
exports.insertStyles = insertStyles;
exports.registerStyles = registerStyles;

View File

@@ -0,0 +1,15 @@
export const baseTimezoneField = ({ name, defaultValue, label, options, required })=>{
return {
name: name,
type: 'select',
admin: {
hidden: true
},
defaultValue,
label,
options: options,
required
};
};
//# sourceMappingURL=baseField.js.map

View File

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

View File

@@ -0,0 +1,88 @@
{
"name": "@parcel/watcher",
"version": "2.5.6",
"main": "index.js",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/parcel-bundler/watcher.git"
},
"description": "A native C++ Node module for querying and subscribing to filesystem events. Used by Parcel 2.",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
},
"files": [
"index.js",
"index.js.flow",
"index.d.ts",
"wrapper.js",
"package.json",
"README.md",
"LICENSE",
"src",
"scripts/build-from-source.js",
"binding.gyp"
],
"scripts": {
"prebuild": "prebuildify --napi --strip --tag-libc",
"format": "prettier --write \"./**/*.{js,json,md}\"",
"build": "node-gyp rebuild",
"install": "node scripts/build-from-source.js",
"test": "mocha"
},
"engines": {
"node": ">= 10.0.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,json,md}": [
"prettier --write",
"git add"
]
},
"dependencies": {
"detect-libc": "^2.0.3",
"is-glob": "^4.0.3",
"node-addon-api": "^7.0.0",
"picomatch": "^4.0.3"
},
"devDependencies": {
"esbuild": "^0.19.8",
"fs-extra": "^10.0.0",
"husky": "^7.0.2",
"lint-staged": "^11.1.2",
"mocha": "^9.1.1",
"napi-wasm": "^1.1.0",
"prebuildify": "^6.0.1",
"prettier": "^2.3.2"
},
"binary": {
"napi_versions": [
3
]
},
"optionalDependencies": {
"@parcel/watcher-darwin-x64": "2.5.6",
"@parcel/watcher-darwin-arm64": "2.5.6",
"@parcel/watcher-win32-x64": "2.5.6",
"@parcel/watcher-win32-arm64": "2.5.6",
"@parcel/watcher-win32-ia32": "2.5.6",
"@parcel/watcher-linux-x64-glibc": "2.5.6",
"@parcel/watcher-linux-x64-musl": "2.5.6",
"@parcel/watcher-linux-arm64-glibc": "2.5.6",
"@parcel/watcher-linux-arm64-musl": "2.5.6",
"@parcel/watcher-linux-arm-glibc": "2.5.6",
"@parcel/watcher-linux-arm-musl": "2.5.6",
"@parcel/watcher-android-arm64": "2.5.6",
"@parcel/watcher-freebsd-x64": "2.5.6"
}
}

View File

@@ -0,0 +1,28 @@
import { constructNow } from "./constructNow.js";
import { isSameSecond } from "./isSameSecond.js";
/**
* @name isThisSecond
* @category Second Helpers
* @summary Is the given date in the same second as the current date?
* @pure false
*
* @description
* Is the given date in the same second as the current date?
*
* @param date - The date to check
*
* @returns The date is in this second
*
* @example
* // If now is 25 September 2014 18:30:15.500,
* // is 25 September 2014 18:30:15.000 in this second?
* const result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15))
* //=> true
*/
export function isThisSecond(date) {
return isSameSecond(date, constructNow(date));
}
// Fallback for modularized imports:
export default isThisSecond;

View File

@@ -0,0 +1,9 @@
import type { Locale } from "./types.js";
/**
* @category Locales
* @summary Arabic locale (Tunisian Arabic).
* @language Arabic
* @iso-639-2 ara
* @author Koussay Haj Kacem [@essana3](https://github.com/essana3)
*/
export declare const arTN: Locale;

View File

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

View File

@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Anchor = createLucideIcon("Anchor", [
["path", { d: "M12 22V8", key: "qkxhtm" }],
["path", { d: "M5 12H2a10 10 0 0 0 20 0h-3", key: "1hv3nh" }],
["circle", { cx: "12", cy: "5", r: "3", key: "rqqgnr" }]
]);
export { Anchor as default };
//# sourceMappingURL=anchor.js.map

View File

@@ -0,0 +1,8 @@
import React from 'react'
declare module 'react' {
interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
jsx?: boolean
global?: boolean
}
}

View File

@@ -0,0 +1,262 @@
'use strict'
const { createInflate, createGunzip, createBrotliDecompress, createZstdDecompress } = require('node:zlib')
const { pipeline } = require('node:stream')
const DecoratorHandler = require('../handler/decorator-handler')
const { runtimeFeatures } = require('../util/runtime-features')
/** @typedef {import('node:stream').Transform} Transform */
/** @typedef {import('node:stream').Transform} Controller */
/** @typedef {Transform&import('node:zlib').Zlib} DecompressorStream */
/** @type {Record<string, () => DecompressorStream>} */
const supportedEncodings = {
gzip: createGunzip,
'x-gzip': createGunzip,
br: createBrotliDecompress,
deflate: createInflate,
compress: createInflate,
'x-compress': createInflate,
...(runtimeFeatures.has('zstd') ? { zstd: createZstdDecompress } : {})
}
const defaultSkipStatusCodes = /** @type {const} */ ([204, 304])
let warningEmitted = /** @type {boolean} */ (false)
/**
* @typedef {Object} DecompressHandlerOptions
* @property {number[]|Readonly<number[]>} [skipStatusCodes=[204, 304]] - List of status codes to skip decompression for
* @property {boolean} [skipErrorResponses] - Whether to skip decompression for error responses (status codes >= 400)
*/
class DecompressHandler extends DecoratorHandler {
/** @type {Transform[]} */
#decompressors = []
/** @type {NodeJS.WritableStream&NodeJS.ReadableStream|null} */
#pipelineStream
/** @type {Readonly<number[]>} */
#skipStatusCodes
/** @type {boolean} */
#skipErrorResponses
constructor (handler, { skipStatusCodes = defaultSkipStatusCodes, skipErrorResponses = true } = {}) {
super(handler)
this.#skipStatusCodes = skipStatusCodes
this.#skipErrorResponses = skipErrorResponses
}
/**
* Determines if decompression should be skipped based on encoding and status code
* @param {string} contentEncoding - Content-Encoding header value
* @param {number} statusCode - HTTP status code of the response
* @returns {boolean} - True if decompression should be skipped
*/
#shouldSkipDecompression (contentEncoding, statusCode) {
if (!contentEncoding || statusCode < 200) return true
if (this.#skipStatusCodes.includes(statusCode)) return true
if (this.#skipErrorResponses && statusCode >= 400) return true
return false
}
/**
* Creates a chain of decompressors for multiple content encodings
*
* @param {string} encodings - Comma-separated list of content encodings
* @returns {Array<DecompressorStream>} - Array of decompressor streams
* @throws {Error} - If the number of content-encodings exceeds the maximum allowed
*/
#createDecompressionChain (encodings) {
const parts = encodings.split(',')
// Limit the number of content-encodings to prevent resource exhaustion.
// CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).
const maxContentEncodings = 5
if (parts.length > maxContentEncodings) {
throw new Error(`too many content-encodings in response: ${parts.length}, maximum allowed is ${maxContentEncodings}`)
}
/** @type {DecompressorStream[]} */
const decompressors = []
for (let i = parts.length - 1; i >= 0; i--) {
const encoding = parts[i].trim()
if (!encoding) continue
if (!supportedEncodings[encoding]) {
decompressors.length = 0 // Clear if unsupported encoding
return decompressors // Unsupported encoding
}
decompressors.push(supportedEncodings[encoding]())
}
return decompressors
}
/**
* Sets up event handlers for a decompressor stream using readable events
* @param {DecompressorStream} decompressor - The decompressor stream
* @param {Controller} controller - The controller to coordinate with
* @returns {void}
*/
#setupDecompressorEvents (decompressor, controller) {
decompressor.on('readable', () => {
let chunk
while ((chunk = decompressor.read()) !== null) {
const result = super.onResponseData(controller, chunk)
if (result === false) {
break
}
}
})
decompressor.on('error', (error) => {
super.onResponseError(controller, error)
})
}
/**
* Sets up event handling for a single decompressor
* @param {Controller} controller - The controller to handle events
* @returns {void}
*/
#setupSingleDecompressor (controller) {
const decompressor = this.#decompressors[0]
this.#setupDecompressorEvents(decompressor, controller)
decompressor.on('end', () => {
super.onResponseEnd(controller, {})
})
}
/**
* Sets up event handling for multiple chained decompressors using pipeline
* @param {Controller} controller - The controller to handle events
* @returns {void}
*/
#setupMultipleDecompressors (controller) {
const lastDecompressor = this.#decompressors[this.#decompressors.length - 1]
this.#setupDecompressorEvents(lastDecompressor, controller)
this.#pipelineStream = pipeline(this.#decompressors, (err) => {
if (err) {
super.onResponseError(controller, err)
return
}
super.onResponseEnd(controller, {})
})
}
/**
* Cleans up decompressor references to prevent memory leaks
* @returns {void}
*/
#cleanupDecompressors () {
this.#decompressors.length = 0
this.#pipelineStream = null
}
/**
* @param {Controller} controller
* @param {number} statusCode
* @param {Record<string, string | string[] | undefined>} headers
* @param {string} statusMessage
* @returns {void}
*/
onResponseStart (controller, statusCode, headers, statusMessage) {
const contentEncoding = headers['content-encoding']
// If content encoding is not supported or status code is in skip list
if (this.#shouldSkipDecompression(contentEncoding, statusCode)) {
return super.onResponseStart(controller, statusCode, headers, statusMessage)
}
const decompressors = this.#createDecompressionChain(contentEncoding.toLowerCase())
if (decompressors.length === 0) {
this.#cleanupDecompressors()
return super.onResponseStart(controller, statusCode, headers, statusMessage)
}
this.#decompressors = decompressors
// Remove compression headers since we're decompressing
const { 'content-encoding': _, 'content-length': __, ...newHeaders } = headers
if (this.#decompressors.length === 1) {
this.#setupSingleDecompressor(controller)
} else {
this.#setupMultipleDecompressors(controller)
}
super.onResponseStart(controller, statusCode, newHeaders, statusMessage)
}
/**
* @param {Controller} controller
* @param {Buffer} chunk
* @returns {void}
*/
onResponseData (controller, chunk) {
if (this.#decompressors.length > 0) {
this.#decompressors[0].write(chunk)
return
}
super.onResponseData(controller, chunk)
}
/**
* @param {Controller} controller
* @param {Record<string, string | string[]> | undefined} trailers
* @returns {void}
*/
onResponseEnd (controller, trailers) {
if (this.#decompressors.length > 0) {
this.#decompressors[0].end()
this.#cleanupDecompressors()
return
}
super.onResponseEnd(controller, trailers)
}
/**
* @param {Controller} controller
* @param {Error} err
* @returns {void}
*/
onResponseError (controller, err) {
if (this.#decompressors.length > 0) {
for (const decompressor of this.#decompressors) {
decompressor.destroy(err)
}
this.#cleanupDecompressors()
}
super.onResponseError(controller, err)
}
}
/**
* Creates a decompression interceptor for HTTP responses
* @param {DecompressHandlerOptions} [options] - Options for the interceptor
* @returns {Function} - Interceptor function
*/
function createDecompressInterceptor (options = {}) {
// Emit experimental warning only once
if (!warningEmitted) {
process.emitWarning(
'DecompressInterceptor is experimental and subject to change',
'ExperimentalWarning'
)
warningEmitted = true
}
return (dispatch) => {
return (opts, handler) => {
const decompressHandler = new DecompressHandler(handler, options)
return dispatch(opts, decompressHandler)
}
}
}
module.exports = createDecompressInterceptor

View File

@@ -0,0 +1,22 @@
Prism.languages.io = {
'comment': {
pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*|#.*)/,
lookbehind: true,
greedy: true
},
'triple-quoted-string': {
pattern: /"""(?:\\[\s\S]|(?!""")[^\\])*"""/,
greedy: true,
alias: 'string'
},
'string': {
pattern: /"(?:\\.|[^\\\r\n"])*"/,
greedy: true
},
'keyword': /\b(?:activate|activeCoroCount|asString|block|break|call|catch|clone|collectGarbage|compileString|continue|do|doFile|doMessage|doString|else|elseif|exit|for|foreach|forward|getEnvironmentVariable|getSlot|hasSlot|if|ifFalse|ifNil|ifNilEval|ifTrue|isActive|isNil|isResumable|list|message|method|parent|pass|pause|perform|performWithArgList|print|println|proto|raise|raiseResumable|removeSlot|resend|resume|schedulerSleepSeconds|self|sender|setSchedulerSleepSeconds|setSlot|shallowCopy|slotNames|super|system|then|thisBlock|thisContext|try|type|uniqueId|updateSlot|wait|while|write|yield)\b/,
'builtin': /\b(?:Array|AudioDevice|AudioMixer|BigNum|Block|Box|Buffer|CFunction|CGI|Color|Curses|DBM|DNSResolver|DOConnection|DOProxy|DOServer|Date|Directory|Duration|DynLib|Error|Exception|FFT|File|Fnmatch|Font|Future|GL|GLE|GLScissor|GLU|GLUCylinder|GLUQuadric|GLUSphere|GLUT|Host|Image|Importer|LinkList|List|Lobby|Locals|MD5|MP3Decoder|MP3Encoder|Map|Message|Movie|Notification|Number|Object|OpenGL|Point|Protos|Random|Regex|SGML|SGMLElement|SGMLParser|SQLite|Sequence|Server|ShowMessage|SleepyCat|SleepyCatCursor|Socket|SocketManager|Sound|Soup|Store|String|Tree|UDPSender|UPDReceiver|URL|User|Warning|WeakLink)\b/,
'boolean': /\b(?:false|nil|true)\b/,
'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?/i,
'operator': /[=!*/%+\-^&|]=|>>?=?|<<?=?|:?:?=|\+\+?|--?|\*\*?|\/\/?|%|\|\|?|&&?|\b(?:and|not|or|return)\b|@@?|\?\??|\.\./,
'punctuation': /[{}[\];(),.:]/
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/vocabularies/discriminator/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,iCAAmB,CAAA;AACrB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB"}

View File

@@ -0,0 +1,118 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Explorer = void 0;
var _path = _interopRequireDefault(require("path"));
var _ExplorerBase = require("./ExplorerBase");
var _readFile = require("./readFile");
var _cacheWrapper = require("./cacheWrapper");
var _getDirectory = require("./getDirectory");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
class Explorer extends _ExplorerBase.ExplorerBase {
constructor(options) {
super(options);
}
async search(searchFrom = process.cwd()) {
const startDirectory = await (0, _getDirectory.getDirectory)(searchFrom);
const result = await this.searchFromDirectory(startDirectory);
return result;
}
async searchFromDirectory(dir) {
const absoluteDir = _path.default.resolve(process.cwd(), dir);
const run = async () => {
const result = await this.searchDirectory(absoluteDir);
const nextDir = this.nextDirectoryToSearch(absoluteDir, result);
if (nextDir) {
return this.searchFromDirectory(nextDir);
}
const transformResult = await this.config.transform(result);
return transformResult;
};
if (this.searchCache) {
return (0, _cacheWrapper.cacheWrapper)(this.searchCache, absoluteDir, run);
}
return run();
}
async searchDirectory(dir) {
for await (const place of this.config.searchPlaces) {
const placeResult = await this.loadSearchPlace(dir, place);
if (this.shouldSearchStopWithResult(placeResult) === true) {
return placeResult;
}
} // config not found
return null;
}
async loadSearchPlace(dir, place) {
const filepath = _path.default.join(dir, place);
const fileContents = await (0, _readFile.readFile)(filepath);
const result = await this.createCosmiconfigResult(filepath, fileContents);
return result;
}
async loadFileContent(filepath, content) {
if (content === null) {
return null;
}
if (content.trim() === '') {
return undefined;
}
const loader = this.getLoaderEntryForFile(filepath);
const loaderResult = await loader(filepath, content);
return loaderResult;
}
async createCosmiconfigResult(filepath, content) {
const fileContent = await this.loadFileContent(filepath, content);
const result = this.loadedContentToCosmiconfigResult(filepath, fileContent);
return result;
}
async load(filepath) {
this.validateFilePath(filepath);
const absoluteFilePath = _path.default.resolve(process.cwd(), filepath);
const runLoad = async () => {
const fileContents = await (0, _readFile.readFile)(absoluteFilePath, {
throwNotFound: true
});
const result = await this.createCosmiconfigResult(absoluteFilePath, fileContents);
const transformResult = await this.config.transform(result);
return transformResult;
};
if (this.loadCache) {
return (0, _cacheWrapper.cacheWrapper)(this.loadCache, absoluteFilePath, runLoad);
}
return runLoad();
}
}
exports.Explorer = Explorer;
//# sourceMappingURL=Explorer.js.map

View File

@@ -0,0 +1 @@
Prism.languages.nsis={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|[#;].*)/,lookbehind:!0,greedy:!0},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:{pattern:/(^[\t ]*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|BG(?:Font|Gradient|Image)|Banner|BrandingText|BringToFront|CRCCheck|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|Seek|Write|WriteByte|WriteUTF16LE|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DLLVersion(?:Local)?|DlgItem|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|KnownFolderPath|LabelAddress|TempFileName|WinVer)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|RtlLanguage|ShellVarContextAll|Silent)|InitPluginsDir|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|NSISdl|Name|Nop|OutFile|PE(?:DllCharacteristics|SubsysVer)|Page(?:Callbacks)?|Pop|Push|Quit|RMDir|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|Target|UnRegDLL|Unicode|UninstPage|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UserInfo|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|Var|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle|ns(?:Dialogs|Exec))\b/m,lookbehind:!0},property:/\b(?:ARCHIVE|FILE_(?:ATTRIBUTE_ARCHIVE|ATTRIBUTE_NORMAL|ATTRIBUTE_OFFLINE|ATTRIBUTE_READONLY|ATTRIBUTE_SYSTEM|ATTRIBUTE_TEMPORARY)|HK(?:(?:CR|CU|LM)(?:32|64)?|DD|PD|U)|HKEY_(?:CLASSES_ROOT|CURRENT_CONFIG|CURRENT_USER|DYN_DATA|LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|ID(?:ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|MB_(?:ABORTRETRYIGNORE|DEFBUTTON1|DEFBUTTON2|DEFBUTTON3|DEFBUTTON4|ICONEXCLAMATION|ICONINFORMATION|ICONQUESTION|ICONSTOP|OK|OKCANCEL|RETRYCANCEL|RIGHT|RTLREADING|SETFOREGROUND|TOPMOST|USERICON|YESNO)|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY|admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user)\b/,constant:/\$\{[!\w\.:\^-]+\}|\$\([!\w\.:\^-]+\)/,variable:/\$\w[\w\.]*/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--?|\+\+?|<=?|>=?|==?=?|&&?|\|\|?|[?*\/~^%]/,punctuation:/[{}[\];(),.:]/,important:{pattern:/(^[\t ]*)!(?:addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversion|gettlbversion|if|ifdef|ifmacrodef|ifmacrondef|ifndef|include|insertmacro|macro|macroend|makensis|packhdr|pragma|searchparse|searchreplace|system|tempfile|undef|verbose|warning)\b/im,lookbehind:!0}};

View File

@@ -0,0 +1,57 @@
"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 checks_exports = {};
__export(checks_exports, {
Check: () => Check,
CheckBuilder: () => CheckBuilder,
check: () => check
});
module.exports = __toCommonJS(checks_exports);
var import_entity = require("../entity.cjs");
class CheckBuilder {
constructor(name, value) {
this.name = name;
this.value = value;
}
static [import_entity.entityKind] = "SQLiteCheckBuilder";
brand;
build(table) {
return new Check(table, this);
}
}
class Check {
constructor(table, builder) {
this.table = table;
this.name = builder.name;
this.value = builder.value;
}
static [import_entity.entityKind] = "SQLiteCheck";
name;
value;
}
function check(name, value) {
return new CheckBuilder(name, value);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Check,
CheckBuilder,
check
});
//# sourceMappingURL=checks.cjs.map

View File

@@ -0,0 +1,57 @@
import { getCurrentDate } from '../utilities/getCurrentDate.js';
import { getWorkflowRetryBehavior } from './getWorkflowRetryBehavior.js';
/**
* This is called if a workflow catches an error. It determines if it's a final error
* or not and handles logging.
* A Workflow error = error that happens anywhere in between running tasks.
*
* This function assumes that the error is not a TaskError, but a WorkflowError. If a task errors,
* only a TaskError should be thrown, not a WorkflowError.
*/ export async function handleWorkflowError({ error, req, silent = false, updateJob }) {
const { job, workflowConfig } = error.args;
const errorJSON = {
name: error.name,
cancelled: Boolean('cancelled' in error && error.cancelled),
message: error.message,
stack: error.stack
};
const { hasFinalError, maxWorkflowRetries, waitUntil } = getWorkflowRetryBehavior({
job,
retriesConfig: workflowConfig.retries
});
if (!hasFinalError) {
if (job.waitUntil) {
// Check if waitUntil is in the past
const waitUntil = new Date(job.waitUntil);
if (waitUntil < getCurrentDate()) {
// Outdated waitUntil, remove it
delete job.waitUntil;
}
}
// Update job's waitUntil only if this waitUntil is later than the current one
if (waitUntil && (!job.waitUntil || waitUntil > new Date(job.waitUntil))) {
job.waitUntil = waitUntil.toISOString();
}
}
const jobLabel = job.workflowSlug || `Task: ${job.taskSlug}`;
if (!silent || typeof silent === 'object' && !silent.error) {
req.payload.logger.error({
err: error,
msg: `Error running job ${jobLabel} id: ${job.id} attempt ${job.totalTried + 1}${maxWorkflowRetries !== undefined ? '/' + (maxWorkflowRetries + 1) : ''}`
});
}
// Tasks update the job if they error - but in case there is an unhandled error (e.g. in the workflow itself, not in a task)
// we need to ensure the job is updated to reflect the error
await updateJob({
error: errorJSON,
hasError: hasFinalError,
processing: false,
totalTried: (job.totalTried ?? 0) + 1,
waitUntil: job.waitUntil
});
return {
hasFinalError
};
}
//# sourceMappingURL=handleWorkflowError.js.map

View File

@@ -0,0 +1,26 @@
import type { MarkOptional } from 'ts-essentials';
import type { UploadField, UploadFieldClient } from '../../fields/config/types.js';
import type { UploadFieldValidation } from '../../fields/validations.js';
import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js';
import type { ClientFieldBase, FieldClientComponent, FieldPaths, FieldServerComponent, ServerFieldBase } from '../forms/Field.js';
import type { FieldDescriptionClientComponent, FieldDescriptionServerComponent, FieldDiffClientComponent, FieldDiffServerComponent, FieldLabelClientComponent, FieldLabelServerComponent } from '../types.js';
type UploadFieldClientWithoutType = MarkOptional<UploadFieldClient, 'type'>;
type UploadFieldBaseClientProps = {
readonly path: string;
readonly validate?: UploadFieldValidation;
};
type UploadFieldBaseServerProps = Pick<FieldPaths, 'path'>;
export type UploadFieldClientProps = ClientFieldBase<UploadFieldClientWithoutType> & UploadFieldBaseClientProps;
export type UploadFieldServerProps = ServerFieldBase<UploadField, UploadFieldClientWithoutType> & UploadFieldBaseServerProps;
export type UploadFieldServerComponent = FieldServerComponent<UploadField, UploadFieldClientWithoutType, UploadFieldBaseServerProps>;
export type UploadFieldClientComponent = FieldClientComponent<UploadFieldClientWithoutType, UploadFieldBaseClientProps>;
export type UploadFieldLabelServerComponent = FieldLabelServerComponent<UploadField, UploadFieldClientWithoutType>;
export type UploadFieldLabelClientComponent = FieldLabelClientComponent<UploadFieldClientWithoutType>;
export type UploadFieldDescriptionServerComponent = FieldDescriptionServerComponent<UploadField, UploadFieldClientWithoutType>;
export type UploadFieldDescriptionClientComponent = FieldDescriptionClientComponent<UploadFieldClientWithoutType>;
export type UploadFieldErrorServerComponent = FieldErrorServerComponent<UploadField, UploadFieldClientWithoutType>;
export type UploadFieldErrorClientComponent = FieldErrorClientComponent<UploadFieldClientWithoutType>;
export type UploadFieldDiffServerComponent = FieldDiffServerComponent<UploadField, UploadFieldClient>;
export type UploadFieldDiffClientComponent = FieldDiffClientComponent<UploadFieldClient>;
export {};
//# sourceMappingURL=Upload.d.ts.map

View File

@@ -0,0 +1 @@
export declare type CSSTypes = 'angle' | 'color' | 'image' | 'length' | 'length-percentage' | 'time';

View File

@@ -0,0 +1,5 @@
const GelViewConfig = Symbol.for("drizzle:GelViewConfig");
export {
GelViewConfig
};
//# sourceMappingURL=view-common.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../../../src/routes/graphql/playground.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAGpE,eAAO,MAAM,GAAG,WAAY,OAAO,CAAC,eAAe,CAAC,eAAqB,OAAO,sBAiC/E,CAAA"}

View File

@@ -0,0 +1,10 @@
import type { PayloadRequest } from 'payload';
import type { DrizzleAdapter } from '../types.js';
/**
* Returns current db transaction instance from req or adapter.drizzle itself
*
* If a transaction session doesn't exist (e.g., it was already committed/rolled back),
* falls back to the default adapter.drizzle instance to prevent errors.
*/
export declare const getTransaction: <T extends DrizzleAdapter = DrizzleAdapter>(adapter: T, req?: Partial<PayloadRequest>) => Promise<T["drizzle"]>;
//# sourceMappingURL=getTransaction.d.ts.map

View File

@@ -0,0 +1,121 @@
import { createHandler as createRawHandler, parseRequestParams as rawParseRequestParams, } from '../handler.mjs';
/**
* The GraphQL over HTTP spec compliant request parser for an incoming GraphQL request.
*
* It is important to pass in the `abortedRef` so that the parser does not perform any
* operations on a disposed request (see example).
*
* If the HTTP request _is not_ a [well-formatted GraphQL over HTTP request](https://graphql.github.io/graphql-over-http/draft/#sec-Request), the function will return a `Response`.
*
* If the HTTP request _is_ a [well-formatted GraphQL over HTTP request](https://graphql.github.io/graphql-over-http/draft/#sec-Request), but is invalid or malformed,
* the function will throw an error and it is up to the user to handle and respond as they see fit.
*
* ```js
* import http from 'http';
* import { createServerAdapter } from '@whatwg-node/server'; // yarn add @whatwg-node/server
* import { parseRequestParams } from 'graphql-http/lib/use/fetch';
*
* // Use this adapter in _any_ environment.
* const adapter = createServerAdapter({
* handleRequest: async (req) => {
* try {
* const paramsOrResponse = await parseRequestParams(req);
* if (paramsOrResponse instanceof Response) {
* // not a well-formatted GraphQL over HTTP request,
* // parser created a response object to use
* return paramsOrResponse;
* }
*
* // well-formatted GraphQL over HTTP request,
* // with valid parameters
* return new Response(JSON.stringify(paramsOrResponse, null, ' '), {
* status: 200,
* });
* } catch (err) {
* // well-formatted GraphQL over HTTP request,
* // but with invalid parameters
* return new Response(err.message, { status: 400 });
* }
* },
* });
*
* const server = http.createServer(adapter);
*
* server.listen(4000);
* console.log('Listening to port 4000');
* ```
*
* @category Server/fetch
*/
export async function parseRequestParams(req, api = {}) {
const rawReq = toRequest(req, api);
const paramsOrRes = await rawParseRequestParams(rawReq);
if (!('query' in paramsOrRes)) {
const [body, init] = paramsOrRes;
return new (api.Response || Response)(body, init);
}
return paramsOrRes;
}
/**
* Create a GraphQL over HTTP spec compliant request handler for
* a fetch environment like Deno, Bun, CloudFlare Workers, Lambdas, etc.
*
* You can use [@whatwg-node/server](https://github.com/ardatan/whatwg-node/tree/master/packages/server) to create a server adapter and
* isomorphically use it in _any_ environment. See an example:
*
* ```js
* import http from 'http';
* import { createServerAdapter } from '@whatwg-node/server'; // yarn add @whatwg-node/server
* import { createHandler } from 'graphql-http/lib/use/fetch';
* import { schema } from './my-graphql-schema/index.mjs';
*
* // Use this adapter in _any_ environment.
* const adapter = createServerAdapter({
* handleRequest: createHandler({ schema }),
* });
*
* const server = http.createServer(adapter);
*
* server.listen(4000);
* console.log('Listening to port 4000');
* ```
*
* @param reqCtx - Custom fetch API engine, will use from global scope if left undefined.
*
* @category Server/fetch
*/
export function createHandler(options, reqCtx = {}) {
const api = {
Response: reqCtx.Response || Response,
TextEncoder: reqCtx.TextEncoder || TextEncoder,
ReadableStream: reqCtx.ReadableStream || ReadableStream,
};
const handler = createRawHandler(options);
return async function handleRequest(req) {
try {
const [body, init] = await handler(toRequest(req, api));
return new api.Response(body, init);
}
catch (err) {
// The handler shouldnt throw errors.
// If you wish to handle them differently, consider implementing your own request handler.
console.error('Internal error occurred during request handling. ' +
'Please check your implementation.', err);
return new api.Response(null, { status: 500 });
}
};
}
function toRequest(req, api = {}) {
return {
method: req.method,
url: req.url,
headers: req.headers,
body: () => req.text(),
raw: req,
context: {
Response: api.Response || Response,
TextEncoder: api.TextEncoder || TextEncoder,
ReadableStream: api.ReadableStream || ReadableStream,
},
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/buildForeignKeyName.ts"],"sourcesContent":["import type { DrizzleAdapter } from '../types.js'\n\nexport const buildForeignKeyName = ({\n name,\n adapter,\n number = 0,\n}: {\n adapter: DrizzleAdapter\n name: string\n number?: number\n}): string => {\n let foreignKeyName = `${name}${number ? `_${number}` : ''}_fk`\n\n if (foreignKeyName.length > 60) {\n const suffix = `${number ? `_${number}` : ''}_fk`\n foreignKeyName = `${name.slice(0, 60 - suffix.length)}${suffix}`\n }\n\n if (!adapter.foreignKeys.has(foreignKeyName)) {\n adapter.foreignKeys.add(foreignKeyName)\n return foreignKeyName\n }\n\n return buildForeignKeyName({\n name,\n adapter,\n number: number + 1,\n })\n}\n"],"names":["buildForeignKeyName","name","adapter","number","foreignKeyName","length","suffix","slice","foreignKeys","has","add"],"mappings":"AAEA,OAAO,MAAMA,sBAAsB,CAAC,EAClCC,IAAI,EACJC,OAAO,EACPC,SAAS,CAAC,EAKX;IACC,IAAIC,iBAAiB,GAAGH,OAAOE,SAAS,CAAC,CAAC,EAAEA,QAAQ,GAAG,GAAG,GAAG,CAAC;IAE9D,IAAIC,eAAeC,MAAM,GAAG,IAAI;QAC9B,MAAMC,SAAS,GAAGH,SAAS,CAAC,CAAC,EAAEA,QAAQ,GAAG,GAAG,GAAG,CAAC;QACjDC,iBAAiB,GAAGH,KAAKM,KAAK,CAAC,GAAG,KAAKD,OAAOD,MAAM,IAAIC,QAAQ;IAClE;IAEA,IAAI,CAACJ,QAAQM,WAAW,CAACC,GAAG,CAACL,iBAAiB;QAC5CF,QAAQM,WAAW,CAACE,GAAG,CAACN;QACxB,OAAOA;IACT;IAEA,OAAOJ,oBAAoB;QACzBC;QACAC;QACAC,QAAQA,SAAS;IACnB;AACF,EAAC"}

View File

@@ -0,0 +1,37 @@
# strip-ansi
> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
> [!NOTE]
> Node.js has this built-in now with [`stripVTControlCharacters`](https://nodejs.org/api/util.html#utilstripvtcontrolcharactersstr). The benefit of this package is consistent behavior across Node.js versions and faster improvements. The Node.js version is actually based on this package.
## Install
```sh
npm install strip-ansi
```
## Usage
```js
import stripAnsi from 'strip-ansi';
stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
//=> 'Click'
```
## Related
- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)

View File

@@ -0,0 +1,116 @@
import Dispatcher from "./dispatcher";
export default RetryHandler;
declare class RetryHandler implements Dispatcher.DispatchHandlers {
constructor(
options: Dispatcher.DispatchOptions & {
retryOptions?: RetryHandler.RetryOptions;
},
retryHandlers: RetryHandler.RetryHandlers
);
}
declare namespace RetryHandler {
export type RetryState = { counter: number; };
export type RetryContext = {
state: RetryState;
opts: Dispatcher.DispatchOptions & {
retryOptions?: RetryHandler.RetryOptions;
};
}
export type OnRetryCallback = (result?: Error | null) => void;
export type RetryCallback = (
err: Error,
context: {
state: RetryState;
opts: Dispatcher.DispatchOptions & {
retryOptions?: RetryHandler.RetryOptions;
};
},
callback: OnRetryCallback
) => number | null;
export interface RetryOptions {
/**
* Callback to be invoked on every retry iteration.
* It receives the error, current state of the retry object and the options object
* passed when instantiating the retry handler.
*
* @type {RetryCallback}
* @memberof RetryOptions
*/
retry?: RetryCallback;
/**
* Maximum number of retries to allow.
*
* @type {number}
* @memberof RetryOptions
* @default 5
*/
maxRetries?: number;
/**
* Max number of milliseconds allow between retries
*
* @type {number}
* @memberof RetryOptions
* @default 30000
*/
maxTimeout?: number;
/**
* Initial number of milliseconds to wait before retrying for the first time.
*
* @type {number}
* @memberof RetryOptions
* @default 500
*/
minTimeout?: number;
/**
* Factior to multiply the timeout factor between retries.
*
* @type {number}
* @memberof RetryOptions
* @default 2
*/
timeoutFactor?: number;
/**
* It enables to automatically infer timeout between retries based on the `Retry-After` header.
*
* @type {boolean}
* @memberof RetryOptions
* @default true
*/
retryAfter?: boolean;
/**
* HTTP methods to retry.
*
* @type {Dispatcher.HttpMethod[]}
* @memberof RetryOptions
* @default ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
*/
methods?: Dispatcher.HttpMethod[];
/**
* Error codes to be retried. e.g. `ECONNRESET`, `ENOTFOUND`, `ETIMEDOUT`, `ECONNREFUSED`, etc.
*
* @type {string[]}
* @default ['ECONNRESET','ECONNREFUSED','ENOTFOUND','ENETDOWN','ENETUNREACH','EHOSTDOWN','EHOSTUNREACH','EPIPE']
*/
errorCodes?: string[];
/**
* HTTP status codes to be retried.
*
* @type {number[]}
* @memberof RetryOptions
* @default [500, 502, 503, 504, 429],
*/
statusCodes?: number[];
}
export interface RetryHandlers {
dispatch: Dispatcher["dispatch"];
handler: Dispatcher.DispatchHandlers;
}
}

View File

@@ -0,0 +1,168 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.js";
const eraValues = {
narrow: ["ق", "ب"],
abbreviated: ["ق.م.", "ب.م."],
wide: ["قبل از میلاد", "بعد از میلاد"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["سم1", "سم2", "سم3", "سم4"],
wide: ["سه‌ماهه 1", "سه‌ماهه 2", "سه‌ماهه 3", "سه‌ماهه 4"],
};
// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const monthValues = {
narrow: ["ژ", "ف", "م", "آ", "م", "ج", "ج", "آ", "س", "ا", "ن", "د"],
abbreviated: [
"ژانـ",
"فور",
"مارس",
"آپر",
"می",
"جون",
"جولـ",
"آگو",
"سپتـ",
"اکتـ",
"نوامـ",
"دسامـ",
],
wide: [
"ژانویه",
"فوریه",
"مارس",
"آپریل",
"می",
"جون",
"جولای",
"آگوست",
"سپتامبر",
"اکتبر",
"نوامبر",
"دسامبر",
],
};
const dayValues = {
narrow: ["ی", "د", "س", "چ", "پ", "ج", "ش"],
short: ["1ش", "2ش", "3ش", "4ش", "5ش", "ج", "ش"],
abbreviated: [
"یکشنبه",
"دوشنبه",
"سه‌شنبه",
"چهارشنبه",
"پنجشنبه",
"جمعه",
"شنبه",
],
wide: ["یکشنبه", "دوشنبه", "سه‌شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"],
};
const dayPeriodValues = {
narrow: {
am: "ق",
pm: "ب",
midnight: "ن",
noon: "ظ",
morning: "ص",
afternoon: "ب.ظ.",
evening: "ع",
night: "ش",
},
abbreviated: {
am: "ق.ظ.",
pm: "ب.ظ.",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
wide: {
am: "قبل‌ازظهر",
pm: "بعدازظهر",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ق",
pm: "ب",
midnight: "ن",
noon: "ظ",
morning: "ص",
afternoon: "ب.ظ.",
evening: "ع",
night: "ش",
},
abbreviated: {
am: "ق.ظ.",
pm: "ب.ظ.",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
wide: {
am: "قبل‌ازظهر",
pm: "بعدازظهر",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
return String(dirtyNumber);
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"onFCP.js","sources":["../../../../src/metrics/web-vitals/onFCP.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\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 { bindReporter } from './lib/bindReporter';\nimport { getActivationStart } from './lib/getActivationStart';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { whenActivated } from './lib/whenActivated';\nimport type { FCPMetric, MetricRatingThresholds, ReportOpts } from './types';\n\n/** Thresholds for FCP. See https://web.dev/articles/fcp#what_is_a_good_fcp_score */\nexport const FCPThresholds: MetricRatingThresholds = [1800, 3000];\n\n/**\n * Calculates the [FCP](https://web.dev/articles/fcp) value for the current page and\n * calls the `callback` function once the value is ready, along with the\n * relevant `paint` performance entry used to determine the value. The reported\n * value is a `DOMHighResTimeStamp`.\n */\nexport const onFCP = (onReport: (metric: FCPMetric) => void, opts: ReportOpts = {}) => {\n whenActivated(() => {\n const visibilityWatcher = getVisibilityWatcher();\n const metric = initMetric('FCP');\n let report: ReturnType<typeof bindReporter>;\n\n const handleEntries = (entries: FCPMetric['entries']) => {\n for (const entry of entries) {\n if (entry.name === 'first-contentful-paint') {\n po!.disconnect();\n\n // Only report if the page wasn't hidden prior to the first paint.\n if (entry.startTime < visibilityWatcher.firstHiddenTime) {\n // The activationStart reference is used because FCP should be\n // relative to page activation rather than navigation start if the\n // page was prerendered. But in cases where `activationStart` occurs\n // after the FCP, this time should be clamped at 0.\n metric.value = Math.max(entry.startTime - getActivationStart(), 0);\n metric.entries.push(entry);\n report(true);\n }\n }\n }\n };\n\n const po = observe('paint', handleEntries);\n\n if (po) {\n report = bindReporter(onReport, metric, FCPThresholds, opts.reportAllChanges);\n }\n });\n};\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAUA;AACO,MAAM,aAAa,GAA2B,CAAC,IAAI,EAAE,IAAI;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,KAAA,GAAQ,CAAC,QAAQ,EAA+B,IAAI,GAAe,EAAE,KAAK;AACvF,EAAE,aAAa,CAAC,MAAM;AACtB,IAAI,MAAM,iBAAA,GAAoB,oBAAoB,EAAE;AACpD,IAAI,MAAM,MAAA,GAAS,UAAU,CAAC,KAAK,CAAC;AACpC,IAAI,IAAI,MAAM;;AAEd,IAAI,MAAM,aAAA,GAAgB,CAAC,OAAO,KAA2B;AAC7D,MAAM,KAAK,MAAM,KAAA,IAAS,OAAO,EAAE;AACnC,QAAQ,IAAI,KAAK,CAAC,IAAA,KAAS,wBAAwB,EAAE;AACrD,UAAU,EAAE,CAAE,UAAU,EAAE;;AAE1B;AACA,UAAU,IAAI,KAAK,CAAC,YAAY,iBAAiB,CAAC,eAAe,EAAE;AACnE;AACA;AACA;AACA;AACA,YAAY,MAAM,CAAC,KAAA,GAAQ,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,kBAAkB,EAAE,EAAE,CAAC,CAAC;AAC9E,YAAY,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;AACtC,YAAY,MAAM,CAAC,IAAI,CAAC;AACxB,UAAU;AACV,QAAQ;AACR,MAAM;AACN,IAAI,CAAC;;AAEL,IAAI,MAAM,KAAK,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC;;AAE9C,IAAI,IAAI,EAAE,EAAE;AACZ,MAAM,MAAA,GAAS,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,gBAAgB,CAAC;AACnF,IAAI;AACJ,EAAE,CAAC,CAAC;AACJ;;;;"}

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