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,14 @@
var defineProperty = require("./defineProperty.js");
function _objectSpread(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? Object(arguments[r]) : {},
o = Object.keys(t);
"function" == typeof Object.getOwnPropertySymbols && o.push.apply(o, Object.getOwnPropertySymbols(t).filter(function (e) {
return Object.getOwnPropertyDescriptor(t, e).enumerable;
})), o.forEach(function (r) {
defineProperty(e, r, t[r]);
});
}
return e;
}
module.exports = _objectSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;

View File

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

View File

@@ -0,0 +1,6 @@
import type { FieldAffectingData } from '../fields/config/types.js';
import { APIError } from './APIError.js';
export declare class ReservedFieldName extends APIError {
constructor(field: FieldAffectingData, fieldName: string);
}
//# sourceMappingURL=ReservedFieldName.d.ts.map

View File

@@ -0,0 +1 @@
module.exports={C:{"115":1.4856,"136":0.01981,"139":0.01981,"140":0.01486,"142":0.00495,"143":0.77746,"145":0.71804,"146":0.6289,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 137 138 141 144 147 148 149 3.5 3.6"},D:{"38":0.00495,"69":0.00495,"76":0.21789,"85":0.00495,"87":0.15846,"103":0.0099,"108":0.00495,"109":0.26246,"112":0.08418,"116":0.00495,"122":0.61405,"124":0.00495,"125":0.04952,"126":0.00495,"127":0.03962,"128":0.01981,"130":0.00495,"131":0.01486,"132":0.00495,"133":0.00495,"135":0.02476,"136":0.04952,"137":0.00495,"138":0.03962,"139":0.74775,"140":0.03962,"141":0.04457,"142":9.69106,"143":16.56939,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 70 71 72 73 74 75 77 78 79 80 81 83 84 86 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 104 105 106 107 110 111 113 114 115 117 118 119 120 121 123 129 134 144 145 146"},F:{"93":0.0099,"122":0.00495,"123":0.02971,"124":1.09439,"125":0.60414,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"109":0.01981,"134":0.00495,"135":0.02476,"137":0.00495,"138":0.07923,"139":0.23274,"140":0.00495,"141":0.01981,"142":1.74806,"143":4.91734,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 136"},E:{"14":0.06438,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 16.1 16.2 16.4 17.2 17.4 18.0 18.2 18.4 26.0 26.3","13.1":0.00495,"14.1":0.06438,"15.5":0.00495,"15.6":0.10894,"16.0":0.00495,"16.3":0.00495,"16.5":0.00495,"16.6":0.05447,"17.0":0.0099,"17.1":0.01981,"17.3":0.0099,"17.5":0.00495,"17.6":0.03466,"18.1":0.00495,"18.3":0.00495,"18.5-18.6":0.02476,"26.1":0.15846,"26.2":0.01486},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00182,"5.0-5.1":0,"6.0-6.1":0.00363,"7.0-7.1":0.00273,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00727,"10.0-10.2":0.00091,"10.3":0.01272,"11.0-11.2":0.15629,"11.3-11.4":0.00454,"12.0-12.1":0.00363,"12.2-12.5":0.04089,"13.0-13.1":0.00091,"13.2":0.00636,"13.3":0.00182,"13.4-13.7":0.00636,"14.0-14.4":0.01272,"14.5-14.8":0.01363,"15.0-15.1":0.01454,"15.2-15.3":0.0109,"15.4":0.01181,"15.5":0.01272,"15.6-15.8":0.19717,"16.0":0.02272,"16.1":0.04361,"16.2":0.02272,"16.3":0.04089,"16.4":0.01,"16.5":0.01726,"16.6-16.7":0.25624,"17.0":0.01454,"17.1":0.02362,"17.2":0.01726,"17.3":0.02635,"17.4":0.04452,"17.5":0.08723,"17.6-17.7":0.20172,"18.0":0.04543,"18.1":0.0945,"18.2":0.04998,"18.3":0.16265,"18.4":0.08359,"18.5-18.7":6.00248,"26.0":0.11721,"26.1":0.97497,"26.2":0.18536,"26.3":0.00818},P:{"26":0.0787,"28":0.06746,"29":4.05882,_:"4 20 21 22 23 24 25 27 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0.08568,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00002,"4.4":0,"4.4.3-4.4.4":0.00007},A:{_:"6 7 8 9 10 11 5.5"},K:{"0":0.05048,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{_:"0"},H:{"0":0},L:{"0":39.4835},R:{_:"0"},M:{"0":2.25646}};

View File

@@ -0,0 +1,16 @@
import type { DocumentTabConfig, PayloadRequest, SanitizedCollectionConfig, SanitizedGlobalConfig, SanitizedPermissions } from 'payload';
import type React from 'react';
import './index.scss';
export declare const baseClass = "doc-tab";
export declare const DefaultDocumentTab: React.FC<{
apiURL?: string;
collectionConfig?: SanitizedCollectionConfig;
globalConfig?: SanitizedGlobalConfig;
path?: string;
permissions?: SanitizedPermissions;
req: PayloadRequest;
tabConfig: {
readonly Pill_Component?: React.FC;
} & DocumentTabConfig;
}>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,5 @@
/**
* Securely detect if an XML buffer contains a valid SVG document
*/
export declare function detectSvgFromXml(buffer: Buffer): boolean;
//# sourceMappingURL=detectSvgFromXml.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.ts"],"sourcesContent":["import type { PayloadRequest, Where } from '../../../types/index.js'\nimport type { TaskType } from '../../config/types/taskTypes.js'\nimport type { WorkflowTypes } from '../../config/types/workflowTypes.js'\n\n/**\n * Gets all queued jobs that can be run. This means they either:\n * - failed but do not have a definitive error => can be retried\n * - are currently processing\n * - have not been started yet\n */\nexport async function countRunnableOrActiveJobsForQueue({\n onlyScheduled = false,\n queue,\n req,\n taskSlug,\n workflowSlug,\n}: {\n /**\n * If true, this counts only jobs that have been created through the scheduling system.\n *\n * @default false\n */\n onlyScheduled?: boolean\n queue: string\n req: PayloadRequest\n taskSlug?: TaskType\n workflowSlug?: WorkflowTypes\n}): Promise<number> {\n const and: Where[] = [\n {\n queue: {\n equals: queue,\n },\n },\n\n {\n completedAt: { exists: false },\n },\n {\n error: { exists: false },\n },\n ]\n\n if (taskSlug) {\n and.push({\n taskSlug: {\n equals: taskSlug,\n },\n })\n } else if (workflowSlug) {\n and.push({\n workflowSlug: {\n equals: workflowSlug,\n },\n })\n }\n if (onlyScheduled) {\n and.push({\n 'meta.scheduled': {\n equals: true,\n },\n })\n }\n\n const runnableOrActiveJobsForQueue = await req.payload.db.count({\n collection: 'payload-jobs',\n req,\n where: {\n and,\n },\n })\n\n return runnableOrActiveJobsForQueue.totalDocs\n}\n"],"names":["countRunnableOrActiveJobsForQueue","onlyScheduled","queue","req","taskSlug","workflowSlug","and","equals","completedAt","exists","error","push","runnableOrActiveJobsForQueue","payload","db","count","collection","where","totalDocs"],"mappings":"AAIA;;;;;CAKC,GACD,OAAO,eAAeA,kCAAkC,EACtDC,gBAAgB,KAAK,EACrBC,KAAK,EACLC,GAAG,EACHC,QAAQ,EACRC,YAAY,EAYb;IACC,MAAMC,MAAe;QACnB;YACEJ,OAAO;gBACLK,QAAQL;YACV;QACF;QAEA;YACEM,aAAa;gBAAEC,QAAQ;YAAM;QAC/B;QACA;YACEC,OAAO;gBAAED,QAAQ;YAAM;QACzB;KACD;IAED,IAAIL,UAAU;QACZE,IAAIK,IAAI,CAAC;YACPP,UAAU;gBACRG,QAAQH;YACV;QACF;IACF,OAAO,IAAIC,cAAc;QACvBC,IAAIK,IAAI,CAAC;YACPN,cAAc;gBACZE,QAAQF;YACV;QACF;IACF;IACA,IAAIJ,eAAe;QACjBK,IAAIK,IAAI,CAAC;YACP,kBAAkB;gBAChBJ,QAAQ;YACV;QACF;IACF;IAEA,MAAMK,+BAA+B,MAAMT,IAAIU,OAAO,CAACC,EAAE,CAACC,KAAK,CAAC;QAC9DC,YAAY;QACZb;QACAc,OAAO;YACLX;QACF;IACF;IAEA,OAAOM,6BAA6BM,SAAS;AAC/C"}

View File

@@ -0,0 +1,22 @@
import type { ColumnBuilderBaseConfig, HasDefault, NotNull } from "../../column-builder.js";
import type { ColumnBaseConfig } from "../../column.js";
import { entityKind } from "../../entity.js";
import { PgColumn, PgColumnBuilder } from "./common.js";
export type PgSerialBuilderInitial<TName extends string> = NotNull<HasDefault<PgSerialBuilder<{
name: TName;
dataType: 'number';
columnType: 'PgSerial';
data: number;
driverParam: number;
enumValues: undefined;
}>>>;
export declare class PgSerialBuilder<T extends ColumnBuilderBaseConfig<'number', 'PgSerial'>> extends PgColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class PgSerial<T extends ColumnBaseConfig<'number', 'PgSerial'>> extends PgColumn<T> {
static readonly [entityKind]: string;
getSQLType(): string;
}
export declare function serial(): PgSerialBuilderInitial<''>;
export declare function serial<TName extends string>(name: TName): PgSerialBuilderInitial<TName>;

View File

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

View File

@@ -0,0 +1,30 @@
"use strict";
exports.nlBE = void 0;
var _index = require("./nl-BE/_lib/formatDistance.cjs");
var _index2 = require("./nl-BE/_lib/formatLong.cjs");
var _index3 = require("./nl-BE/_lib/formatRelative.cjs");
var _index4 = require("./nl-BE/_lib/localize.cjs");
var _index5 = require("./nl-BE/_lib/match.cjs");
/**
* @category Locales
* @summary Dutch locale.
* @language Dutch
* @iso-639-2 nld
* @author Jorik Tangelder [@jtangelder](https://github.com/jtangelder)
* @author Ruben Stolk [@rubenstolk](https://github.com/rubenstolk)
* @author Lode Vanhove [@bitcrumb](https://github.com/bitcrumb)
* @author Alex Hoeing [@dcbn](https://github.com/dcbn)
*/
const nlBE = (exports.nlBE = {
code: "nl-BE",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
});

View File

@@ -0,0 +1,286 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
// Vietnamese locale reference: http://www.localeplanet.com/icu/vi-VN/index.html
// Capitalization reference: http://hcmup.edu.vn/index.php?option=com_content&view=article&id=4106%3Avit-hoa-trong-vn-bn-hanh-chinh&catid=2345%3Atham-kho&Itemid=4103&lang=vi&site=134
const eraValues = {
narrow: ["TCN", "SCN"],
abbreviated: ["trước CN", "sau CN"],
wide: ["trước Công Nguyên", "sau Công Nguyên"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["Quý 1", "Quý 2", "Quý 3", "Quý 4"],
};
const formattingQuarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
// I notice many news outlet use this "quý II/2018"
wide: ["quý I", "quý II", "quý III", "quý 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: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
abbreviated: [
"Thg 1",
"Thg 2",
"Thg 3",
"Thg 4",
"Thg 5",
"Thg 6",
"Thg 7",
"Thg 8",
"Thg 9",
"Thg 10",
"Thg 11",
"Thg 12",
],
wide: [
"Tháng Một",
"Tháng Hai",
"Tháng Ba",
"Tháng Tư",
"Tháng Năm",
"Tháng Sáu",
"Tháng Bảy",
"Tháng Tám",
"Tháng Chín",
"Tháng Mười",
"Tháng Mười Một",
"Tháng Mười Hai",
],
};
// In Vietnamese date formatting, month number less than 10 expected to have leading zero
const formattingMonthValues = {
narrow: [
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"12",
],
abbreviated: [
"thg 1",
"thg 2",
"thg 3",
"thg 4",
"thg 5",
"thg 6",
"thg 7",
"thg 8",
"thg 9",
"thg 10",
"thg 11",
"thg 12",
],
wide: [
"tháng 01",
"tháng 02",
"tháng 03",
"tháng 04",
"tháng 05",
"tháng 06",
"tháng 07",
"tháng 08",
"tháng 09",
"tháng 10",
"tháng 11",
"tháng 12",
],
};
const dayValues = {
narrow: ["CN", "T2", "T3", "T4", "T5", "T6", "T7"],
short: ["CN", "Th 2", "Th 3", "Th 4", "Th 5", "Th 6", "Th 7"],
abbreviated: ["CN", "Thứ 2", "Thứ 3", "Thứ 4", "Thứ 5", "Thứ 6", "Thứ 7"],
wide: [
"Chủ Nhật",
"Thứ Hai",
"Thứ Ba",
"Thứ Tư",
"Thứ Năm",
"Thứ Sáu",
"Thứ Bảy",
],
};
// Vietnamese are used to AM/PM borrowing from English, hence `narrow` and
// `abbreviated` are just like English but I'm leaving the `wide`
// format being localized with abbreviations found in some systems (SÁng / CHiều);
// however, personally, I don't think `Chiều` sounds appropriate for `PM`
const dayPeriodValues = {
// narrow date period is extremely rare in Vietnamese
// I used abbreviated form for noon, morning and afternoon
// which are regconizable by Vietnamese, others cannot be any shorter
narrow: {
am: "am",
pm: "pm",
midnight: "nửa đêm",
noon: "tr",
morning: "sg",
afternoon: "ch",
evening: "tối",
night: "đêm",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "nửa đêm",
noon: "trưa",
morning: "sáng",
afternoon: "chiều",
evening: "tối",
night: "đêm",
},
wide: {
am: "SA",
pm: "CH",
midnight: "nửa đêm",
noon: "trưa",
morning: "sáng",
afternoon: "chiều",
evening: "tối",
night: "đêm",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "am",
pm: "pm",
midnight: "nửa đêm",
noon: "tr",
morning: "sg",
afternoon: "ch",
evening: "tối",
night: "đêm",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "nửa đêm",
noon: "trưa",
morning: "sáng",
afternoon: "chiều",
evening: "tối",
night: "đêm",
},
wide: {
am: "SA",
pm: "CH",
midnight: "nửa đêm",
noon: "giữa trưa",
morning: "vào buổi sáng",
afternoon: "vào buổi chiều",
evening: "vào buổi tối",
night: "vào ban đêm",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = options?.unit;
if (unit === "quarter") {
// many news outlets use "quý I"...
switch (number) {
case 1:
return "I";
case 2:
return "II";
case 3:
return "III";
case 4:
return "IV";
}
} else if (unit === "day") {
// day of week in Vietnamese has ordinal number meaning,
// so we should use them, else it'll sound weird
switch (number) {
case 1:
return "thứ 2"; // meaning 2nd day but it's the first day of the week :D
case 2:
return "thứ 3"; // meaning 3rd day
case 3:
return "thứ 4"; // meaning 4th day and so on
case 4:
return "thứ 5";
case 5:
return "thứ 6";
case 6:
return "thứ 7";
case 7:
return "chủ nhật"; // meaning Sunday, there's no 8th day :D
}
} else if (unit === "week") {
if (number === 1) {
return "thứ nhất";
} else {
return "thứ " + number;
}
} else if (unit === "dayOfYear") {
if (number === 1) {
return "đầu tiên";
} else {
return "thứ " + number;
}
}
// there are no different forms of ordinal numbers in Vietnamese
return String(number);
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
formattingValues: formattingQuarterValues,
defaultFormattingWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1,57 @@
Prism.languages.moonscript = {
'comment': /--.*/,
'string': [
{
pattern: /'[^']*'|\[(=*)\[[\s\S]*?\]\1\]/,
greedy: true
},
{
pattern: /"[^"]*"/,
greedy: true,
inside: {
'interpolation': {
pattern: /#\{[^{}]*\}/,
inside: {
'moonscript': {
pattern: /(^#\{)[\s\S]+(?=\})/,
lookbehind: true,
inside: null // see beow
},
'interpolation-punctuation': {
pattern: /#\{|\}/,
alias: 'punctuation'
}
}
}
}
}
],
'class-name': [
{
pattern: /(\b(?:class|extends)[ \t]+)\w+/,
lookbehind: true
},
// class-like names start with a capital letter
/\b[A-Z]\w*/
],
'keyword': /\b(?:class|continue|do|else|elseif|export|extends|for|from|if|import|in|local|nil|return|self|super|switch|then|unless|using|when|while|with)\b/,
'variable': /@@?\w*/,
'property': {
pattern: /\b(?!\d)\w+(?=:)|(:)(?!\d)\w+/,
lookbehind: true
},
'function': {
pattern: /\b(?:_G|_VERSION|assert|collectgarbage|coroutine\.(?:create|resume|running|status|wrap|yield)|debug\.(?:debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|setfenv|sethook|setlocal|setmetatable|setupvalue|traceback)|dofile|error|getfenv|getmetatable|io\.(?:close|flush|input|lines|open|output|popen|read|stderr|stdin|stdout|tmpfile|type|write)|ipairs|load|loadfile|loadstring|math\.(?:abs|acos|asin|atan|atan2|ceil|cos|cosh|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pi|pow|rad|random|randomseed|sin|sinh|sqrt|tan|tanh)|module|next|os\.(?:clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(?:cpath|loaded|loadlib|path|preload|seeall)|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string\.(?:byte|char|dump|find|format|gmatch|gsub|len|lower|match|rep|reverse|sub|upper)|table\.(?:concat|insert|maxn|remove|sort)|tonumber|tostring|type|unpack|xpcall)\b/,
inside: {
'punctuation': /\./
}
},
'boolean': /\b(?:false|true)\b/,
'number': /(?:\B\.\d+|\b\d+\.\d+|\b\d+(?=[eE]))(?:[eE][-+]?\d+)?\b|\b(?:0x[a-fA-F\d]+|\d+)(?:U?LL)?\b/,
'operator': /\.{3}|[-=]>|~=|(?:[-+*/%<>!=]|\.\.)=?|[:#^]|\b(?:and|or)\b=?|\b(?:not)\b/,
'punctuation': /[.,()[\]{}\\]/
};
Prism.languages.moonscript.string[1].inside.interpolation.inside.moonscript.inside = Prism.languages.moonscript;
Prism.languages.moon = Prism.languages.moonscript;

View File

@@ -0,0 +1,156 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["пр.н.е.", "н.е."],
abbreviated: ["преди н. е.", "н. е."],
wide: ["преди новата ера", "новата ера"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-во тримес.", "2-ро тримес.", "3-то тримес.", "4-то тримес."],
wide: [
"1-во тримесечие",
"2-ро тримесечие",
"3-то тримесечие",
"4-то тримесечие",
],
};
const monthValues = {
abbreviated: [
"яну",
"фев",
"мар",
"апр",
"май",
"юни",
"юли",
"авг",
"сеп",
"окт",
"ное",
"дек",
],
wide: [
"януари",
"февруари",
"март",
"април",
"май",
"юни",
"юли",
"август",
"септември",
"октомври",
"ноември",
"декември",
],
};
const dayValues = {
narrow: ["Н", "П", "В", "С", "Ч", "П", "С"],
short: ["нд", "пн", "вт", "ср", "чт", "пт", "сб"],
abbreviated: ["нед", "пон", "вто", "сря", "чет", "пет", "съб"],
wide: [
"неделя",
"понеделник",
"вторник",
"сряда",
"четвъртък",
"петък",
"събота",
],
};
const dayPeriodValues = {
wide: {
am: "преди обяд",
pm: "след обяд",
midnight: "в полунощ",
noon: "на обяд",
morning: "сутринта",
afternoon: "следобед",
evening: "вечерта",
night: "през нощта",
},
};
function isFeminine(unit) {
return (
unit === "year" || unit === "week" || unit === "minute" || unit === "second"
);
}
function isNeuter(unit) {
return unit === "quarter";
}
function numberWithSuffix(number, unit, masculine, feminine, neuter) {
const suffix = isNeuter(unit)
? neuter
: isFeminine(unit)
? feminine
: masculine;
return number + "-" + suffix;
}
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = options?.unit;
if (number === 0) {
return numberWithSuffix(0, unit, "ев", "ева", "ево");
} else if (number % 1000 === 0) {
return numberWithSuffix(number, unit, "ен", "на", "но");
} else if (number % 100 === 0) {
return numberWithSuffix(number, unit, "тен", "тна", "тно");
}
const rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return numberWithSuffix(number, unit, "ви", "ва", "во");
case 2:
return numberWithSuffix(number, unit, "ри", "ра", "ро");
case 7:
case 8:
return numberWithSuffix(number, unit, "ми", "ма", "мо");
}
}
return numberWithSuffix(number, unit, "ти", "та", "то");
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
}),
};

