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,36 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "EEEE, dd MMMM yyyy",
long: "dd MMMM yyyy",
medium: "dd MMM yyyy",
short: "dd/MM/yyyy",
};
const timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "H:mm",
};
const dateTimeFormats = {
any: "{{date}} {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "any",
}),
};

View File

@@ -0,0 +1,137 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.js";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.js";
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(پ|د)/i,
abbreviated: /^(پ-ز|د.ز)/i,
wide: /^(پێش زاین| دوای زاین)/i,
};
const parseEraPatterns = {
any: [/^د/g, /^پ/g],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^م[1234]چ/i,
wide: /^(یەکەم|دووەم|سێیەم| چوارەم) (چارەگی)? quarter/i,
};
const parseQuarterPatterns = {
wide: [/چارەگی یەکەم/, /چارەگی دووەم/, /چارەگی سيیەم/, /چارەگی چوارەم/],
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^(ک-د|ش|ئا|ن|م|ح|ت|ئە|تش-ی|تش-د|ک-ی)/i,
abbreviated:
/^(کان-دوو|شوب|ئاد|نیس|مایس|حوز|تەم|ئاب|ئەل|تش-یەک|تش-دوو|کان-یەک)/i,
wide: /^(کانوونی دووەم|شوبات|ئادار|نیسان|مایس|حوزەیران|تەمموز|ئاب|ئەیلول|تشرینی یەکەم|تشرینی دووەم|کانوونی یەکەم)/i,
};
const parseMonthPatterns = {
narrow: [
/^ک-د/i,
/^ش/i,
/^ئا/i,
/^ن/i,
/^م/i,
/^ح/i,
/^ت/i,
/^ئا/i,
/^ئە/i,
/^تش-ی/i,
/^تش-د/i,
/^ک-ی/i,
],
any: [
/^کان-دوو/i,
/^شوب/i,
/^ئاد/i,
/^نیس/i,
/^مایس/i,
/^حوز/i,
/^تەم/i,
/^ئاب/i,
/^ئەل/i,
/^تش-یەک/i,
/^تش-دوو/i,
/^|کان-یەک/i,
],
};
const matchDayPatterns = {
narrow: /^(ش|ی|د|س|چ|پ|هە)/i,
short: /^(یە-شە|دوو-شە|سێ-شە|چو-شە|پێ-شە|هە|شە)/i,
abbreviated: /^(یەک-شەم|دوو-شەم|سێ-شەم|چوار-شەم|پێنخ-شەم|هەینی|شەمە)/i,
wide: /^(یەک شەمە|دوو شەمە|سێ شەمە|چوار شەمە|پێنج شەمە|هەینی|شەمە)/i,
};
const parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
};
const matchDayPeriodPatterns = {
narrow: /^(پ|د|ن-ش|ن| (بەیانی|دوای نیوەڕۆ|ئێوارە|شەو))/i,
abbreviated: /^(پ-ن|د-ن|نیوە شەو|نیوەڕۆ|بەیانی|دوای نیوەڕۆ|ئێوارە|شەو)/,
wide: /^(پێش نیوەڕۆ|دوای نیوەڕۆ|نیوەڕۆ|نیوە شەو|لەبەیانیدا|لەدواینیوەڕۆدا|لە ئێوارەدا|لە شەودا)/,
any: /^(پ|د|بەیانی|نیوەڕۆ|ئێوارە|شەو)/,
};
const parseDayPeriodPatterns = {
any: {
am: /^د/i,
pm: /^پ/i,
midnight: /^ن-ش/i,
noon: /^ن/i,
morning: /بەیانی/i,
afternoon: /دواینیوەڕۆ/i,
evening: /ئێوارە/i,
night: /شەو/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};

View File

@@ -0,0 +1,66 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.js";
import type { ColumnBaseConfig } from "../../column.js";
import { entityKind } from "../../entity.js";
import type { AnyPgTable } from "../table.js";
import { type Equal } from "../../utils.js";
import { PgColumn } from "./common.js";
import { PgDateColumnBaseBuilder } from "./date.common.js";
export type PgTimestampBuilderInitial<TName extends string> = PgTimestampBuilder<{
name: TName;
dataType: 'date';
columnType: 'PgTimestamp';
data: Date;
driverParam: string;
enumValues: undefined;
}>;
export declare class PgTimestampBuilder<T extends ColumnBuilderBaseConfig<'date', 'PgTimestamp'>> extends PgDateColumnBaseBuilder<T, {
withTimezone: boolean;
precision: number | undefined;
}> {
static readonly [entityKind]: string;
constructor(name: T['name'], withTimezone: boolean, precision: number | undefined);
}
export declare class PgTimestamp<T extends ColumnBaseConfig<'date', 'PgTimestamp'>> extends PgColumn<T> {
static readonly [entityKind]: string;
readonly withTimezone: boolean;
readonly precision: number | undefined;
constructor(table: AnyPgTable<{
name: T['tableName'];
}>, config: PgTimestampBuilder<T>['config']);
getSQLType(): string;
mapFromDriverValue: (value: string) => Date | null;
mapToDriverValue: (value: Date) => string;
}
export type PgTimestampStringBuilderInitial<TName extends string> = PgTimestampStringBuilder<{
name: TName;
dataType: 'string';
columnType: 'PgTimestampString';
data: string;
driverParam: string;
enumValues: undefined;
}>;
export declare class PgTimestampStringBuilder<T extends ColumnBuilderBaseConfig<'string', 'PgTimestampString'>> extends PgDateColumnBaseBuilder<T, {
withTimezone: boolean;
precision: number | undefined;
}> {
static readonly [entityKind]: string;
constructor(name: T['name'], withTimezone: boolean, precision: number | undefined);
}
export declare class PgTimestampString<T extends ColumnBaseConfig<'string', 'PgTimestampString'>> extends PgColumn<T> {
static readonly [entityKind]: string;
readonly withTimezone: boolean;
readonly precision: number | undefined;
constructor(table: AnyPgTable<{
name: T['tableName'];
}>, config: PgTimestampStringBuilder<T>['config']);
getSQLType(): string;
}
export type Precision = 0 | 1 | 2 | 3 | 4 | 5 | 6;
export interface PgTimestampConfig<TMode extends 'date' | 'string' = 'date' | 'string'> {
mode?: TMode;
precision?: Precision;
withTimezone?: boolean;
}
export declare function timestamp(): PgTimestampBuilderInitial<''>;
export declare function timestamp<TMode extends PgTimestampConfig['mode'] & {}>(config?: PgTimestampConfig<TMode>): Equal<TMode, 'string'> extends true ? PgTimestampStringBuilderInitial<''> : PgTimestampBuilderInitial<''>;
export declare function timestamp<TName extends string, TMode extends PgTimestampConfig['mode'] & {}>(name: TName, config?: PgTimestampConfig<TMode>): Equal<TMode, 'string'> extends true ? PgTimestampStringBuilderInitial<TName> : PgTimestampBuilderInitial<TName>;

View File

@@ -0,0 +1,19 @@
import { deepCopyObjectSimple } from '../utilities/deepCopyObject.js';
export const getDefaultValue = async ({ defaultValue, locale, req, user, value })=>{
if (typeof value !== 'undefined') {
return value;
}
if (defaultValue && typeof defaultValue === 'function') {
return await defaultValue({
locale,
req,
user
});
}
if (typeof defaultValue === 'object') {
return deepCopyObjectSimple(defaultValue);
}
return defaultValue;
};
//# sourceMappingURL=getDefaultValue.js.map

View File

@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Ratio = createLucideIcon("Ratio", [
["rect", { width: "12", height: "20", x: "6", y: "2", rx: "2", key: "1oxtiu" }],
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }]
]);
export { Ratio as default };
//# sourceMappingURL=ratio.js.map

View File

@@ -0,0 +1,15 @@
import type { Active, Over } from '../../store';
export interface Arguments {
active: Active;
over: Over | null;
}
export interface Announcements {
onDragStart({ active }: Pick<Arguments, 'active'>): string | undefined;
onDragMove?({ active, over }: Arguments): string | undefined;
onDragOver({ active, over }: Arguments): string | undefined;
onDragEnd({ active, over }: Arguments): string | undefined;
onDragCancel({ active, over }: Arguments): string | undefined;
}
export interface ScreenReaderInstructions {
draggable: string;
}

View File

@@ -0,0 +1,36 @@
// We need to be careful not to inject anything before any `"use strict";`s or "use client"s or really any other directive.
// As an additional complication directives may come after any number of comments.
// This regex is shamelessly stolen from: https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/7f984482c73e4284e8b12a08dfedf23b5a82f0af/packages/bundler-plugin-core/src/index.ts#L535-L539
const SKIP_COMMENT_AND_DIRECTIVE_REGEX =
// Note: CodeQL complains that this regex potentially has n^2 runtime. This likely won't affect realistic files.
new RegExp('^(?:\\s*|/\\*(?:.|\\r|\\n)*?\\*/|//.*[\\n\\r])*(?:"[^"]*";?|\'[^\']*\';?)?');
/**
* Set values on the global/window object at the start of a module.
*
* Options:
* - `values`: An object where the keys correspond to the keys of the global values to set and the values
* correspond to the values of the values on the global object. Values must be JSON serializable.
*/
function valueInjectionLoader( userCode) {
// We know one or the other will be defined, depending on the version of webpack being used
const { values } = 'getOptions' in this ? this.getOptions() : this.query;
// We do not want to cache injected values across builds
this.cacheable(false);
// Not putting any newlines in the generated code will decrease the likelihood of sourcemaps breaking
const injectedCode =
// eslint-disable-next-line prefer-template
';' +
Object.entries(values)
.map(([key, value]) => `globalThis["${key}"] = ${JSON.stringify(value)};`)
.join('');
return userCode.replace(SKIP_COMMENT_AND_DIRECTIVE_REGEX, match => {
return match + injectedCode;
});
}
export { valueInjectionLoader as default };
//# sourceMappingURL=valueInjectionLoader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"enrichDocsWithVersionStatus.d.ts","sourceRoot":"","sources":["../../../src/views/List/enrichDocsWithVersionStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAEvF;;;;;;GAMG;AACH,wBAAsB,2BAA2B,CAAC,EAChD,gBAAgB,EAChB,IAAI,EACJ,GAAG,GACJ,EAAE;IACD,gBAAgB,EAAE,yBAAyB,CAAA;IAC3C,IAAI,EAAE,aAAa,CAAA;IACnB,GAAG,EAAE,cAAc,CAAA;CACpB,GAAG,OAAO,CAAC,aAAa,CAAC,CAmGzB"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"emotion-hash.cjs.d.mts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"_util.js","sourceRoot":"","sources":["../../src/definitions/_util.ts"],"names":[],"mappings":";;;AAEA,sDAA0C;AAE1C,MAAM,cAAc,GAAG,+BAA+B,CAAA;AAEtD,SAAgB,aAAa,CAAC,EAAC,WAAW,KAAuB,EAAE;IACjE,OAAO,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,IAAI,EAAE,WAAW,IAAI,cAAc,EAAC,CAAA;AAC3E,CAAC;AAFD,sCAEC;AAED,SAAgB,UAAU,CACxB,EAAC,GAAG,EAAE,EAAE,EAAE,EAAC,IAAI,EAAC,EAAa,EAC7B,OAAe,EACf,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;IAErC,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACrC,OAAO,GAAG,CAAC,UAAU,CAAC,SAAS,EAAE;QAC/B,GAAG,EAAE,EAAE,CAAC,QAAQ,EAAE;QAClB,GAAG,EAAE,EAAE;QACP,IAAI,EAAE,IAAA,WAAC,EAAA,cAAc,OAAO,KAAK,KAAK,GAAG;KAC1C,CAAC,CAAA;AACJ,CAAC;AAXD,gCAWC"}

View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./async').groupBySeries;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","md5","React","useAuth","GravatarAccountIcon","$","user","hash","email","trim","toLowerCase","params","URLSearchParams","default","r","s","toString","query","t0","t1","_jsx","alt","className","height","src","style","borderRadius","width"],"sources":["../../../../src/graphics/Account/Gravatar/index.tsx"],"sourcesContent":["'use client'\nimport md5 from 'md5'\nimport React from 'react'\n\nimport { useAuth } from '../../../providers/Auth/index.js'\n\nexport const GravatarAccountIcon: React.FC = () => {\n const { user } = useAuth()\n\n const hash = md5(user.email.trim().toLowerCase())\n\n const params = new URLSearchParams({\n default: 'mp',\n r: 'g',\n s: '50',\n }).toString()\n\n const query = `?${params}`\n\n return (\n <img\n alt=\"yas\"\n className=\"gravatar-account\"\n height={25}\n src={`https://www.gravatar.com/avatar/${hash}${query}`}\n style={{ borderRadius: '50%' }}\n width={25}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,GAAA,MAAS;AAChB,OAAOC,KAAA,MAAW;AAElB,SAASC,OAAO,QAAQ;AAExB,OAAO,MAAMC,mBAAA,GAAgCA,CAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EAC3C;IAAAM;EAAA,IAAiBH,OAAA;EAEjB,MAAAI,IAAA,GAAaN,GAAA,CAAIK,IAAA,CAAAE,KAAA,CAAAC,IAAA,CAAe,EAAAC,WAAA,CAAc;EAE9C,MAAAC,MAAA,GAAe,IAAAC,eAAA;IAAAC,OAAA,EACJ;IAAAC,CAAA,EACN;IAAAC,CAAA,EACA;EAAA,GAAAC,QAAA,CACM;EAEX,MAAAC,KAAA,GAAc,IAAIN,MAAA,EAAQ;EAOjB,MAAAO,EAAA,sCAAmCX,IAAA,GAAOU,KAAA,EAAO;EAAA,IAAAE,EAAA;EAAA,IAAAd,CAAA,QAAAa,EAAA;IAJxDC,EAAA,GAAAC,IAAA,CAAC;MAAAC,GAAA,EACK;MAAAC,SAAA,EACM;MAAAC,MAAA;MAAAC,GAAA,EAELN,EAAiD;MAAAO,KAAA;QAAAC,YAAA,EAC/B;MAAA;MAAAC,KAAA;IAAA,C;;;;;;SALzBR,E;CASJ","ignoreList":[]}

View File

@@ -0,0 +1,353 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const currentScopes = require('../../currentScopes.js');
const debugBuild = require('../../debug-build.js');
const _exports = require('../../exports.js');
const semanticAttributes = require('../../semanticAttributes.js');
const debugLogger = require('../../utils/debug-logger.js');
const is = require('../../utils/is.js');
const spanstatus = require('../spanstatus.js');
const trace = require('../trace.js');
const genAiAttributes = require('../ai/gen-ai-attributes.js');
const utils$1 = require('../ai/utils.js');
const streaming = require('./streaming.js');
const utils = require('./utils.js');
/**
* Extract available tools from request parameters
*/
function extractAvailableTools(params) {
const tools = Array.isArray(params.tools) ? params.tools : [];
const hasWebSearchOptions = params.web_search_options && typeof params.web_search_options === 'object';
const webSearchOptions = hasWebSearchOptions
? [{ type: 'web_search_options', ...(params.web_search_options ) }]
: [];
const availableTools = [...tools, ...webSearchOptions];
if (availableTools.length === 0) {
return undefined;
}
try {
return JSON.stringify(availableTools);
} catch (error) {
debugBuild.DEBUG_BUILD && debugLogger.debug.error('Failed to serialize OpenAI tools:', error);
return undefined;
}
}
/**
* Extract request attributes from method arguments
*/
function extractRequestAttributes(args, methodPath) {
const attributes = {
[genAiAttributes.GEN_AI_SYSTEM_ATTRIBUTE]: 'openai',
[genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]: utils.getOperationName(methodPath),
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.openai',
};
if (args.length > 0 && typeof args[0] === 'object' && args[0] !== null) {
const params = args[0] ;
const availableTools = extractAvailableTools(params);
if (availableTools) {
attributes[genAiAttributes.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE] = availableTools;
}
Object.assign(attributes, utils.extractRequestParameters(params));
} else {
attributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] = 'unknown';
}
return attributes;
}
/**
* Add response attributes to spans
* This supports Chat Completion, Responses API, Embeddings, and Conversations API responses
*/
function addResponseAttributes(span, result, recordOutputs) {
if (!result || typeof result !== 'object') return;
const response = result ;
if (utils.isChatCompletionResponse(response)) {
utils.addChatCompletionAttributes(span, response, recordOutputs);
if (recordOutputs && response.choices?.length) {
const responseTexts = response.choices.map(choice => choice.message?.content || '');
span.setAttributes({ [genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]: JSON.stringify(responseTexts) });
}
} else if (utils.isResponsesApiResponse(response)) {
utils.addResponsesApiAttributes(span, response, recordOutputs);
if (recordOutputs && response.output_text) {
span.setAttributes({ [genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]: response.output_text });
}
} else if (utils.isEmbeddingsResponse(response)) {
utils.addEmbeddingsAttributes(span, response);
} else if (utils.isConversationResponse(response)) {
utils.addConversationAttributes(span, response);
}
}
// Extract and record AI request inputs, if present. This is intentionally separate from response attributes.
function addRequestAttributes(span, params, operationName) {
// Store embeddings input on a separate attribute and do not truncate it
if (operationName === genAiAttributes.OPENAI_OPERATIONS.EMBEDDINGS && 'input' in params) {
const input = params.input;
// No input provided
if (input == null) {
return;
}
// Empty input string
if (typeof input === 'string' && input.length === 0) {
return;
}
// Empty array input
if (Array.isArray(input) && input.length === 0) {
return;
}
// Store strings as-is, arrays/objects as JSON
span.setAttribute(genAiAttributes.GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE, typeof input === 'string' ? input : JSON.stringify(input));
return;
}
const src = 'input' in params ? params.input : 'messages' in params ? params.messages : undefined;
if (!src) {
return;
}
if (Array.isArray(src) && src.length === 0) {
return;
}
const { systemInstructions, filteredMessages } = utils$1.extractSystemInstructions(src);
if (systemInstructions) {
span.setAttribute(genAiAttributes.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE, systemInstructions);
}
const truncatedInput = utils$1.getTruncatedJsonString(filteredMessages);
span.setAttribute(genAiAttributes.GEN_AI_INPUT_MESSAGES_ATTRIBUTE, truncatedInput);
if (Array.isArray(filteredMessages)) {
span.setAttribute(genAiAttributes.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE, filteredMessages.length);
} else {
span.setAttribute(genAiAttributes.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE, 1);
}
}
/**
* Creates a wrapped version of .withResponse() that replaces the data field
* with the instrumented result while preserving metadata (response, request_id).
*/
async function createWithResponseWrapper(
originalWithResponse,
instrumentedPromise,
) {
// Attach catch handler to originalWithResponse immediately to prevent unhandled rejection
// If instrumentedPromise rejects first, we still need this handled
const safeOriginalWithResponse = originalWithResponse.catch(error => {
_exports.captureException(error, {
mechanism: {
handled: false,
type: 'auto.ai.openai',
},
});
throw error;
});
const instrumentedResult = await instrumentedPromise;
const originalWrapper = await safeOriginalWithResponse;
// Combine instrumented result with original metadata
if (originalWrapper && typeof originalWrapper === 'object' && 'data' in originalWrapper) {
return {
...originalWrapper,
data: instrumentedResult,
};
}
return instrumentedResult;
}
/**
* Wraps a promise-like object to preserve additional methods (like .withResponse())
*/
function wrapPromiseWithMethods(originalPromiseLike, instrumentedPromise) {
// If the original result is not thenable, return the instrumented promise
// Should not happen with current OpenAI SDK instrumented methods, but just in case.
if (!is.isThenable(originalPromiseLike)) {
return instrumentedPromise;
}
// Create a proxy that forwards Promise methods to instrumentedPromise
// and preserves additional methods from the original result
return new Proxy(originalPromiseLike, {
get(target, prop) {
// For standard Promise methods (.then, .catch, .finally, Symbol.toStringTag),
// use instrumentedPromise to preserve Sentry instrumentation.
// For custom methods (like .withResponse()), use the original target.
const useInstrumentedPromise = prop in Promise.prototype || prop === Symbol.toStringTag;
const source = useInstrumentedPromise ? instrumentedPromise : target;
const value = Reflect.get(source, prop) ;
// Special handling for .withResponse() to preserve instrumentation
// .withResponse() returns { data: T, response: Response, request_id: string }
if (prop === 'withResponse' && typeof value === 'function') {
return function wrappedWithResponse() {
const originalWithResponse = (value ).call(target);
return createWithResponseWrapper(originalWithResponse, instrumentedPromise);
};
}
return typeof value === 'function' ? value.bind(source) : value;
},
}) ;
}
/**
* Instrument a method with Sentry spans
* Following Sentry AI Agents Manual Instrumentation conventions
* @see https://docs.sentry.io/platforms/javascript/guides/node/tracing/instrumentation/ai-agents-module/#manual-instrumentation
*/
function instrumentMethod(
originalMethod,
methodPath,
context,
options,
) {
return function instrumentedMethod(...args) {
const requestAttributes = extractRequestAttributes(args, methodPath);
const model = (requestAttributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] ) || 'unknown';
const operationName = utils.getOperationName(methodPath);
const params = args[0] ;
const isStreamRequested = params && typeof params === 'object' && params.stream === true;
const spanConfig = {
name: `${operationName} ${model}${isStreamRequested ? ' stream-response' : ''}`,
op: utils.getSpanOperation(methodPath),
attributes: requestAttributes ,
};
if (isStreamRequested) {
let originalResult;
const instrumentedPromise = trace.startSpanManual(spanConfig, (span) => {
originalResult = originalMethod.apply(context, args);
if (options.recordInputs && params) {
addRequestAttributes(span, params, operationName);
}
// Return async processing
return (async () => {
try {
const result = await originalResult;
return streaming.instrumentStream(
result ,
span,
options.recordOutputs ?? false,
) ;
} catch (error) {
span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: 'internal_error' });
_exports.captureException(error, {
mechanism: {
handled: false,
type: 'auto.ai.openai.stream',
data: { function: methodPath },
},
});
span.end();
throw error;
}
})();
});
return wrapPromiseWithMethods(originalResult, instrumentedPromise);
}
// Non-streaming
let originalResult;
const instrumentedPromise = trace.startSpan(spanConfig, (span) => {
// Call synchronously to capture the promise
originalResult = originalMethod.apply(context, args);
if (options.recordInputs && params) {
addRequestAttributes(span, params, operationName);
}
return originalResult.then(
result => {
addResponseAttributes(span, result, options.recordOutputs);
return result;
},
error => {
_exports.captureException(error, {
mechanism: {
handled: false,
type: 'auto.ai.openai',
data: { function: methodPath },
},
});
throw error;
},
);
});
return wrapPromiseWithMethods(originalResult, instrumentedPromise);
};
}
/**
* Create a deep proxy for OpenAI client instrumentation
*/
function createDeepProxy(target, currentPath = '', options) {
return new Proxy(target, {
get(obj, prop) {
const value = (obj )[prop];
const methodPath = utils.buildMethodPath(currentPath, String(prop));
if (typeof value === 'function' && utils.shouldInstrument(methodPath)) {
return instrumentMethod(value , methodPath, obj, options);
}
if (typeof value === 'function') {
// Bind non-instrumented functions to preserve the original `this` context,
// which is required for accessing private class fields (e.g. #baseURL) in OpenAI SDK v5.
return value.bind(obj);
}
if (value && typeof value === 'object') {
return createDeepProxy(value, methodPath, options);
}
return value;
},
}) ;
}
/**
* Instrument an OpenAI client with Sentry tracing
* Can be used across Node.js, Cloudflare Workers, and Vercel Edge
*/
function instrumentOpenAiClient(client, options) {
const sendDefaultPii = Boolean(currentScopes.getClient()?.getOptions().sendDefaultPii);
const _options = {
recordInputs: sendDefaultPii,
recordOutputs: sendDefaultPii,
...options,
};
return createDeepProxy(client, '', _options);
}
exports.instrumentOpenAiClient = instrumentOpenAiClient;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,14 @@
import type { Match } from "../../../locale/types.js";
import type { Era } from "../../../types.js";
import { Parser } from "../Parser.js";
import type { ParseFlags, ParseResult } from "../types.js";
export declare class EraParser extends Parser<number> {
priority: number;
parse(dateString: string, token: string, match: Match): ParseResult<Era>;
set<DateType extends Date>(
date: DateType,
flags: ParseFlags,
value: number,
): DateType;
incompatibleTokens: string[];
}

View File

@@ -0,0 +1,35 @@
/// <reference types="node" />
import { Context, HrTime, Span, Attributes } from '@opentelemetry/api';
import { SemconvStability } from '@opentelemetry/instrumentation';
import type * as amqp from 'amqplib';
export declare const MESSAGE_STORED_SPAN: unique symbol;
export declare const CHANNEL_SPANS_NOT_ENDED: unique symbol;
export declare const CHANNEL_CONSUME_TIMEOUT_TIMER: unique symbol;
export declare const CONNECTION_ATTRIBUTES: unique symbol;
export type InstrumentationConnection = amqp.Connection & {
[CONNECTION_ATTRIBUTES]?: Attributes;
};
export type InstrumentationPublishChannel = (amqp.Channel | amqp.ConfirmChannel) & {
connection: InstrumentationConnection;
};
export type InstrumentationConsumeChannel = amqp.Channel & {
connection: InstrumentationConnection;
[CHANNEL_SPANS_NOT_ENDED]?: {
msg: amqp.ConsumeMessage;
timeOfConsume: HrTime;
}[];
[CHANNEL_CONSUME_TIMEOUT_TIMER]?: NodeJS.Timeout;
};
export type InstrumentationMessage = amqp.Message & {
[MESSAGE_STORED_SPAN]?: Span;
};
export type InstrumentationConsumeMessage = amqp.ConsumeMessage & {
[MESSAGE_STORED_SPAN]?: Span;
};
export declare const normalizeExchange: (exchangeName: string) => string;
export declare const getConnectionAttributesFromServer: (conn: amqp.Connection) => Attributes;
export declare const getConnectionAttributesFromUrl: (url: string | amqp.Options.Connect, netSemconvStability: SemconvStability) => Attributes;
export declare const markConfirmChannelTracing: (context: Context) => Context;
export declare const unmarkConfirmChannelTracing: (context: Context) => Context;
export declare const isConfirmChannelTracing: (context: Context) => boolean;
//# sourceMappingURL=utils.d.ts.map

View File

@@ -0,0 +1,55 @@
'use strict';
const kDone = Symbol('kDone');
const kRun = Symbol('kRun');
/**
* A very simple job queue with adjustable concurrency. Adapted from
* https://github.com/STRML/async-limiter
*/
class Limiter {
/**
* Creates a new `Limiter`.
*
* @param {Number} [concurrency=Infinity] The maximum number of jobs allowed
* to run concurrently
*/
constructor(concurrency) {
this[kDone] = () => {
this.pending--;
this[kRun]();
};
this.concurrency = concurrency || Infinity;
this.jobs = [];
this.pending = 0;
}
/**
* Adds a job to the queue.
*
* @param {Function} job The job to run
* @public
*/
add(job) {
this.jobs.push(job);
this[kRun]();
}
/**
* Removes a job from the queue and runs it if possible.
*
* @private
*/
[kRun]() {
if (this.pending === this.concurrency) return;
if (this.jobs.length) {
const job = this.jobs.shift();
this.pending++;
job(this[kDone]);
}
}
}
module.exports = Limiter;

View File

@@ -0,0 +1,19 @@
import type { GraphQLNamedType } from './definition';
import { GraphQLScalarType } from './definition';
/**
* Maximum possible Int value as per GraphQL Spec (32-bit signed integer).
* n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe up-to 2^53 - 1
* */
export declare const GRAPHQL_MAX_INT = 2147483647;
/**
* Minimum possible Int value as per GraphQL Spec (32-bit signed integer).
* n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe starting at -(2^53 - 1)
* */
export declare const GRAPHQL_MIN_INT = -2147483648;
export declare const GraphQLInt: GraphQLScalarType<number, number>;
export declare const GraphQLFloat: GraphQLScalarType<number, number>;
export declare const GraphQLString: GraphQLScalarType<string, string>;
export declare const GraphQLBoolean: GraphQLScalarType<boolean, boolean>;
export declare const GraphQLID: GraphQLScalarType<string, string>;
export declare const specifiedScalarTypes: ReadonlyArray<GraphQLScalarType>;
export declare function isSpecifiedScalarType(type: GraphQLNamedType): boolean;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/folders/hooks/deleteSubfoldersAfterDelete.ts"],"sourcesContent":["import type { CollectionBeforeDeleteHook } from '../../index.js'\n\ntype Args = {\n folderFieldName: string\n folderSlug: string\n}\nexport const deleteSubfoldersBeforeDelete = ({\n folderFieldName,\n folderSlug,\n}: Args): CollectionBeforeDeleteHook => {\n return async ({ id, req }) => {\n await req.payload.delete({\n collection: folderSlug,\n req,\n where: {\n [folderFieldName]: {\n equals: id,\n },\n },\n })\n }\n}\n"],"names":["deleteSubfoldersBeforeDelete","folderFieldName","folderSlug","id","req","payload","delete","collection","where","equals"],"mappings":"AAMA,OAAO,MAAMA,+BAA+B,CAAC,EAC3CC,eAAe,EACfC,UAAU,EACL;IACL,OAAO,OAAO,EAAEC,EAAE,EAAEC,GAAG,EAAE;QACvB,MAAMA,IAAIC,OAAO,CAACC,MAAM,CAAC;YACvBC,YAAYL;YACZE;YACAI,OAAO;gBACL,CAACP,gBAAgB,EAAE;oBACjBQ,QAAQN;gBACV;YACF;QACF;IACF;AACF,EAAC"}

View File

@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Youtube = createLucideIcon("Youtube", [
[
"path",
{
d: "M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",
key: "1q2vi4"
}
],
["path", { d: "m10 15 5-3-5-3z", key: "1jp15x" }]
]);
export { Youtube as default };
//# sourceMappingURL=youtube.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TabLink.js","names":["c","_c","Button","useParams","usePathname","useSearchParams","formatAdminURL","React","DocumentTabLink","t0","$","adminRoute","ariaLabel","baseClass","children","href","hrefFromProps","isActive","isActiveFromProps","newTab","pathname","params","searchParams","locale","get","entityType","entitySlug","segmentThree","segmentFour","segments","isCollection","t1","t2","path","docPath","hrefWithLocale","t3","startsWith","_jsx","buttonStyle","className","filter","Boolean","join","disabled","el","margin","size","to","undefined"],"sources":["../../../../../src/elements/DocumentHeader/Tabs/Tab/TabLink.tsx"],"sourcesContent":["'use client'\nimport type { SanitizedConfig } from 'payload'\n\nimport { Button } from '@payloadcms/ui'\nimport { useParams, usePathname, useSearchParams } from 'next/navigation.js'\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\nexport const DocumentTabLink: React.FC<{\n adminRoute: SanitizedConfig['routes']['admin']\n ariaLabel?: string\n baseClass: string\n children?: React.ReactNode\n href: string\n isActive?: boolean\n newTab?: boolean\n}> = ({\n adminRoute,\n ariaLabel,\n baseClass,\n children,\n href: hrefFromProps,\n isActive: isActiveFromProps,\n newTab,\n}) => {\n const pathname = usePathname()\n const params = useParams()\n\n const searchParams = useSearchParams()\n\n const locale = searchParams.get('locale')\n\n const [entityType, entitySlug, segmentThree, segmentFour, ...rest] = params.segments || []\n const isCollection = entityType === 'collections'\n\n let docPath = formatAdminURL({\n adminRoute,\n path: `/${isCollection ? 'collections' : 'globals'}/${entitySlug}`,\n })\n\n if (isCollection) {\n if (segmentThree === 'trash' && segmentFour) {\n docPath += `/trash/${segmentFour}`\n } else if (segmentThree) {\n docPath += `/${segmentThree}`\n }\n }\n\n const href = `${docPath}${hrefFromProps}`\n // separated the two so it doesn't break checks against pathname\n const hrefWithLocale = `${href}${locale ? `?locale=${locale}` : ''}`\n\n const isActive =\n (href === docPath && pathname === docPath) ||\n (href !== docPath && pathname.startsWith(href)) ||\n isActiveFromProps\n\n return (\n <Button\n aria-label={ariaLabel}\n buttonStyle=\"tab\"\n className={[baseClass, isActive && `${baseClass}--active`].filter(Boolean).join(' ')}\n disabled={isActive}\n el={!isActive || href !== pathname ? 'link' : 'div'}\n margin={false}\n newTab={newTab}\n size=\"medium\"\n to={!isActive || href !== pathname ? hrefWithLocale : undefined}\n >\n {children}\n </Button>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,MAAM,QAAQ;AACvB,SAASC,SAAS,EAAEC,WAAW,EAAEC,eAAe,QAAQ;AACxD,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAElB,OAAO,MAAMC,eAAA,GAQRC,EAAA;EAAA,MAAAC,CAAA,GAAAT,EAAA;EAAC;IAAAU,UAAA;IAAAC,SAAA;IAAAC,SAAA;IAAAC,QAAA;IAAAC,IAAA,EAAAC,aAAA;IAAAC,QAAA,EAAAC,iBAAA;IAAAC;EAAA,IAAAV,EAQL;EACC,MAAAW,QAAA,GAAiBhB,WAAA;EACjB,MAAAiB,MAAA,GAAelB,SAAA;EAEf,MAAAmB,YAAA,GAAqBjB,eAAA;EAErB,MAAAkB,MAAA,GAAeD,YAAA,CAAAE,GAAA,CAAiB;EAEhC,OAAAC,UAAA,EAAAC,UAAA,EAAAC,YAAA,EAAAC,WAAA,IAAqEP,MAAA,CAAAQ,QAAA,MAAqB;EAC1F,MAAAC,YAAA,GAAqBL,UAAA,KAAe;EAI5B,MAAAM,EAAA,OAAID,YAAA,GAAe,gBAAgB,aAAaJ,UAAA,EAAY;EAAA,IAAAM,EAAA;EAAA,IAAAtB,CAAA,QAAAC,UAAA,IAAAD,CAAA,QAAAqB,EAAA;IAFtDC,EAAA,GAAA1B,cAAA;MAAAK,UAAA;MAAAsB,IAAA,EAENF;IAA4D,CACpE;IAAArB,CAAA,MAAAC,UAAA;IAAAD,CAAA,MAAAqB,EAAA;IAAArB,CAAA,MAAAsB,EAAA;EAAA;IAAAA,EAAA,GAAAtB,CAAA;EAAA;EAHA,IAAAwB,OAAA,GAAcF,EAGd;EAAA,IAEIF,YAAA;IAAA,IACEH,YAAA,KAAiB,WAAWC,WAAA;MAC9BM,OAAA,GAAAA,OAAA,GAAW,UAAUN,WAAA,EAAa;IAAA;MAAA,IACzBD,YAAA;QACTO,OAAA,GAAAA,OAAA,GAAW,IAAIP,YAAA,EAAc;MAAA;IAAA;EAAA;EAIjC,MAAAZ,IAAA,GAAa,GAAGmB,OAAA,GAAUlB,aAAA,EAAe;EAEzC,MAAAmB,cAAA,GAAuB,GAAGpB,IAAA,GAAOQ,MAAA,GAAS,WAAWA,MAAA,EAAQ,GAAG,IAAI;EAAA,IAAAa,EAAA;EAAA,IAAA1B,CAAA,QAAAE,SAAA,IAAAF,CAAA,QAAAG,SAAA,IAAAH,CAAA,QAAAI,QAAA,IAAAJ,CAAA,QAAAwB,OAAA,IAAAxB,CAAA,QAAAK,IAAA,IAAAL,CAAA,QAAAyB,cAAA,IAAAzB,CAAA,QAAAQ,iBAAA,IAAAR,CAAA,SAAAS,MAAA,IAAAT,CAAA,SAAAU,QAAA;IAEpE,MAAAH,QAAA,GACEF,IAAC,KAASmB,OAAA,IAAWd,QAAA,KAAac,OAAA,IACjCnB,IAAA,KAASmB,OAAA,IAAWd,QAAA,CAAAiB,UAAA,CAAoBtB,IAAA,KACzCG,iBAAA;IAGAkB,EAAA,GAAAE,IAAA,CAAApC,MAAA;MAAA,cACcU,SAAA;MAAA2B,WAAA,EACA;MAAAC,SAAA,EACD,CAAC3B,SAAA,EAAWI,QAAA,IAAY,GAAGJ,SAAA,UAAmB,EAAA4B,MAAA,CAAAC,OAAS,EAAAC,IAAA,CAAc;MAAAC,QAAA,EACtE3B,QAAA;MAAA4B,EAAA,EACN,CAAC5B,QAAA,IAAYF,IAAA,KAASK,QAAA,GAAW,SAAS;MAAA0B,MAAA;MAAA3B,MAAA;MAAA4B,IAAA,EAGzC;MAAAC,EAAA,EACD,CAAC/B,QAAA,IAAYF,IAAA,KAASK,QAAA,GAAWe,cAAA,GAAAc,SAAiB;MAAAnC;IAAA,C;;;;;;;;;;;;;;SATxDsB,E;CAcJ","ignoreList":[]}

View File

@@ -0,0 +1,39 @@
import type { Span } from '@sentry/core';
import type { ServerResponse } from 'http';
/**
* Wrap `res.end()` so that it ends the span and flushes events before letting the request finish.
*
* Note: This wraps a sync method with an async method. While in general that's not a great idea in terms of keeping
* things in the right order, in this case it's safe, because the native `.end()` actually *is* (effectively) async, and
* its run actually *is* (literally) awaited, just manually so (which reflects the fact that the core of the
* request/response code in Node by far predates the introduction of `async`/`await`). When `.end()` is done, it emits
* the `prefinish` event, and only once that fires does request processing continue. See
* https://github.com/nodejs/node/commit/7c9b607048f13741173d397795bac37707405ba7.
*
* Also note: `res.end()` isn't called until *after* all response data and headers have been sent, so blocking inside of
* `end` doesn't delay data getting to the end user. See
* https://nodejs.org/api/http.html#responseenddata-encoding-callback.
*
* @param span The span tracking the request
* @param res: The request's corresponding response
*/
export declare function autoEndSpanOnResponseEnd(span: Span, res: ServerResponse): void;
/** Finish the given response's span and set HTTP status data */
export declare function finishSpan(span: Span, res: ServerResponse): void;
/**
* Flushes pending Sentry events with a 2 second timeout and in a way that cannot create unhandled promise rejections.
*/
export declare function flushSafelyWithTimeout(): Promise<void>;
/**
* Uses platform-specific waitUntil function to wait for the provided task to complete without blocking.
*/
export declare function waitUntil(task: Promise<unknown>): void;
/**
* Function that delays closing of a Cloudflare lambda until the provided promise is resolved.
*/
export declare function cloudflareWaitUntil(task: Promise<unknown>): void;
/**
* Checks if the Cloudflare waitUntil function is available globally.
*/
export declare function isCloudflareWaitUntilAvailable(): boolean;
//# sourceMappingURL=responseEnd.d.ts.map