View File

@@ -0,0 +1,2 @@
export { browserProfilingIntegration } from '../profiling/integration';
//# sourceMappingURL=browserprofiling.d.ts.map

View File

@@ -0,0 +1,145 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const interactionCountPolyfill = require('./polyfills/interactionCountPolyfill.js');
/*
* Copyright 2024 Google LLC
*
* 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.
*/
// To prevent unnecessary memory usage on pages with lots of interactions,
// store at most 10 of the longest interactions to consider as INP candidates.
const MAX_INTERACTIONS_TO_CONSIDER = 10;
// Used to store the interaction count after a bfcache restore, since p98
// interaction latencies should only consider the current navigation.
let prevInteractionCount = 0;
/**
* Returns the interaction count since the last bfcache restore (or for the
* full page lifecycle if there were no bfcache restores).
*/
const getInteractionCountForNavigation = () => {
return interactionCountPolyfill.getInteractionCount() - prevInteractionCount;
};
/**
*
*/
class InteractionManager {constructor() { InteractionManager.prototype.__init.call(this);InteractionManager.prototype.__init2.call(this); }
/**
* A list of longest interactions on the page (by latency) sorted so the
* longest one is first. The list is at most MAX_INTERACTIONS_TO_CONSIDER
* long.
*/
// eslint-disable-next-line @sentry-internal/sdk/no-class-field-initializers, @typescript-eslint/explicit-member-accessibility
__init() {this._longestInteractionList = [];}
/**
* A mapping of longest interactions by their interaction ID.
* This is used for faster lookup.
*/
// eslint-disable-next-line @sentry-internal/sdk/no-class-field-initializers, @typescript-eslint/explicit-member-accessibility
__init2() {this._longestInteractionMap = new Map();}
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility, jsdoc/require-jsdoc
_resetInteractions() {
prevInteractionCount = interactionCountPolyfill.getInteractionCount();
this._longestInteractionList.length = 0;
this._longestInteractionMap.clear();
}
/**
* Returns the estimated p98 longest interaction based on the stored
* interaction candidates and the interaction count for the current page.
*/
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
_estimateP98LongestInteraction() {
const candidateInteractionIndex = Math.min(
this._longestInteractionList.length - 1,
Math.floor(getInteractionCountForNavigation() / 50),
);
return this._longestInteractionList[candidateInteractionIndex];
}
/**
* Takes a performance entry and adds it to the list of worst interactions
* if its duration is long enough to make it among the worst. If the
* entry is part of an existing interaction, it is merged and the latency
* and entries list is updated as needed.
*/
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
_processEntry(entry) {
this._onBeforeProcessingEntry?.(entry);
// Skip further processing for entries that cannot be INP candidates.
if (!(entry.interactionId || entry.entryType === 'first-input')) return;
// The least-long of the 10 longest interactions.
const minLongestInteraction = this._longestInteractionList.at(-1);
let interaction = this._longestInteractionMap.get(entry.interactionId);
// Only process the entry if it's possibly one of the ten longest,
// or if it's part of an existing interaction.
if (
interaction ||
this._longestInteractionList.length < MAX_INTERACTIONS_TO_CONSIDER ||
// If the above conditions are false, `minLongestInteraction` will be set.
entry.duration > minLongestInteraction._latency
) {
// If the interaction already exists, update it. Otherwise create one.
if (interaction) {
// If the new entry has a longer duration, replace the old entries,
// otherwise add to the array.
if (entry.duration > interaction._latency) {
interaction.entries = [entry];
interaction._latency = entry.duration;
} else if (entry.duration === interaction._latency && entry.startTime === interaction.entries[0].startTime) {
interaction.entries.push(entry);
}
} else {
interaction = {
id: entry.interactionId,
entries: [entry],
_latency: entry.duration,
};
this._longestInteractionMap.set(interaction.id, interaction);
this._longestInteractionList.push(interaction);
}
// Sort the entries by latency (descending) and keep only the top ten.
this._longestInteractionList.sort((a, b) => b._latency - a._latency);
if (this._longestInteractionList.length > MAX_INTERACTIONS_TO_CONSIDER) {
const removedInteractions = this._longestInteractionList.splice(MAX_INTERACTIONS_TO_CONSIDER);
for (const interaction of removedInteractions) {
this._longestInteractionMap.delete(interaction.id);
}
}
// Call any post-processing on the interaction
this._onAfterProcessingINPCandidate?.(interaction);
}
}
}
exports.InteractionManager = InteractionManager;
//# sourceMappingURL=InteractionManager.js.map

View File

@@ -0,0 +1,27 @@
"use strict";
exports.eu = void 0;
var _index = require("./eu/_lib/formatDistance.js");
var _index2 = require("./eu/_lib/formatLong.js");
var _index3 = require("./eu/_lib/formatRelative.js");
var _index4 = require("./eu/_lib/localize.js");
var _index5 = require("./eu/_lib/match.js");
/**
* @category Locales
* @summary Basque locale.
* @language Basque
* @iso-639-2 eus
* @author Jacob Söderblom [@JacobSoderblom](https://github.com/JacobSoderblom)
*/
const eu = (exports.eu = {
code: "eu",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 1,
},
});

View File

@@ -0,0 +1,76 @@
import { getWeekYear } from "../../../getWeekYear.js";
import { startOfWeek } from "../../../startOfWeek.js";
import { Parser } from "../Parser.js";
import { mapValue, normalizeTwoDigitYear, parseNDigits } from "../utils.js";
// Local week-numbering year
export class LocalWeekYearParser extends Parser {
priority = 130;
parse(dateString, token, match) {
const valueCallback = (year) => ({
year,
isTwoDigitYear: token === "YY",
});
switch (token) {
case "Y":
return mapValue(parseNDigits(4, dateString), valueCallback);
case "Yo":
return mapValue(
match.ordinalNumber(dateString, {
unit: "year",
}),
valueCallback,
);
default:
return mapValue(parseNDigits(token.length, dateString), valueCallback);
}
}
validate(_date, value) {
return value.isTwoDigitYear || value.year > 0;
}
set(date, flags, value, options) {
const currentYear = getWeekYear(date, options);
if (value.isTwoDigitYear) {
const normalizedTwoDigitYear = normalizeTwoDigitYear(
value.year,
currentYear,
);
date.setFullYear(
normalizedTwoDigitYear,
0,
options.firstWeekContainsDate,
);
date.setHours(0, 0, 0, 0);
return startOfWeek(date, options);
}
const year =
!("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
date.setFullYear(year, 0, options.firstWeekContainsDate);
date.setHours(0, 0, 0, 0);
return startOfWeek(date, options);
}
incompatibleTokens = [
"y",
"R",
"u",
"Q",
"q",
"M",
"L",
"I",
"d",
"D",
"i",
"t",
"T",
];
}

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/text"),r=require("@lexical/utils"),i=require("react");exports.useLexicalTextEntity=function(c,x,s){const[l]=e.useLexicalComposerContext();i.useEffect((()=>r.mergeRegister(...t.registerLexicalTextEntity(l,c,x,s))),[s,l,c,x])};

View File

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

View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.toGetWrapperPayload = toGetWrapperPayload;
exports.wrapReference = wrapReference;
var _core = require("@babel/core");
var _normalizeAndLoadMetadata = require("./normalize-and-load-metadata.js");
function toGetWrapperPayload(lazy) {
return (source, metadata) => {
if (lazy === false) return null;
if ((0, _normalizeAndLoadMetadata.isSideEffectImport)(metadata) || metadata.reexportAll) return null;
if (lazy === true) {
return source.includes(".") ? null : "lazy";
}
if (Array.isArray(lazy)) {
return !lazy.includes(source) ? null : "lazy";
}
if (typeof lazy === "function") {
return lazy(source) ? "lazy" : null;
}
throw new Error(`.lazy must be a boolean, string array, or function`);
};
}
function wrapReference(ref, payload) {
if (payload === "lazy") return _core.types.callExpression(ref, []);
return null;
}
//# sourceMappingURL=lazy-modules.js.map

View File

@@ -0,0 +1,41 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.js");
const dateFormats = {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy",
};
const timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a",
};
const dateTimeFormats = {
full: "{{date}} {{time}} 'সময়'",
long: "{{date}} {{time}} 'সময়'",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
const formatLong = (exports.formatLong = {
date: (0, _index.buildFormatLongFn)({
formats: dateFormats,
defaultWidth: "full",
}),
time: (0, _index.buildFormatLongFn)({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: (0, _index.buildFormatLongFn)({
formats: dateTimeFormats,
defaultWidth: "full",
}),
});

View File

@@ -0,0 +1,28 @@
import { formatDistance } from "./ar-EG/_lib/formatDistance.js";
import { formatLong } from "./ar-EG/_lib/formatLong.js";
import { formatRelative } from "./ar-EG/_lib/formatRelative.js";
import { localize } from "./ar-EG/_lib/localize.js";
import { match } from "./ar-EG/_lib/match.js";
/**
* @category Locales
* @summary Arabic locale (Egypt).
* @language Arabic
* @iso-639-2 ara
* @author AbdAllah AbdElFattah [@AbdAllahAbdElFattah13](https://github.com/AbdAllahAbdElFattah13)
*/
export const arEG = {
code: "ar-EG",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 0 /* Sunday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
export default arEG;

View File

@@ -0,0 +1,29 @@
import { entityKind, is } from "../entity.js";
import { singlestoreTableWithSchema } from "./table.js";
class SingleStoreSchema {
constructor(schemaName) {
this.schemaName = schemaName;
}
static [entityKind] = "SingleStoreSchema";
table = (name, columns, extraConfig) => {
return singlestoreTableWithSchema(name, columns, extraConfig, this.schemaName);
};
/*
view = ((name, columns) => {
return singlestoreViewWithSchema(name, columns, this.schemaName);
}) as typeof singlestoreView; */
}
function isSingleStoreSchema(obj) {
return is(obj, SingleStoreSchema);
}
function singlestoreDatabase(name) {
return new SingleStoreSchema(name);
}
const singlestoreSchema = singlestoreDatabase;
export {
SingleStoreSchema,
isSingleStoreSchema,
singlestoreDatabase,
singlestoreSchema
};
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1,32 @@
"use strict";
exports.previousWednesday = previousWednesday;
var _index = require("./previousDay.cjs");
/**
* The {@link previousWednesday} function options.
*/
/**
* @name previousWednesday
* @category Weekday Helpers
* @summary When is the previous Wednesday?
*
* @description
* When is the previous Wednesday?
*
* @typeParam DateType - The Date type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [UTCDate](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to start counting from
* @param options - An object with options
*
* @returns The previous Wednesday
*
* @example
* // When is the previous Wednesday before Jun, 18, 2021?
* const result = previousWednesday(new Date(2021, 5, 18))
* //=> Wed June 16 2021 00:00:00
*/
function previousWednesday(date, options) {
return (0, _index.previousDay)(date, 3, options);
}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/auth/crypto.ts"],"sourcesContent":["import crypto from 'crypto'\n\nconst algorithm = 'aes-256-ctr'\n\nexport function encrypt(text: string): string {\n const iv = crypto.randomBytes(16)\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n const secret = this.secret\n const cipher = crypto.createCipheriv(algorithm, secret, iv)\n\n const encrypted = cipher.update(text, 'utf8', 'hex') + cipher.final('hex')\n const ivString = iv.toString('hex')\n\n return `${ivString}${encrypted}`\n}\n\nexport function decrypt(hash: string): string {\n const iv = hash.slice(0, 32)\n const content = hash.slice(32)\n\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n const secret = this.secret\n const decipher = crypto.createDecipheriv(algorithm, secret, Buffer.from(iv, 'hex'))\n\n return decipher.update(content, 'hex', 'utf8') + decipher.final('utf8')\n}\n"],"names":["crypto","algorithm","encrypt","text","iv","randomBytes","secret","cipher","createCipheriv","encrypted","update","final","ivString","toString","decrypt","hash","slice","content","decipher","createDecipheriv","Buffer","from"],"mappings":"AAAA,OAAOA,YAAY,SAAQ;AAE3B,MAAMC,YAAY;AAElB,OAAO,SAASC,QAAQC,IAAY;IAClC,MAAMC,KAAKJ,OAAOK,WAAW,CAAC;IAC9B,oFAAoF;IACpF,MAAMC,SAAS,IAAI,CAACA,MAAM;IAC1B,MAAMC,SAASP,OAAOQ,cAAc,CAACP,WAAWK,QAAQF;IAExD,MAAMK,YAAYF,OAAOG,MAAM,CAACP,MAAM,QAAQ,SAASI,OAAOI,KAAK,CAAC;IACpE,MAAMC,WAAWR,GAAGS,QAAQ,CAAC;IAE7B,OAAO,GAAGD,WAAWH,WAAW;AAClC;AAEA,OAAO,SAASK,QAAQC,IAAY;IAClC,MAAMX,KAAKW,KAAKC,KAAK,CAAC,GAAG;IACzB,MAAMC,UAAUF,KAAKC,KAAK,CAAC;IAE3B,oFAAoF;IACpF,MAAMV,SAAS,IAAI,CAACA,MAAM;IAC1B,MAAMY,WAAWlB,OAAOmB,gBAAgB,CAAClB,WAAWK,QAAQc,OAAOC,IAAI,CAACjB,IAAI;IAE5E,OAAOc,SAASR,MAAM,CAACO,SAAS,OAAO,UAAUC,SAASP,KAAK,CAAC;AAClE"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/resolvers/auth/me.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAMzC,wBAAgB,EAAE,CAAC,UAAU,EAAE,UAAU,GAAG,GAAG,CAqB9C"}

View File

@@ -0,0 +1,5 @@
export declare const startOfMinuteWithOptions: import("./types.js").FPFn2<
Date,
import("../startOfMinute.js").StartOfMinuteOptions<Date> | undefined,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1,16 @@
import { ClientOptions, DirectusClient } from "./types/client.cjs";
//#region src/client.d.ts
/**
* Creates a client to communicate with a Directus app.
*
* @param url The URL to the Directus app.
* @param options The client options. Defaults to the standard implementation of `globals`.
*
* @returns A Directus client.
*/
declare const createDirectus: <Schema = any>(url: string, options?: ClientOptions) => DirectusClient<Schema>;
//#endregion
export { createDirectus };
//# sourceMappingURL=client.d.cts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/preferences/requestHandlers/update.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAK3D,eAAO,MAAM,aAAa,EAAE,cAmC3B,CAAA"}

View File

@@ -0,0 +1,42 @@
'use strict'
module.exports = prettifyTime
const formatTime = require('./format-time')
/**
* @typedef {object} PrettifyTimeParams
* @property {object} log The log object with the timestamp to be prettified.
* @property {PrettyContext} context The context object built from parsing
* the options.
*/
/**
* Prettifies a timestamp if the given `log` has either `time`, `timestamp` or custom specified timestamp
* property.
*
* @param {PrettifyTimeParams} input
*
* @returns {undefined|string} If a timestamp property cannot be found then
* `undefined` is returned. Otherwise, the prettified time is returned as a
* string.
*/
function prettifyTime ({ log, context }) {
const {
timestampKey,
translateTime: translateFormat
} = context
const prettifier = context.customPrettifiers?.time
let time = null
if (timestampKey in log) {
time = log[timestampKey]
} else if ('timestamp' in log) {
time = log.timestamp
}
if (time === null) return undefined
const output = translateFormat ? formatTime(time, translateFormat) : time
return prettifier ? prettifier(output) : `[${output}]`
}

View File

@@ -0,0 +1,7 @@
import { browserTracingIntegrationShim, consoleLoggingIntegrationShim, loggerShim, replayIntegrationShim } from '@sentry-internal/integration-shims';
import { feedbackAsyncIntegration } from './feedbackAsync';
export * from './index.bundle.base';
export { consoleLoggingIntegrationShim as consoleLoggingIntegration, loggerShim as logger };
export { getFeedback, sendFeedback } from '@sentry-internal/feedback';
export { browserTracingIntegrationShim as browserTracingIntegration, feedbackAsyncIntegration as feedbackAsyncIntegration, feedbackAsyncIntegration as feedbackIntegration, replayIntegrationShim as replayIntegration, };
//# sourceMappingURL=index.bundle.feedback.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/languages.ts"],"sourcesContent":["import type { AcceptedLanguages, LanguagePreference } from '../types.js'\n\nexport const rtlLanguages = ['ar', 'fa', 'he'] as const\n\nexport const acceptedLanguages = [\n 'ar',\n 'az',\n 'bg',\n 'bn-BD',\n 'bn-IN',\n 'ca',\n 'cs',\n 'bn-BD',\n 'bn-IN',\n 'da',\n 'de',\n 'en',\n 'es',\n 'et',\n 'fa',\n 'fr',\n 'he',\n 'hr',\n 'hu',\n 'hy',\n 'id',\n 'is',\n 'it',\n 'ja',\n 'ko',\n 'lt',\n 'lv',\n 'my',\n 'nb',\n 'nl',\n 'pl',\n 'pt',\n 'ro',\n 'rs',\n 'rs-latin',\n 'ru',\n 'sk',\n 'sl',\n 'sv',\n 'ta',\n 'th',\n 'tr',\n 'uk',\n 'vi',\n 'zh',\n 'zh-TW',\n\n /**\n * Languages not implemented:\n *\n * 'af',\n * 'am',\n * 'ar-sa',\n * 'as',\n * 'az-latin',\n * 'be',\n * 'bs',\n * 'ca-ES-valencia',\n * 'cy',\n * 'el',\n * 'en-GB',\n * 'en-US',\n * 'es-ES',\n * 'es-US',\n * 'es-MX',\n * 'eu',\n * 'fi',\n * 'fil-Latn',\n * 'fr-FR',\n * 'fr-CA',\n * 'ga',\n * 'gd-Latn',\n * 'gl',\n * 'gu',\n * 'ha-Latn',\n * 'hi',\n * 'ig-Latn',\n * 'it-it',\n * 'ka',\n * 'kk',\n * 'km',\n * 'kn',\n * 'kok',\n * 'ku-Arab',\n * 'ky-Cyrl',\n * 'lb',\n * 'mi-Latn',\n * 'mk',\n * 'ml',\n * 'mn-Cyrl',\n * 'mr',\n * 'ms',\n * 'mt',\n * 'ne',\n * 'nl-BE',\n * 'nn',\n * 'nso',\n * 'or',\n * 'pa',\n * 'pa-Arab',\n * 'prs-Arab',\n * 'pt-BR',\n * 'pt-PT',\n * 'qut-Latn',\n * 'quz',\n * 'rw',\n * 'sd-Arab',\n * 'si',\n * 'sq',\n * 'sr-Cyrl-BA',\n * 'sr-Cyrl-RS',\n * 'sr-Latn-RS',\n * 'sw',\n * 'ta',\n * 'te',\n * 'tg-Cyrl',\n * 'ti',\n * 'tk-Latn',\n * 'tn',\n * 'tt-Cyrl',\n * 'ug-Arab',\n * 'ur',\n * 'uz-Latn',\n * 'wo',\n * 'xh',\n * 'yo-Latn',\n * 'zh-Hans',\n * 'zh-Hant',\n * 'zu',\n */\n] as const\n\nfunction parseAcceptLanguage(acceptLanguageHeader: string): LanguagePreference[] {\n return acceptLanguageHeader\n .split(',')\n .map((lang) => {\n const [language, quality] = lang.trim().split(';q=') as [\n AcceptedLanguages,\n string | undefined,\n ]\n return {\n language,\n quality: quality ? parseFloat(quality) : 1,\n }\n })\n .sort((a, b) => b.quality - a.quality) // Sort by quality, highest to lowest\n}\n\nexport function extractHeaderLanguage(acceptLanguageHeader: string): AcceptedLanguages | undefined {\n const parsedHeader = parseAcceptLanguage(acceptLanguageHeader)\n\n let matchedLanguage: AcceptedLanguages | undefined\n\n for (const { language } of parsedHeader) {\n if (!matchedLanguage && acceptedLanguages.includes(language)) {\n matchedLanguage = language\n }\n }\n\n return matchedLanguage\n}\n"],"names":["rtlLanguages","acceptedLanguages","parseAcceptLanguage","acceptLanguageHeader","split","map","lang","language","quality","trim","parseFloat","sort","a","b","extractHeaderLanguage","parsedHeader","matchedLanguage","includes"],"mappings":"AAEA,OAAO,MAAMA,eAAe;IAAC;IAAM;IAAM;CAAK,CAAS;AAEvD,OAAO,MAAMC,oBAAoB;IAC/B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CAqFD,CAAS;AAEV,SAASC,oBAAoBC,oBAA4B;IACvD,OAAOA,qBACJC,KAAK,CAAC,KACNC,GAAG,CAAC,CAACC;QACJ,MAAM,CAACC,UAAUC,QAAQ,GAAGF,KAAKG,IAAI,GAAGL,KAAK,CAAC;QAI9C,OAAO;YACLG;YACAC,SAASA,UAAUE,WAAWF,WAAW;QAC3C;IACF,GACCG,IAAI,CAAC,CAACC,GAAGC,IAAMA,EAAEL,OAAO,GAAGI,EAAEJ,OAAO,EAAE,qCAAqC;;AAChF;AAEA,OAAO,SAASM,sBAAsBX,oBAA4B;IAChE,MAAMY,eAAeb,oBAAoBC;IAEzC,IAAIa;IAEJ,KAAK,MAAM,EAAET,QAAQ,EAAE,IAAIQ,aAAc;QACvC,IAAI,CAACC,mBAAmBf,kBAAkBgB,QAAQ,CAACV,WAAW;YAC5DS,kBAAkBT;QACpB;IACF;IAEA,OAAOS;AACT"}

View File

@@ -0,0 +1,39 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const currentScopes = require('../currentScopes.js');
// Treeshakable guard to remove all code related to tracing
/**
* Determines if span recording is currently enabled.
*
* Spans are recorded when at least one of `tracesSampleRate` and `tracesSampler`
* is defined in the SDK config. This function does not make any assumption about
* sampling decisions, it only checks if the SDK is configured to record spans.
*
* Important: This function only determines if span recording is enabled. Trace
* continuation and propagation is separately controlled and not covered by this function.
* If this function returns `false`, traces can still be propagated (which is what
* we refer to by "Tracing without Performance")
* @see https://develop.sentry.dev/sdk/telemetry/traces/tracing-without-performance/
*
* @param maybeOptions An SDK options object to be passed to this function.
* If this option is not provided, the function will use the current client's options.
*/
function hasSpansEnabled(
maybeOptions,
) {
if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {
return false;
}
const options = maybeOptions || currentScopes.getClient()?.getOptions();
return (
!!options &&
// Note: This check is `!= null`, meaning "nullish". `0` is not "nullish", `undefined` and `null` are. (This comment was brought to you by 15 minutes of questioning life)
(options.tracesSampleRate != null || !!options.tracesSampler)
);
}
exports.hasSpansEnabled = hasSpansEnabled;
//# sourceMappingURL=hasSpansEnabled.js.map

View File

@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = void 0;
var node_crypto_1 = require("node:crypto");
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return node_crypto_1.randomFillSync; } });

View File

@@ -0,0 +1,17 @@
import { lookup } from 'dns';
import { fetch as undiciFetch } from 'undici';
/**
* @internal this is used to mock the IP `lookup` function in integration tests
*/
export declare const _internal_safeFetchGlobal: {
lookup: typeof lookup;
};
/**
* A "safe" version of undici's fetch that prevents SSRF attacks.
*
* - Utilizes a custom dispatcher that filters out requests to unsafe IP addresses.
* - Validates domain names by resolving them to IP addresses and checking if they're safe.
* - Undici was used because it supported interceptors as well as "credentials: include". Native fetch
*/
export declare const safeFetch: (input: import("undici").RequestInfo, init?: import("undici").RequestInit | undefined) => Promise<import("undici").Response>;
//# sourceMappingURL=safeFetch.d.ts.map

View File

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

View File

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

View File

@@ -0,0 +1,94 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ExternalsPlugin = require("../ExternalsPlugin");
/** @typedef {import("../../declarations/WebpackOptions").ExternalsType} ExternalsType */
/** @typedef {import("../Compiler")} Compiler */
const builtins = [
"assert",
"assert/strict",
"async_hooks",
"buffer",
"child_process",
"cluster",
"console",
"constants",
"crypto",
"dgram",
"diagnostics_channel",
"dns",
"dns/promises",
"domain",
"events",
"fs",
"fs/promises",
"http",
"http2",
"https",
"inspector",
"inspector/promises",
"module",
"net",
"os",
"path",
"path/posix",
"path/win32",
"perf_hooks",
"process",
"punycode",
"querystring",
"readline",
"readline/promises",
"repl",
"stream",
"stream/consumers",
"stream/promises",
"stream/web",
"string_decoder",
"sys",
"timers",
"timers/promises",
"tls",
"trace_events",
"tty",
"url",
"util",
"util/types",
"v8",
"vm",
"wasi",
"worker_threads",
"zlib",
/^node:/,
// cspell:word pnpapi
// Yarn PnP adds pnpapi as "builtin"
"pnpapi"
];
class NodeTargetPlugin {
/**
* @param {ExternalsType} type default external type
*/
constructor(type = "node-commonjs") {
/** @type {ExternalsType} */
this.type = type;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
new ExternalsPlugin(this.type, builtins).apply(compiler);
}
}
module.exports = NodeTargetPlugin;

View File

@@ -0,0 +1,25 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { JSX } from 'react';
import { EditorState, EditorThemeClasses, HTMLConfig, Klass, LexicalEditor, LexicalNode, LexicalNodeReplacement } from 'lexical';
import * as React from 'react';
export type InitialEditorStateType = null | string | EditorState | ((editor: LexicalEditor) => void);
export type InitialConfigType = Readonly<{
namespace: string;
nodes?: ReadonlyArray<Klass<LexicalNode> | LexicalNodeReplacement>;
onError: (error: Error, editor: LexicalEditor) => void;
editable?: boolean;
theme?: EditorThemeClasses;
editorState?: InitialEditorStateType;
html?: HTMLConfig;
}>;
type Props = React.PropsWithChildren<{
initialConfig: InitialConfigType;
}>;
export declare function LexicalComposer({ initialConfig, children }: Props): JSX.Element;
export {};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/sqlite-core/columns/real.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnySQLiteTable } from '../table.ts';\nimport { SQLiteColumn, SQLiteColumnBuilder } from './common.ts';\n\nexport type SQLiteRealBuilderInitial<TName extends string> = SQLiteRealBuilder<{\n\tname: TName;\n\tdataType: 'number';\n\tcolumnType: 'SQLiteReal';\n\tdata: number;\n\tdriverParam: number;\n\tenumValues: undefined;\n}>;\n\nexport class SQLiteRealBuilder<T extends ColumnBuilderBaseConfig<'number', 'SQLiteReal'>>\n\textends SQLiteColumnBuilder<T>\n{\n\tstatic override readonly [entityKind]: string = 'SQLiteRealBuilder';\n\n\tconstructor(name: T['name']) {\n\t\tsuper(name, 'number', 'SQLiteReal');\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnySQLiteTable<{ name: TTableName }>,\n\t): SQLiteReal<MakeColumnConfig<T, TTableName>> {\n\t\treturn new SQLiteReal<MakeColumnConfig<T, TTableName>>(table, this.config as ColumnBuilderRuntimeConfig<any, any>);\n\t}\n}\n\nexport class SQLiteReal<T extends ColumnBaseConfig<'number', 'SQLiteReal'>> extends SQLiteColumn<T> {\n\tstatic override readonly [entityKind]: string = 'SQLiteReal';\n\n\tgetSQLType(): string {\n\t\treturn 'real';\n\t}\n}\n\nexport function real(): SQLiteRealBuilderInitial<''>;\nexport function real<TName extends string>(name: TName): SQLiteRealBuilderInitial<TName>;\nexport function real(name?: string) {\n\treturn new SQLiteRealBuilder(name ?? '');\n}\n"],"mappings":"AAEA,SAAS,kBAAkB;AAE3B,SAAS,cAAc,2BAA2B;AAW3C,MAAM,0BACJ,oBACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB;AAC5B,UAAM,MAAM,UAAU,YAAY;AAAA,EACnC;AAAA;AAAA,EAGS,MACR,OAC8C;AAC9C,WAAO,IAAI,WAA4C,OAAO,KAAK,MAA8C;AAAA,EAClH;AACD;AAEO,MAAM,mBAAuE,aAAgB;AAAA,EACnG,QAA0B,UAAU,IAAY;AAAA,EAEhD,aAAqB;AACpB,WAAO;AAAA,EACR;AACD;AAIO,SAAS,KAAK,MAAe;AACnC,SAAO,IAAI,kBAAkB,QAAQ,EAAE;AACxC;","names":[]}

View File

@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const AlignCenterVertical = createLucideIcon("AlignCenterVertical", [
["path", { d: "M12 2v20", key: "t6zp3m" }],
["path", { d: "M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4", key: "14d6g8" }],
["path", { d: "M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4", key: "1e2lrw" }],
["path", { d: "M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1", key: "1fkdwx" }],
["path", { d: "M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1", key: "1euafb" }]
]);
export { AlignCenterVertical as default };
//# sourceMappingURL=align-center-vertical.js.map

View File