View File

@@ -0,0 +1,13 @@
import type { Where } from 'payload';
import React from 'react';
import type { UnpublishManyProps } from './index.js';
type UnpublishManyDrawerContentProps = {
drawerSlug: string;
ids: (number | string)[];
onSuccess?: () => void;
selectAll: boolean;
where?: Where;
} & UnpublishManyProps;
export declare function UnpublishManyDrawerContent(props: UnpublishManyDrawerContentProps): React.JSX.Element;
export {};
//# sourceMappingURL=DrawerContent.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAEA,0DAAgC;AAIhC,MAAM,WAAW,GAA8B,CAAC,GAAQ,EAAE,OAA2B,EAAO,EAAE;IAC5F,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC1B,KAAK,MAAM,CAAC,IAAI,OAAO;YAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QACpC,OAAO,GAAG,CAAA;KACX;IACD,IAAI,OAAO,EAAE;QACX,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAA;QACjB,OAAO,GAAG,CAAA;KACX;IACD,KAAK,OAAO,IAAI,kBAAO;QAAE,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAA;IAC1C,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,WAAW,CAAC,GAAG,GAAG,GAAG,CAAA;AAErB,SAAS,GAAG,CAAC,OAAe;IAC1B,MAAM,OAAO,GAAG,kBAAO,CAAC,OAAO,CAAC,CAAA;IAChC,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,OAAO,CAAC,CAAA;IAC3D,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,kBAAe,WAAW,CAAA;AAC1B,MAAM,CAAC,OAAO,GAAG,WAAW,CAAA;AAE5B,sEAAsE;AACtE,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,WAAW,CAAA"}

View File

@@ -0,0 +1,59 @@
import { warnOnce } from '../../utils/warn-once.mjs';
import { motionValue } from '../../value/index.mjs';
import { isMotionValue } from '../../value/utils/is-motion-value.mjs';
function updateMotionValuesFromProps(element, next, prev) {
for (const key in next) {
const nextValue = next[key];
const prevValue = prev[key];
if (isMotionValue(nextValue)) {
/**
* If this is a motion value found in props or style, we want to add it
* to our visual element's motion value map.
*/
element.addValue(key, nextValue);
/**
* Check the version of the incoming motion value with this version
* and warn against mismatches.
*/
if (process.env.NODE_ENV === "development") {
warnOnce(nextValue.version === "11.18.2", `Attempting to mix Motion versions ${nextValue.version} with 11.18.2 may not work as expected.`);
}
}
else if (isMotionValue(prevValue)) {
/**
* If we're swapping from a motion value to a static value,
* create a new motion value from that
*/
element.addValue(key, motionValue(nextValue, { owner: element }));
}
else if (prevValue !== nextValue) {
/**
* If this is a flat value that has changed, update the motion value
* or create one if it doesn't exist. We only want to do this if we're
* not handling the value with our animation state.
*/
if (element.hasValue(key)) {
const existingValue = element.getValue(key);
if (existingValue.liveStyle === true) {
existingValue.jump(nextValue);
}
else if (!existingValue.hasAnimated) {
existingValue.set(nextValue);
}
}
else {
const latestValue = element.getStaticValue(key);
element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));
}
}
}
// Handle removed values
for (const key in prev) {
if (next[key] === undefined)
element.removeValue(key);
}
return next;
}
export { updateMotionValuesFromProps };

View File

@@ -0,0 +1,19 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { envDetector } from './EnvDetector';
export { hostDetector, osDetector, processDetector, serviceInstanceIdDetector, } from './platform';
export { noopDetector } from './NoopDetector';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,21 @@
export const migrationsCollection = {
slug: 'payload-migrations',
admin: {
hidden: true
},
endpoints: false,
fields: [
{
name: 'name',
type: 'text'
},
{
name: 'batch',
type: 'number'
}
],
graphQL: false,
lockDocuments: false
};
//# sourceMappingURL=migrationsCollection.js.map

View File

@@ -0,0 +1,17 @@
import * as qs from 'qs-esm';
/**
* A utility function to parse URLSearchParams into a ParsedQs object.
* This function is a wrapper around the `qs` library.
* In Next.js, the `useSearchParams()` hook from `next/navigation` returns a `URLSearchParams` object.
* This function can be used to parse that object into a more usable format.
* @param {ReadonlyURLSearchParams} searchParams - The URLSearchParams object to parse.
* @returns {qs.ParsedQs} - The parsed query string object.
*/
export function parseSearchParams(searchParams) {
const search = searchParams.toString();
return qs.parse(search, {
depth: 10,
ignoreQueryPrefix: true
});
}
//# sourceMappingURL=parseSearchParams.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SetStepNav.d.ts","sourceRoot":"","sources":["../../../../src/views/Version/Default/SetStepNav.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AACzE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;IAChC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,sBAAsB,CAAA;IAClD,QAAQ,CAAC,YAAY,CAAC,EAAE,kBAAkB,CAAA;IAC1C,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,2BAA2B,CAAC,EAAE,MAAM,CAAA;IACpC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAiHA,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"global-error-handler.js","sourceRoot":"","sources":["../../../src/common/global-error-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,mEAA8D;AAG9D,wCAAwC;AACxC,IAAI,eAAe,GAAG,IAAA,2CAAmB,GAAE,CAAC;AAE5C;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,OAAqB;IACzD,eAAe,GAAG,OAAO,CAAC;AAC5B,CAAC;AAFD,sDAEC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,EAAa;IAC9C,IAAI;QACF,eAAe,CAAC,EAAE,CAAC,CAAC;KACrB;IAAC,MAAM,GAAE,CAAC,+BAA+B;AAC5C,CAAC;AAJD,gDAIC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Exception } from '@opentelemetry/api';\nimport { loggingErrorHandler } from './logging-error-handler';\nimport { ErrorHandler } from './types';\n\n/** The global error handler delegate */\nlet delegateHandler = loggingErrorHandler();\n\n/**\n * Set the global error handler\n * @param {ErrorHandler} handler\n */\nexport function setGlobalErrorHandler(handler: ErrorHandler): void {\n delegateHandler = handler;\n}\n\n/**\n * Return the global error handler\n * @param {Exception} ex\n */\nexport function globalErrorHandler(ex: Exception): void {\n try {\n delegateHandler(ex);\n } catch {} // eslint-disable-line no-empty\n}\n"]}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"dependentSchemas.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/dependentSchemas.ts"],"names":[],"mappings":";;AACA,iDAAiD;AAEjD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,iCAAkB,EAAC,GAAG,CAAC;CACvC,CAAA;AAED,kBAAe,GAAG,CAAA"}

View File

@@ -0,0 +1,34 @@
import { GLOBAL_OBJ, debug } from '@sentry/core';
import { createAddHookMessageChannel } from 'import-in-the-middle';
import * as moduleModule from 'module';
import { supportsEsmLoaderHooks } from '../utils/detection.js';
/**
* Initialize the ESM loader - This method is private and not part of the public
* API.
*
* @ignore
*/
function initializeEsmLoader() {
if (!supportsEsmLoaderHooks()) {
return;
}
if (!GLOBAL_OBJ._sentryEsmLoaderHookRegistered) {
GLOBAL_OBJ._sentryEsmLoaderHookRegistered = true;
try {
const { addHookMessagePort } = createAddHookMessageChannel();
// @ts-expect-error register is available in these versions
moduleModule.register('import-in-the-middle/hook.mjs', import.meta.url, {
data: { addHookMessagePort, include: [] },
transferList: [addHookMessagePort],
});
} catch (error) {
debug.warn("Failed to register 'import-in-the-middle' hook", error);
}
}
}
export { initializeEsmLoader };
//# sourceMappingURL=esmLoader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../lib/compile/resolve.ts"],"names":[],"mappings":";;;AAGA,iCAA+B;AAC/B,yCAAwC;AACxC,iDAAgD;AAKhD,2CAA2C;AAC3C,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,MAAM;IACN,QAAQ;IACR,SAAS;IACT,WAAW;IACX,WAAW;IACX,eAAe;IACf,eAAe;IACf,UAAU;IACV,UAAU;IACV,SAAS;IACT,SAAS;IACT,aAAa;IACb,YAAY;IACZ,UAAU;IACV,MAAM;IACN,OAAO;CACR,CAAC,CAAA;AAEF,SAAgB,SAAS,CAAC,MAAiB,EAAE,QAA0B,IAAI;IACzE,IAAI,OAAO,MAAM,IAAI,SAAS;QAAE,OAAO,IAAI,CAAA;IAC3C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC1C,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAA;IACxB,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,KAAK,CAAA;AACnC,CAAC;AALD,8BAKC;AAED,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,MAAM;IACN,eAAe;IACf,kBAAkB;IAClB,aAAa;IACb,gBAAgB;CACjB,CAAC,CAAA;AAEF,SAAS,MAAM,CAAC,MAAuB;IACrC,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAA;QACtC,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;QACvB,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;YAAE,OAAO,IAAI,CAAA;QACvD,IAAI,OAAO,GAAG,IAAI,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAA;IACxD,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,SAAS,CAAC,MAAuB;IACxC,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,IAAI,GAAG,KAAK,MAAM;YAAE,OAAO,QAAQ,CAAA;QACnC,KAAK,EAAE,CAAA;QACP,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAQ;QACrC,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,QAAQ,EAAE,CAAC;YACnC,IAAA,eAAQ,EAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QAC3D,CAAC;QACD,IAAI,KAAK,KAAK,QAAQ;YAAE,OAAO,QAAQ,CAAA;IACzC,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAgB,WAAW,CAAC,QAAqB,EAAE,EAAE,GAAG,EAAE,EAAE,SAAmB;IAC7E,IAAI,SAAS,KAAK,KAAK;QAAE,EAAE,GAAG,WAAW,CAAC,EAAE,CAAC,CAAA;IAC7C,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAC5B,OAAO,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;AAClC,CAAC;AAJD,kCAIC;AAED,SAAgB,YAAY,CAAC,QAAqB,EAAE,CAAe;IACjE,MAAM,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;IACxC,OAAO,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;AACvC,CAAC;AAHD,oCAGC;AAED,MAAM,mBAAmB,GAAG,OAAO,CAAA;AACnC,SAAgB,WAAW,CAAC,EAAsB;IAChD,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACtD,CAAC;AAFD,kCAEC;AAED,SAAgB,UAAU,CAAC,QAAqB,EAAE,MAAc,EAAE,EAAU;IAC1E,EAAE,GAAG,WAAW,CAAC,EAAE,CAAC,CAAA;IACpB,OAAO,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AACrC,CAAC;AAHD,gCAGC;AAED,MAAM,MAAM,GAAG,uBAAuB,CAAA;AAEtC,SAAgB,aAAa,CAAY,MAAiB,EAAE,MAAc;IACxE,IAAI,OAAO,MAAM,IAAI,SAAS;QAAE,OAAO,EAAE,CAAA;IACzC,MAAM,EAAC,QAAQ,EAAE,WAAW,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;IACzC,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,CAAA;IACrD,MAAM,OAAO,GAAmC,EAAC,EAAE,EAAE,KAAK,EAAC,CAAA;IAC3D,MAAM,UAAU,GAAG,WAAW,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;IACzD,MAAM,SAAS,GAAc,EAAE,CAAA;IAC/B,MAAM,UAAU,GAAgB,IAAI,GAAG,EAAE,CAAA;IAEzC,QAAQ,CAAC,MAAM,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE;QACnE,IAAI,aAAa,KAAK,SAAS;YAAE,OAAM;QACvC,MAAM,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAA;QACrC,IAAI,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;QACxC,IAAI,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAI,QAAQ;YAAE,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAA;QACpF,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;QACjC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;QACxC,OAAO,CAAC,OAAO,CAAC,GAAG,WAAW,CAAA;QAE9B,SAAS,MAAM,CAAY,GAAW;YACpC,6DAA6D;YAC7D,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAA;YAC9C,GAAG,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;YACjE,IAAI,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAA;YAC5C,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACnB,IAAI,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YAC7B,IAAI,OAAO,QAAQ,IAAI,QAAQ;gBAAE,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YAC/D,IAAI,OAAO,QAAQ,IAAI,QAAQ,EAAE,CAAC;gBAChC,gBAAgB,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;YAC7C,CAAC;iBAAM,IAAI,GAAG,KAAK,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACzC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;oBACnB,gBAAgB,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAA;oBAC1C,SAAS,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA;gBACtB,CAAC;qBAAM,CAAC;oBACN,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAA;gBAC3B,CAAC;YACH,CAAC;YACD,OAAO,GAAG,CAAA;QACZ,CAAC;QAED,SAAS,SAAS,CAAY,MAAe;YAC3C,IAAI,OAAO,MAAM,IAAI,QAAQ,EAAE,CAAC;gBAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;oBAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,GAAG,CAAC,CAAA;gBACvE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,MAAM,EAAE,CAAC,CAAA;YACjC,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,SAAS,CAAA;IAEhB,SAAS,gBAAgB,CAAC,IAAe,EAAE,IAA2B,EAAE,GAAW;QACjF,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;YAAE,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAA;IACnE,CAAC;IAED,SAAS,QAAQ,CAAC,GAAW;QAC3B,OAAO,IAAI,KAAK,CAAC,cAAc,GAAG,oCAAoC,CAAC,CAAA;IACzE,CAAC;AACH,CAAC;AAxDD,sCAwDC"}

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = v6ToV1;
var _parse = _interopRequireDefault(require("./parse.js"));
var _stringify = require("./stringify.js");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/**
* Convert a v6 UUID to a v1 UUID
*
* @param {string|Uint8Array} uuid - The v6 UUID to convert to v6
* @returns {string|Uint8Array} The v1 UUID as the same type as the `uuid` arg
* (string or Uint8Array)
*/
function v6ToV1(uuid) {
const v6Bytes = typeof uuid === 'string' ? (0, _parse.default)(uuid) : uuid;
const v1Bytes = _v6ToV1(v6Bytes);
return typeof uuid === 'string' ? (0, _stringify.unsafeStringify)(v1Bytes) : v1Bytes;
}
// Do the field transformation needed for v6 -> v1
function _v6ToV1(v6Bytes) {
return Uint8Array.of((v6Bytes[3] & 0x0f) << 4 | v6Bytes[4] >> 4 & 0x0f, (v6Bytes[4] & 0x0f) << 4 | (v6Bytes[5] & 0xf0) >> 4, (v6Bytes[5] & 0x0f) << 4 | v6Bytes[6] & 0x0f, v6Bytes[7], (v6Bytes[1] & 0x0f) << 4 | (v6Bytes[2] & 0xf0) >> 4, (v6Bytes[2] & 0x0f) << 4 | (v6Bytes[3] & 0xf0) >> 4, 0x10 | (v6Bytes[0] & 0xf0) >> 4, (v6Bytes[0] & 0x0f) << 4 | (v6Bytes[1] & 0xf0) >> 4, v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]);
}

View File

@@ -0,0 +1,39 @@
import { GraphQLError } from '../../error/GraphQLError.mjs';
/**
* Unique operation names
*
* A GraphQL document is only valid if all defined operations have unique names.
*
* See https://spec.graphql.org/draft/#sec-Operation-Name-Uniqueness
*/
export function UniqueOperationNamesRule(context) {
const knownOperationNames = Object.create(null);
return {
OperationDefinition(node) {
const operationName = node.name;
if (operationName) {
if (knownOperationNames[operationName.value]) {
context.reportError(
new GraphQLError(
`There can be only one operation named "${operationName.value}".`,
{
nodes: [
knownOperationNames[operationName.value],
operationName,
],
},
),
);
} else {
knownOperationNames[operationName.value] = operationName;
}
}
return false;
},
FragmentDefinition: () => false,
};
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"da.d.ts","sourceRoot":"","sources":["../../src/languages/da.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtE,eAAO,MAAM,cAAc,EAAE,yBA2nB5B,CAAA;AAED,eAAO,MAAM,EAAE,EAAE,QAGhB,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"fetchPreferences.js","names":[],"sources":["../../src/utilities/fetchPreferences.ts"],"sourcesContent":[null],"mappings":"","ignoreList":[]}

View File

@@ -0,0 +1,20 @@
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
const baseClass = 'form-header';
export function FormHeader({
description,
heading
}) {
if (!heading) {
return null;
}
return /*#__PURE__*/_jsxs("div", {
className: baseClass,
children: [/*#__PURE__*/_jsx("h1", {
children: heading
}), Boolean(description) && /*#__PURE__*/_jsx("p", {
children: description
})]
});
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,16 @@
"use strict";
function _object_without_properties_loose(source, excluded) {
if (source == null) return {};
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
return target;
}
exports._ = _object_without_properties_loose;

View File

@@ -0,0 +1,193 @@
"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: ["چارەگی یەکەم", "چارەگی دووەم", "چارەگی سێیەم", "چارەگی چوارەم"],
};
// 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: ["یە-شە", "دوو-شە", "سێ-شە", "چو-شە", "پێ-شە", "هەی", "شە"],
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);
};
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",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1,230 @@
import { AnimationPlaybackControls, TransformProperties, AnimationPlaybackOptions, Transition, UnresolvedValueKeyframe, ElementOrSelector, DOMKeyframesDefinition, AnimationOptions, GroupPlaybackControls } from 'motion-dom';
/**
* @public
*/
type Subscriber<T> = (v: T) => void;
interface MotionValueEventCallbacks<V> {
animationStart: () => void;
animationComplete: () => void;
animationCancel: () => void;
change: (latestValue: V) => void;
renderRequest: () => void;
}
interface ResolvedValues {
[key: string]: string | number;
}
interface Owner {
current: HTMLElement | unknown;
getProps: () => {
onUpdate?: (latest: ResolvedValues) => void;
transformTemplate?: (transform: TransformProperties, generatedTransform: string) => string;
};
}
/**
* `MotionValue` is used to track the state and velocity of motion values.
*
* @public
*/
declare class MotionValue<V = any> {
/**
* This will be replaced by the build step with the latest version number.
* When MotionValues are provided to motion components, warn if versions are mixed.
*/
version: string;
/**
* If a MotionValue has an owner, it was created internally within Motion
* and therefore has no external listeners. It is therefore safe to animate via WAAPI.
*/
owner?: Owner;
/**
* The current state of the `MotionValue`.
*/
private current;
/**
* The previous state of the `MotionValue`.
*/
private prev;
/**
* The previous state of the `MotionValue` at the end of the previous frame.
*/
private prevFrameValue;
/**
* The last time the `MotionValue` was updated.
*/
updatedAt: number;
/**
* The time `prevFrameValue` was updated.
*/
prevUpdatedAt: number | undefined;
private stopPassiveEffect?;
/**
* A reference to the currently-controlling animation.
*/
animation?: AnimationPlaybackControls;
setCurrent(current: V): void;
setPrevFrameValue(prevFrameValue?: V | undefined): void;
/**
* Adds a function that will be notified when the `MotionValue` is updated.
*
* It returns a function that, when called, will cancel the subscription.
*
* When calling `onChange` inside a React component, it should be wrapped with the
* `useEffect` hook. As it returns an unsubscribe function, this should be returned
* from the `useEffect` function to ensure you don't add duplicate subscribers..
*
* ```jsx
* export const MyComponent = () => {
* const x = useMotionValue(0)
* const y = useMotionValue(0)
* const opacity = useMotionValue(1)
*
* useEffect(() => {
* function updateOpacity() {
* const maxXY = Math.max(x.get(), y.get())
* const newOpacity = transform(maxXY, [0, 100], [1, 0])
* opacity.set(newOpacity)
* }
*
* const unsubscribeX = x.on("change", updateOpacity)
* const unsubscribeY = y.on("change", updateOpacity)
*
* return () => {
* unsubscribeX()
* unsubscribeY()
* }
* }, [])
*
* return <motion.div style={{ x }} />
* }
* ```
*
* @param subscriber - A function that receives the latest value.
* @returns A function that, when called, will cancel this subscription.
*
* @deprecated
*/
onChange(subscription: Subscriber<V>): () => void;
/**
* An object containing a SubscriptionManager for each active event.
*/
private events;
on<EventName extends keyof MotionValueEventCallbacks<V>>(eventName: EventName, callback: MotionValueEventCallbacks<V>[EventName]): VoidFunction;
clearListeners(): void;
/**
* Sets the state of the `MotionValue`.
*
* @remarks
*
* ```jsx
* const x = useMotionValue(0)
* x.set(10)
* ```
*
* @param latest - Latest value to set.
* @param render - Whether to notify render subscribers. Defaults to `true`
*
* @public
*/
set(v: V, render?: boolean): void;
setWithVelocity(prev: V, current: V, delta: number): void;
/**
* Set the state of the `MotionValue`, stopping any active animations,
* effects, and resets velocity to `0`.
*/
jump(v: V, endAnimation?: boolean): void;
updateAndNotify: (v: V, render?: boolean) => void;
/**
* Returns the latest state of `MotionValue`
*
* @returns - The latest state of `MotionValue`
*
* @public
*/
get(): NonNullable<V>;
/**
* @public
*/
getPrevious(): V | undefined;
/**
* Returns the latest velocity of `MotionValue`
*
* @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
*
* @public
*/
getVelocity(): number;
hasAnimated: boolean;
/**
* Stop the currently active animation.
*
* @public
*/
stop(): void;
/**
* Returns `true` if this value is currently animating.
*
* @public
*/
isAnimating(): boolean;
private clearAnimation;
/**
* Destroy and clean up subscribers to this `MotionValue`.
*
* The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
* handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
* created a `MotionValue` via the `motionValue` function.
*
* @public
*/
destroy(): void;
}
type GenericKeyframesTarget<V> = V[] | Array<null | V>;
type ObjectTarget<O> = {
[K in keyof O]?: O[K] | GenericKeyframesTarget<O[K]>;
};
type SequenceTime = number | "<" | `+${number}` | `-${number}` | `${string}`;
type SequenceLabel = string;
interface SequenceLabelWithTime {
name: SequenceLabel;
at: SequenceTime;
}
interface At {
at?: SequenceTime;
}
type MotionValueSegment = [
MotionValue,
UnresolvedValueKeyframe | UnresolvedValueKeyframe[]
];
type MotionValueSegmentWithTransition = [
MotionValue,
UnresolvedValueKeyframe | UnresolvedValueKeyframe[],
Transition & At
];
type DOMSegment = [ElementOrSelector, DOMKeyframesDefinition];
type DOMSegmentWithTransition = [
ElementOrSelector,
DOMKeyframesDefinition,
AnimationOptions & At
];
type ObjectSegment<O extends {} = {}> = [O, ObjectTarget<O>];
type ObjectSegmentWithTransition<O extends {} = {}> = [
O,
ObjectTarget<O>,
AnimationOptions & At
];
type Segment = ObjectSegment | ObjectSegmentWithTransition | SequenceLabel | SequenceLabelWithTime | MotionValueSegment | MotionValueSegmentWithTransition | DOMSegment | DOMSegmentWithTransition;
type AnimationSequence = Segment[];
interface SequenceOptions extends AnimationPlaybackOptions {
delay?: number;
duration?: number;
defaultTransition?: Transition;
}
declare function animateSequence(definition: AnimationSequence, options?: SequenceOptions): GroupPlaybackControls;
declare const animateMini: (elementOrSelector: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions) => AnimationPlaybackControls;
export { animateMini as animate, animateSequence };