@@ -0,0 +1,227 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
Object.defineProperty(exports, 'BREAK', {
enumerable: true,
get: function () {
return _visitor.BREAK;
},
});
Object.defineProperty(exports, 'DirectiveLocation', {
enumerable: true,
get: function () {
return _directiveLocation.DirectiveLocation;
},
});
Object.defineProperty(exports, 'Kind', {
enumerable: true,
get: function () {
return _kinds.Kind;
},
});
Object.defineProperty(exports, 'Lexer', {
enumerable: true,
get: function () {
return _lexer.Lexer;
},
});
Object.defineProperty(exports, 'Location', {
enumerable: true,
get: function () {
return _ast.Location;
},
});
Object.defineProperty(exports, 'OperationTypeNode', {
enumerable: true,
get: function () {
return _ast.OperationTypeNode;
},
});
Object.defineProperty(exports, 'Source', {
enumerable: true,
get: function () {
return _source.Source;
},
});
Object.defineProperty(exports, 'Token', {
enumerable: true,
get: function () {
return _ast.Token;
},
});
Object.defineProperty(exports, 'TokenKind', {
enumerable: true,
get: function () {
return _tokenKind.TokenKind;
},
});
Object.defineProperty(exports, 'getEnterLeaveForKind', {
enumerable: true,
get: function () {
return _visitor.getEnterLeaveForKind;
},
});
Object.defineProperty(exports, 'getLocation', {
enumerable: true,
get: function () {
return _location.getLocation;
},
});
Object.defineProperty(exports, 'getVisitFn', {
enumerable: true,
get: function () {
return _visitor.getVisitFn;
},
});
Object.defineProperty(exports, 'isConstValueNode', {
enumerable: true,
get: function () {
return _predicates.isConstValueNode;
},
});
Object.defineProperty(exports, 'isDefinitionNode', {
enumerable: true,
get: function () {
return _predicates.isDefinitionNode;
},
});
Object.defineProperty(exports, 'isExecutableDefinitionNode', {
enumerable: true,
get: function () {
return _predicates.isExecutableDefinitionNode;
},
});
Object.defineProperty(exports, 'isSchemaCoordinateNode', {
enumerable: true,
get: function () {
return _predicates.isSchemaCoordinateNode;
},
});
Object.defineProperty(exports, 'isSelectionNode', {
enumerable: true,
get: function () {
return _predicates.isSelectionNode;
},
});
Object.defineProperty(exports, 'isTypeDefinitionNode', {
enumerable: true,
get: function () {
return _predicates.isTypeDefinitionNode;
},
});
Object.defineProperty(exports, 'isTypeExtensionNode', {
enumerable: true,
get: function () {
return _predicates.isTypeExtensionNode;
},
});
Object.defineProperty(exports, 'isTypeNode', {
enumerable: true,
get: function () {
return _predicates.isTypeNode;
},
});
Object.defineProperty(exports, 'isTypeSystemDefinitionNode', {
enumerable: true,
get: function () {
return _predicates.isTypeSystemDefinitionNode;
},
});
Object.defineProperty(exports, 'isTypeSystemExtensionNode', {
enumerable: true,
get: function () {
return _predicates.isTypeSystemExtensionNode;
},
});
Object.defineProperty(exports, 'isValueNode', {
enumerable: true,
get: function () {
return _predicates.isValueNode;
},
});
Object.defineProperty(exports, 'parse', {
enumerable: true,
get: function () {
return _parser.parse;
},
});
Object.defineProperty(exports, 'parseConstValue', {
enumerable: true,
get: function () {
return _parser.parseConstValue;
},
});
Object.defineProperty(exports, 'parseSchemaCoordinate', {
enumerable: true,
get: function () {
return _parser.parseSchemaCoordinate;
},
});
Object.defineProperty(exports, 'parseType', {
enumerable: true,
get: function () {
return _parser.parseType;
},
});
Object.defineProperty(exports, 'parseValue', {
enumerable: true,
get: function () {
return _parser.parseValue;
},
});
Object.defineProperty(exports, 'print', {
enumerable: true,
get: function () {
return _printer.print;
},
});
Object.defineProperty(exports, 'printLocation', {
enumerable: true,
get: function () {
return _printLocation.printLocation;
},
});
Object.defineProperty(exports, 'printSourceLocation', {
enumerable: true,
get: function () {
return _printLocation.printSourceLocation;
},
});
Object.defineProperty(exports, 'visit', {
enumerable: true,
get: function () {
return _visitor.visit;
},
});
Object.defineProperty(exports, 'visitInParallel', {
enumerable: true,
get: function () {
return _visitor.visitInParallel;
},
});
var _source = require('./source.js');
var _location = require('./location.js');
var _printLocation = require('./printLocation.js');
var _kinds = require('./kinds.js');
var _tokenKind = require('./tokenKind.js');
var _lexer = require('./lexer.js');
var _parser = require('./parser.js');
var _printer = require('./printer.js');
var _visitor = require('./visitor.js');
var _ast = require('./ast.js');
var _predicates = require('./predicates.js');
var _directiveLocation = require('./directiveLocation.js');

View File

@@ -0,0 +1,439 @@
import { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent';
import { dequal } from 'dequal/lite';
import { MissingEditorProp } from 'payload';
import { fieldIsID, fieldShouldBeLocalized, getFieldPaths, getUniqueListBy, tabHasName } from 'payload/shared';
import { diffComponents } from './fields/index.js';
/**
* Build up an object that contains rendered diff components for each field.
* This is then sent to the client to be rendered.
*
* Here, the server is responsible for traversing through the document data and building up this
* version state object.
*/
export const buildVersionFields = ({
clientSchemaMap,
customDiffComponents,
entitySlug,
fields,
fieldsPermissions,
i18n,
modifiedOnly,
nestingLevel = 0,
parentIndexPath,
parentIsLocalized,
parentPath,
parentSchemaPath,
req,
selectedLocales,
versionFromSiblingData,
versionToSiblingData
}) => {
const versionFields = [];
let fieldIndex = -1;
for (const field of fields) {
fieldIndex++;
if (fieldIsID(field)) {
continue;
}
const {
indexPath,
path,
schemaPath
} = getFieldPaths({
field,
index: fieldIndex,
parentIndexPath,
parentPath,
parentSchemaPath
});
const clientField = clientSchemaMap.get(entitySlug + '.' + schemaPath);
if (!clientField) {
req.payload.logger.error({
clientFieldKey: entitySlug + '.' + schemaPath,
clientSchemaMapKeys: Array.from(clientSchemaMap.keys()),
msg: 'No client field found for ' + entitySlug + '.' + schemaPath,
parentPath,
parentSchemaPath,
path,
schemaPath
});
throw new Error('No client field found for ' + entitySlug + '.' + schemaPath);
}
const versionField = {};
const isLocalized = fieldShouldBeLocalized({
field,
parentIsLocalized
});
const fieldName = 'name' in field ? field.name : null;
const valueFrom = fieldName ? versionFromSiblingData?.[fieldName] : versionFromSiblingData;
const valueTo = fieldName ? versionToSiblingData?.[fieldName] : versionToSiblingData;
if (isLocalized) {
versionField.fieldByLocale = {};
for (const locale of selectedLocales) {
const localizedVersionField = buildVersionField({
clientField: clientField,
clientSchemaMap,
customDiffComponents,
entitySlug,
field,
i18n,
indexPath,
locale,
modifiedOnly,
nestingLevel,
parentFieldsPermissions: fieldsPermissions,
parentIsLocalized: true,
parentPath,
parentSchemaPath,
path,
req,
schemaPath,
selectedLocales,
valueFrom: valueFrom?.[locale],
valueTo: valueTo?.[locale]
});
if (localizedVersionField) {
versionField.fieldByLocale[locale] = localizedVersionField;
}
}
} else {
const baseVersionField = buildVersionField({
clientField: clientField,
clientSchemaMap,
customDiffComponents,
entitySlug,
field,
i18n,
indexPath,
modifiedOnly,
nestingLevel,
parentFieldsPermissions: fieldsPermissions,
parentIsLocalized: parentIsLocalized || 'localized' in field && field.localized,
parentPath,
parentSchemaPath,
path,
req,
schemaPath,
selectedLocales,
valueFrom,
valueTo
});
if (baseVersionField) {
versionField.field = baseVersionField;
}
}
if (versionField.field || versionField.fieldByLocale && Object.keys(versionField.fieldByLocale).length) {
versionFields.push(versionField);
}
}
return {
versionFields
};
};
const buildVersionField = ({
clientField,
clientSchemaMap,
customDiffComponents,
entitySlug,
field,
i18n,
indexPath,
locale,
modifiedOnly,
nestingLevel,
parentFieldsPermissions,
parentIsLocalized,
parentPath,
parentSchemaPath,
path,
req,
schemaPath,
selectedLocales,
valueFrom,
valueTo
}) => {
let hasReadPermission = false;
let fieldPermissions = undefined;
if (typeof parentFieldsPermissions === 'boolean') {
hasReadPermission = parentFieldsPermissions;
fieldPermissions = parentFieldsPermissions;
} else {
if ('name' in field) {
fieldPermissions = parentFieldsPermissions?.[field.name];
if (typeof fieldPermissions === 'boolean') {
hasReadPermission = fieldPermissions;
} else if (typeof fieldPermissions?.read === 'boolean') {
hasReadPermission = fieldPermissions.read;
}
} else {
// If the field is unnamed and parentFieldsPermissions is an object, its sub-fields will decide their read permissions state.
// As far as this field is concerned, we are allowed to read it, as we need to reach its sub-fields to determine their read permissions.
hasReadPermission = true;
}
}
if (!hasReadPermission) {
// HasReadPermission is only valid if the field has a name. E.g. for a tabs field it would incorrectly return `false`.
return null;
}
if (modifiedOnly && dequal(valueFrom, valueTo)) {
return null;
}
let CustomComponent = customDiffComponents?.[field.type];
if (field?.type === 'richText') {
if (!field?.editor) {
throw new MissingEditorProp(field) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor
;
}
if (typeof field?.editor === 'function') {
throw new Error('Attempted to access unsanitized rich text editor.');
}
if (field.editor.CellComponent) {
CustomComponent = field.editor.DiffComponent;
}
}
if (field?.admin?.components?.Diff) {
CustomComponent = field.admin.components.Diff;
}
const DefaultComponent = diffComponents?.[field.type];
const baseVersionField = {
type: field.type,
fields: [],
path,
schemaPath
};
if (field.type === 'tabs' && 'tabs' in field) {
baseVersionField.tabs = [];
let tabIndex = -1;
for (const tab of field.tabs) {
tabIndex++;
const isNamedTab = tabHasName(tab);
const tabAsField = {
...tab,
type: 'tab'
};
const {
indexPath: tabIndexPath,
path: tabPath,
schemaPath: tabSchemaPath
} = getFieldPaths({
field: tabAsField,
index: tabIndex,
parentIndexPath: indexPath,
parentPath: path,
parentSchemaPath: schemaPath
});
let tabFieldsPermissions = undefined;
// The tabs field does not have its own permissions as it's unnamed => use parentFieldsPermissions
if (typeof parentFieldsPermissions === 'boolean') {
tabFieldsPermissions = parentFieldsPermissions;
} else {
if ('name' in tab) {
const tabPermissions = parentFieldsPermissions?.[tab.name];
if (typeof tabPermissions === 'boolean') {
tabFieldsPermissions = tabPermissions;
} else {
tabFieldsPermissions = tabPermissions?.fields;
}
} else {
tabFieldsPermissions = parentFieldsPermissions;
}
}
const tabVersion = {
name: 'name' in tab ? tab.name : null,
fields: buildVersionFields({
clientSchemaMap,
customDiffComponents,
entitySlug,
fields: tab.fields,
fieldsPermissions: tabFieldsPermissions,
i18n,
modifiedOnly,
nestingLevel: nestingLevel + 1,
parentIndexPath: isNamedTab ? '' : tabIndexPath,
parentIsLocalized: parentIsLocalized || tab.localized,
parentPath: isNamedTab ? tabPath : 'name' in field ? path : parentPath,
parentSchemaPath: tabSchemaPath,
req,
selectedLocales,
versionFromSiblingData: 'name' in tab ? valueFrom?.[tab.name] : valueFrom,
versionToSiblingData: 'name' in tab ? valueTo?.[tab.name] : valueTo
}).versionFields,
label: typeof tab.label === 'function' ? tab.label({
i18n,
t: i18n.t
}) : tab.label
};
if (tabVersion?.fields?.length) {
baseVersionField.tabs.push(tabVersion);
}
}
if (modifiedOnly && !baseVersionField.tabs.length) {
return null;
}
} else if ('fields' in field) {
let subFieldsPermissions = undefined;
if ('name' in field && typeof fieldPermissions !== 'undefined') {
// Named fields like arrays
subFieldsPermissions = typeof fieldPermissions === 'boolean' ? fieldPermissions : fieldPermissions.fields;
} else {
// Unnamed fields like collapsible and row inherit directly from parent permissions
subFieldsPermissions = parentFieldsPermissions;
}
if (field.type === 'array' && (valueTo || valueFrom)) {
const maxLength = Math.max(Array.isArray(valueTo) ? valueTo.length : 0, Array.isArray(valueFrom) ? valueFrom.length : 0);
baseVersionField.rows = [];
for (let i = 0; i < maxLength; i++) {
const fromRow = Array.isArray(valueFrom) && valueFrom?.[i] || {};
const toRow = Array.isArray(valueTo) && valueTo?.[i] || {};
const versionFields = buildVersionFields({
clientSchemaMap,
customDiffComponents,
entitySlug,
fields: field.fields,
fieldsPermissions: subFieldsPermissions,
i18n,
modifiedOnly,
nestingLevel: nestingLevel + 1,
parentIndexPath: 'name' in field ? '' : indexPath,
parentIsLocalized: parentIsLocalized || field.localized,
parentPath: ('name' in field ? path : parentPath) + '.' + i,
parentSchemaPath: schemaPath,
req,
selectedLocales,
versionFromSiblingData: fromRow,
versionToSiblingData: toRow
}).versionFields;
if (versionFields?.length) {
baseVersionField.rows[i] = versionFields;
}
}
if (!baseVersionField.rows?.length && modifiedOnly) {
return null;
}
} else {
baseVersionField.fields = buildVersionFields({
clientSchemaMap,
customDiffComponents,
entitySlug,
fields: field.fields,
fieldsPermissions: subFieldsPermissions,
i18n,
modifiedOnly,
nestingLevel: field.type !== 'row' ? nestingLevel + 1 : nestingLevel,
parentIndexPath: 'name' in field ? '' : indexPath,
parentIsLocalized: parentIsLocalized || 'localized' in field && field.localized,
parentPath: 'name' in field ? path : parentPath,
parentSchemaPath: schemaPath,
req,
selectedLocales,
versionFromSiblingData: valueFrom,
versionToSiblingData: valueTo
}).versionFields;
if (modifiedOnly && !baseVersionField.fields?.length) {
return null;
}
}
} else if (field.type === 'blocks') {
baseVersionField.rows = [];
const maxLength = Math.max(Array.isArray(valueTo) ? valueTo.length : 0, Array.isArray(valueFrom) ? valueFrom.length : 0);
for (let i = 0; i < maxLength; i++) {
const fromRow = Array.isArray(valueFrom) && valueFrom?.[i] || {};
const toRow = Array.isArray(valueTo) && valueTo?.[i] || {};
const blockSlugToMatch = toRow?.blockType ?? fromRow?.blockType;
const toBlock = req.payload.blocks[blockSlugToMatch] ?? (field.blockReferences ?? field.blocks).find(block => typeof block !== 'string' && block.slug === blockSlugToMatch);
let fields = [];
if (toRow.blockType === fromRow.blockType) {
fields = toBlock.fields;
} else {
const fromBlockSlugToMatch = toRow?.blockType ?? fromRow?.blockType;
const fromBlock = req.payload.blocks[fromBlockSlugToMatch] ?? (field.blockReferences ?? field.blocks).find(block => typeof block !== 'string' && block.slug === fromBlockSlugToMatch);
if (fromBlock) {
fields = getUniqueListBy([...toBlock.fields, ...fromBlock.fields], 'name');
} else {
fields = toBlock.fields;
}
}
let blockFieldsPermissions = undefined;
// fieldPermissions will be set here, as the blocks field has a name
if (typeof fieldPermissions === 'boolean') {
blockFieldsPermissions = fieldPermissions;
} else if (typeof fieldPermissions?.blocks === 'boolean') {
blockFieldsPermissions = fieldPermissions.blocks;
} else {
const permissionsBlockSpecific = fieldPermissions?.blocks?.[blockSlugToMatch];
if (typeof permissionsBlockSpecific === 'boolean') {
blockFieldsPermissions = permissionsBlockSpecific;
} else {
blockFieldsPermissions = permissionsBlockSpecific?.fields;
}
}
const versionFields = buildVersionFields({
clientSchemaMap,
customDiffComponents,
entitySlug,
fields,
fieldsPermissions: blockFieldsPermissions,
i18n,
modifiedOnly,
nestingLevel: nestingLevel + 1,
parentIndexPath: 'name' in field ? '' : indexPath,
parentIsLocalized: parentIsLocalized || 'localized' in field && field.localized,
parentPath: ('name' in field ? path : parentPath) + '.' + i,
parentSchemaPath: schemaPath + '.' + toBlock.slug,
req,
selectedLocales,
versionFromSiblingData: fromRow,
versionToSiblingData: toRow
}).versionFields;
if (versionFields?.length) {
baseVersionField.rows[i] = versionFields;
}
}
if (!baseVersionField.rows?.length && modifiedOnly) {
return null;
}
}
const clientDiffProps = {
baseVersionField: {
...baseVersionField,
CustomComponent: undefined
},
/**
* TODO: Change to valueFrom in 4.0
*/
comparisonValue: valueFrom,
/**
* @deprecated remove in 4.0. Each field should handle its own diffing logic
*/
diffMethod: 'diffWordsWithSpace',
field: clientField,
fieldPermissions: typeof fieldPermissions === 'undefined' ? parentFieldsPermissions : fieldPermissions,
parentIsLocalized,
nestingLevel: nestingLevel ? nestingLevel : undefined,
/**
* TODO: Change to valueTo in 4.0
*/
versionValue: valueTo
};
if (locale) {
clientDiffProps.locale = locale;
}
const serverDiffProps = {
...clientDiffProps,
clientField,
field,
i18n,
req,
selectedLocales
};
baseVersionField.CustomComponent = RenderServerComponent({
clientProps: clientDiffProps,
Component: CustomComponent,
Fallback: DefaultComponent,
importMap: req.payload.importMap,
key: 'diff component',
serverProps: serverDiffProps
});
return baseVersionField;
};
//# sourceMappingURL=buildVersionFields.js.map

View File

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

View File

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

View File

@@ -0,0 +1,52 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.BindOnceFuture = void 0;
const promise_1 = require("./promise");
/**
* Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked.
*/
class BindOnceFuture {
_isCalled = false;
_deferred = new promise_1.Deferred();
_callback;
_that;
constructor(callback, that) {
this._callback = callback;
this._that = that;
}
get isCalled() {
return this._isCalled;
}
get promise() {
return this._deferred.promise;
}
call(...args) {
if (!this._isCalled) {
this._isCalled = true;
try {
Promise.resolve(this._callback.call(this._that, ...args)).then(val => this._deferred.resolve(val), err => this._deferred.reject(err));
}
catch (err) {
this._deferred.reject(err);
}
}
return this._deferred.promise;
}
}
exports.BindOnceFuture = BindOnceFuture;
//# sourceMappingURL=callback.js.map

View File

@@ -0,0 +1,2 @@
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
module.exports = require("./data/overlapping-plugins.json");

View File

@@ -0,0 +1,14 @@
import { _ as _get } from "./_get.js";
import { _ as _set } from "./_set.js";
function _update(target, property, receiver, isStrict) {
return {
get _() {
return _get(target, property, receiver);
},
set _(value) {
_set(target, property, value, receiver, isStrict);
}
};
}
export { _update as _ };

View File

@@ -0,0 +1,218 @@
"use strict";
exports.intlFormatDistance = intlFormatDistance;
var _index = require("./_lib/normalizeDates.cjs");
var _index2 = require("./constants.cjs");
var _index3 = require("./differenceInCalendarDays.cjs");
var _index4 = require("./differenceInCalendarMonths.cjs");
var _index5 = require("./differenceInCalendarQuarters.cjs");
var _index6 = require("./differenceInCalendarWeeks.cjs");
var _index7 = require("./differenceInCalendarYears.cjs");
var _index8 = require("./differenceInHours.cjs");
var _index9 = require("./differenceInMinutes.cjs");
var _index10 = require("./differenceInSeconds.cjs");
/**
* The {@link intlFormatDistance} function options.
*/
/**
* The unit used to format the distance in {@link intlFormatDistance}.
*/
/**
* @name intlFormatDistance
* @category Common Helpers
* @summary Formats distance between two dates in a human-readable format
* @description
* The function calculates the difference between two dates and formats it as a human-readable string.
*
* The function will pick the most appropriate unit depending on the distance between dates. For example, if the distance is a few hours, it might return `x hours`. If the distance is a few months, it might return `x months`.
*
* You can also specify a unit to force using it regardless of the distance to get a result like `123456 hours`.
*
* See the table below for the unit picking logic:
*
* | Distance between dates | Result (past) | Result (future) |
* | ---------------------- | -------------- | --------------- |
* | 0 seconds | now | now |
* | 1-59 seconds | X seconds ago | in X seconds |
* | 1-59 minutes | X minutes ago | in X minutes |
* | 1-23 hours | X hours ago | in X hours |
* | 1 day | yesterday | tomorrow |
* | 2-6 days | X days ago | in X days |
* | 7 days | last week | next week |
* | 8 days-1 month | X weeks ago | in X weeks |
* | 1 month | last month | next month |
* | 2-3 months | X months ago | in X months |
* | 1 quarter | last quarter | next quarter |
* | 2-3 quarters | X quarters ago | in X quarters |
* | 1 year | last year | next year |
* | 2+ years | X years ago | in X years |
*
* @param laterDate - The date
* @param earlierDate - The date to compare with.
* @param options - An object with options.
* See MDN for details [Locale identification and negotiation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)
* The narrow one could be similar to the short one for some locales.
*
* @returns The distance in words according to language-sensitive relative time formatting.
*
* @throws `date` must not be Invalid Date
* @throws `baseDate` must not be Invalid Date
* @throws `options.unit` must not be invalid Unit
* @throws `options.locale` must not be invalid locale
* @throws `options.localeMatcher` must not be invalid localeMatcher
* @throws `options.numeric` must not be invalid numeric
* @throws `options.style` must not be invalid style
*
* @example
* // What is the distance between the dates when the fist date is after the second?
* intlFormatDistance(
* new Date(1986, 3, 4, 11, 30, 0),
* new Date(1986, 3, 4, 10, 30, 0)
* )
* //=> 'in 1 hour'
*
* // What is the distance between the dates when the fist date is before the second?
* intlFormatDistance(
* new Date(1986, 3, 4, 10, 30, 0),
* new Date(1986, 3, 4, 11, 30, 0)
* )
* //=> '1 hour ago'
*
* @example
* // Use the unit option to force the function to output the result in quarters. Without setting it, the example would return "next year"
* intlFormatDistance(
* new Date(1987, 6, 4, 10, 30, 0),
* new Date(1986, 3, 4, 10, 30, 0),
* { unit: 'quarter' }
* )
* //=> 'in 5 quarters'
*
* @example
* // Use the locale option to get the result in Spanish. Without setting it, the example would return "in 1 hour".
* intlFormatDistance(
* new Date(1986, 3, 4, 11, 30, 0),
* new Date(1986, 3, 4, 10, 30, 0),
* { locale: 'es' }
* )
* //=> 'dentro de 1 hora'
*
* @example
* // Use the numeric option to force the function to use numeric values. Without setting it, the example would return "tomorrow".
* intlFormatDistance(
* new Date(1986, 3, 5, 11, 30, 0),
* new Date(1986, 3, 4, 11, 30, 0),
* { numeric: 'always' }
* )
* //=> 'in 1 day'
*
* @example
* // Use the style option to force the function to use short values. Without setting it, the example would return "in 2 years".
* intlFormatDistance(
* new Date(1988, 3, 4, 11, 30, 0),
* new Date(1986, 3, 4, 11, 30, 0),
* { style: 'short' }
* )
* //=> 'in 2 yr'
*/
function intlFormatDistance(laterDate, earlierDate, options) {
let value = 0;
let unit;
const [laterDate_, earlierDate_] = (0, _index.normalizeDates)(
options?.in,
laterDate,
earlierDate,
);
if (!options?.unit) {
// Get the unit based on diffInSeconds calculations if no unit is specified
const diffInSeconds = (0, _index10.differenceInSeconds)(
laterDate_,
earlierDate_,
); // The smallest unit
if (Math.abs(diffInSeconds) < _index2.secondsInMinute) {
value = (0, _index10.differenceInSeconds)(laterDate_, earlierDate_);
unit = "second";
} else if (Math.abs(diffInSeconds) < _index2.secondsInHour) {
value = (0, _index9.differenceInMinutes)(laterDate_, earlierDate_);
unit = "minute";
} else if (
Math.abs(diffInSeconds) < _index2.secondsInDay &&
Math.abs(
(0, _index3.differenceInCalendarDays)(laterDate_, earlierDate_),
) < 1
) {
value = (0, _index8.differenceInHours)(laterDate_, earlierDate_);
unit = "hour";
} else if (
Math.abs(diffInSeconds) < _index2.secondsInWeek &&
(value = (0, _index3.differenceInCalendarDays)(
laterDate_,
earlierDate_,
)) &&
Math.abs(value) < 7
) {
unit = "day";
} else if (Math.abs(diffInSeconds) < _index2.secondsInMonth) {
value = (0, _index6.differenceInCalendarWeeks)(laterDate_, earlierDate_);
unit = "week";
} else if (Math.abs(diffInSeconds) < _index2.secondsInQuarter) {
value = (0, _index4.differenceInCalendarMonths)(laterDate_, earlierDate_);
unit = "month";
} else if (Math.abs(diffInSeconds) < _index2.secondsInYear) {
if (
(0, _index5.differenceInCalendarQuarters)(laterDate_, earlierDate_) < 4
) {
// To filter out cases that are less than a year but match 4 quarters
value = (0, _index5.differenceInCalendarQuarters)(
laterDate_,
earlierDate_,
);
unit = "quarter";
} else {
value = (0, _index7.differenceInCalendarYears)(
laterDate_,
earlierDate_,
);
unit = "year";
}
} else {
value = (0, _index7.differenceInCalendarYears)(laterDate_, earlierDate_);
unit = "year";
}
} else {
// Get the value if unit is specified
unit = options?.unit;
if (unit === "second") {
value = (0, _index10.differenceInSeconds)(laterDate_, earlierDate_);
} else if (unit === "minute") {
value = (0, _index9.differenceInMinutes)(laterDate_, earlierDate_);
} else if (unit === "hour") {
value = (0, _index8.differenceInHours)(laterDate_, earlierDate_);
} else if (unit === "day") {
value = (0, _index3.differenceInCalendarDays)(laterDate_, earlierDate_);
} else if (unit === "week") {
value = (0, _index6.differenceInCalendarWeeks)(laterDate_, earlierDate_);
} else if (unit === "month") {
value = (0, _index4.differenceInCalendarMonths)(laterDate_, earlierDate_);
} else if (unit === "quarter") {
value = (0, _index5.differenceInCalendarQuarters)(
laterDate_,
earlierDate_,
);
} else if (unit === "year") {
value = (0, _index7.differenceInCalendarYears)(laterDate_, earlierDate_);
}
}
const rtf = new Intl.RelativeTimeFormat(options?.locale, {
numeric: "auto",
...options,
});
return rtf.format(value, unit);
}

View File

@@ -0,0 +1,23 @@
import { _ as _define_property } from "./_define_property.js";
function _object_spread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys = ownKeys.concat(
Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
})
);
}
ownKeys.forEach(function(key) {
_define_property(target, key, source[key]);
});
}
return target;
}
export { _object_spread as _ };

View File

@@ -0,0 +1,69 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = literalTemplate;
var _options = require("./options.js");
var _parse = require("./parse.js");
var _populate = require("./populate.js");
function literalTemplate(formatter, tpl, opts) {
const {
metadata,
names
} = buildLiteralData(formatter, tpl, opts);
return arg => {
const defaultReplacements = {};
arg.forEach((replacement, i) => {
defaultReplacements[names[i]] = replacement;
});
return arg => {
const replacements = (0, _options.normalizeReplacements)(arg);
if (replacements) {
Object.keys(replacements).forEach(key => {
if (hasOwnProperty.call(defaultReplacements, key)) {
throw new Error("Unexpected replacement overlap.");
}
});
}
return formatter.unwrap((0, _populate.default)(metadata, replacements ? Object.assign(replacements, defaultReplacements) : defaultReplacements));
};
};
}
function buildLiteralData(formatter, tpl, opts) {
let prefix = "BABEL_TPL$";
const raw = tpl.join("");
do {
prefix = "$$" + prefix;
} while (raw.includes(prefix));
const {
names,
code
} = buildTemplateCode(tpl, prefix);
const metadata = (0, _parse.default)(formatter, formatter.code(code), {
parser: opts.parser,
placeholderWhitelist: new Set(names.concat(opts.placeholderWhitelist ? Array.from(opts.placeholderWhitelist) : [])),
placeholderPattern: opts.placeholderPattern,
preserveComments: opts.preserveComments,
syntacticPlaceholders: opts.syntacticPlaceholders
});
return {
metadata,
names
};
}
function buildTemplateCode(tpl, prefix) {
const names = [];
let code = tpl[0];
for (let i = 1; i < tpl.length; i++) {
const value = `${prefix}${i - 1}`;
names.push(value);
code += value + tpl[i];
}
return {
names,
code
};
}
//# sourceMappingURL=literal.js.map

View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.paddingLeft = exports.paddingBottom = exports.paddingRight = exports.paddingTop = void 0;
var paddingForSide = function (side) { return ({
name: "padding-" + side,
initialValue: '0',
prefix: false,
type: 3 /* TYPE_VALUE */,
format: 'length-percentage'
}); };
exports.paddingTop = paddingForSide('top');
exports.paddingRight = paddingForSide('right');
exports.paddingBottom = paddingForSide('bottom');
exports.paddingLeft = paddingForSide('left');
//# sourceMappingURL=padding.js.map

View File

@@ -0,0 +1,80 @@
"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 schema_exports = {};
__export(schema_exports, {
PgSchema: () => PgSchema,
isPgSchema: () => isPgSchema,
pgSchema: () => pgSchema
});
module.exports = __toCommonJS(schema_exports);
var import_entity = require("../entity.cjs");
var import_sql = require("../sql/sql.cjs");
var import_enum = require("./columns/enum.cjs");
var import_sequence = require("./sequence.cjs");
var import_table = require("./table.cjs");
var import_view = require("./view.cjs");
class PgSchema {
constructor(schemaName) {
this.schemaName = schemaName;
}
static [import_entity.entityKind] = "PgSchema";
table = (name, columns, extraConfig) => {
return (0, import_table.pgTableWithSchema)(name, columns, extraConfig, this.schemaName);
};
view = (name, columns) => {
return (0, import_view.pgViewWithSchema)(name, columns, this.schemaName);
};
materializedView = (name, columns) => {
return (0, import_view.pgMaterializedViewWithSchema)(name, columns, this.schemaName);
};
enum(enumName, input) {
return Array.isArray(input) ? (0, import_enum.pgEnumWithSchema)(
enumName,
[...input],
this.schemaName
) : (0, import_enum.pgEnumObjectWithSchema)(enumName, input, this.schemaName);
}
sequence = (name, options) => {
return (0, import_sequence.pgSequenceWithSchema)(name, options, this.schemaName);
};
getSQL() {
return new import_sql.SQL([import_sql.sql.identifier(this.schemaName)]);
}
shouldOmitSQLParens() {
return true;
}
}
function isPgSchema(obj) {
return (0, import_entity.is)(obj, PgSchema);
}
function pgSchema(name) {
if (name === "public") {
throw new Error(
`You can't specify 'public' as schema name. Postgres is using public schema by default. If you want to use 'public' schema, just use pgTable() instead of creating a schema`
);
}
return new PgSchema(name);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PgSchema,
isPgSchema,
pgSchema
});
//# sourceMappingURL=schema.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"clearSession.d.ts","sourceRoot":"","sources":["../../../../src/session/clearSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAG1D"}

View File