View File

@@ -0,0 +1,55 @@
'use strict';
var isArray = Array.isArray;
var keyList = Object.keys;
var hasProp = Object.prototype.hasOwnProperty;
module.exports = function equal(a, b) {
if (a === b) return true;
if (a && b && typeof a == 'object' && typeof b == 'object') {
var arrA = isArray(a)
, arrB = isArray(b)
, i
, length
, key;
if (arrA && arrB) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (!equal(a[i], b[i])) return false;
return true;
}
if (arrA != arrB) return false;
var dateA = a instanceof Date
, dateB = b instanceof Date;
if (dateA != dateB) return false;
if (dateA && dateB) return a.getTime() == b.getTime();
var regexpA = a instanceof RegExp
, regexpB = b instanceof RegExp;
if (regexpA != regexpB) return false;
if (regexpA && regexpB) return a.toString() == b.toString();
var keys = keyList(a);
length = keys.length;
if (length !== keyList(b).length)
return false;
for (i = length; i-- !== 0;)
if (!hasProp.call(b, keys[i])) return false;
for (i = length; i-- !== 0;) {
key = keys[i];
if (!equal(a[key], b[key])) return false;
}
return true;
}
return a!==a && b!==b;
};

View File

@@ -0,0 +1,332 @@
import { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';
import { isKeyframesTarget } from '../../animation/utils/is-keyframes-target.mjs';
import { shallowCompare } from '../../utils/shallow-compare.mjs';
import { isVariantLabel } from './is-variant-label.mjs';
import { resolveVariant } from './resolve-dynamic-variants.mjs';
import { variantPriorityOrder } from './variant-props.mjs';
import { animateVisualElement } from '../../animation/interfaces/visual-element.mjs';
import { getVariantContext } from './get-variant-context.mjs';
const reversePriorityOrder = [...variantPriorityOrder].reverse();
const numAnimationTypes = variantPriorityOrder.length;
function animateList(visualElement) {
return (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));
}
function createAnimationState(visualElement) {
let animate = animateList(visualElement);
let state = createState();
let isInitialRender = true;
/**
* This function will be used to reduce the animation definitions for
* each active animation type into an object of resolved values for it.
*/
const buildResolvedTypeValues = (type) => (acc, definition) => {
var _a;
const resolved = resolveVariant(visualElement, definition, type === "exit"
? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom
: undefined);
if (resolved) {
const { transition, transitionEnd, ...target } = resolved;
acc = { ...acc, ...target, ...transitionEnd };
}
return acc;
};
/**
* This just allows us to inject mocked animation functions
* @internal
*/
function setAnimateFunction(makeAnimator) {
animate = makeAnimator(visualElement);
}
/**
* When we receive new props, we need to:
* 1. Create a list of protected keys for each type. This is a directory of
* value keys that are currently being "handled" by types of a higher priority
* so that whenever an animation is played of a given type, these values are
* protected from being animated.
* 2. Determine if an animation type needs animating.
* 3. Determine if any values have been removed from a type and figure out
* what to animate those to.
*/
function animateChanges(changedActiveType) {
const { props } = visualElement;
const context = getVariantContext(visualElement.parent) || {};
/**
* A list of animations that we'll build into as we iterate through the animation
* types. This will get executed at the end of the function.
*/
const animations = [];
/**
* Keep track of which values have been removed. Then, as we hit lower priority
* animation types, we can check if they contain removed values and animate to that.
*/
const removedKeys = new Set();
/**
* A dictionary of all encountered keys. This is an object to let us build into and
* copy it without iteration. Each time we hit an animation type we set its protected
* keys - the keys its not allowed to animate - to the latest version of this object.
*/
let encounteredKeys = {};
/**
* If a variant has been removed at a given index, and this component is controlling
* variant animations, we want to ensure lower-priority variants are forced to animate.
*/
let removedVariantIndex = Infinity;
/**
* Iterate through all animation types in reverse priority order. For each, we want to
* detect which values it's handling and whether or not they've changed (and therefore
* need to be animated). If any values have been removed, we want to detect those in
* lower priority props and flag for animation.
*/
for (let i = 0; i < numAnimationTypes; i++) {
const type = reversePriorityOrder[i];
const typeState = state[type];
const prop = props[type] !== undefined
? props[type]
: context[type];
const propIsVariant = isVariantLabel(prop);
/**
* If this type has *just* changed isActive status, set activeDelta
* to that status. Otherwise set to null.
*/
const activeDelta = type === changedActiveType ? typeState.isActive : null;
if (activeDelta === false)
removedVariantIndex = i;
/**
* If this prop is an inherited variant, rather than been set directly on the
* component itself, we want to make sure we allow the parent to trigger animations.
*
* TODO: Can probably change this to a !isControllingVariants check
*/
let isInherited = prop === context[type] &&
prop !== props[type] &&
propIsVariant;
/**
*
*/
if (isInherited &&
isInitialRender &&
visualElement.manuallyAnimateOnMount) {
isInherited = false;
}
/**
* Set all encountered keys so far as the protected keys for this type. This will
* be any key that has been animated or otherwise handled by active, higher-priortiy types.
*/
typeState.protectedKeys = { ...encounteredKeys };
// Check if we can skip analysing this prop early
if (
// If it isn't active and hasn't *just* been set as inactive
(!typeState.isActive && activeDelta === null) ||
// If we didn't and don't have any defined prop for this animation type
(!prop && !typeState.prevProp) ||
// Or if the prop doesn't define an animation
isAnimationControls(prop) ||
typeof prop === "boolean") {
continue;
}
/**
* As we go look through the values defined on this type, if we detect
* a changed value or a value that was removed in a higher priority, we set
* this to true and add this prop to the animation list.
*/
const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);
let shouldAnimateType = variantDidChange ||
// If we're making this variant active, we want to always make it active
(type === changedActiveType &&
typeState.isActive &&
!isInherited &&
propIsVariant) ||
// If we removed a higher-priority variant (i is in reverse order)
(i > removedVariantIndex && propIsVariant);
let handledRemovedValues = false;
/**
* As animations can be set as variant lists, variants or target objects, we
* coerce everything to an array if it isn't one already
*/
const definitionList = Array.isArray(prop) ? prop : [prop];
/**
* Build an object of all the resolved values. We'll use this in the subsequent
* animateChanges calls to determine whether a value has changed.
*/
let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {});
if (activeDelta === false)
resolvedValues = {};
/**
* Now we need to loop through all the keys in the prev prop and this prop,
* and decide:
* 1. If the value has changed, and needs animating
* 2. If it has been removed, and needs adding to the removedKeys set
* 3. If it has been removed in a higher priority type and needs animating
* 4. If it hasn't been removed in a higher priority but hasn't changed, and
* needs adding to the type's protectedKeys list.
*/
const { prevResolvedValues = {} } = typeState;
const allKeys = {
...prevResolvedValues,
...resolvedValues,
};
const markToAnimate = (key) => {
shouldAnimateType = true;
if (removedKeys.has(key)) {
handledRemovedValues = true;
removedKeys.delete(key);
}
typeState.needsAnimating[key] = true;
const motionValue = visualElement.getValue(key);
if (motionValue)
motionValue.liveStyle = false;
};
for (const key in allKeys) {
const next = resolvedValues[key];
const prev = prevResolvedValues[key];
// If we've already handled this we can just skip ahead
if (encounteredKeys.hasOwnProperty(key))
continue;
/**
* If the value has changed, we probably want to animate it.
*/
let valueHasChanged = false;
if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {
valueHasChanged = !shallowCompare(next, prev);
}
else {
valueHasChanged = next !== prev;
}
if (valueHasChanged) {
if (next !== undefined && next !== null) {
// If next is defined and doesn't equal prev, it needs animating
markToAnimate(key);
}
else {
// If it's undefined, it's been removed.
removedKeys.add(key);
}
}
else if (next !== undefined && removedKeys.has(key)) {
/**
* If next hasn't changed and it isn't undefined, we want to check if it's
* been removed by a higher priority
*/
markToAnimate(key);
}
else {
/**
* If it hasn't changed, we add it to the list of protected values
* to ensure it doesn't get animated.
*/
typeState.protectedKeys[key] = true;
}
}
/**
* Update the typeState so next time animateChanges is called we can compare the
* latest prop and resolvedValues to these.
*/
typeState.prevProp = prop;
typeState.prevResolvedValues = resolvedValues;
/**
*
*/
if (typeState.isActive) {
encounteredKeys = { ...encounteredKeys, ...resolvedValues };
}
if (isInitialRender && visualElement.blockInitialAnimation) {
shouldAnimateType = false;
}
/**
* If this is an inherited prop we want to skip this animation
* unless the inherited variants haven't changed on this render.
*/
const willAnimateViaParent = isInherited && variantDidChange;
const needsAnimating = !willAnimateViaParent || handledRemovedValues;
if (shouldAnimateType && needsAnimating) {
animations.push(...definitionList.map((animation) => ({
animation: animation,
options: { type },
})));
}
}
/**
* If there are some removed value that haven't been dealt with,
* we need to create a new animation that falls back either to the value
* defined in the style prop, or the last read value.
*/
if (removedKeys.size) {
const fallbackAnimation = {};
removedKeys.forEach((key) => {
const fallbackTarget = visualElement.getBaseTarget(key);
const motionValue = visualElement.getValue(key);
if (motionValue)
motionValue.liveStyle = true;
// @ts-expect-error - @mattgperry to figure if we should do something here
fallbackAnimation[key] = fallbackTarget !== null && fallbackTarget !== void 0 ? fallbackTarget : null;
});
animations.push({ animation: fallbackAnimation });
}
let shouldAnimate = Boolean(animations.length);
if (isInitialRender &&
(props.initial === false || props.initial === props.animate) &&
!visualElement.manuallyAnimateOnMount) {
shouldAnimate = false;
}
isInitialRender = false;
return shouldAnimate ? animate(animations) : Promise.resolve();
}
/**
* Change whether a certain animation type is active.
*/
function setActive(type, isActive) {
var _a;
// If the active state hasn't changed, we can safely do nothing here
if (state[type].isActive === isActive)
return Promise.resolve();
// Propagate active change to children
(_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach((child) => { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); });
state[type].isActive = isActive;
const animations = animateChanges(type);
for (const key in state) {
state[key].protectedKeys = {};
}
return animations;
}
return {
animateChanges,
setActive,
setAnimateFunction,
getState: () => state,
reset: () => {
state = createState();
isInitialRender = true;
},
};
}
function checkVariantsDidChange(prev, next) {
if (typeof next === "string") {
return next !== prev;
}
else if (Array.isArray(next)) {
return !shallowCompare(next, prev);
}
return false;
}
function createTypeState(isActive = false) {
return {
isActive,
protectedKeys: {},
needsAnimating: {},
prevResolvedValues: {},
};
}
function createState() {
return {
animate: createTypeState(true),
whileInView: createTypeState(),
whileHover: createTypeState(),
whileTap: createTypeState(),
whileDrag: createTypeState(),
whileFocus: createTypeState(),
exit: createTypeState(),
};
}
export { checkVariantsDidChange, createAnimationState };

View File

@@ -0,0 +1,9 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
"use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/utils"),n=require("lexical"),r=require("react");function o(e,r){return t.mergeRegister(e.registerCommand(n.KEY_TAB_COMMAND,(r=>{const o=n.$getSelection();if(!n.$isRangeSelection(o))return!1;r.preventDefault();const i=function(e){const r=e.getNodes();if(t.$filter(r,(e=>n.$isBlockElementNode(e)&&e.canIndent()?e:null)).length>0)return!0;const o=e.anchor,i=e.focus,c=i.isBefore(o)?i:o,s=c.getNode(),l=t.$getNearestBlockElementAncestorOrThrow(s);if(l.canIndent()){const e=l.getKey();let t=n.$createRangeSelection();if(t.anchor.set(e,0,"element"),t.focus.set(e,0,"element"),t=n.$normalizeSelection__EXPERIMENTAL(t),t.anchor.is(c))return!0}return!1}(o)?r.shiftKey?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND;return e.dispatchCommand(i,void 0)}),n.COMMAND_PRIORITY_EDITOR),e.registerCommand(n.INDENT_CONTENT_COMMAND,(()=>{if(null==r)return!1;const e=n.$getSelection();if(!n.$isRangeSelection(e))return!1;const o=e.getNodes().map((e=>t.$getNearestBlockElementAncestorOrThrow(e).getIndent()));return Math.max(...o)+1>=r}),n.COMMAND_PRIORITY_CRITICAL))}exports.TabIndentationPlugin=function({maxIndent:t}){const[n]=e.useLexicalComposerContext();return r.useEffect((()=>o(n,t)),[n,t]),null},exports.registerTabIndentation=o;

View File

@@ -0,0 +1,39 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Florent Cailhol @ooflorent
*/
"use strict";
const ConstDependency = require("./ConstDependency");
const HarmonyExports = require("./HarmonyExports");
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */
/** @typedef {import("../javascript/JavascriptParser").Range} Range */
const PLUGIN_NAME = "HarmonyTopLevelThisParserPlugin";
class HarmonyTopLevelThisParserPlugin {
/**
* @param {JavascriptParser} parser the parser
* @returns {void}
*/
apply(parser) {
parser.hooks.expression.for("this").tap(PLUGIN_NAME, (node) => {
if (!parser.scope.topLevelScope) return;
if (HarmonyExports.isEnabled(parser.state)) {
const dep = new ConstDependency(
"undefined",
/** @type {Range} */ (node.range),
null
);
dep.loc = /** @type {DependencyLocation} */ (node.loc);
parser.state.module.addPresentationalDependency(dep);
return true;
}
});
}
}
module.exports = HarmonyTopLevelThisParserPlugin;

View File

@@ -0,0 +1 @@
export { _ as default } from "../esm/_class_private_field_destructure.js";

View File

@@ -0,0 +1,9 @@
import { consoleLoggingIntegrationShim, feedbackIntegrationShim, loggerShim, replayIntegrationShim } from '@sentry-internal/integration-shims';
export * from './index.bundle.base';
export { consoleLoggingIntegrationShim as consoleLoggingIntegration, loggerShim as logger };
export { getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, startNewTrace, withActiveSpan, getSpanDescendants, setMeasurement, } from '@sentry/core';
export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration';
export { setActiveSpanInBrowser } from './tracing/setActiveSpan';
export { reportPageLoaded } from './tracing/reportPageLoaded';
export { feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration, replayIntegrationShim as replayIntegration, };
//# sourceMappingURL=index.bundle.tracing.d.ts.map

View File

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

View File

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

View File

@@ -0,0 +1,10 @@
import { JSONSchema, SchemaType } from './types/JSONSchema';
/**
* Duck types a JSONSchema schema or property to determine which kind of AST node to parse it into.
*
* Due to what some might say is an oversight in the JSON-Schema spec, a given schema may
* implicitly be an *intersection* of multiple JSON-Schema directives (ie. multiple TypeScript
* types). The spec leaves it up to implementations to decide what to do with this
* loosely-defined behavior.
*/
export declare function typesOfSchema(schema: JSONSchema): Set<SchemaType>;

View File