@@ -0,0 +1,40 @@
const formatRelativeLocale = {
lastWeek: (date) => {
switch (date.getDay()) {
case 0:
return "'prošlu nedjelju u' p";
case 3:
return "'prošlu srijedu u' p";
case 6:
return "'prošlu subotu u' p";
default:
return "'prošli' EEEE 'u' p";
}
},
yesterday: "'jučer u' p",
today: "'danas u' p",
tomorrow: "'sutra u' p",
nextWeek: (date) => {
switch (date.getDay()) {
case 0:
return "'iduću nedjelju u' p";
case 3:
return "'iduću srijedu u' p";
case 6:
return "'iduću subotu u' p";
default:
return "'prošli' EEEE 'u' p";
}
},
other: "P",
};
export const formatRelative = (token, date, _baseDate, _options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date);
}
return format;
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../../src/asyncContext/index.ts"],"sourcesContent":["import type { Carrier } from './../carrier';\nimport { getMainCarrier, getSentryCarrier } from './../carrier';\nimport { getStackAsyncContextStrategy } from './stackStrategy';\nimport type { AsyncContextStrategy } from './types';\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nexport function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n const sentry = getSentryCarrier(registry);\n sentry.acs = strategy;\n}\n\n/**\n * Get the current async context strategy.\n * If none has been setup, the default will be used.\n */\nexport function getAsyncContextStrategy(carrier: Carrier): AsyncContextStrategy {\n const sentry = getSentryCarrier(carrier);\n\n if (sentry.acs) {\n return sentry.acs;\n }\n\n // Otherwise, use the default one (stack)\n return getStackAsyncContextStrategy();\n}\n"],"names":[],"mappings":";;;AAKA;AACA;AACA;AACA;AACA;AACO,SAAS,uBAAuB,CAAC,QAAQ,EAA0C;AAC1F;AACA,EAAE,MAAM,QAAA,GAAW,cAAc,EAAE;AACnC,EAAE,MAAM,MAAA,GAAS,gBAAgB,CAAC,QAAQ,CAAC;AAC3C,EAAE,MAAM,CAAC,GAAA,GAAM,QAAQ;AACvB;;AAEA;AACA;AACA;AACA;AACO,SAAS,uBAAuB,CAAC,OAAO,EAAiC;AAChF,EAAE,MAAM,MAAA,GAAS,gBAAgB,CAAC,OAAO,CAAC;;AAE1C,EAAE,IAAI,MAAM,CAAC,GAAG,EAAE;AAClB,IAAI,OAAO,MAAM,CAAC,GAAG;AACrB,EAAE;;AAEF;AACA,EAAE,OAAO,4BAA4B,EAAE;AACvC;;;;"}

View File

@@ -0,0 +1,42 @@
{
"name": "@img/sharp-libvips-linuxmusl-arm64",
"version": "1.2.4",
"description": "Prebuilt libvips and dependencies for use with sharp on Linux (musl) 64-bit ARM",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",
"repository": {
"type": "git",
"url": "git+https://github.com/lovell/sharp-libvips.git",
"directory": "npm/linuxmusl-arm64"
},
"license": "LGPL-3.0-or-later",
"funding": {
"url": "https://opencollective.com/libvips"
},
"preferUnplugged": true,
"publishConfig": {
"access": "public"
},
"files": [
"lib",
"versions.json"
],
"type": "commonjs",
"exports": {
"./lib": "./lib/index.js",
"./package": "./package.json",
"./versions": "./versions.json"
},
"config": {
"musl": ">=1.2.2"
},
"os": [
"linux"
],
"libc": [
"musl"
],
"cpu": [
"arm64"
]
}

View File

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

View File

@@ -0,0 +1,20 @@
Prism.languages.icon = {
'comment': /#.*/,
'string': {
pattern: /(["'])(?:(?!\1)[^\\\r\n_]|\\.|_(?!\1)(?:\r\n|[\s\S]))*\1/,
greedy: true
},
'number': /\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i,
'builtin-keyword': {
pattern: /&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/,
alias: 'variable'
},
'directive': {
pattern: /\$\w+/,
alias: 'builtin'
},
'keyword': /\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/,
'function': /\b(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/,
'operator': /[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|<?=?)|>>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/,
'punctuation': /[\[\](){},;]/
};

View File

@@ -0,0 +1,12 @@
import type { ReadonlyURLSearchParams } from 'next/navigation.js';
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 declare function parseSearchParams(searchParams: ReadonlyURLSearchParams): qs.ParsedQs;
//# sourceMappingURL=parseSearchParams.d.ts.map

View File

@@ -0,0 +1,15 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: "'গত' eeee 'সময়' p",
yesterday: "'গতকাল' 'সময়' p",
today: "'আজ' 'সময়' p",
tomorrow: "'আগামীকাল' 'সময়' p",
nextWeek: "eeee 'সময়' p",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,9 @@
export const validateMimeType = (mimeType, allowedMimeTypes)=>{
if (allowedMimeTypes.length === 0) {
return true;
}
const cleanedMimeTypes = allowedMimeTypes.map((v)=>v.replace('*', ''));
return cleanedMimeTypes.some((cleanedMimeType)=>mimeType.startsWith(cleanedMimeType));
};
//# sourceMappingURL=validateMimeType.js.map

View File

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

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"optionsReducer.js","names":["getTranslation","reduceToIDs","options","reduce","ids","option","id","optionsReducer","state","action","type","collection","data","hasMultipleRelations","i18n","relation","labelKey","admin","useAsTitle","loadedIDs","docs","doc","indexOf","push","label","value","newOptions","optionsToAddTo","find","optionGroup","labels","plural","newSubOptions","relationTo","undefined","required","t"],"sources":["../../../../../src/elements/WhereBuilder/Condition/Relationship/optionsReducer.ts"],"sourcesContent":["'use client'\nimport { getTranslation } from '@payloadcms/translations'\n\nimport type { Action, Option } from './types.js'\n\nconst reduceToIDs = (options) =>\n options.reduce((ids, option) => {\n if (option.options) {\n return [...ids, ...reduceToIDs(option.options)]\n }\n\n return [...ids, option.id]\n }, [])\n\nconst optionsReducer = (state: Option[], action: Action): Option[] => {\n switch (action.type) {\n case 'ADD': {\n const { collection, data, hasMultipleRelations, i18n, relation } = action\n\n const labelKey = collection.admin.useAsTitle || 'id'\n\n const loadedIDs = reduceToIDs(state)\n\n if (!hasMultipleRelations) {\n return [\n ...state,\n ...data.docs.reduce((docs, doc) => {\n if (loadedIDs.indexOf(doc.id) === -1) {\n loadedIDs.push(doc.id)\n return [\n ...docs,\n {\n label: doc[labelKey],\n value: doc.id,\n },\n ]\n }\n return docs\n }, []),\n ]\n }\n\n const newOptions = [...state]\n const optionsToAddTo = newOptions.find(\n (optionGroup) => optionGroup.label === getTranslation(collection.labels.plural, i18n),\n )\n\n const newSubOptions = data.docs.reduce((docs, doc) => {\n if (loadedIDs.indexOf(doc.id) === -1) {\n loadedIDs.push(doc.id)\n\n return [\n ...docs,\n {\n label: doc[labelKey],\n relationTo: relation,\n value: doc.id,\n },\n ]\n }\n\n return docs\n }, [])\n\n if (optionsToAddTo) {\n optionsToAddTo.options = [...optionsToAddTo.options, ...newSubOptions]\n } else {\n newOptions.push({\n label: getTranslation(collection.labels.plural, i18n),\n options: newSubOptions,\n value: undefined,\n })\n }\n\n return newOptions\n }\n\n case 'CLEAR': {\n return action.required ? [] : [{ label: action.i18n.t('general:none'), value: 'null' }]\n }\n\n default: {\n return state\n }\n }\n}\n\nexport default optionsReducer\n"],"mappings":"AAAA;;AACA,SAASA,cAAc,QAAQ;AAI/B,MAAMC,WAAA,GAAeC,OAAA,IACnBA,OAAA,CAAQC,MAAM,CAAC,CAACC,GAAA,EAAKC,MAAA;EACnB,IAAIA,MAAA,CAAOH,OAAO,EAAE;IAClB,OAAO,C,GAAIE,GAAA,E,GAAQH,WAAA,CAAYI,MAAA,CAAOH,OAAO,EAAE;EACjD;EAEA,OAAO,C,GAAIE,GAAA,EAAKC,MAAA,CAAOC,EAAE,CAAC;AAC5B,GAAG,EAAE;AAEP,MAAMC,cAAA,GAAiBA,CAACC,KAAA,EAAiBC,MAAA;EACvC,QAAQA,MAAA,CAAOC,IAAI;IACjB,KAAK;MAAO;QACV,MAAM;UAAEC,UAAU;UAAEC,IAAI;UAAEC,oBAAoB;UAAEC,IAAI;UAAEC;QAAQ,CAAE,GAAGN,MAAA;QAEnE,MAAMO,QAAA,GAAWL,UAAA,CAAWM,KAAK,CAACC,UAAU,IAAI;QAEhD,MAAMC,SAAA,GAAYlB,WAAA,CAAYO,KAAA;QAE9B,IAAI,CAACK,oBAAA,EAAsB;UACzB,OAAO,C,GACFL,KAAA,E,GACAI,IAAA,CAAKQ,IAAI,CAACjB,MAAM,CAAC,CAACiB,IAAA,EAAMC,GAAA;YACzB,IAAIF,SAAA,CAAUG,OAAO,CAACD,GAAA,CAAIf,EAAE,MAAM,CAAC,GAAG;cACpCa,SAAA,CAAUI,IAAI,CAACF,GAAA,CAAIf,EAAE;cACrB,OAAO,C,GACFc,IAAA,EACH;gBACEI,KAAA,EAAOH,GAAG,CAACL,QAAA,CAAS;gBACpBS,KAAA,EAAOJ,GAAA,CAAIf;cACb,EACD;YACH;YACA,OAAOc,IAAA;UACT,GAAG,EAAE,EACN;QACH;QAEA,MAAMM,UAAA,GAAa,C,GAAIlB,KAAA,CAAM;QAC7B,MAAMmB,cAAA,GAAiBD,UAAA,CAAWE,IAAI,CACnCC,WAAA,IAAgBA,WAAA,CAAYL,KAAK,KAAKxB,cAAA,CAAeW,UAAA,CAAWmB,MAAM,CAACC,MAAM,EAAEjB,IAAA;QAGlF,MAAMkB,aAAA,GAAgBpB,IAAA,CAAKQ,IAAI,CAACjB,MAAM,CAAC,CAACiB,IAAA,EAAMC,GAAA;UAC5C,IAAIF,SAAA,CAAUG,OAAO,CAACD,GAAA,CAAIf,EAAE,MAAM,CAAC,GAAG;YACpCa,SAAA,CAAUI,IAAI,CAACF,GAAA,CAAIf,EAAE;YAErB,OAAO,C,GACFc,IAAA,EACH;cACEI,KAAA,EAAOH,GAAG,CAACL,QAAA,CAAS;cACpBiB,UAAA,EAAYlB,QAAA;cACZU,KAAA,EAAOJ,GAAA,CAAIf;YACb,EACD;UACH;UAEA,OAAOc,IAAA;QACT,GAAG,EAAE;QAEL,IAAIO,cAAA,EAAgB;UAClBA,cAAA,CAAezB,OAAO,GAAG,C,GAAIyB,cAAA,CAAezB,OAAO,E,GAAK8B,aAAA,CAAc;QACxE,OAAO;UACLN,UAAA,CAAWH,IAAI,CAAC;YACdC,KAAA,EAAOxB,cAAA,CAAeW,UAAA,CAAWmB,MAAM,CAACC,MAAM,EAAEjB,IAAA;YAChDZ,OAAA,EAAS8B,aAAA;YACTP,KAAA,EAAOS;UACT;QACF;QAEA,OAAOR,UAAA;MACT;IAEA,KAAK;MAAS;QACZ,OAAOjB,MAAA,CAAO0B,QAAQ,GAAG,EAAE,GAAG,CAAC;UAAEX,KAAA,EAAOf,MAAA,CAAOK,IAAI,CAACsB,CAAC,CAAC;UAAiBX,KAAA,EAAO;QAAO,EAAE;MACzF;IAEA;MAAS;QACP,OAAOjB,KAAA;MACT;EACF;AACF;AAEA,eAAeD,cAAA","ignoreList":[]}

View File

@@ -0,0 +1,4 @@
import React from 'react';
import './index.scss';
export declare const MenuIcon: React.FC;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,62 @@
import { entityKind } from "../entity.cjs";
import type { SQL } from "../sql/sql.cjs";
import type { AnySingleStoreColumn, SingleStoreColumn } from "./columns/index.cjs";
import type { SingleStoreTable } from "./table.cjs";
interface IndexConfig {
name: string;
columns: IndexColumn[];
/**
* If true, the index will be created as `create unique index` instead of `create index`.
*/
unique?: boolean;
/**
* If set, the index will be created as `create index ... using { 'btree' | 'hash' }`.
*/
using?: 'btree' | 'hash';
/**
* If set, the index will be created as `create index ... algorythm { 'default' | 'inplace' | 'copy' }`.
*/
algorythm?: 'default' | 'inplace' | 'copy';
/**
* If set, adds locks to the index creation.
*/
lock?: 'default' | 'none' | 'shared' | 'exclusive';
}
export type IndexColumn = SingleStoreColumn | SQL;
export declare class IndexBuilderOn {
private name;
private unique;
static readonly [entityKind]: string;
constructor(name: string, unique: boolean);
on(...columns: [IndexColumn, ...IndexColumn[]]): IndexBuilder;
}
export interface AnyIndexBuilder {
build(table: SingleStoreTable): Index;
}
export interface IndexBuilder extends AnyIndexBuilder {
}
export declare class IndexBuilder implements AnyIndexBuilder {
static readonly [entityKind]: string;
constructor(name: string, columns: IndexColumn[], unique: boolean);
using(using: IndexConfig['using']): this;
algorythm(algorythm: IndexConfig['algorythm']): this;
lock(lock: IndexConfig['lock']): this;
}
export declare class Index {
static readonly [entityKind]: string;
readonly config: IndexConfig & {
table: SingleStoreTable;
};
constructor(config: IndexConfig, table: SingleStoreTable);
}
export type GetColumnsTableName<TColumns> = TColumns extends AnySingleStoreColumn<{
tableName: infer TTableName extends string;
}> | AnySingleStoreColumn<{
tableName: infer TTableName extends string;
}>[] ? TTableName : never;
export declare function index(name: string): IndexBuilderOn;
export declare function uniqueIndex(name: string): IndexBuilderOn;
export {};
/** @internal */
/** @internal */
/** @internal */

View File

@@ -0,0 +1 @@
{"version":3,"file":"deployment.cjs","names":[],"sources":["../../../../src/rest/commands/utils/deployment.ts"],"sourcesContent":["import type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport interface TriggerDeploymentResult {\n\tid: string;\n\texternal_id: string;\n\tproject: string;\n\ttarget: string;\n\tstatus: 'building' | 'ready' | 'error' | 'canceled';\n\turl?: string;\n\tdate_created: string;\n}\n\nexport interface TriggerDeploymentOptions {\n\tpreview?: boolean;\n\tclear_cache?: boolean;\n}\n\n/**\n * Trigger a new deployment for a project.\n *\n * @param provider The provider type (e.g. 'vercel')\n * @param projectId The project ID to deploy\n * @param options Deployment options (preview, clear_cache)\n *\n * @returns The deployment trigger result with deployment ID and status.\n * @throws Will throw if provider or projectId is empty\n */\nexport const triggerDeployment =\n\t<Schema>(\n\t\tprovider: string,\n\t\tprojectId: string,\n\t\toptions?: TriggerDeploymentOptions,\n\t): RestCommand<TriggerDeploymentResult, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(provider, 'Provider cannot be empty');\n\t\tthrowIfEmpty(projectId, 'Project ID cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/deployments/${provider}/projects/${projectId}/deploy`,\n\t\t\tmethod: 'POST',\n\t\t\t...(options && { body: JSON.stringify(options) }),\n\t\t};\n\t};\n\n/**\n * Cancel a deployment run.\n *\n * @param provider The provider type (e.g. 'vercel')\n * @param runId The run ID to cancel\n *\n * @returns The updated run object.\n * @throws Will throw if provider or runId is empty\n */\nexport const cancelDeployment =\n\t<Schema>(provider: string, runId: string): RestCommand<TriggerDeploymentResult, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(provider, 'Provider cannot be empty');\n\t\tthrowIfEmpty(runId, 'Run ID cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/deployments/${provider}/runs/${runId}/cancel`,\n\t\t\tmethod: 'POST',\n\t\t};\n\t};\n"],"mappings":"kDA4Ba,GAEX,EACA,EACA,SAGA,EAAA,aAAa,EAAU,2BAA2B,CAClD,EAAA,aAAa,EAAW,6BAA6B,CAE9C,CACN,KAAM,gBAAgB,EAAS,YAAY,EAAU,SACrD,OAAQ,OACR,GAAI,GAAW,CAAE,KAAM,KAAK,UAAU,EAAQ,CAAE,CAChD,EAYU,GACH,EAAkB,SAE1B,EAAA,aAAa,EAAU,2BAA2B,CAClD,EAAA,aAAa,EAAO,yBAAyB,CAEtC,CACN,KAAM,gBAAgB,EAAS,QAAQ,EAAM,SAC7C,OAAQ,OACR"}

View File

@@ -0,0 +1,36 @@
import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from "./common.js";
class MySqlIntBuilder extends MySqlColumnBuilderWithAutoIncrement {
static [entityKind] = "MySqlIntBuilder";
constructor(name, config) {
super(name, "number", "MySqlInt");
this.config.unsigned = config ? config.unsigned : false;
}
/** @internal */
build(table) {
return new MySqlInt(table, this.config);
}
}
class MySqlInt extends MySqlColumnWithAutoIncrement {
static [entityKind] = "MySqlInt";
getSQLType() {
return `int${this.config.unsigned ? " unsigned" : ""}`;
}
mapFromDriverValue(value) {
if (typeof value === "string") {
return Number(value);
}
return value;
}
}
function int(a, b) {
const { name, config } = getColumnNameAndConfig(a, b);
return new MySqlIntBuilder(name, config);
}
export {
MySqlInt,
MySqlIntBuilder,
int
};
//# sourceMappingURL=int.js.map

View File

@@ -0,0 +1,314 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export * as PopupList from './PopupButtonList/index.js';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import { useEffectEvent } from '../../hooks/useEffectEvent.js';
import './index.scss';
import { PopupTrigger } from './PopupTrigger/index.js';
const baseClass = 'popup';
/**
* Selector for all elements the browser considers tabbable.
*/
const TABBABLE_SELECTOR = ['a[href]', 'button:not(:disabled)', 'input:not(:disabled):not([type="hidden"])', 'select:not(:disabled)', 'textarea:not(:disabled)', '[tabindex]', '[contenteditable]:not([contenteditable="false"])', 'audio[controls]', 'video[controls]', 'summary'].map(s => `${s}:not([tabindex="-1"])`).join(', ');
/**
* Component that renders a popup, as well as a button that triggers the popup.
*
* The popup is rendered in a portal, and is automatically positioned above / below the trigger,
* depending on the verticalAlign prop and the space available.
*/
export const Popup = props => {
const {
id,
button,
buttonClassName,
buttonSize,
buttonType = 'default',
caret = true,
children,
className,
disabled,
forceOpen,
horizontalAlign = 'left',
initActive = false,
noBackground,
onToggleClose,
onToggleOpen,
portalClassName,
render,
showOnHover = false,
showScrollbar = false,
size = 'medium',
verticalAlign = 'bottom'
} = props;
const popupRef = useRef(null);
const triggerRef = useRef(null);
/**
* Keeps track of whether the popup was opened via keyboard.
* This is used to determine whether to autofocus the first element in the popup.
* If the popup was opened via mouse, we do not want to autofocus the first element.
*/
const openedViaKeyboardRef = useRef(false);
const [mounted, setMounted] = useState(false);
const [active, setActiveInternal] = useState(initActive);
const [isOnTop, setIsOnTop] = useState(verticalAlign === 'top');
// Track when component is mounted to avoid SSR/client hydration mismatch
useEffect(() => {
setMounted(true);
}, []);
const setActive = useCallback((isActive, viaKeyboard = false) => {
if (isActive) {
openedViaKeyboardRef.current = viaKeyboard;
onToggleOpen?.(true);
} else {
onToggleClose?.();
}
setActiveInternal(isActive);
}, [onToggleClose, onToggleOpen]);
// /////////////////////////////////////
// Position Calculation
//
// Calculates and applies popup position relative to trigger.
// Always checks viewport bounds (for flipping), but only updates
// styles if the calculated position differs from current position.
// /////////////////////////////////////
const updatePosition = useEffectEvent(() => {
const trigger = triggerRef.current;
const popup = popupRef.current;
if (!trigger || !popup) {
return;
}
const triggerRect = trigger.getBoundingClientRect();
const popupRect = popup.getBoundingClientRect();
// Gap between the popup and the trigger/viewport edges (in pixels)
const offset = 10;
// /////////////////////////////////////
// Vertical Positioning
// Calculates the `top` position in absolute page coordinates.
// Uses `verticalAlign` prop as the preferred direction, but flips
// to the opposite side if there's not enough viewport space.
// /////////////////////////////////////
let top;
let onTop = verticalAlign === 'top';
if (verticalAlign === 'bottom') {
top = triggerRect.bottom + window.scrollY + offset;
if (triggerRect.bottom + popupRect.height + offset > window.innerHeight) {
top = triggerRect.top + window.scrollY - popupRect.height - offset;
onTop = true;
}
} else {
top = triggerRect.top + window.scrollY - popupRect.height - offset;
if (triggerRect.top - popupRect.height - offset < 0) {
top = triggerRect.bottom + window.scrollY + offset;
onTop = false;
}
}
setIsOnTop(onTop);
// /////////////////////////////////////
// Horizontal Positioning
// Calculates the `left` position based on `horizontalAlign` prop:
// - 'left': aligns popup's left edge with trigger's left edge
// - 'right': aligns popup's right edge with trigger's right edge
// - 'center': centers popup horizontally relative to trigger
// Then clamps to keep the popup within viewport bounds.
// /////////////////////////////////////
let left = horizontalAlign === 'right' ? triggerRect.right - popupRect.width : horizontalAlign === 'center' ? triggerRect.left + triggerRect.width / 2 - popupRect.width / 2 : triggerRect.left;
left = Math.max(offset, Math.min(left, window.innerWidth - popupRect.width - offset));
// /////////////////////////////////////
// Caret Positioning
// Positions the caret arrow to point at the trigger's horizontal center.
// Clamps between 12px from edges to prevent caret from overflowing the popup.
// /////////////////////////////////////
const triggerCenter = triggerRect.left + triggerRect.width / 2;
const caretLeft = Math.max(12, Math.min(triggerCenter - left, popupRect.width - 12));
// /////////////////////////////////////
// Apply Styles (only if changed)
// Compares calculated position with current styles to avoid unnecessary
// DOM updates during scroll. This prevents visual lag by relying on the absolute
// positioning where possible (popup slightly lags behind when scrolling really fast),
// while still allowing position changes when needed (e.g., sticky parent, viewport flip).
// Values are rounded to match browser's CSS precision and avoid false updates.
// /////////////////////////////////////
const newTop = `${Math.round(top)}px`;
const newLeft = `${Math.round(left + window.scrollX)}px`;
const newCaretLeft = `${Math.round(caretLeft)}px`;
if (popup.style.top !== newTop) {
popup.style.top = newTop;
}
if (popup.style.left !== newLeft) {
popup.style.left = newLeft;
}
if (popup.style.getPropertyValue('--caret-left') !== newCaretLeft) {
popup.style.setProperty('--caret-left', newCaretLeft);
}
});
// /////////////////////////////////////
// Click Outside Handler
// Closes popup when clicking outside both the popup and trigger.
// /////////////////////////////////////
const handleClickOutside = useEffectEvent(e => {
const isOutsidePopup = !popupRef.current?.contains(e.target);
const isOutsideTrigger = !triggerRef.current?.contains(e.target);
if (isOutsidePopup && isOutsideTrigger) {
setActive(false);
}
});
// /////////////////////////////////////
// Keyboard Navigation
// Handles keyboard interactions when popup is open:
// - Escape: closes popup and returns focus to trigger
// - Tab/Shift+Tab: cycles through focusable items with wrapping
// - ArrowUp/ArrowDown: same as Shift+Tab/Tab for menu-style navigation
// Focus is managed manually to support elements the browser might skip.
// /////////////////////////////////////
const handleKeyDown = useEffectEvent(e_0 => {
const popup_0 = popupRef.current;
if (!popup_0 || !active) {
return;
}
if (e_0.key === 'Escape') {
e_0.preventDefault();
setActive(false);
triggerRef.current?.querySelector('button, [tabindex="0"]')?.focus();
return;
}
if (e_0.key === 'Tab' || e_0.key === 'ArrowDown' || e_0.key === 'ArrowUp') {
const focusable = Array.from(popup_0.querySelectorAll(TABBABLE_SELECTOR));
if (focusable.length === 0) {
return;
}
e_0.preventDefault();
const currentIndex = focusable.findIndex(el => el === document.activeElement);
const goBackward = e_0.key === 'ArrowUp' || e_0.key === 'Tab' && e_0.shiftKey;
let nextIndex;
if (currentIndex === -1) {
nextIndex = goBackward ? focusable.length - 1 : 0;
} else if (goBackward) {
nextIndex = currentIndex === 0 ? focusable.length - 1 : currentIndex - 1;
} else {
nextIndex = currentIndex === focusable.length - 1 ? 0 : currentIndex + 1;
}
focusable[nextIndex].focus();
}
});
// /////////////////////////////////////
// Click Handler for Actionable Elements
// Closes popup when buttons/links inside are clicked (includes Enter/Space activation).
// /////////////////////////////////////
const handleActionableClick = useEffectEvent(e_1 => {
const target = e_1.target;
// Allow opting out with data-popup-prevent-close attribute on element or ancestor
if (target.closest('[data-popup-prevent-close]')) {
return;
}
// Check if the clicked element or any ancestor is an actionable element
const actionable = target.closest('button, a[href], [role="button"], [role="menuitem"]');
if (actionable && popupRef.current?.contains(actionable)) {
setActive(false);
}
});
// /////////////////////////////////////
// Effect: Setup/Teardown position and focus management
// /////////////////////////////////////
useEffect(() => {
if (!active) {
return;
}
const popup_1 = popupRef.current;
if (!popup_1) {
return;
}
// /////////////////////////////////////
// Initial Position
// Calculate and apply popup position immediately on open.
// /////////////////////////////////////
updatePosition();
// /////////////////////////////////////
// Focus Management
// When opened via keyboard, autofocus the first focusable button.
// When opened via mouse, skip autofocus to avoid unwanted highlights.
// /////////////////////////////////////
if (openedViaKeyboardRef.current) {
// Use requestAnimationFrame to ensure DOM is ready.
requestAnimationFrame(() => {
const firstFocusable = popup_1.querySelector(TABBABLE_SELECTOR);
firstFocusable?.focus();
});
}
// /////////////////////////////////////
// Event Listeners
// - resize/scroll: recalculate position (only applies styles if changed)
// - mousedown: detect clicks outside to close
// - keydown: handle keyboard navigation
// /////////////////////////////////////
window.addEventListener('resize', updatePosition);
window.addEventListener('scroll', updatePosition, {
capture: true,
passive: true
});
document.addEventListener('mousedown', handleClickOutside);
document.addEventListener('keydown', handleKeyDown);
popup_1.addEventListener('click', handleActionableClick);
return () => {
window.removeEventListener('resize', updatePosition);
window.removeEventListener('scroll', updatePosition, {
capture: true
});
document.removeEventListener('mousedown', handleClickOutside);
document.removeEventListener('keydown', handleKeyDown);
popup_1.removeEventListener('click', handleActionableClick);
};
}, [active]);
useEffect(() => {
if (forceOpen !== undefined) {
setActive(forceOpen);
}
}, [forceOpen, setActive]);
const Trigger = /*#__PURE__*/_jsx(PopupTrigger, {
active: active,
button: button,
buttonType: buttonType,
className: buttonClassName,
disabled: disabled,
noBackground: noBackground,
setActive: setActive,
size: buttonSize
});
return /*#__PURE__*/_jsxs("div", {
className: [baseClass, className].filter(Boolean).join(' '),
id: id,
children: [/*#__PURE__*/_jsx("div", {
className: `${baseClass}__trigger-wrap`,
ref: triggerRef,
children: showOnHover ? /*#__PURE__*/_jsx("div", {
className: `${baseClass}__on-hover-watch`,
onMouseEnter: () => setActive(true),
onMouseLeave: () => setActive(false),
role: "button",
tabIndex: 0,
children: Trigger
}) : Trigger
}), mounted ?
// This ensures that components within the popup, like modals, do not unmount when the popup closes.
// Otherwise, modals opened from the popup will close unexpectedly when clicking within the modal, since
// that closes the popup due to the click outside handler.
/*#__PURE__*/
createPortal(/*#__PURE__*/_jsxs("div", {
className: active ? [`${baseClass}__content`, `${baseClass}--size-${size}`, isOnTop ? `${baseClass}--v-top` : `${baseClass}--v-bottom`, portalClassName].filter(Boolean).join(' ') :
// tests do not accidentally target inactive popups.
`${baseClass}__hidden-content`,
"data-popup-id": id || undefined,
ref: popupRef,
children: [/*#__PURE__*/_jsxs("div", {
className: `${baseClass}__scroll-container${showScrollbar ? ` ${baseClass}__scroll-container--show-scrollbar` : ''}`,
children: [render?.({
close: () => setActive(false)
}), children]
}), caret && /*#__PURE__*/_jsx("div", {
className: `${baseClass}__caret`
})]
}), document.body) : null]
});
};
//# sourceMappingURL=index.js.map

View File

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

View File

@@ -0,0 +1,21 @@
export { AutoScrollActivator, TraversalOrder, useAutoScroller, } from './useAutoScroller';
export type { Options as AutoScrollOptions } from './useAutoScroller';
export { useCachedNode } from './useCachedNode';
export { useCombineActivators } from './useCombineActivators';
export { useDroppableMeasuring, MeasuringFrequency, MeasuringStrategy, } from './useDroppableMeasuring';
export type { DroppableMeasuring } from './useDroppableMeasuring';
export { useInitialValue } from './useInitialValue';
export { useInitialRect } from './useInitialRect';
export { useRect } from './useRect';
export { useRectDelta } from './useRectDelta';
export { useResizeObserver } from './useResizeObserver';
export { useScrollableAncestors } from './useScrollableAncestors';
export { useScrollIntoViewIfNeeded } from './useScrollIntoViewIfNeeded';
export { useScrollOffsets } from './useScrollOffsets';
export { useScrollOffsetsDelta } from './useScrollOffsetsDelta';
export { useSensorSetup } from './useSensorSetup';
export { useSyntheticListeners } from './useSyntheticListeners';
export type { SyntheticListener, SyntheticListeners, SyntheticListenerMap, } from './useSyntheticListeners';
export { useRects } from './useRects';
export { useWindowRect } from './useWindowRect';
export { useDragOverlayMeasuring } from './useDragOverlayMeasuring';

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/auth/baseFields/verification.ts"],"sourcesContent":["import type { Field, FieldHook } from '../../fields/config/types.js'\n\nconst autoRemoveVerificationToken: FieldHook = ({ data, operation, originalDoc, value }) => {\n // If a user manually sets `_verified` to true,\n // and it was `false`, set _verificationToken to `null`.\n // This is useful because the admin panel\n // allows users to set `_verified` to true manually\n\n if (operation === 'update') {\n if (data?._verified === true && originalDoc?._verified === false) {\n return null\n }\n }\n\n return value\n}\n\nexport const verificationFields: Field[] = [\n {\n name: '_verified',\n type: 'checkbox',\n access: {\n create: ({ req: { user } }) => Boolean(user),\n read: ({ req: { user } }) => Boolean(user),\n update: ({ req: { user } }) => Boolean(user),\n },\n admin: {\n components: {\n Field: false,\n },\n },\n label: ({ t }) => t('authentication:verified'),\n },\n {\n name: '_verificationToken',\n type: 'text',\n hidden: true,\n hooks: {\n beforeChange: [autoRemoveVerificationToken],\n },\n },\n] as Field[]\n"],"names":["autoRemoveVerificationToken","data","operation","originalDoc","value","_verified","verificationFields","name","type","access","create","req","user","Boolean","read","update","admin","components","Field","label","t","hidden","hooks","beforeChange"],"mappings":"AAEA,MAAMA,8BAAyC,CAAC,EAAEC,IAAI,EAAEC,SAAS,EAAEC,WAAW,EAAEC,KAAK,EAAE;IACrF,+CAA+C;IAC/C,wDAAwD;IACxD,yCAAyC;IACzC,mDAAmD;IAEnD,IAAIF,cAAc,UAAU;QAC1B,IAAID,MAAMI,cAAc,QAAQF,aAAaE,cAAc,OAAO;YAChE,OAAO;QACT;IACF;IAEA,OAAOD;AACT;AAEA,OAAO,MAAME,qBAA8B;IACzC;QACEC,MAAM;QACNC,MAAM;QACNC,QAAQ;YACNC,QAAQ,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKC,QAAQD;YACvCE,MAAM,CAAC,EAAEH,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKC,QAAQD;YACrCG,QAAQ,CAAC,EAAEJ,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKC,QAAQD;QACzC;QACAI,OAAO;YACLC,YAAY;gBACVC,OAAO;YACT;QACF;QACAC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;IACtB;IACA;QACEb,MAAM;QACNC,MAAM;QACNa,QAAQ;QACRC,OAAO;YACLC,cAAc;gBAACvB;aAA4B;QAC7C;IACF;CACD,CAAW"}

View File

@@ -0,0 +1,34 @@
{
"name": "postgres-interval",
"main": "index.js",
"version": "3.0.0",
"description": "Parse Postgres interval columns",
"license": "MIT",
"repository": "bendrucker/postgres-interval",
"author": {
"name": "Ben Drucker",
"email": "bvdrucker@gmail.com",
"url": "https://www.bendrucker.me"
},
"engines": {
"node": ">=12"
},
"scripts": {
"test": "standard && tape test.js"
},
"keywords": [
"postgres",
"interval",
"parser"
],
"dependencies": {},
"devDependencies": {
"standard": "^16.0.0",
"tape": "^5.0.0"
},
"files": [
"index.js",
"index.d.ts",
"readme.md"
]
}

View File

@@ -0,0 +1,3 @@
import type { Plugin } from "ajv";
declare const prohibited: Plugin<undefined>;
export default prohibited;

View File

@@ -0,0 +1 @@
{"version":3,"file":"collections.cjs","names":[],"sources":["../../../../src/rest/commands/delete/collections.ts"],"sourcesContent":["import type { DirectusCollection } from '../../../schema/collection.js';\nimport type { RestCommand } from '../../types.js';\n\n/**\n * Delete a collection.\n * @param collection\n * @returns\n */\nexport const deleteCollection =\n\t<Schema>(collection: DirectusCollection<Schema>['collection']): RestCommand<void, Schema> =>\n\t() => ({\n\t\tpath: `/collections/${collection}`,\n\t\tmethod: 'DELETE',\n\t});\n"],"mappings":"AAQA,MAAa,EACH,QACF,CACN,KAAM,gBAAgB,IACtB,OAAQ,SACR"}

View File

@@ -0,0 +1,12 @@
import type { CollectionSlug, Document } from '../../index.js';
import type { FolderOrDocument } from '../types.js';
type Args = {
folderFieldName: string;
isUpload: boolean;
relationTo: CollectionSlug;
useAsTitle?: string;
value: Document;
};
export declare function formatFolderOrDocumentItem({ folderFieldName, isUpload, relationTo, useAsTitle, value, }: Args): FolderOrDocument;
export {};
//# sourceMappingURL=formatFolderOrDocumentItem.d.ts.map

View File

@@ -0,0 +1 @@
var l=Object.defineProperty;var i=(n,r)=>l(n,"name",{value:r,configurable:!0});import{r as a}from"./get-pipe-path-BHW2eJdv.mjs";import{constants as f}from"node:os";import{isMainThread as d}from"node:worker_threads";import{c as u}from"./client-BQVF1NaW.mjs";import"./suppress-warnings.mjs";import"module";import"node:path";import"./temporary-directory-CwHp0_NW.mjs";import"node:net";const m=i((n,r)=>{const o=new Map;for(const e of n){const t=i(s=>{r(s),process.listenerCount(e)===0&&process.exit(128+f.signals[e])},"hiddenHandler");process.on(e,t),o.set(e,t)}const{listenerCount:c,listeners:p}=process;process.listenerCount=function(e){let t=Reflect.apply(c,this,arguments);return n.includes(e)&&(t-=1),t},process.listeners=function(e){const t=Reflect.apply(p,this,arguments);return n.includes(e)?t.filter(s=>s!==o.get(e)):t}},"bindHiddenSignalsHandler");d&&(a("./cjs/index.cjs"),(async()=>{const n=await u;n&&m(["SIGINT","SIGTERM"],r=>{n({type:"signal",signal:r})})})());

View File

@@ -0,0 +1,286 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.importAttributesOrAssertions = exports.importAttributes = exports.importAssertions = void 0;
var _acorn = _interopRequireWildcard(require("acorn"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
const leftCurlyBrace = "{".charCodeAt(0);
const space = " ".charCodeAt(0);
const withKeyword = "with";
const assertKeyword = "assert";
const FUNC_STATEMENT = 1,
FUNC_HANGING_STATEMENT = 2,
FUNC_NULLABLE_ID = 4;
const importAttributes = exports.importAttributes = plugin({
keyword: "with"
});
const importAssertions = exports.importAssertions = plugin({
keyword: "assert"
});
const importAttributesOrAssertions = exports.importAttributesOrAssertions = plugin({
keyword: "with-assert"
});
function plugin(options) {
return function (Parser) {
return pluginImpl(options, Parser);
};
}
function pluginImpl(options, Parser) {
// Use supplied version acorn version if present, to avoid
// reference mismatches due to different acorn versions. This
// allows this plugin to be used with Rollup which supplies
// its own internal version of acorn and thereby sidesteps
// the package manager.
const acorn = Parser.acorn || _acorn;
const {
tokTypes: tt,
TokenType
} = acorn;
const {
keyword
} = options;
const isWithKeyword = keyword.includes(withKeyword);
const isAssertKeyword = keyword.includes(assertKeyword);
const isWithOrAssertKeyword = isWithKeyword && isAssertKeyword;
return class extends Parser {
constructor(...args) {
super(...args);
this.withToken = isWithKeyword && new TokenType(withKeyword);
this.assertToken = isAssertKeyword && new TokenType(assertKeyword);
}
_codeAt(i) {
return this.input.charCodeAt(i);
}
_eat(t) {
if (this.type !== t) {
this.unexpected();
}
this.next();
}
_matchKeywordToken() {
return isWithOrAssertKeyword && (this.type === this.withToken || this.type === this.assertToken) || isWithKeyword && this.type === this.withToken || isAssertKeyword && this.type === this.assertToken;
}
_getProperty() {
if (isWithOrAssertKeyword) {
return this.type === this.withToken ? "attributes" : "assertions";
}
return isWithKeyword ? "attributes" : "assertions";
}
readToken(code) {
let i = 0;
let keyword;
let token;
if (isWithOrAssertKeyword) {
if (this.input.slice(this.pos, this.pos + withKeyword.length) === withKeyword) {
keyword = withKeyword;
token = this.withToken;
} else if (this.input.slice(this.pos, this.pos + assertKeyword.length) === assertKeyword) {
keyword = assertKeyword;
token = this.assertToken;
} else {
return super.readToken(code);
}
i += keyword.length;
} else {
keyword = isWithKeyword ? withKeyword : assertKeyword;
token = isWithKeyword ? this.withToken : this.assertToken;
for (; i < keyword.length; i++) {
if (this._codeAt(this.pos + i) !== keyword.charCodeAt(i)) {
return super.readToken(code);
}
}
}
// ensure that the keyword is at the correct location
// ie `with{...` or `with {...`
for (;; i++) {
if (this._codeAt(this.pos + i) === leftCurlyBrace) {
// Found '{'
break;
} else if (this._codeAt(this.pos + i) === space) {
// white space is allowed between `with` and `{`, so continue.
continue;
} else {
return super.readToken(code);
}
}
// If we're inside a dynamic import expression we'll parse
// the `with` keyword as a standard object property name
// ie `import(""./foo.json", { with: { type: "json" } })`
if (this.type.label === "{") {
return super.readToken(code);
}
this.pos += keyword.length;
return this.finishToken(token);
}
parseDynamicImport(node) {
this.next(); // skip `(`
// Parse node.source.
node.source = this.parseMaybeAssign();
if (this.eat(tt.comma)) {
const expr = this.parseExpression();
node.arguments = [expr];
}
this._eat(tt.parenR);
return this.finishNode(node, "ImportExpression");
}
// ported from acorn/src/statement.js pp.parseExport
parseExport(node, exports) {
this.next();
// export * from '...'
if (this.eat(tt.star)) {
if (this.options.ecmaVersion >= 11) {
if (this.eatContextual("as")) {
node.exported = this.parseIdent(true);
this.checkExport(exports, node.exported.name, this.lastTokStart);
} else {
node.exported = null;
}
}
this.expectContextual("from");
if (this.type !== tt.string) {
this.unexpected();
}
node.source = this.parseExprAtom();
if (this._matchKeywordToken()) {
const property = this._getProperty();
this.next();
const attributes = this.parseImportAttributes();
if (attributes) {
node[property] = attributes;
}
}
this.semicolon();
return this.finishNode(node, "ExportAllDeclaration");
}
if (this.eat(tt._default)) {
// export default ...
this.checkExport(exports, "default", this.lastTokStart);
var isAsync;
if (this.type === tt._function || (isAsync = this.isAsyncFunction())) {
var fNode = this.startNode();
this.next();
if (isAsync) {
this.next();
}
node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);
} else if (this.type === tt._class) {
var cNode = this.startNode();
node.declaration = this.parseClass(cNode, "nullableID");
} else {
node.declaration = this.parseMaybeAssign();
this.semicolon();
}
return this.finishNode(node, "ExportDefaultDeclaration");
}
// export var|const|let|function|class ...
if (this.shouldParseExportStatement()) {
node.declaration = this.parseStatement(null);
if (node.declaration.type === "VariableDeclaration") {
this.checkVariableExport(exports, node.declaration.declarations);
} else {
this.checkExport(exports, node.declaration.id.name, node.declaration.id.start);
}
node.specifiers = [];
node.source = null;
} else {
// export { x, y as z } [from '...']
node.declaration = null;
node.specifiers = this.parseExportSpecifiers(exports);
if (this.eatContextual("from")) {
if (this.type !== tt.string) {
this.unexpected();
}
node.source = this.parseExprAtom();
if (this._matchKeywordToken()) {
const property = this._getProperty();
this.next();
const attributes = this.parseImportAttributes();
if (attributes) {
node[property] = attributes;
}
}
} else {
for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
// check for keywords used as local names
var spec = list[i];
this.checkUnreserved(spec.local);
// check if export is defined
this.checkLocalExport(spec.local);
}
node.source = null;
}
this.semicolon();
}
return this.finishNode(node, "ExportNamedDeclaration");
}
parseImport(node) {
this.next();
// import '...'
if (this.type === tt.string) {
node.specifiers = [];
node.source = this.parseExprAtom();
} else {
node.specifiers = this.parseImportSpecifiers();
this.expectContextual("from");
node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected();
}
if (this._matchKeywordToken()) {
const property = this._getProperty();
this.next();
const attributes = this.parseImportAttributes();
if (attributes) {
node[property] = attributes;
}
}
this.semicolon();
return this.finishNode(node, "ImportDeclaration");
}
parseImportAttributes() {
this._eat(tt.braceL);
const attrs = this.parsewithEntries();
this._eat(tt.braceR);
return attrs;
}
parsewithEntries() {
const attrs = [];
const attrNames = new Set();
do {
if (this.type === tt.braceR) {
break;
}
const node = this.startNode();
// parse withionKey : IdentifierName, StringLiteral
let withionKeyNode;
if (this.type === tt.string) {
withionKeyNode = this.parseLiteral(this.value);
} else {
withionKeyNode = this.parseIdent(true);
}
this.next();
node.key = withionKeyNode;
// check if we already have an entry for an attribute
// if a duplicate entry is found, throw an error
// for now this logic will come into play only when someone declares `type` twice
if (attrNames.has(node.key.name)) {
this.raise(this.pos, "Duplicated key in attributes");
}
attrNames.add(node.key.name);
if (this.type !== tt.string) {
this.raise(this.pos, "Only string is supported as an attribute value");
}
node.value = this.parseLiteral(this.value);
attrs.push(this.finishNode(node, "ImportAttribute"));
} while (this.eat(tt.comma));
return attrs;
}
};
}

View File

@@ -0,0 +1,2 @@
const e=require(`../../utils/throw-if-empty.cjs`),t=(t,n,r)=>()=>(e.throwIfEmpty(t,`Keys cannot be empty`),{path:`/policies`,params:r??{},body:JSON.stringify({keys:t,data:n}),method:`PATCH`}),n=(e,t)=>()=>({path:`/policies`,params:t??{},body:JSON.stringify(e),method:`PATCH`}),r=(t,n,r)=>()=>(e.throwIfEmpty(String(t),`Key cannot be empty`),{path:`/policies/${t}`,params:r??{},body:JSON.stringify(n),method:`PATCH`});exports.updatePolicies=t,exports.updatePoliciesBatch=n,exports.updatePolicy=r;
//# sourceMappingURL=policies.cjs.map

View File

@@ -0,0 +1,12 @@
import { Parser } from "../Parser.js";
import type { ParseFlags, ParseResult } from "../types.js";
export declare class TimestampMillisecondsParser extends Parser<number> {
priority: number;
parse(dateString: string): ParseResult<number>;
set<DateType extends Date>(
date: DateType,
_flags: ParseFlags,
value: number,
): [DateType, ParseFlags];
incompatibleTokens: "*";
}

View File

@@ -0,0 +1,9 @@
import { readMigrationFiles } from "../migrator.js";
function migrate(db, config) {
const migrations = readMigrationFiles(config);
db.dialect.migrate(migrations, db.session, config);
}
export {
migrate
};
//# sourceMappingURL=migrator.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"should-ignore-span.d.ts","sourceRoot":"","sources":["../../../src/utils/should-ignore-span.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAQpD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC,EAC1C,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC,aAAa,CAAC,GAClD,OAAO,CAgCT;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAe9E"}

View File

@@ -0,0 +1,90 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
import { util } from "../helpers/util.js";
const promSchema = z.promise(
z.object({
name: z.string(),
age: z.number(),
})
);
test("promise inference", () => {
type promSchemaType = z.infer<typeof promSchema>;
util.assertEqual<promSchemaType, Promise<{ name: string; age: number }>>(true);
});
test("promise parsing success", async () => {
const pr = promSchema.parse(Promise.resolve({ name: "Bobby", age: 10 }));
expect(pr).toBeInstanceOf(Promise);
const result = await pr;
expect(typeof result).toBe("object");
expect(typeof result.age).toBe("number");
expect(typeof result.name).toBe("string");
});
test("promise parsing success 2", () => {
const fakePromise = {
then() {
return this;
},
catch() {
return this;
},
};
promSchema.parse(fakePromise);
});
test("promise parsing fail", async () => {
const bad = promSchema.parse(Promise.resolve({ name: "Bobby", age: "10" }));
// return await expect(bad).resolves.toBe({ name: 'Bobby', age: '10' });
return await expect(bad).rejects.toBeInstanceOf(z.ZodError);
// done();
});
test("promise parsing fail 2", async () => {
const failPromise = promSchema.parse(Promise.resolve({ name: "Bobby", age: "10" }));
await expect(failPromise).rejects.toBeInstanceOf(z.ZodError);
// done();/z
});
test("promise parsing fail", () => {
const bad = () => promSchema.parse({ then: () => {}, catch: {} });
expect(bad).toThrow();
});
// test('sync promise parsing', () => {
// expect(() => z.promise(z.string()).parse(Promise.resolve('asfd'))).toThrow();
// });
const asyncFunction = z.function(z.tuple([]), promSchema);
test("async function pass", async () => {
const validatedFunction = asyncFunction.implement(async () => {
return { name: "jimmy", age: 14 };
});
await expect(validatedFunction()).resolves.toEqual({
name: "jimmy",
age: 14,
});
});
test("async function fail", async () => {
const validatedFunction = asyncFunction.implement(() => {
return Promise.resolve("asdf" as any);
});
await expect(validatedFunction()).rejects.toBeInstanceOf(z.ZodError);
});
test("async promise parsing", () => {
const res = z.promise(z.number()).parseAsync(Promise.resolve(12));
expect(res).toBeInstanceOf(Promise);
});
test("resolves", () => {
const foo = z.literal("foo");
const res = z.promise(foo);
expect(res.unwrap()).toEqual(foo);
});

View File

@@ -0,0 +1,138 @@
import { IntlMessageFormat } from 'intl-messageformat';
import { isValidElement } from 'react';
import { I as IntlError, a as IntlErrorCode, m as memoFn } from '../formatters-r4aAmsMP.js';
/**
* `intl-messageformat` uses separate keys for `date` and `time`, but there's
* only one native API: `Intl.DateTimeFormat`. Additionally you might want to
* include both a time and a date in a value, therefore the separation doesn't
* seem so useful. We offer a single `dateTime` namespace instead, but we have
* to convert the format before `intl-messageformat` can be used.
*/
function convertFormatsToIntlMessageFormat(globalFormats, inlineFormats, timeZone) {
const mfDateDefaults = IntlMessageFormat.formats.date;
const mfTimeDefaults = IntlMessageFormat.formats.time;
const dateTimeFormats = {
...globalFormats?.dateTime,
...inlineFormats?.dateTime
};
const allFormats = {
date: {
...mfDateDefaults,
...dateTimeFormats
},
time: {
...mfTimeDefaults,
...dateTimeFormats
},
number: {
...globalFormats?.number,
...inlineFormats?.number
}
// (list is not supported in ICU messages)
};
if (timeZone) {
// The only way to set a time zone with `intl-messageformat` is to merge it into the formats
// https://github.com/formatjs/formatjs/blob/8256c5271505cf2606e48e3c97ecdd16ede4f1b5/packages/intl/src/message.ts#L15
['date', 'time'].forEach(property => {
const formats = allFormats[property];
for (const [key, value] of Object.entries(formats)) {
formats[key] = {
timeZone,
...value
};
}
});
}
return allFormats;
}
// Placed here for improved tree shaking. Somehow when this is placed in
// `formatters.tsx`, then it can't be shaken off from `next-intl`.
function createMessageFormatter(cache, intlFormatters) {
const getMessageFormat = memoFn((...args) => new IntlMessageFormat(args[0], args[1], args[2], {
formatters: intlFormatters,
...args[3]
}), cache.message);
return getMessageFormat;
}
function getPlainMessage(candidate, values) {
// To improve runtime performance, only compile message if:
return (
// 1. Values are provided
values ||
// 2. There are escaped braces (e.g. "'{name'}")
/'[{}]/.test(candidate) ||
// 3. There are missing arguments or tags (dev-only error handling)
/<|{/.test(candidate) ? undefined // Compile
: candidate // Don't compile
);
}
/**
* Compiles and formats an ICU message at runtime using intl-messageformat.
* This is the default implementation used when messages are not precompiled.
*/
function formatMessage(/** The raw ICU message string (or precompiled message, though this implementation ignores precompilation) */
...[key, message, values, options]) {
if (Array.isArray(message)) {
throw new IntlError(IntlErrorCode.INVALID_MESSAGE, `Message at \`${key}\` resolved to an array, but only strings are supported. See https://next-intl.dev/docs/usage/translations#arrays-of-messages` );
}
if (typeof message === 'object') {
throw new IntlError(IntlErrorCode.INSUFFICIENT_PATH, `Message at \`${key}\` resolved to \`${typeof message}\`, but only strings are supported. Use a \`.\` to retrieve nested messages. See https://next-intl.dev/docs/usage/translations#structuring-messages` );
}
// Hot path that avoids creating an `IntlMessageFormat` instance
if (typeof message === 'string') {
const plainMessage = getPlainMessage(message, values);
if (plainMessage) return plainMessage;
}
const {
cache,
formats,
formatters,
globalFormats,
locale,
timeZone
} = options;
// Lazy init the message formatter for better tree
// shaking in case message formatting is not used.
if (!formatters.getMessageFormat) {
formatters.getMessageFormat = createMessageFormatter(cache, formatters);
}
let messageFormat;
try {
messageFormat = formatters.getMessageFormat(message, locale, convertFormatsToIntlMessageFormat(globalFormats, formats, timeZone), {
formatters: {
...formatters,
getDateTimeFormat(locales, dateTimeOptions) {
// Workaround for https://github.com/formatjs/formatjs/issues/4279
return formatters.getDateTimeFormat(locales, {
...dateTimeOptions,
timeZone: dateTimeOptions?.timeZone ?? timeZone
});
}
}
});
} catch (error) {
throw new IntlError(IntlErrorCode.INVALID_MESSAGE, `${error.message} (${error.originalMessage})` );
}
const formattedMessage = messageFormat.format(
// @ts-expect-error `intl-messageformat` expects a different format
// for rich text elements since a recent minor update. This
// needs to be evaluated in detail, possibly also in regard
// to be able to format to parts.
values);
// Limit the function signature to return strings or React elements
return /*#__PURE__*/isValidElement(formattedMessage) ||
// Arrays of React elements
Array.isArray(formattedMessage) || typeof formattedMessage === 'string' ? formattedMessage : String(formattedMessage);
}
// `t.raw` is supported
formatMessage.raw = true;
export { formatMessage as default };

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","React","useTranslation","CheckboxCell","t0","$","cellData","t","t1","t2","_jsx","className","children","toLowerCase"],"sources":["../../../../../../src/elements/Table/DefaultCell/fields/Checkbox/index.tsx"],"sourcesContent":["'use client'\nimport type { CheckboxFieldClient, DefaultCellComponentProps } from 'payload'\n\nimport React from 'react'\n\nimport { useTranslation } from '../../../../../providers/Translation/index.js'\nimport './index.scss'\n\nexport const CheckboxCell: React.FC<DefaultCellComponentProps<CheckboxFieldClient>> = ({\n cellData,\n}) => {\n const { t } = useTranslation()\n\n return (\n <code className=\"bool-cell\">\n <span>{t(`general:${cellData}`).toLowerCase()}</span>\n </code>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,OAAOC,KAAA,MAAW;AAElB,SAASC,cAAc,QAAQ;AAC/B,OAAO;AAEP,OAAO,MAAMC,YAAA,GAAyEC,EAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EAAC;IAAAM;EAAA,IAAAF,EAEtF;EACC;IAAAG;EAAA,IAAcL,cAAA;EAID,MAAAM,EAAA,cAAWF,QAAA,EAAU;EAAA,IAAAG,EAAA;EAAA,IAAAJ,CAAA,QAAAE,CAAA,IAAAF,CAAA,QAAAG,EAAA;IADhCC,EAAA,GAAAC,IAAA,CAAC;MAAAC,SAAA,EAAe;MAAAC,QAAA,EACdF,IAAA,CAAC;QAAAE,QAAA,EAAML,CAAA,CAAEC,EAAqB,EAAAK,WAAA,CAAa;MAAA,C;;;;;;;;SAD7CJ,E;CAIJ","ignoreList":[]}

View File

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

View File

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

View File

@@ -0,0 +1,2 @@
declare let weakMemoize: <Arg extends object, Return>(func: (arg: Arg) => Return) => (arg: Arg) => Return;
export default weakMemoize;

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