@@ -0,0 +1,52 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const errors_js_1 = require("../util/errors.js");
const js_yaml_1 = __importDefault(require("js-yaml"));
const js_yaml_2 = require("js-yaml");
exports.default = {
/**
* The order that this parser will run, in relation to other parsers.
*/
order: 200,
/**
* Whether to allow "empty" files. This includes zero-byte files, as well as empty JSON objects.
*/
allowEmpty: true,
/**
* Determines whether this parser can parse a given file reference.
* Parsers that match will be tried, in order, until one successfully parses the file.
* Parsers that don't match will be skipped, UNLESS none of the parsers match, in which case
* every parser will be tried.
*/
canParse: [".yaml", ".yml", ".json"], // JSON is valid YAML
/**
* Parses the given file as YAML
*
* @param file - An object containing information about the referenced file
* @param file.url - The full URL of the referenced file
* @param file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.)
* @param file.data - The file contents. This will be whatever data type was returned by the resolver
* @returns
*/
async parse(file) {
let data = file.data;
if (Buffer.isBuffer(data)) {
data = data.toString();
}
if (typeof data === "string") {
try {
return js_yaml_1.default.load(data, { schema: js_yaml_2.JSON_SCHEMA });
}
catch (e) {
throw new errors_js_1.ParserError(e?.message || "Parser Error", file.url);
}
}
else {
// data is already a JavaScript value (object, array, number, null, NaN, etc.)
return data;
}
},
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../src/utils/misc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAM5D,UAAU,cAAc;IACtB,UAAU,CAAC,IAAI,MAAM,CAAC;CACvB;AAmBD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,MAAM,6BAAc,GAAG,MAAM,CAqBlD;AAMD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAcxD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAUvF;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAc3F;AAMD;;GAEG;AACH,UAAU,MAAM;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAYjD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,GAAE,MAAU,GAAG,IAAI,CAsBtG;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAcnE"}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"names":["transformFile","exports","filename","opts","callback","Error","transformFileSync","transformFileAsync","Promise","reject"],"sources":["../src/transform-file-browser.ts"],"sourcesContent":["/* c8 ignore start */\n\n// duplicated from transform-file so we do not have to import anything here\ntype TransformFile = {\n (filename: string, callback: (error: Error, file: null) => void): void;\n (\n filename: string,\n opts: any,\n callback: (error: Error, file: null) => void,\n ): void;\n};\n\nexport const transformFile: TransformFile = function transformFile(\n filename,\n opts,\n callback?: (error: Error, file: null) => void,\n) {\n if (typeof opts === \"function\") {\n callback = opts;\n }\n\n callback(new Error(\"Transforming files is not supported in browsers\"), null);\n};\n\nexport function transformFileSync(): never {\n throw new Error(\"Transforming files is not supported in browsers\");\n}\n\nexport function transformFileAsync() {\n return Promise.reject(\n new Error(\"Transforming files is not supported in browsers\"),\n );\n}\n"],"mappings":";;;;;;;;AAYO,MAAMA,aAA4B,GAAAC,OAAA,CAAAD,aAAA,GAAG,SAASA,aAAaA,CAChEE,QAAQ,EACRC,IAAI,EACJC,QAA6C,EAC7C;EACA,IAAI,OAAOD,IAAI,KAAK,UAAU,EAAE;IAC9BC,QAAQ,GAAGD,IAAI;EACjB;EAEAC,QAAQ,CAAC,IAAIC,KAAK,CAAC,iDAAiD,CAAC,EAAE,IAAI,CAAC;AAC9E,CAAC;AAEM,SAASC,iBAAiBA,CAAA,EAAU;EACzC,MAAM,IAAID,KAAK,CAAC,iDAAiD,CAAC;AACpE;AAEO,SAASE,kBAAkBA,CAAA,EAAG;EACnC,OAAOC,OAAO,CAACC,MAAM,CACnB,IAAIJ,KAAK,CAAC,iDAAiD,CAC7D,CAAC;AACH;AAAC","ignoreList":[]}

View File

@@ -0,0 +1,81 @@
import { Logger } from "./logger";
import { Options as UserOptions, SetCommitsOptions, RewriteSourcesHook, ResolveSourceMapHook, IncludeEntry, ModuleMetadata, ModuleMetadataCallback } from "./types";
export type NormalizedOptions = {
org: string | undefined;
project: string | string[] | undefined;
authToken: string | undefined;
url: string;
headers: Record<string, string> | undefined;
debug: boolean;
silent: boolean;
errorHandler: ((err: Error) => void) | undefined;
telemetry: boolean;
disable: boolean;
sourcemaps: {
disable?: boolean | "disable-upload";
assets?: string | string[];
ignore?: string | string[];
rewriteSources?: RewriteSourcesHook;
resolveSourceMap?: ResolveSourceMapHook;
filesToDeleteAfterUpload?: string | string[] | Promise<string | string[] | undefined>;
} | undefined;
release: {
name: string | undefined;
inject: boolean;
create: boolean;
finalize: boolean;
vcsRemote: string;
setCommits: (SetCommitsOptions & {
shouldNotThrowOnFailure?: boolean;
}) | false | undefined;
dist?: string;
deploy?: {
env: string;
started?: number | string;
finished?: number | string;
time?: number;
name?: string;
url?: string;
} | false;
uploadLegacySourcemaps?: string | IncludeEntry | Array<string | IncludeEntry>;
};
bundleSizeOptimizations: {
excludeDebugStatements?: boolean;
excludeTracing?: boolean;
excludeReplayCanvas?: boolean;
excludeReplayShadowDom?: boolean;
excludeReplayIframe?: boolean;
excludeReplayWorker?: boolean;
} | undefined;
reactComponentAnnotation: {
enabled?: boolean;
ignoredComponents?: string[];
_experimentalInjectIntoHtml?: boolean;
} | undefined;
_metaOptions: {
telemetry: {
metaFramework: string | undefined;
};
};
applicationKey: string | undefined;
moduleMetadata: ModuleMetadata | ModuleMetadataCallback | undefined;
_experiments: {
injectBuildInformation?: boolean;
} & Record<string, unknown>;
};
export declare const SENTRY_SAAS_URL = "https://sentry.io";
export declare function normalizeUserOptions(userOptions: UserOptions): NormalizedOptions;
/**
* Validates a few combinations of options that are not checked by Sentry CLI.
*
* For all other options, we can rely on Sentry CLI to validate them. In fact,
* we can't validate them in the plugin because Sentry CLI might pick up options from
* its config file.
*
* @param options the internal options
* @param logger the logger
*
* @returns `true` if the options are valid, `false` otherwise
*/
export declare function validateOptions(options: NormalizedOptions, logger: Logger): boolean;
//# sourceMappingURL=options-mapping.d.ts.map

View File

@@ -0,0 +1,27 @@
import { previousDay } from "./previousDay.mjs";
/**
* @name previousMonday
* @category Weekday Helpers
* @summary When is the previous Monday?
*
* @description
* When is the previous Monday?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to start counting from
*
* @returns The previous Monday
*
* @example
* // When is the previous Monday before Jun, 18, 2021?
* const result = previousMonday(new Date(2021, 5, 18))
* //=> Mon June 14 2021 00:00:00
*/
export function previousMonday(date) {
return previousDay(date, 1);
}
// Fallback for modularized imports:
export default previousMonday;

View File

@@ -0,0 +1 @@
{"version":3,"file":"envelope.js","sources":["../../../src/logs/envelope.ts"],"sourcesContent":["import type { DsnComponents } from '../types-hoist/dsn';\nimport type { LogContainerItem, LogEnvelope } from '../types-hoist/envelope';\nimport type { SerializedLog } from '../types-hoist/log';\nimport type { SdkMetadata } from '../types-hoist/sdkmetadata';\nimport { dsnToString } from '../utils/dsn';\nimport { createEnvelope } from '../utils/envelope';\n\n/**\n * Creates a log container envelope item for a list of logs.\n *\n * @param items - The logs to include in the envelope.\n * @returns The created log container envelope item.\n */\nexport function createLogContainerEnvelopeItem(items: Array<SerializedLog>): LogContainerItem {\n return [\n {\n type: 'log',\n item_count: items.length,\n content_type: 'application/vnd.sentry.items.log+json',\n },\n {\n items,\n },\n ];\n}\n\n/**\n * Creates an envelope for a list of logs.\n *\n * Logs from multiple traces can be included in the same envelope.\n *\n * @param logs - The logs to include in the envelope.\n * @param metadata - The metadata to include in the envelope.\n * @param tunnel - The tunnel to include in the envelope.\n * @param dsn - The DSN to include in the envelope.\n * @returns The created envelope.\n */\nexport function createLogEnvelope(\n logs: Array<SerializedLog>,\n metadata?: SdkMetadata,\n tunnel?: string,\n dsn?: DsnComponents,\n): LogEnvelope {\n const headers: LogEnvelope[0] = {};\n\n if (metadata?.sdk) {\n headers.sdk = {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n };\n }\n\n if (!!tunnel && !!dsn) {\n headers.dsn = dsnToString(dsn);\n }\n\n return createEnvelope<LogEnvelope>(headers, [createLogContainerEnvelopeItem(logs)]);\n}\n"],"names":[],"mappings":";;;AAOA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,8BAA8B,CAAC,KAAK,EAA0C;AAC9F,EAAE,OAAO;AACT,IAAI;AACJ,MAAM,IAAI,EAAE,KAAK;AACjB,MAAM,UAAU,EAAE,KAAK,CAAC,MAAM;AAC9B,MAAM,YAAY,EAAE,uCAAuC;AAC3D,KAAK;AACL,IAAI;AACJ,MAAM,KAAK;AACX,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB;AACjC,EAAE,IAAI;AACN,EAAE,QAAQ;AACV,EAAE,MAAM;AACR,EAAE,GAAG;AACL,EAAe;AACf,EAAE,MAAM,OAAO,GAAmB,EAAE;;AAEpC,EAAE,IAAI,QAAQ,EAAE,GAAG,EAAE;AACrB,IAAI,OAAO,CAAC,GAAA,GAAM;AAClB,MAAM,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI;AAC7B,MAAM,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;AACnC,KAAK;AACL,EAAE;;AAEF,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE;AACzB,IAAI,OAAO,CAAC,GAAA,GAAM,WAAW,CAAC,GAAG,CAAC;AAClC,EAAE;;AAEF,EAAE,OAAO,cAAc,CAAc,OAAO,EAAE,CAAC,8BAA8B,CAAC,IAAI,CAAC,CAAC,CAAC;AACrF;;;;"}

View File

@@ -0,0 +1,156 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Factory = require("enhanced-resolve").ResolverFactory;
const { HookMap, SyncHook, SyncWaterfallHook } = require("tapable");
const {
cachedCleverMerge,
removeOperations,
resolveByProperty
} = require("./util/cleverMerge");
/** @typedef {import("enhanced-resolve").ResolveOptions} ResolveOptions */
/** @typedef {import("enhanced-resolve").Resolver} Resolver */
/** @typedef {import("../declarations/WebpackOptions").ResolveOptions} WebpackResolveOptions */
/** @typedef {import("../declarations/WebpackOptions").ResolvePluginInstance} ResolvePluginInstance */
/** @typedef {WebpackResolveOptions & { dependencyType?: string, resolveToContext?: boolean }} ResolveOptionsWithDependencyType */
/**
* @typedef {object} WithOptions
* @property {(options: Partial<ResolveOptionsWithDependencyType>) => ResolverWithOptions} withOptions create a resolver with additional/different options
*/
/** @typedef {Resolver & WithOptions} ResolverWithOptions */
// need to be hoisted on module level for caching identity
/** @type {ResolveOptionsWithDependencyType} */
const EMPTY_RESOLVE_OPTIONS = {};
/**
* @param {ResolveOptionsWithDependencyType} resolveOptionsWithDepType enhanced options
* @returns {ResolveOptions} merged options
*/
const convertToResolveOptions = (resolveOptionsWithDepType) => {
const { dependencyType, plugins, ...remaining } = resolveOptionsWithDepType;
// check type compat
/** @type {Partial<ResolveOptionsWithDependencyType>} */
const partialOptions = {
...remaining,
plugins:
plugins &&
/** @type {ResolvePluginInstance[]} */ (
plugins.filter((item) => item !== "...")
)
};
if (!partialOptions.fileSystem) {
throw new Error(
"fileSystem is missing in resolveOptions, but it's required for enhanced-resolve"
);
}
// These weird types validate that we checked all non-optional properties
const options =
/** @type {Partial<ResolveOptionsWithDependencyType> & Pick<ResolveOptionsWithDependencyType, "fileSystem">} */ (
partialOptions
);
return /** @type {ResolveOptions} */ (
removeOperations(
resolveByProperty(options, "byDependency", dependencyType),
// Keep the `unsafeCache` because it can be a `Proxy`
["unsafeCache"]
)
);
};
/**
* @typedef {object} ResolverCache
* @property {WeakMap<ResolveOptionsWithDependencyType, ResolverWithOptions>} direct
* @property {Map<string, ResolverWithOptions>} stringified
*/
module.exports = class ResolverFactory {
constructor() {
this.hooks = Object.freeze({
/** @type {HookMap<SyncWaterfallHook<[ResolveOptionsWithDependencyType]>>} */
resolveOptions: new HookMap(
() => new SyncWaterfallHook(["resolveOptions"])
),
/** @type {HookMap<SyncHook<[Resolver, ResolveOptions, ResolveOptionsWithDependencyType]>>} */
resolver: new HookMap(
() => new SyncHook(["resolver", "resolveOptions", "userResolveOptions"])
)
});
/** @type {Map<string, ResolverCache>} */
this.cache = new Map();
}
/**
* @param {string} type type of resolver
* @param {ResolveOptionsWithDependencyType=} resolveOptions options
* @returns {ResolverWithOptions} the resolver
*/
get(type, resolveOptions = EMPTY_RESOLVE_OPTIONS) {
let typedCaches = this.cache.get(type);
if (!typedCaches) {
typedCaches = {
direct: new WeakMap(),
stringified: new Map()
};
this.cache.set(type, typedCaches);
}
const cachedResolver = typedCaches.direct.get(resolveOptions);
if (cachedResolver) {
return cachedResolver;
}
const ident = JSON.stringify(resolveOptions);
const resolver = typedCaches.stringified.get(ident);
if (resolver) {
typedCaches.direct.set(resolveOptions, resolver);
return resolver;
}
const newResolver = this._create(type, resolveOptions);
typedCaches.direct.set(resolveOptions, newResolver);
typedCaches.stringified.set(ident, newResolver);
return newResolver;
}
/**
* @param {string} type type of resolver
* @param {ResolveOptionsWithDependencyType} resolveOptionsWithDepType options
* @returns {ResolverWithOptions} the resolver
*/
_create(type, resolveOptionsWithDepType) {
/** @type {ResolveOptionsWithDependencyType} */
const originalResolveOptions = { ...resolveOptionsWithDepType };
const resolveOptions = convertToResolveOptions(
this.hooks.resolveOptions.for(type).call(resolveOptionsWithDepType)
);
const resolver = /** @type {ResolverWithOptions} */ (
Factory.createResolver(resolveOptions)
);
if (!resolver) {
throw new Error("No resolver created");
}
/** @type {WeakMap<Partial<ResolveOptionsWithDependencyType>, ResolverWithOptions>} */
const childCache = new WeakMap();
resolver.withOptions = (options) => {
const cacheEntry = childCache.get(options);
if (cacheEntry !== undefined) return cacheEntry;
const mergedOptions = cachedCleverMerge(originalResolveOptions, options);
const resolver = this.get(type, mergedOptions);
childCache.set(options, resolver);
return resolver;
};
this.hooks.resolver
.for(type)
.call(resolver, resolveOptions, originalResolveOptions);
return resolver;
}
};

View File

@@ -0,0 +1,21 @@
import crypto from 'crypto';
const algorithm = 'aes-256-ctr';
export function encrypt(text) {
const iv = crypto.randomBytes(16);
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
const secret = this.secret;
const cipher = crypto.createCipheriv(algorithm, secret, iv);
const encrypted = cipher.update(text, 'utf8', 'hex') + cipher.final('hex');
const ivString = iv.toString('hex');
return `${ivString}${encrypted}`;
}
export function decrypt(hash) {
const iv = hash.slice(0, 32);
const content = hash.slice(32);
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
const secret = this.secret;
const decipher = crypto.createDecipheriv(algorithm, secret, Buffer.from(iv, 'hex'));
return decipher.update(content, 'hex', 'utf8') + decipher.final('utf8');
}
//# sourceMappingURL=crypto.js.map

View File

@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const RockingChair = createLucideIcon("RockingChair", [
["polyline", { points: "3.5 2 6.5 12.5 18 12.5", key: "y3iy52" }],
["line", { x1: "9.5", x2: "5.5", y1: "12.5", y2: "20", key: "19vg5i" }],
["line", { x1: "15", x2: "18.5", y1: "12.5", y2: "20", key: "1inpmv" }],
["path", { d: "M2.75 18a13 13 0 0 0 18.5 0", key: "1nquas" }]
]);
export { RockingChair as default };
//# sourceMappingURL=rocking-chair.js.map

View File

@@ -0,0 +1,66 @@
import { normalizeInterval } from "./_lib/normalizeInterval.js";
import { add } from "./add.js";
import { differenceInDays } from "./differenceInDays.js";
import { differenceInHours } from "./differenceInHours.js";
import { differenceInMinutes } from "./differenceInMinutes.js";
import { differenceInMonths } from "./differenceInMonths.js";
import { differenceInSeconds } from "./differenceInSeconds.js";
import { differenceInYears } from "./differenceInYears.js";
/**
* The {@link intervalToDuration} function options.
*/
/**
* @name intervalToDuration
* @category Common Helpers
* @summary Convert interval to duration
*
* @description
* Convert an interval object to a duration object.
*
* @param interval - The interval to convert to duration
* @param options - The context options
*
* @returns The duration object
*
* @example
* // Get the duration between January 15, 1929 and April 4, 1968.
* intervalToDuration({
* start: new Date(1929, 0, 15, 12, 0, 0),
* end: new Date(1968, 3, 4, 19, 5, 0)
* });
* //=> { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 }
*/
export function intervalToDuration(interval, options) {
const { start, end } = normalizeInterval(options?.in, interval);
const duration = {};
const years = differenceInYears(end, start);
if (years) duration.years = years;
const remainingMonths = add(start, { years: duration.years });
const months = differenceInMonths(end, remainingMonths);
if (months) duration.months = months;
const remainingDays = add(remainingMonths, { months: duration.months });
const days = differenceInDays(end, remainingDays);
if (days) duration.days = days;
const remainingHours = add(remainingDays, { days: duration.days });
const hours = differenceInHours(end, remainingHours);
if (hours) duration.hours = hours;
const remainingMinutes = add(remainingHours, { hours: duration.hours });
const minutes = differenceInMinutes(end, remainingMinutes);
if (minutes) duration.minutes = minutes;
const remainingSeconds = add(remainingMinutes, { minutes: duration.minutes });
const seconds = differenceInSeconds(end, remainingSeconds);
if (seconds) duration.seconds = seconds;
return duration;
}
// Fallback for modularized imports:
export default intervalToDuration;

View File

@@ -0,0 +1,72 @@
import { useEffect, useMemo, useRef, useState } from 'react';
export const usePatchAnimateHeight = ({
containerRef,
contentRef,
duration,
open
}) => {
const browserSupportsKeywordAnimation = useMemo(() => typeof CSS !== 'undefined' && CSS && CSS.supports ? CSS.supports('interpolate-size', 'allow-keywords') : false, []);
const hasInitialized = useRef(false);
const previousOpenState = useRef(open);
const [isAnimating, setIsAnimating] = useState(false);
const resizeObserverRef = useRef(null);
useEffect(() => {
const container = containerRef.current;
const content = contentRef.current;
if (!container || !content || browserSupportsKeywordAnimation) {
return;
}
const setContainerHeight = height => {
container.style.height = height;
};
const handleTransitionEnd = () => {
if (container) {
container.style.transition = '';
container.style.height = open ? 'auto' : '0px';
setIsAnimating(false);
}
};
const animate = () => {
if (!hasInitialized.current && open) {
// Skip animation on first render
setContainerHeight('auto');
setIsAnimating(false);
return;
}
hasInitialized.current = true;
if (previousOpenState.current !== open) {
setContainerHeight(open ? '0px' : `${content.scrollHeight}px`);
}
// Trigger reflow
container.offsetHeight; // eslint-disable-line @typescript-eslint/no-unused-expressions
setIsAnimating(true);
container.style.transition = `height ${duration}ms ease`;
setContainerHeight(open ? `${content.scrollHeight}px` : '0px');
const onTransitionEnd = () => {
handleTransitionEnd();
container.removeEventListener('transitionend', onTransitionEnd);
};
container.addEventListener('transitionend', onTransitionEnd);
};
animate();
previousOpenState.current = open;
// Setup ResizeObserver
resizeObserverRef.current = new ResizeObserver(() => {
if (isAnimating) {
container.style.height = open ? `${content.scrollHeight}px` : '0px';
}
});
resizeObserverRef.current.observe(content);
return () => {
if (container) {
container.style.transition = '';
container.style.height = '';
}
resizeObserverRef.current?.disconnect();
};
}, [open, duration, containerRef, contentRef, browserSupportsKeywordAnimation]);
return {
browserSupportsKeywordAnimation
};
};
//# sourceMappingURL=usePatchAnimateHeight.js.map

View File

@@ -0,0 +1,66 @@
Prism.languages['excel-formula'] = {
'comment': {
pattern: /(\bN\(\s*)"(?:[^"]|"")*"(?=\s*\))/i,
lookbehind: true,
greedy: true
},
'string': {
pattern: /"(?:[^"]|"")*"(?!")/,
greedy: true
},
'reference': {
// https://www.ablebits.com/office-addins-blog/2015/12/08/excel-reference-another-sheet-workbook/
// Sales!B2
// 'Winter sales'!B2
// [Sales.xlsx]Jan!B2:B5
// D:\Reports\[Sales.xlsx]Jan!B2:B5
// '[Sales.xlsx]Jan sales'!B2:B5
// 'D:\Reports\[Sales.xlsx]Jan sales'!B2:B5
pattern: /(?:'[^']*'|(?:[^\s()[\]{}<>*?"';,$&]*\[[^^\s()[\]{}<>*?"']+\])?\w+)!/,
greedy: true,
alias: 'string',
inside: {
'operator': /!$/,
'punctuation': /'/,
'sheet': {
pattern: /[^[\]]+$/,
alias: 'function'
},
'file': {
pattern: /\[[^[\]]+\]$/,
inside: {
'punctuation': /[[\]]/
}
},
'path': /[\s\S]+/
}
},
'function-name': {
pattern: /\b[A-Z]\w*(?=\()/i,
alias: 'builtin'
},
'range': {
pattern: /\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/i,
alias: 'selector',
inside: {
'operator': /:/,
'cell': /\$?[A-Z]+\$?\d+/i,
'column': /\$?[A-Z]+/i,
'row': /\$?\d+/
}
},
'cell': {
// Excel is case insensitive, so the string "foo1" could be either a variable or a cell.
// To combat this, we match cells case insensitive, if the contain at least one "$", and case sensitive otherwise.
pattern: /\b[A-Z]+\d+\b|\$[A-Za-z]+\$?\d+\b|\b[A-Za-z]+\$\d+\b/,
alias: 'selector'
},
'number': /(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i,
'boolean': /\b(?:FALSE|TRUE)\b/i,
'operator': /[-+*/^%=&,]|<[=>]?|>=?/,
'punctuation': /[[\]();{}|]/
};
Prism.languages['xlsx'] = Prism.languages['xls'] = Prism.languages['excel-formula'];

View File

@@ -0,0 +1,2 @@
/** Conveniently represents flow's "Maybe" type https://flow.org/en/docs/types/maybe/ */
export declare type Maybe<T> = null | undefined | T;

View File

@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const MoveUp = createLucideIcon("MoveUp", [
["path", { d: "M8 6L12 2L16 6", key: "1yvkyx" }],
["path", { d: "M12 2V22", key: "r89rzk" }]
]);
export { MoveUp as default };
//# sourceMappingURL=move-up.js.map

View File

@@ -0,0 +1,190 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createCachedDescriptors = createCachedDescriptors;
exports.createDescriptor = createDescriptor;
exports.createUncachedDescriptors = createUncachedDescriptors;
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
var _functional = require("../gensync-utils/functional.js");
var _index = require("./files/index.js");
var _item = require("./item.js");
var _caching = require("./caching.js");
var _resolveTargets = require("./resolve-targets.js");
function isEqualDescriptor(a, b) {
var _a$file, _b$file, _a$file2, _b$file2;
return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && ((_a$file = a.file) == null ? void 0 : _a$file.request) === ((_b$file = b.file) == null ? void 0 : _b$file.request) && ((_a$file2 = a.file) == null ? void 0 : _a$file2.resolved) === ((_b$file2 = b.file) == null ? void 0 : _b$file2.resolved);
}
function* handlerOf(value) {
return value;
}
function optionsWithResolvedBrowserslistConfigFile(options, dirname) {
if (typeof options.browserslistConfigFile === "string") {
options.browserslistConfigFile = (0, _resolveTargets.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname);
}
return options;
}
function createCachedDescriptors(dirname, options, alias) {
const {
plugins,
presets,
passPerPreset
} = options;
return {
options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]),
presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([])
};
}
function createUncachedDescriptors(dirname, options, alias) {
return {
options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname, alias)),
presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset))
};
}
const PRESET_DESCRIPTOR_CACHE = new WeakMap();
const createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
const dirname = cache.using(dir => dir);
return (0, _caching.makeStrongCacheSync)(alias => (0, _caching.makeStrongCache)(function* (passPerPreset) {
const descriptors = yield* createPresetDescriptors(items, dirname, alias, passPerPreset);
return descriptors.map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
}));
});
const PLUGIN_DESCRIPTOR_CACHE = new WeakMap();
const createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
const dirname = cache.using(dir => dir);
return (0, _caching.makeStrongCache)(function* (alias) {
const descriptors = yield* createPluginDescriptors(items, dirname, alias);
return descriptors.map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
});
});
const DEFAULT_OPTIONS = {};
function loadCachedDescriptor(cache, desc) {
const {
value,
options = DEFAULT_OPTIONS
} = desc;
if (options === false) return desc;
let cacheByOptions = cache.get(value);
if (!cacheByOptions) {
cacheByOptions = new WeakMap();
cache.set(value, cacheByOptions);
}
let possibilities = cacheByOptions.get(options);
if (!possibilities) {
possibilities = [];
cacheByOptions.set(options, possibilities);
}
if (!possibilities.includes(desc)) {
const matches = possibilities.filter(possibility => isEqualDescriptor(possibility, desc));
if (matches.length > 0) {
return matches[0];
}
possibilities.push(desc);
}
return desc;
}
function* createPresetDescriptors(items, dirname, alias, passPerPreset) {
return yield* createDescriptors("preset", items, dirname, alias, passPerPreset);
}
function* createPluginDescriptors(items, dirname, alias) {
return yield* createDescriptors("plugin", items, dirname, alias);
}
function* createDescriptors(type, items, dirname, alias, ownPass) {
const descriptors = yield* _gensync().all(items.map((item, index) => createDescriptor(item, dirname, {
type,
alias: `${alias}$${index}`,
ownPass: !!ownPass
})));
assertNoDuplicates(descriptors);
return descriptors;
}
function* createDescriptor(pair, dirname, {
type,
alias,
ownPass
}) {
const desc = (0, _item.getItemDescriptor)(pair);
if (desc) {
return desc;
}
let name;
let options;
let value = pair;
if (Array.isArray(value)) {
if (value.length === 3) {
[value, options, name] = value;
} else {
[value, options] = value;
}
}
let file = undefined;
let filepath = null;
if (typeof value === "string") {
if (typeof type !== "string") {
throw new Error("To resolve a string-based item, the type of item must be given");
}
const resolver = type === "plugin" ? _index.loadPlugin : _index.loadPreset;
const request = value;
({
filepath,
value
} = yield* resolver(value, dirname));
file = {
request,
resolved: filepath
};
}
if (!value) {
throw new Error(`Unexpected falsy value: ${String(value)}`);
}
if (typeof value === "object" && value.__esModule) {
if (value.default) {
value = value.default;
} else {
throw new Error("Must export a default export when using ES6 modules.");
}
}
if (typeof value !== "object" && typeof value !== "function") {
throw new Error(`Unsupported format: ${typeof value}. Expected an object or a function.`);
}
if (filepath !== null && typeof value === "object" && value) {
throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`);
}
return {
name,
alias: filepath || alias,
value,
options,
dirname,
ownPass,
file
};
}
function assertNoDuplicates(items) {
const map = new Map();
for (const item of items) {
if (typeof item.value !== "function") continue;
let nameMap = map.get(item.value);
if (!nameMap) {
nameMap = new Set();
map.set(item.value, nameMap);
}
if (nameMap.has(item.name)) {
const conflicts = items.filter(i => i.value === item.value);
throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join("\n"));
}
nameMap.add(item.name);
}
}
0 && 0;
//# sourceMappingURL=config-descriptors.js.map

View File

@@ -0,0 +1,28 @@
import { formatDistance } from "./bs/_lib/formatDistance.js";
import { formatLong } from "./bs/_lib/formatLong.js";
import { formatRelative } from "./bs/_lib/formatRelative.js";
import { localize } from "./bs/_lib/localize.js";
import { match } from "./bs/_lib/match.js";
/**
* @category Locales
* @summary Bosnian locale.
* @language Bosnian
* @iso-639-2 bos
* @author Branislav Lazić [@branislavlazic](https://github.com/branislavlazic)
*/
export const bs = {
code: "bs",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
};
// Fallback for modularized imports:
export default bs;

View File

@@ -0,0 +1,8 @@
export type RowLabelProps = {
readonly className?: string;
readonly CustomComponent?: React.ReactNode;
readonly label?: React.ReactNode | string;
readonly path: string;
readonly rowNumber?: number;
};
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1,2 @@
import { findIndexFrom } from "../fp";
export = findIndexFrom;

View File

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

View File

@@ -0,0 +1,206 @@
"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 utils_exports = {};
__export(utils_exports, {
applyMixins: () => applyMixins,
getColumnNameAndConfig: () => getColumnNameAndConfig,
getTableColumns: () => getTableColumns,
getTableLikeName: () => getTableLikeName,
getViewSelectedFields: () => getViewSelectedFields,
haveSameKeys: () => haveSameKeys,
isConfig: () => isConfig,
mapResultRow: () => mapResultRow,
mapUpdateSet: () => mapUpdateSet,
orderSelectedFields: () => orderSelectedFields,
textDecoder: () => textDecoder
});
module.exports = __toCommonJS(utils_exports);
var import_column = require("./column.cjs");
var import_entity = require("./entity.cjs");
var import_sql = require("./sql/sql.cjs");
var import_subquery = require("./subquery.cjs");
var import_table = require("./table.cjs");
var import_view_common = require("./view-common.cjs");
function mapResultRow(columns, row, joinsNotNullableMap) {
const nullifyMap = {};
const result = columns.reduce(
(result2, { path, field }, columnIndex) => {
let decoder;
if ((0, import_entity.is)(field, import_column.Column)) {
decoder = field;
} else if ((0, import_entity.is)(field, import_sql.SQL)) {
decoder = field.decoder;
} else {
decoder = field.sql.decoder;
}
let node = result2;
for (const [pathChunkIndex, pathChunk] of path.entries()) {
if (pathChunkIndex < path.length - 1) {
if (!(pathChunk in node)) {
node[pathChunk] = {};
}
node = node[pathChunk];
} else {
const rawValue = row[columnIndex];
const value = node[pathChunk] = rawValue === null ? null : decoder.mapFromDriverValue(rawValue);
if (joinsNotNullableMap && (0, import_entity.is)(field, import_column.Column) && path.length === 2) {
const objectName = path[0];
if (!(objectName in nullifyMap)) {
nullifyMap[objectName] = value === null ? (0, import_table.getTableName)(field.table) : false;
} else if (typeof nullifyMap[objectName] === "string" && nullifyMap[objectName] !== (0, import_table.getTableName)(field.table)) {
nullifyMap[objectName] = false;
}
}
}
}
return result2;
},
{}
);
if (joinsNotNullableMap && Object.keys(nullifyMap).length > 0) {
for (const [objectName, tableName] of Object.entries(nullifyMap)) {
if (typeof tableName === "string" && !joinsNotNullableMap[tableName]) {
result[objectName] = null;
}
}
}
return result;
}
function orderSelectedFields(fields, pathPrefix) {
return Object.entries(fields).reduce((result, [name, field]) => {
if (typeof name !== "string") {
return result;
}
const newPath = pathPrefix ? [...pathPrefix, name] : [name];
if ((0, import_entity.is)(field, import_column.Column) || (0, import_entity.is)(field, import_sql.SQL) || (0, import_entity.is)(field, import_sql.SQL.Aliased)) {
result.push({ path: newPath, field });
} else if ((0, import_entity.is)(field, import_table.Table)) {
result.push(...orderSelectedFields(field[import_table.Table.Symbol.Columns], newPath));
} else {
result.push(...orderSelectedFields(field, newPath));
}
return result;
}, []);
}
function haveSameKeys(left, right) {
const leftKeys = Object.keys(left);
const rightKeys = Object.keys(right);
if (leftKeys.length !== rightKeys.length) {
return false;
}
for (const [index, key] of leftKeys.entries()) {
if (key !== rightKeys[index]) {
return false;
}
}
return true;
}
function mapUpdateSet(table, values) {
const entries = Object.entries(values).filter(([, value]) => value !== void 0).map(([key, value]) => {
if ((0, import_entity.is)(value, import_sql.SQL) || (0, import_entity.is)(value, import_column.Column)) {
return [key, value];
} else {
return [key, new import_sql.Param(value, table[import_table.Table.Symbol.Columns][key])];
}
});
if (entries.length === 0) {
throw new Error("No values to set");
}
return Object.fromEntries(entries);
}
function applyMixins(baseClass, extendedClasses) {
for (const extendedClass of extendedClasses) {
for (const name of Object.getOwnPropertyNames(extendedClass.prototype)) {
if (name === "constructor") continue;
Object.defineProperty(
baseClass.prototype,
name,
Object.getOwnPropertyDescriptor(extendedClass.prototype, name) || /* @__PURE__ */ Object.create(null)
);
}
}
}
function getTableColumns(table) {
return table[import_table.Table.Symbol.Columns];
}
function getViewSelectedFields(view) {
return view[import_view_common.ViewBaseConfig].selectedFields;
}
function getTableLikeName(table) {
return (0, import_entity.is)(table, import_subquery.Subquery) ? table._.alias : (0, import_entity.is)(table, import_sql.View) ? table[import_view_common.ViewBaseConfig].name : (0, import_entity.is)(table, import_sql.SQL) ? void 0 : table[import_table.Table.Symbol.IsAlias] ? table[import_table.Table.Symbol.Name] : table[import_table.Table.Symbol.BaseName];
}
function getColumnNameAndConfig(a, b) {
return {
name: typeof a === "string" && a.length > 0 ? a : "",
config: typeof a === "object" ? a : b
};
}
const _ = {};
const __ = {};
function isConfig(data) {
if (typeof data !== "object" || data === null) return false;
if (data.constructor.name !== "Object") return false;
if ("logger" in data) {
const type = typeof data["logger"];
if (type !== "boolean" && (type !== "object" || typeof data["logger"]["logQuery"] !== "function") && type !== "undefined") return false;
return true;
}
if ("schema" in data) {
const type = typeof data["schema"];
if (type !== "object" && type !== "undefined") return false;
return true;
}
if ("casing" in data) {
const type = typeof data["casing"];
if (type !== "string" && type !== "undefined") return false;
return true;
}
if ("mode" in data) {
if (data["mode"] !== "default" || data["mode"] !== "planetscale" || data["mode"] !== void 0) return false;
return true;
}
if ("connection" in data) {
const type = typeof data["connection"];
if (type !== "string" && type !== "object" && type !== "undefined") return false;
return true;
}
if ("client" in data) {
const type = typeof data["client"];
if (type !== "object" && type !== "function" && type !== "undefined") return false;
return true;
}
if (Object.keys(data).length === 0) return true;
return false;
}
const textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
applyMixins,
getColumnNameAndConfig,
getTableColumns,
getTableLikeName,
getViewSelectedFields,
haveSameKeys,
isConfig,
mapResultRow,
mapUpdateSet,
orderSelectedFields,
textDecoder
});
//# sourceMappingURL=utils.cjs.map

View File

@@ -0,0 +1,7 @@
/**
* Insert a given element as the first child of a parent element.
*
* @param node the element to prepend
* @param parent the parent element
*/
export default function prepend(node: Element | null, parent: Element | null): Element | null;

View File

@@ -0,0 +1 @@
"use strict";const a=new Set(["Custom ESM Loaders is an experimental feature. This feature could change at any time","Custom ESM Loaders is an experimental feature and might change at any time","Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js."]),{emit:n}=process;process.emit=function(e,t){if(!(e==="warning"&&a.has(t.message)))return Reflect.apply(n,this,arguments)};

View File

@@ -0,0 +1,91 @@
"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 driver_exports = {};
__export(driver_exports, {
BunSQLiteDatabase: () => BunSQLiteDatabase,
drizzle: () => drizzle
});
module.exports = __toCommonJS(driver_exports);
var import_bun_sqlite = require("bun:sqlite");
var import_entity = require("../entity.cjs");
var import_logger = require("../logger.cjs");
var import_relations = require("../relations.cjs");
var import_db = require("../sqlite-core/db.cjs");
var import_dialect = require("../sqlite-core/dialect.cjs");
var import_utils = require("../utils.cjs");
var import_session = require("./session.cjs");
class BunSQLiteDatabase extends import_db.BaseSQLiteDatabase {
static [import_entity.entityKind] = "BunSQLiteDatabase";
}
function construct(client, config = {}) {
const dialect = new import_dialect.SQLiteSyncDialect({ casing: config.casing });
let logger;
if (config.logger === true) {
logger = new import_logger.DefaultLogger();
} else if (config.logger !== false) {
logger = config.logger;
}
let schema;
if (config.schema) {
const tablesConfig = (0, import_relations.extractTablesRelationalConfig)(
config.schema,
import_relations.createTableRelationsHelpers
);
schema = {
fullSchema: config.schema,
schema: tablesConfig.tables,
tableNamesMap: tablesConfig.tableNamesMap
};
}
const session = new import_session.SQLiteBunSession(client, dialect, schema, { logger });
const db = new BunSQLiteDatabase("sync", dialect, session, schema);
db.$client = client;
return db;
}
function drizzle(...params) {
if (params[0] === void 0 || typeof params[0] === "string") {
const instance = params[0] === void 0 ? new import_bun_sqlite.Database() : new import_bun_sqlite.Database(params[0]);
return construct(instance, params[1]);
}
if ((0, import_utils.isConfig)(params[0])) {
const { connection, client, ...drizzleConfig } = params[0];
if (client) return construct(client, drizzleConfig);
if (typeof connection === "object") {
const { source, ...opts } = connection;
const options = Object.values(opts).filter((v) => v !== void 0).length ? opts : void 0;
const instance2 = new import_bun_sqlite.Database(source, options);
return construct(instance2, drizzleConfig);
}
const instance = new import_bun_sqlite.Database(connection);
return construct(instance, drizzleConfig);
}
return construct(params[0], params[1]);
}
((drizzle2) => {
function mock(config) {
return construct({}, config);
}
drizzle2.mock = mock;
})(drizzle || (drizzle = {}));
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
BunSQLiteDatabase,
drizzle
});
//# sourceMappingURL=driver.cjs.map

View File

@@ -0,0 +1,41 @@
import { status as httpStatus } from 'http-status';
import { getRequestCollection } from '../../utilities/getRequestEntity.js';
import { headersWithCors } from '../../utilities/headersWithCors.js';
import { generatePayloadCookie } from '../cookies.js';
import { resetPasswordOperation } from '../operations/resetPassword.js';
export const resetPasswordHandler = async (req)=>{
const collection = getRequestCollection(req);
const { searchParams, t } = req;
const depth = searchParams.get('depth');
const result = await resetPasswordOperation({
collection,
data: {
password: typeof req.data?.password === 'string' ? req.data.password : '',
token: typeof req.data?.token === 'string' ? req.data.token : ''
},
depth: depth ? Number(depth) : undefined,
req
});
const cookie = generatePayloadCookie({
collectionAuthConfig: collection.config.auth,
cookiePrefix: req.payload.config.cookiePrefix,
token: result.token
});
if (collection.config.auth.removeTokenFromResponses) {
delete result.token;
}
return Response.json({
message: t('authentication:passwordResetSuccessfully'),
...result
}, {
headers: headersWithCors({
headers: new Headers({
'Set-Cookie': cookie
}),
req
}),
status: httpStatus.OK
});
};
//# sourceMappingURL=resetPassword.js.map

View File

@@ -0,0 +1,12 @@
import type { Client, Scope, SerializedTraceData, Span } from '@sentry/core';
/**
* Otel-specific implementation of `getTraceData`.
* @see `@sentry/core` version of `getTraceData` for more information
*/
export declare function getTraceData({ span, scope, client, propagateTraceparent, }?: {
span?: Span;
scope?: Scope;
client?: Client;
propagateTraceparent?: boolean;
}): SerializedTraceData;
//# sourceMappingURL=getTraceData.d.ts.map

View File

@@ -0,0 +1,69 @@
"use strict";
exports.formatRelative = void 0;
var _index = require("../../../isSameWeek.cjs");
const weekdays = [
"domenica",
"lunedì",
"martedì",
"mercoledì",
"giovedì",
"venerdì",
"sabato",
];
function lastWeek(day) {
switch (day) {
case 0:
return "'domenica scorsa alle' p";
default:
return "'" + weekdays[day] + " scorso alle' p";
}
}
function thisWeek(day) {
return "'" + weekdays[day] + " alle' p";
}
function nextWeek(day) {
switch (day) {
case 0:
return "'domenica prossima alle' p";
default:
return "'" + weekdays[day] + " prossimo alle' p";
}
}
const formatRelativeLocale = {
lastWeek: (date, baseDate, options) => {
const day = date.getDay();
if ((0, _index.isSameWeek)(date, baseDate, options)) {
return thisWeek(day);
} else {
return lastWeek(day);
}
},
yesterday: "'ieri alle' p",
today: "'oggi alle' p",
tomorrow: "'domani alle' p",
nextWeek: (date, baseDate, options) => {
const day = date.getDay();
if ((0, _index.isSameWeek)(date, baseDate, options)) {
return thisWeek(day);
} else {
return nextWeek(day);
}
},
other: "P",
};
const formatRelative = (token, date, baseDate, options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date, baseDate, options);
}
return format;
};
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,660 @@
export type Platform = 'browser' | 'node' | 'neutral'
export type Format = 'iife' | 'cjs' | 'esm'
export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx'
export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent'
export type Charset = 'ascii' | 'utf8'
export type Drop = 'console' | 'debugger'
interface CommonOptions {
/** Documentation: https://esbuild.github.io/api/#sourcemap */
sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both'
/** Documentation: https://esbuild.github.io/api/#legal-comments */
legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external'
/** Documentation: https://esbuild.github.io/api/#source-root */
sourceRoot?: string
/** Documentation: https://esbuild.github.io/api/#sources-content */
sourcesContent?: boolean
/** Documentation: https://esbuild.github.io/api/#format */
format?: Format
/** Documentation: https://esbuild.github.io/api/#global-name */
globalName?: string
/** Documentation: https://esbuild.github.io/api/#target */
target?: string | string[]
/** Documentation: https://esbuild.github.io/api/#supported */
supported?: Record<string, boolean>
/** Documentation: https://esbuild.github.io/api/#platform */
platform?: Platform
/** Documentation: https://esbuild.github.io/api/#mangle-props */
mangleProps?: RegExp
/** Documentation: https://esbuild.github.io/api/#mangle-props */
reserveProps?: RegExp
/** Documentation: https://esbuild.github.io/api/#mangle-props */
mangleQuoted?: boolean
/** Documentation: https://esbuild.github.io/api/#mangle-props */
mangleCache?: Record<string, string | false>
/** Documentation: https://esbuild.github.io/api/#drop */
drop?: Drop[]
/** Documentation: https://esbuild.github.io/api/#drop-labels */
dropLabels?: string[]
/** Documentation: https://esbuild.github.io/api/#minify */
minify?: boolean
/** Documentation: https://esbuild.github.io/api/#minify */
minifyWhitespace?: boolean
/** Documentation: https://esbuild.github.io/api/#minify */
minifyIdentifiers?: boolean
/** Documentation: https://esbuild.github.io/api/#minify */
minifySyntax?: boolean
/** Documentation: https://esbuild.github.io/api/#line-limit */
lineLimit?: number
/** Documentation: https://esbuild.github.io/api/#charset */
charset?: Charset
/** Documentation: https://esbuild.github.io/api/#tree-shaking */
treeShaking?: boolean
/** Documentation: https://esbuild.github.io/api/#ignore-annotations */
ignoreAnnotations?: boolean
/** Documentation: https://esbuild.github.io/api/#jsx */
jsx?: 'transform' | 'preserve' | 'automatic'
/** Documentation: https://esbuild.github.io/api/#jsx-factory */
jsxFactory?: string
/** Documentation: https://esbuild.github.io/api/#jsx-fragment */
jsxFragment?: string
/** Documentation: https://esbuild.github.io/api/#jsx-import-source */
jsxImportSource?: string
/** Documentation: https://esbuild.github.io/api/#jsx-development */
jsxDev?: boolean
/** Documentation: https://esbuild.github.io/api/#jsx-side-effects */
jsxSideEffects?: boolean
/** Documentation: https://esbuild.github.io/api/#define */
define?: { [key: string]: string }
/** Documentation: https://esbuild.github.io/api/#pure */
pure?: string[]
/** Documentation: https://esbuild.github.io/api/#keep-names */
keepNames?: boolean
/** Documentation: https://esbuild.github.io/api/#color */
color?: boolean
/** Documentation: https://esbuild.github.io/api/#log-level */
logLevel?: LogLevel
/** Documentation: https://esbuild.github.io/api/#log-limit */
logLimit?: number
/** Documentation: https://esbuild.github.io/api/#log-override */
logOverride?: Record<string, LogLevel>
/** Documentation: https://esbuild.github.io/api/#tsconfig-raw */
tsconfigRaw?: string | TsconfigRaw
}
export interface TsconfigRaw {
compilerOptions?: {
alwaysStrict?: boolean
baseUrl?: boolean
experimentalDecorators?: boolean
importsNotUsedAsValues?: 'remove' | 'preserve' | 'error'
jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev'
jsxFactory?: string
jsxFragmentFactory?: string
jsxImportSource?: string
paths?: Record<string, string[]>
preserveValueImports?: boolean
strict?: boolean
target?: string
useDefineForClassFields?: boolean
verbatimModuleSyntax?: boolean
}
}
export interface BuildOptions extends CommonOptions {
/** Documentation: https://esbuild.github.io/api/#bundle */
bundle?: boolean
/** Documentation: https://esbuild.github.io/api/#splitting */
splitting?: boolean
/** Documentation: https://esbuild.github.io/api/#preserve-symlinks */
preserveSymlinks?: boolean
/** Documentation: https://esbuild.github.io/api/#outfile */
outfile?: string
/** Documentation: https://esbuild.github.io/api/#metafile */
metafile?: boolean
/** Documentation: https://esbuild.github.io/api/#outdir */
outdir?: string
/** Documentation: https://esbuild.github.io/api/#outbase */
outbase?: string
/** Documentation: https://esbuild.github.io/api/#external */
external?: string[]
/** Documentation: https://esbuild.github.io/api/#packages */
packages?: 'external'
/** Documentation: https://esbuild.github.io/api/#alias */
alias?: Record<string, string>
/** Documentation: https://esbuild.github.io/api/#loader */
loader?: { [ext: string]: Loader }
/** Documentation: https://esbuild.github.io/api/#resolve-extensions */
resolveExtensions?: string[]
/** Documentation: https://esbuild.github.io/api/#main-fields */
mainFields?: string[]
/** Documentation: https://esbuild.github.io/api/#conditions */
conditions?: string[]
/** Documentation: https://esbuild.github.io/api/#write */
write?: boolean
/** Documentation: https://esbuild.github.io/api/#allow-overwrite */
allowOverwrite?: boolean
/** Documentation: https://esbuild.github.io/api/#tsconfig */
tsconfig?: string
/** Documentation: https://esbuild.github.io/api/#out-extension */
outExtension?: { [ext: string]: string }
/** Documentation: https://esbuild.github.io/api/#public-path */
publicPath?: string
/** Documentation: https://esbuild.github.io/api/#entry-names */
entryNames?: string
/** Documentation: https://esbuild.github.io/api/#chunk-names */
chunkNames?: string
/** Documentation: https://esbuild.github.io/api/#asset-names */
assetNames?: string
/** Documentation: https://esbuild.github.io/api/#inject */
inject?: string[]
/** Documentation: https://esbuild.github.io/api/#banner */
banner?: { [type: string]: string }
/** Documentation: https://esbuild.github.io/api/#footer */
footer?: { [type: string]: string }
/** Documentation: https://esbuild.github.io/api/#entry-points */
entryPoints?: string[] | Record<string, string> | { in: string, out: string }[]
/** Documentation: https://esbuild.github.io/api/#stdin */
stdin?: StdinOptions
/** Documentation: https://esbuild.github.io/plugins/ */
plugins?: Plugin[]
/** Documentation: https://esbuild.github.io/api/#working-directory */
absWorkingDir?: string
/** Documentation: https://esbuild.github.io/api/#node-paths */
nodePaths?: string[]; // The "NODE_PATH" variable from Node.js
}
export interface StdinOptions {
contents: string | Uint8Array
resolveDir?: string
sourcefile?: string
loader?: Loader
}
export interface Message {
id: string
pluginName: string
text: string
location: Location | null
notes: Note[]
/**
* Optional user-specified data that is passed through unmodified. You can
* use this to stash the original error, for example.
*/
detail: any
}
export interface Note {
text: string
location: Location | null
}
export interface Location {
file: string
namespace: string
/** 1-based */
line: number
/** 0-based, in bytes */
column: number
/** in bytes */
length: number
lineText: string
suggestion: string
}
export interface OutputFile {
path: string
contents: Uint8Array
hash: string
/** "contents" as text (changes automatically with "contents") */
readonly text: string
}
export interface BuildResult<ProvidedOptions extends BuildOptions = BuildOptions> {
errors: Message[]
warnings: Message[]
/** Only when "write: false" */
outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined)
/** Only when "metafile: true" */
metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined)
/** Only when "mangleCache" is present */
mangleCache: Record<string, string | false> | (ProvidedOptions['mangleCache'] extends Object ? never : undefined)
}
export interface BuildFailure extends Error {
errors: Message[]
warnings: Message[]
}
/** Documentation: https://esbuild.github.io/api/#serve-arguments */
export interface ServeOptions {
port?: number
host?: string
servedir?: string
keyfile?: string
certfile?: string
fallback?: string
onRequest?: (args: ServeOnRequestArgs) => void
}
export interface ServeOnRequestArgs {
remoteAddress: string
method: string
path: string
status: number
/** The time to generate the response, not to send it */
timeInMS: number
}
/** Documentation: https://esbuild.github.io/api/#serve-return-values */
export interface ServeResult {
port: number
host: string
}
export interface TransformOptions extends CommonOptions {
/** Documentation: https://esbuild.github.io/api/#sourcefile */
sourcefile?: string
/** Documentation: https://esbuild.github.io/api/#loader */
loader?: Loader
/** Documentation: https://esbuild.github.io/api/#banner */
banner?: string
/** Documentation: https://esbuild.github.io/api/#footer */
footer?: string
}
export interface TransformResult<ProvidedOptions extends TransformOptions = TransformOptions> {
code: string
map: string
warnings: Message[]
/** Only when "mangleCache" is present */
mangleCache: Record<string, string | false> | (ProvidedOptions['mangleCache'] extends Object ? never : undefined)
/** Only when "legalComments" is "external" */
legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined)
}
export interface TransformFailure extends Error {
errors: Message[]
warnings: Message[]
}
export interface Plugin {
name: string
setup: (build: PluginBuild) => (void | Promise<void>)
}
export interface PluginBuild {
/** Documentation: https://esbuild.github.io/plugins/#build-options */
initialOptions: BuildOptions
/** Documentation: https://esbuild.github.io/plugins/#resolve */
resolve(path: string, options?: ResolveOptions): Promise<ResolveResult>
/** Documentation: https://esbuild.github.io/plugins/#on-start */
onStart(callback: () =>
(OnStartResult | null | void | Promise<OnStartResult | null | void>)): void
/** Documentation: https://esbuild.github.io/plugins/#on-end */
onEnd(callback: (result: BuildResult) =>
(OnEndResult | null | void | Promise<OnEndResult | null | void>)): void
/** Documentation: https://esbuild.github.io/plugins/#on-resolve */
onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) =>
(OnResolveResult | null | undefined | Promise<OnResolveResult | null | undefined>)): void
/** Documentation: https://esbuild.github.io/plugins/#on-load */
onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) =>
(OnLoadResult | null | undefined | Promise<OnLoadResult | null | undefined>)): void
/** Documentation: https://esbuild.github.io/plugins/#on-dispose */
onDispose(callback: () => void): void
// This is a full copy of the esbuild library in case you need it
esbuild: {
context: typeof context,
build: typeof build,
buildSync: typeof buildSync,
transform: typeof transform,
transformSync: typeof transformSync,
formatMessages: typeof formatMessages,
formatMessagesSync: typeof formatMessagesSync,
analyzeMetafile: typeof analyzeMetafile,
analyzeMetafileSync: typeof analyzeMetafileSync,
initialize: typeof initialize,
version: typeof version,
}
}
/** Documentation: https://esbuild.github.io/plugins/#resolve-options */
export interface ResolveOptions {
pluginName?: string
importer?: string
namespace?: string
resolveDir?: string
kind?: ImportKind
pluginData?: any
}
/** Documentation: https://esbuild.github.io/plugins/#resolve-results */
export interface ResolveResult {
errors: Message[]
warnings: Message[]
path: string
external: boolean
sideEffects: boolean
namespace: string
suffix: string
pluginData: any
}
export interface OnStartResult {
errors?: PartialMessage[]
warnings?: PartialMessage[]
}
export interface OnEndResult {
errors?: PartialMessage[]
warnings?: PartialMessage[]
}
/** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */
export interface OnResolveOptions {
filter: RegExp
namespace?: string
}
/** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */
export interface OnResolveArgs {
path: string
importer: string
namespace: string
resolveDir: string
kind: ImportKind
pluginData: any
}
export type ImportKind =
| 'entry-point'
// JS
| 'import-statement'
| 'require-call'
| 'dynamic-import'
| 'require-resolve'
// CSS
| 'import-rule'
| 'composes-from'
| 'url-token'
/** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */
export interface OnResolveResult {
pluginName?: string
errors?: PartialMessage[]
warnings?: PartialMessage[]
path?: string
external?: boolean
sideEffects?: boolean
namespace?: string
suffix?: string
pluginData?: any
watchFiles?: string[]
watchDirs?: string[]
}
/** Documentation: https://esbuild.github.io/plugins/#on-load-options */
export interface OnLoadOptions {
filter: RegExp
namespace?: string
}
/** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */
export interface OnLoadArgs {
path: string
namespace: string
suffix: string
pluginData: any
}
/** Documentation: https://esbuild.github.io/plugins/#on-load-results */
export interface OnLoadResult {
pluginName?: string
errors?: PartialMessage[]
warnings?: PartialMessage[]
contents?: string | Uint8Array
resolveDir?: string
loader?: Loader
pluginData?: any
watchFiles?: string[]
watchDirs?: string[]
}
export interface PartialMessage {
id?: string
pluginName?: string
text?: string
location?: Partial<Location> | null
notes?: PartialNote[]
detail?: any
}
export interface PartialNote {
text?: string
location?: Partial<Location> | null
}
/** Documentation: https://esbuild.github.io/api/#metafile */
export interface Metafile {
inputs: {
[path: string]: {
bytes: number
imports: {
path: string
kind: ImportKind
external?: boolean
original?: string
}[]
format?: 'cjs' | 'esm'
}
}
outputs: {
[path: string]: {
bytes: number
inputs: {
[path: string]: {
bytesInOutput: number
}
}
imports: {
path: string
kind: ImportKind | 'file-loader'
external?: boolean
}[]
exports: string[]
entryPoint?: string
cssBundle?: string
}
}
}
export interface FormatMessagesOptions {
kind: 'error' | 'warning'
color?: boolean
terminalWidth?: number
}
export interface AnalyzeMetafileOptions {
color?: boolean
verbose?: boolean
}
export interface WatchOptions {
}
export interface BuildContext<ProvidedOptions extends BuildOptions = BuildOptions> {
/** Documentation: https://esbuild.github.io/api/#rebuild */
rebuild(): Promise<BuildResult<ProvidedOptions>>
/** Documentation: https://esbuild.github.io/api/#watch */
watch(options?: WatchOptions): Promise<void>
/** Documentation: https://esbuild.github.io/api/#serve */
serve(options?: ServeOptions): Promise<ServeResult>
cancel(): Promise<void>
dispose(): Promise<void>
}
// This is a TypeScript type-level function which replaces any keys in "In"
// that aren't in "Out" with "never". We use this to reject properties with
// typos in object literals. See: https://stackoverflow.com/questions/49580725
type SameShape<Out, In extends Out> = In & { [Key in Exclude<keyof In, keyof Out>]: never }
/**
* This function invokes the "esbuild" command-line tool for you. It returns a
* promise that either resolves with a "BuildResult" object or rejects with a
* "BuildFailure" object.
*
* - Works in node: yes
* - Works in browser: yes
*
* Documentation: https://esbuild.github.io/api/#build
*/
export declare function build<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildResult<T>>
/**
* This is the advanced long-running form of "build" that supports additional
* features such as watch mode and a local development server.
*
* - Works in node: yes
* - Works in browser: no
*
* Documentation: https://esbuild.github.io/api/#build
*/
export declare function context<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildContext<T>>
/**
* This function transforms a single JavaScript file. It can be used to minify
* JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript
* to older JavaScript. It returns a promise that is either resolved with a
* "TransformResult" object or rejected with a "TransformFailure" object.
*
* - Works in node: yes
* - Works in browser: yes
*
* Documentation: https://esbuild.github.io/api/#transform
*/
export declare function transform<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): Promise<TransformResult<T>>
/**
* Converts log messages to formatted message strings suitable for printing in
* the terminal. This allows you to reuse the built-in behavior of esbuild's
* log message formatter. This is a batch-oriented API for efficiency.
*
* - Works in node: yes
* - Works in browser: yes
*/
export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise<string[]>
/**
* Pretty-prints an analysis of the metafile JSON to a string. This is just for
* convenience to be able to match esbuild's pretty-printing exactly. If you want
* to customize it, you can just inspect the data in the metafile yourself.
*
* - Works in node: yes
* - Works in browser: yes
*
* Documentation: https://esbuild.github.io/api/#analyze
*/
export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise<string>
/**
* A synchronous version of "build".
*
* - Works in node: yes
* - Works in browser: no
*
* Documentation: https://esbuild.github.io/api/#build
*/
export declare function buildSync<T extends BuildOptions>(options: SameShape<BuildOptions, T>): BuildResult<T>
/**
* A synchronous version of "transform".
*
* - Works in node: yes
* - Works in browser: no
*
* Documentation: https://esbuild.github.io/api/#transform
*/
export declare function transformSync<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): TransformResult<T>
/**
* A synchronous version of "formatMessages".
*
* - Works in node: yes
* - Works in browser: no
*/
export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[]
/**
* A synchronous version of "analyzeMetafile".
*
* - Works in node: yes
* - Works in browser: no
*
* Documentation: https://esbuild.github.io/api/#analyze
*/
export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string
/**
* This configures the browser-based version of esbuild. It is necessary to
* call this first and wait for the returned promise to be resolved before
* making other API calls when using esbuild in the browser.
*
* - Works in node: yes
* - Works in browser: yes ("options" is required)
*
* Documentation: https://esbuild.github.io/api/#browser
*/
export declare function initialize(options: InitializeOptions): Promise<void>
export interface InitializeOptions {
/**
* The URL of the "esbuild.wasm" file. This must be provided when running
* esbuild in the browser.
*/
wasmURL?: string | URL
/**
* The result of calling "new WebAssembly.Module(buffer)" where "buffer"
* is a typed array or ArrayBuffer containing the binary code of the
* "esbuild.wasm" file.
*
* You can use this as an alternative to "wasmURL" for environments where it's
* not possible to download the WebAssembly module.
*/
wasmModule?: WebAssembly.Module
/**
* By default esbuild runs the WebAssembly-based browser API in a web worker
* to avoid blocking the UI thread. This can be disabled by setting "worker"
* to false.
*/
worker?: boolean
}
export let version: string

View File

@@ -0,0 +1,168 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.cjs");
const eraValues = {
narrow: ["P", "M"],
abbreviated: ["PK", "MK"],
wide: ["Para Krishtit", "Mbas Krishtit"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["4-mujori I", "4-mujori II", "4-mujori III", "4-mujori IV"],
};
// 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: ["J", "S", "M", "P", "M", "Q", "K", "G", "S", "T", "N", "D"],
abbreviated: [
"Jan",
"Shk",
"Mar",
"Pri",
"Maj",
"Qer",
"Kor",
"Gus",
"Sht",
"Tet",
"Nën",
"Dhj",
],
wide: [
"Janar",
"Shkurt",
"Mars",
"Prill",
"Maj",
"Qershor",
"Korrik",
"Gusht",
"Shtator",
"Tetor",
"Nëntor",
"Dhjetor",
],
};
const dayValues = {
narrow: ["D", "H", "M", "M", "E", "P", "S"],
short: ["Di", "Hë", "Ma", "Më", "En", "Pr", "Sh"],
abbreviated: ["Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Sht"],
wide: ["Dielë", "Hënë", "Martë", "Mërkurë", "Enjte", "Premte", "Shtunë"],
};
const dayPeriodValues = {
narrow: {
am: "p",
pm: "m",
midnight: "m",
noon: "d",
morning: "mëngjes",
afternoon: "dite",
evening: "mbrëmje",
night: "natë",
},
abbreviated: {
am: "PD",
pm: "MD",
midnight: "mesnëtë",
noon: "drek",
morning: "mëngjes",
afternoon: "mbasdite",
evening: "mbrëmje",
night: "natë",
},
wide: {
am: "p.d.",
pm: "m.d.",
midnight: "mesnëtë",
noon: "drek",
morning: "mëngjes",
afternoon: "mbasdite",
evening: "mbrëmje",
night: "natë",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "p",
pm: "m",
midnight: "m",
noon: "d",
morning: "në mëngjes",
afternoon: "në mbasdite",
evening: "në mbrëmje",
night: "në mesnatë",
},
abbreviated: {
am: "PD",
pm: "MD",
midnight: "mesnatë",
noon: "drek",
morning: "në mëngjes",
afternoon: "në mbasdite",
evening: "në mbrëmje",
night: "në mesnatë",
},
wide: {
am: "p.d.",
pm: "m.d.",
midnight: "mesnatë",
noon: "drek",
morning: "në mëngjes",
afternoon: "në mbasdite",
evening: "në mbrëmje",
night: "në mesnatë",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
if (options?.unit === "hour") return String(number);
if (number === 1) return number + "-rë";
if (number === 4) return number + "t";
return number + "-të";
};
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",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1,177 @@
import type { WithCacheConfig } from "../../cache/core/types.js";
import { entityKind } from "../../entity.js";
import type { PgDialect } from "../dialect.js";
import type { IndexColumn } from "../indexes.js";
import type { PgPreparedQuery, PgQueryResultHKT, PgQueryResultKind, PgSession, PreparedQueryConfig } from "../session.js";
import type { PgTable, TableConfig } from "../table.js";
import type { TypedQueryBuilder } from "../../query-builders/query-builder.js";
import type { SelectResultFields } from "../../query-builders/select.types.js";
import { QueryPromise } from "../../query-promise.js";
import type { RunnableQuery } from "../../runnable-query.js";
import type { ColumnsSelection, Placeholder, Query, SQLWrapper } from "../../sql/sql.js";
import { Param, SQL } from "../../sql/sql.js";
import type { Subquery } from "../../subquery.js";
import type { InferInsertModel } from "../../table.js";
import type { AnyPgColumn } from "../columns/common.js";
import { QueryBuilder } from "./query-builder.js";
import type { SelectedFieldsFlat, SelectedFieldsOrdered } from "./select.types.js";
import type { PgUpdateSetSource } from "./update.js";
export interface PgInsertConfig<TTable extends PgTable = PgTable> {
table: TTable;
values: Record<string, Param | SQL>[] | PgInsertSelectQueryBuilder<TTable> | SQL;
withList?: Subquery[];
onConflict?: SQL;
returningFields?: SelectedFieldsFlat;
returning?: SelectedFieldsOrdered;
select?: boolean;
overridingSystemValue_?: boolean;
}
export type PgInsertValue<TTable extends PgTable<TableConfig>, OverrideT extends boolean = false> = {
[Key in keyof InferInsertModel<TTable, {
dbColumnNames: false;
override: OverrideT;
}>]: InferInsertModel<TTable, {
dbColumnNames: false;
override: OverrideT;
}>[Key] | SQL | Placeholder;
} & {};
export type PgInsertSelectQueryBuilder<TTable extends PgTable> = TypedQueryBuilder<{
[K in keyof TTable['$inferInsert']]: AnyPgColumn | SQL | SQL.Aliased | TTable['$inferInsert'][K];
}>;
export declare class PgInsertBuilder<TTable extends PgTable, TQueryResult extends PgQueryResultHKT, OverrideT extends boolean = false> {
private table;
private session;
private dialect;
private withList?;
private overridingSystemValue_?;
static readonly [entityKind]: string;
constructor(table: TTable, session: PgSession, dialect: PgDialect, withList?: Subquery[] | undefined, overridingSystemValue_?: boolean | undefined);
private authToken?;
overridingSystemValue(): Omit<PgInsertBuilder<TTable, TQueryResult, true>, 'overridingSystemValue'>;
values(value: PgInsertValue<TTable, OverrideT>): PgInsertBase<TTable, TQueryResult>;
values(values: PgInsertValue<TTable, OverrideT>[]): PgInsertBase<TTable, TQueryResult>;
select(selectQuery: (qb: QueryBuilder) => PgInsertSelectQueryBuilder<TTable>): PgInsertBase<TTable, TQueryResult>;
select(selectQuery: (qb: QueryBuilder) => SQL): PgInsertBase<TTable, TQueryResult>;
select(selectQuery: SQL): PgInsertBase<TTable, TQueryResult>;
select(selectQuery: PgInsertSelectQueryBuilder<TTable>): PgInsertBase<TTable, TQueryResult>;
}
export type PgInsertWithout<T extends AnyPgInsert, TDynamic extends boolean, K extends keyof T & string> = TDynamic extends true ? T : Omit<PgInsertBase<T['_']['table'], T['_']['queryResult'], T['_']['selectedFields'], T['_']['returning'], TDynamic, T['_']['excludedMethods'] | K>, T['_']['excludedMethods'] | K>;
export type PgInsertReturning<T extends AnyPgInsert, TDynamic extends boolean, TSelectedFields extends SelectedFieldsFlat> = PgInsertBase<T['_']['table'], T['_']['queryResult'], TSelectedFields, SelectResultFields<TSelectedFields>, TDynamic, T['_']['excludedMethods']>;
export type PgInsertReturningAll<T extends AnyPgInsert, TDynamic extends boolean> = PgInsertBase<T['_']['table'], T['_']['queryResult'], T['_']['table']['_']['columns'], T['_']['table']['$inferSelect'], TDynamic, T['_']['excludedMethods']>;
export interface PgInsertOnConflictDoUpdateConfig<T extends AnyPgInsert> {
target: IndexColumn | IndexColumn[];
/** @deprecated use either `targetWhere` or `setWhere` */
where?: SQL;
targetWhere?: SQL;
setWhere?: SQL;
set: PgUpdateSetSource<T['_']['table']>;
}
export type PgInsertPrepare<T extends AnyPgInsert> = PgPreparedQuery<PreparedQueryConfig & {
execute: T['_']['returning'] extends undefined ? PgQueryResultKind<T['_']['queryResult'], never> : T['_']['returning'][];
}>;
export type PgInsertDynamic<T extends AnyPgInsert> = PgInsert<T['_']['table'], T['_']['queryResult'], T['_']['returning']>;
export type AnyPgInsert = PgInsertBase<any, any, any, any, any, any>;
export type PgInsert<TTable extends PgTable = PgTable, TQueryResult extends PgQueryResultHKT = PgQueryResultHKT, TSelectedFields extends ColumnsSelection | undefined = ColumnsSelection | undefined, TReturning extends Record<string, unknown> | undefined = Record<string, unknown> | undefined> = PgInsertBase<TTable, TQueryResult, TSelectedFields, TReturning, true, never>;
export interface PgInsertBase<TTable extends PgTable, TQueryResult extends PgQueryResultHKT, TSelectedFields extends ColumnsSelection | undefined = undefined, TReturning extends Record<string, unknown> | undefined = undefined, TDynamic extends boolean = false, TExcludedMethods extends string = never> extends TypedQueryBuilder<TSelectedFields, TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[]>, QueryPromise<TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[]>, RunnableQuery<TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[], 'pg'>, SQLWrapper {
readonly _: {
readonly dialect: 'pg';
readonly table: TTable;
readonly queryResult: TQueryResult;
readonly selectedFields: TSelectedFields;
readonly returning: TReturning;
readonly dynamic: TDynamic;
readonly excludedMethods: TExcludedMethods;
readonly result: TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[];
};
}
export declare class PgInsertBase<TTable extends PgTable, TQueryResult extends PgQueryResultHKT, TSelectedFields extends ColumnsSelection | undefined = undefined, TReturning extends Record<string, unknown> | undefined = undefined, TDynamic extends boolean = false, TExcludedMethods extends string = never> extends QueryPromise<TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[]> implements TypedQueryBuilder<TSelectedFields, TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[]>, RunnableQuery<TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[], 'pg'>, SQLWrapper {
private session;
private dialect;
static readonly [entityKind]: string;
private config;
protected cacheConfig?: WithCacheConfig;
constructor(table: TTable, values: PgInsertConfig['values'], session: PgSession, dialect: PgDialect, withList?: Subquery[], select?: boolean, overridingSystemValue_?: boolean);
/**
* Adds a `returning` clause to the query.
*
* Calling this method will return the specified fields of the inserted rows. If no fields are specified, all fields will be returned.
*
* See docs: {@link https://orm.drizzle.team/docs/insert#insert-returning}
*
* @example
* ```ts
* // Insert one row and return all fields
* const insertedCar: Car[] = await db.insert(cars)
* .values({ brand: 'BMW' })
* .returning();
*
* // Insert one row and return only the id
* const insertedCarId: { id: number }[] = await db.insert(cars)
* .values({ brand: 'BMW' })
* .returning({ id: cars.id });
* ```
*/
returning(): PgInsertWithout<PgInsertReturningAll<this, TDynamic>, TDynamic, 'returning'>;
returning<TSelectedFields extends SelectedFieldsFlat>(fields: TSelectedFields): PgInsertWithout<PgInsertReturning<this, TDynamic, TSelectedFields>, TDynamic, 'returning'>;
/**
* Adds an `on conflict do nothing` clause to the query.
*
* Calling this method simply avoids inserting a row as its alternative action.
*
* See docs: {@link https://orm.drizzle.team/docs/insert#on-conflict-do-nothing}
*
* @param config The `target` and `where` clauses.
*
* @example
* ```ts
* // Insert one row and cancel the insert if there's a conflict
* await db.insert(cars)
* .values({ id: 1, brand: 'BMW' })
* .onConflictDoNothing();
*
* // Explicitly specify conflict target
* await db.insert(cars)
* .values({ id: 1, brand: 'BMW' })
* .onConflictDoNothing({ target: cars.id });
* ```
*/
onConflictDoNothing(config?: {
target?: IndexColumn | IndexColumn[];
where?: SQL;
}): PgInsertWithout<this, TDynamic, 'onConflictDoNothing' | 'onConflictDoUpdate'>;
/**
* Adds an `on conflict do update` clause to the query.
*
* Calling this method will update the existing row that conflicts with the row proposed for insertion as its alternative action.
*
* See docs: {@link https://orm.drizzle.team/docs/insert#upserts-and-conflicts}
*
* @param config The `target`, `set` and `where` clauses.
*
* @example
* ```ts
* // Update the row if there's a conflict
* await db.insert(cars)
* .values({ id: 1, brand: 'BMW' })
* .onConflictDoUpdate({
* target: cars.id,
* set: { brand: 'Porsche' }
* });
*
* // Upsert with 'where' clause
* await db.insert(cars)
* .values({ id: 1, brand: 'BMW' })
* .onConflictDoUpdate({
* target: cars.id,
* set: { brand: 'newBMW' },
* targetWhere: sql`${cars.createdAt} > '2023-01-01'::date`,
* });
* ```
*/
onConflictDoUpdate(config: PgInsertOnConflictDoUpdateConfig<this>): PgInsertWithout<this, TDynamic, 'onConflictDoNothing' | 'onConflictDoUpdate'>;
toSQL(): Query;
prepare(name: string): PgInsertPrepare<this>;
private authToken?;
execute: ReturnType<this['prepare']>['execute'];
$dynamic(): PgInsertDynamic<this>;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Version/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EAKxB,MAAM,SAAS,CAAA;AAQhB,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,wBAAsB,WAAW,CAAC,KAAK,EAAE,uBAAuB,8BAoa/D"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","ChevronIcon","baseClass","ClickableArrow","props","direction","isDisabled","updatePage","classes","filter","Boolean","join","_jsx","className","disabled","onClick","undefined","type"],"sources":["../../../../src/elements/Pagination/ClickableArrow/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { ChevronIcon } from '../../../icons/Chevron/index.js'\nimport './index.scss'\n\nconst baseClass = 'clickable-arrow'\n\nexport type ClickableArrowProps = {\n direction?: 'left' | 'right'\n isDisabled?: boolean\n updatePage?: () => void\n}\n\nexport const ClickableArrow: React.FC<ClickableArrowProps> = (props) => {\n const { direction = 'right', isDisabled = false, updatePage } = props\n\n const classes = [\n baseClass,\n isDisabled && `${baseClass}--is-disabled`,\n direction && `${baseClass}--${direction}`,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <button\n className={classes}\n disabled={isDisabled}\n onClick={!isDisabled ? updatePage : undefined}\n type=\"button\"\n >\n <ChevronIcon />\n </button>\n )\n}\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAElB,SAASC,WAAW,QAAQ;AAC5B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAQlB,OAAO,MAAMC,cAAA,GAAiDC,KAAA;EAC5D,MAAM;IAAEC,SAAA,GAAY,OAAO;IAAEC,UAAA,GAAa,KAAK;IAAEC;EAAU,CAAE,GAAGH,KAAA;EAEhE,MAAMI,OAAA,GAAU,CACdN,SAAA,EACAI,UAAA,IAAc,GAAGJ,SAAA,eAAwB,EACzCG,SAAA,IAAa,GAAGH,SAAA,KAAcG,SAAA,EAAW,CAC1C,CACEI,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;EAER,oBACEC,IAAA,CAAC;IACCC,SAAA,EAAWL,OAAA;IACXM,QAAA,EAAUR,UAAA;IACVS,OAAA,EAAS,CAACT,UAAA,GAAaC,UAAA,GAAaS,SAAA;IACpCC,IAAA,EAAK;cAEL,aAAAL,IAAA,CAACX,WAAA;;AAGP","ignoreList":[]}

View File

@@ -0,0 +1,2 @@
declare const _default: () => import("../../ExtractorCodec.js").default;
export default _default;

View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = toIdentifier;
var _isValidIdentifier = require("../validators/isValidIdentifier.js");
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
function toIdentifier(input) {
input = input + "";
let name = "";
for (const c of input) {
name += (0, _helperValidatorIdentifier.isIdentifierChar)(c.codePointAt(0)) ? c : "-";
}
name = name.replace(/^[-0-9]+/, "");
name = name.replace(/[-\s]+(.)?/g, function (match, c) {
return c ? c.toUpperCase() : "";
});
if (!(0, _isValidIdentifier.default)(name)) {
name = `_${name}`;
}
return name || "_";
}
//# sourceMappingURL=toIdentifier.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Select/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,MAAM,EACN,YAAY,EAGb,MAAM,SAAS,CAAA;AAEhB,OAAO,KAA+B,MAAM,OAAO,CAAA;AAGnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAKlD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC,eAAO,MAAM,aAAa,YAAa,MAAM,EAAE,KAAG,YAAY,EAU1D,CAAA;AAgHJ,eAAO,MAAM,WAAW;;;;;;;+EAAsC,CAAA;AAE9D,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"grid-2x2-check.js","sources":["../../../src/icons/grid-2x2-check.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Grid2x2Check\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgM3YxN2ExIDEgMCAwIDEtMSAxSDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJoMTRhMiAyIDAgMCAxIDIgMnY2YTEgMSAwIDAgMS0xIDFIMyIgLz4KICA8cGF0aCBkPSJtMTYgMTkgMiAyIDQtNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/grid-2x2-check\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Grid2x2Check = createLucideIcon('Grid2x2Check', [\n [\n 'path',\n {\n d: 'M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3',\n key: '11za1p',\n },\n ],\n ['path', { d: 'm16 19 2 2 4-4', key: '1b14m6' }],\n]);\n\nexport default Grid2x2Check;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CACpD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACjD,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,26 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link differenceInMonths} function options.
*/
export interface DifferenceInMonthsOptions extends ContextOptions<Date> {}
/**
* @name differenceInMonths
* @category Month Helpers
* @summary Get the number of full months between the given dates.
*
* @param laterDate - The later date
* @param earlierDate - The earlier date
* @param options - An object with options
*
* @returns The number of full months
*
* @example
* // How many full months are between 31 January 2014 and 1 September 2014?
* const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))
* //=> 7
*/
export declare function differenceInMonths(
laterDate: DateArg<Date> & {},
earlierDate: DateArg<Date> & {},
options?: DifferenceInMonthsOptions | undefined,
): number;

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