@beabee/beabee-common 0.21.0-alpha.6 → 0.21.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/beabee-common.js +3 -1
- package/dist/browser/beabee-common.js.map +2 -2
- package/dist/browser/beabee-common.min.js +1 -1
- package/dist/browser/index.js +3 -1
- package/dist/cjs/data/payment-status.cjs +1 -0
- package/dist/cjs/search/payments.cjs +2 -1
- package/dist/cjs/types/index.cjs +2 -0
- package/dist/cjs/types/payment-source-stripe-link.cjs +16 -0
- package/dist/esm/data/payment-status.js +1 -0
- package/dist/esm/search/payments.js +2 -1
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/payment-source-stripe-link.js +0 -0
- package/dist/types/data/payment-status.d.ts +1 -0
- package/dist/types/search/contacts.d.ts +2 -2
- package/dist/types/search/payments.d.ts +1 -1
- package/dist/types/types/callout-data.d.ts +2 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/payment-source-stripe-link.d.ts +4 -0
- package/dist/types/types/payment-source.d.ts +2 -2
- package/package.json +1 -1
|
@@ -272,6 +272,7 @@
|
|
|
272
272
|
|
|
273
273
|
// src/data/payment-status.ts
|
|
274
274
|
var PaymentStatus = /* @__PURE__ */ ((PaymentStatus2) => {
|
|
275
|
+
PaymentStatus2["Draft"] = "draft";
|
|
275
276
|
PaymentStatus2["Pending"] = "pending";
|
|
276
277
|
PaymentStatus2["Successful"] = "successful";
|
|
277
278
|
PaymentStatus2["Failed"] = "failed";
|
|
@@ -611,8 +612,9 @@
|
|
|
611
612
|
status: {
|
|
612
613
|
type: "enum",
|
|
613
614
|
options: [
|
|
614
|
-
"
|
|
615
|
+
"draft" /* Draft */,
|
|
615
616
|
"pending" /* Pending */,
|
|
617
|
+
"successful" /* Successful */,
|
|
616
618
|
"failed" /* Failed */,
|
|
617
619
|
"cancelled" /* Cancelled */
|
|
618
620
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts", "../../src/data/callout-access.ts", "../../src/data/callout-captcha.ts", "../../src/data/callout-channel.ts", "../../src/data/callout-component-base-type.ts", "../../src/data/callout-component-type.ts", "../../src/data/callout-component-input-selectable-types.ts", "../../src/data/callout-component-input-text-types.ts", "../../src/data/callout-component-input-types.ts", "../../src/data/callout-component-nestable-types.ts", "../../src/data/callout-component-types.ts", "../../src/data/content-ids.ts", "../../src/data/contribution-period.ts", "../../src/data/contribution-type.ts", "../../src/data/item-status.ts", "../../src/data/membership-status.ts", "../../src/data/newsletter-status.ts", "../../src/data/payment-method.ts", "../../src/data/payment-status.ts", "../../src/error/InvalidRule.ts", "../../src/search/api-keys.ts", "../../src/search/callouts.ts", "../../src/search/contacts.ts", "../../src/search/notices.ts", "../../src/search/operators.ts", "../../src/search/payments.ts", "../../src/search/segments.ts", "../../src/utils/callouts.ts", "../../src/utils/slug.ts", "../../src/utils/validations.ts", "../../src/utils/conversions.ts", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/toDate.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/constructFrom.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/addDays.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/addMonths.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/add.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/constants.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/startOfDay.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/isDate.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/isValid.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/startOfMinute.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/startOfMonth.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/startOfYear.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/startOfHour.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/startOfSecond.mjs", "../../../../../../.cache/deno/deno_esbuild/date-fns@3.6.0/node_modules/date-fns/parseISO.mjs", "../../src/utils/date.ts", "../../src/utils/payments.ts", "../../src/utils/rules.ts", "../../src/validators/callout-component-content.validator.ts", "../../src/validators/callout-component-input-address.validator.ts", "../../src/validators/callout-component-input-checkbox.validator.ts", "../../src/validators/callout-component-input-currency.validator.ts", "../../src/validators/callout-component-input-date-time.validator.ts", "../../src/validators/callout-component-input-email.validator.ts", "../../src/validators/callout-component-input-file.validator.ts", "../../src/validators/callout-component-input-number.validator.ts", "../../src/validators/callout-component-input-phone-number.validator.ts", "../../src/validators/callout-component-input-select.validator.ts", "../../src/validators/callout-component-input-selectable.validator.ts", "../../src/validators/callout-component-input-signature.validator.ts", "../../src/validators/callout-component-input-text.validator.ts", "../../src/validators/callout-component-input-time.validator.ts", "../../src/validators/callout-component-input-url.validator.ts", "../../src/validators/callout-component.validator.ts", "../../src/index.browser.ts"],
|
|
4
|
-
"sourcesContent": ["export * from \"./data/index.ts\";\nexport * from \"./error/index.ts\";\nexport * from \"./search/index.ts\";\nexport * from \"./utils/index.ts\";\nexport * from \"./validators/index.ts\";\n\nexport type * from \"./types/index.ts\";\n", "export enum CalloutAccess {\n Member = \"member\",\n Guest = \"guest\",\n Anonymous = \"anonymous\",\n OnlyAnonymous = \"only-anonymous\",\n}\n", "export enum CalloutCaptcha {\n None = \"none\",\n Guest = \"guest\",\n All = \"all\",\n}\n", "export enum CalloutChannel {\n // WEB = 'web',\n TELEGRAM = \"telegram\",\n}\n", "/** Enumeration of base callout component types */\nexport enum CalloutComponentBaseType {\n CONTENT,\n INPUT,\n INPUT_TEXT,\n INPUT_SELECTABLE,\n NESTABLE,\n}\n", "/** Enumeration of all possible callout component types */\nexport enum CalloutComponentType {\n CONTENT = \"content\",\n INPUT_ADDRESS = \"address\",\n INPUT_CHECKBOX = \"checkbox\",\n INPUT_CURRENCY = \"currency\",\n INPUT_DATE_TIME = \"datetime\",\n INPUT_EMAIL = \"email\",\n INPUT_FILE = \"file\",\n INPUT_NUMBER = \"number\",\n INPUT_PHONE_NUMBER = \"phoneNumber\",\n INPUT_SELECT = \"select\",\n INPUT_SELECTABLE_RADIO = \"radio\",\n INPUT_SELECTABLE_SELECTBOXES = \"selectboxes\",\n INPUT_SIGNATURE = \"signature\",\n INPUT_TEXT_AREA = \"textarea\",\n INPUT_TEXT_FIELD = \"textfield\",\n INPUT_TIME = \"time\",\n INPUT_URL = \"url\",\n NESTABLE_PANEL = \"panel\",\n NESTABLE_TABS = \"tabs\",\n NESTABLE_WELL = \"well\",\n}\n", "import { CalloutComponentType } from \"./callout-component-type.ts\";\n\nimport type { CalloutComponentBaseInputSelectableSchema } from \"../types/index.ts\";\n\n/** Array of all possible callout nestable component types */\nexport const calloutComponentInputSelectableTypes: Array<\n CalloutComponentBaseInputSelectableSchema[\"type\"]\n> = [\n CalloutComponentType.INPUT_SELECTABLE_RADIO,\n CalloutComponentType.INPUT_SELECTABLE_SELECTBOXES,\n];\n", "import { CalloutComponentType } from \"./callout-component-type.ts\";\n\nimport type { CalloutComponentBaseInputTextSchema } from \"../types/index.ts\";\n\n/** Array of all possible callout input component types */\nexport const calloutComponentInputTextTypes: Array<\n CalloutComponentBaseInputTextSchema[\"type\"]\n> = [\n CalloutComponentType.INPUT_TEXT_AREA,\n CalloutComponentType.INPUT_TEXT_FIELD,\n];\n", "import { CalloutComponentType } from \"./callout-component-type.ts\";\nimport { calloutComponentInputSelectableTypes } from \"./callout-component-input-selectable-types.ts\";\nimport { calloutComponentInputTextTypes } from \"./callout-component-input-text-types.ts\";\n\nimport type { CalloutComponentBaseInputSchema } from \"../types/index.ts\";\n\n/** Array of all possible callout input component types */\nexport const calloutComponentInputTypes: Array<\n CalloutComponentBaseInputSchema[\"type\"]\n> = [\n ...calloutComponentInputSelectableTypes,\n ...calloutComponentInputTextTypes,\n CalloutComponentType.INPUT_ADDRESS,\n CalloutComponentType.INPUT_CHECKBOX,\n CalloutComponentType.INPUT_CURRENCY,\n CalloutComponentType.INPUT_DATE_TIME,\n CalloutComponentType.INPUT_EMAIL,\n CalloutComponentType.INPUT_FILE,\n CalloutComponentType.INPUT_NUMBER,\n CalloutComponentType.INPUT_PHONE_NUMBER,\n CalloutComponentType.INPUT_SELECT,\n CalloutComponentType.INPUT_SIGNATURE,\n CalloutComponentType.INPUT_TIME,\n CalloutComponentType.INPUT_URL,\n];\n", "import { CalloutComponentType } from \"./callout-component-type.ts\";\n\nimport type { CalloutComponentBaseNestableSchema } from \"../types/index.ts\";\n\n/** Array of all possible callout nestable component types */\nexport const calloutComponentNestableTypes: Array<\n CalloutComponentBaseNestableSchema[\"type\"]\n> = [\n CalloutComponentType.NESTABLE_PANEL,\n CalloutComponentType.NESTABLE_WELL,\n CalloutComponentType.NESTABLE_TABS,\n];\n", "import { calloutComponentNestableTypes } from \"./callout-component-nestable-types.ts\";\nimport { calloutComponentInputTypes } from \"./callout-component-input-types.ts\";\nimport { CalloutComponentType } from \"./callout-component-type.ts\";\n\n/** Array of all possible callout component types */\nexport const calloutComponentTypes: CalloutComponentType[] = [\n ...calloutComponentNestableTypes,\n ...calloutComponentInputTypes,\n CalloutComponentType.CONTENT,\n];\n", "import type { ContentId } from \"../types/index.ts\";\n\n/** All possible strings that can be passed to the content get controller to retrieve Beabee content data */\nexport const contentIds = [\n \"contacts\",\n \"email\",\n \"general\",\n \"join\",\n \"join/setup\",\n \"profile\",\n \"share\",\n \"payment\",\n \"telegram\",\n] satisfies ContentId[];\n", "export enum ContributionPeriod {\n Monthly = \"monthly\",\n Annually = \"annually\",\n}\n", "export enum ContributionType {\n Automatic = \"Automatic\",\n Manual = \"Manual\",\n Gift = \"Gift\",\n None = \"None\",\n}\n", "export enum ItemStatus {\n Draft = \"draft\",\n Scheduled = \"scheduled\",\n Open = \"open\",\n Ended = \"ended\",\n}\n", "export enum MembershipStatus {\n Active = \"active\",\n Expiring = \"expiring\",\n Expired = \"expired\",\n None = \"none\",\n}\n", "export enum NewsletterStatus {\n Subscribed = \"subscribed\",\n Unsubscribed = \"unsubscribed\",\n Cleaned = \"cleaned\",\n Pending = \"pending\",\n None = \"none\",\n}\n", "export enum PaymentMethod {\n StripeCard = \"s_card\",\n StripeSEPA = \"s_sepa\",\n StripeBACS = \"s_bacs\",\n StripePayPal = \"s_paypal\",\n GoCardlessDirectDebit = \"gc_direct-debit\",\n}\n", "export enum PaymentStatus {\n Pending = \"pending\",\n Successful = \"successful\",\n Failed = \"failed\",\n Cancelled = \"cancelled\",\n}\n", "import { Rule } from \"../types/index.ts\";\n\nexport class InvalidRule extends Error {\n constructor(\n readonly rule: Rule,\n readonly message: string,\n ) {\n super();\n Object.setPrototypeOf(this, InvalidRule.prototype);\n }\n}\n", "import type { Filters } from \"../types/index.ts\";\n\nexport const apiKeyFilters = {\n id: {\n type: \"text\",\n },\n createdAt: {\n type: \"date\",\n },\n} as const satisfies Filters;\n", "import type { Filters } from \"../types/index.ts\";\nimport { ItemStatus } from \"../data/index.ts\";\n\nexport const calloutFilters = {\n id: {\n type: \"text\",\n },\n slug: {\n type: \"text\",\n },\n title: {\n type: \"text\",\n },\n status: {\n type: \"enum\",\n options: [\n ItemStatus.Draft,\n ItemStatus.Scheduled,\n ItemStatus.Open,\n ItemStatus.Ended,\n ],\n },\n answeredBy: {\n type: \"contact\",\n },\n starts: {\n type: \"date\",\n nullable: true,\n },\n expires: {\n type: \"date\",\n nullable: true,\n },\n hidden: {\n type: \"boolean\",\n },\n channels: {\n type: \"array\",\n nullable: true,\n },\n} as const satisfies Filters;\n\nexport const calloutResponseFilters = {\n id: {\n type: \"text\",\n },\n contact: {\n type: \"contact\",\n nullable: true,\n },\n calloutId: {\n type: \"text\",\n },\n createdAt: {\n type: \"date\",\n },\n updatedAt: {\n type: \"date\",\n },\n bucket: {\n type: \"text\",\n nullable: true,\n },\n tags: {\n type: \"array\",\n },\n assignee: {\n type: \"contact\",\n nullable: true,\n },\n answers: {\n type: \"blob\",\n },\n} as const satisfies Filters;\n\nexport const calloutResponseCommentFilters = {\n id: {\n type: \"text\",\n },\n responseId: {\n type: \"text\",\n },\n contact: {\n type: \"contact\",\n },\n createdAt: {\n type: \"date\",\n },\n updatedAt: {\n type: \"date\",\n },\n text: {\n type: \"text\",\n },\n} as const satisfies Filters;\n\nexport const calloutTagFilters = {\n id: {\n type: \"text\",\n },\n name: {\n type: \"text\",\n },\n description: {\n type: \"text\",\n },\n calloutId: {\n type: \"text\",\n },\n} as const satisfies Filters;\n\nexport const calloutChannelFilters = {\n id: {\n type: \"text\",\n },\n name: {\n type: \"text\",\n },\n description: {\n type: \"text\",\n },\n calloutId: {\n type: \"text\",\n },\n} as const satisfies Filters;\n", "import type { Filters } from \"../types/index.ts\";\nimport {\n ContributionPeriod,\n ContributionType,\n NewsletterStatus,\n} from \"../data/index.ts\";\n\nexport const RoleTypes = [\"member\", \"admin\", \"superadmin\"] as const;\n\nexport const contactFilters = {\n id: {\n type: \"contact\",\n },\n firstname: {\n type: \"text\",\n },\n lastname: {\n type: \"text\",\n },\n email: {\n type: \"text\",\n },\n joined: {\n type: \"date\",\n },\n lastSeen: {\n type: \"date\",\n },\n contributionCancelled: {\n type: \"date\",\n nullable: true,\n },\n contributionType: {\n type: \"enum\",\n options: [\n ContributionType.Automatic,\n ContributionType.Gift,\n ContributionType.Manual,\n ContributionType.None,\n ],\n },\n contributionMonthlyAmount: {\n type: \"number\",\n },\n contributionPeriod: {\n type: \"enum\",\n options: [ContributionPeriod.Monthly, ContributionPeriod.Annually],\n },\n deliveryOptIn: {\n type: \"boolean\",\n },\n newsletterStatus: {\n type: \"enum\",\n options: [\n NewsletterStatus.Subscribed,\n NewsletterStatus.Unsubscribed,\n NewsletterStatus.Cleaned,\n NewsletterStatus.Pending,\n NewsletterStatus.None,\n ],\n },\n activePermission: {\n type: \"enum\",\n options: RoleTypes,\n },\n activeMembership: {\n type: \"boolean\",\n },\n membershipStarts: {\n type: \"date\",\n },\n membershipExpires: {\n type: \"date\",\n },\n manualPaymentSource: {\n type: \"text\",\n nullable: true,\n },\n tags: {\n type: \"array\",\n nullable: true,\n },\n} as const satisfies Filters;\n\nexport type ContactFilterName = keyof typeof contactFilters;\n\nexport const contactCalloutFilters = {\n hasAnswered: {\n type: \"boolean\",\n },\n};\n\nexport type ContactCalloutFilterName = keyof typeof contactCalloutFilters;\n", "import type { Filters } from \"../types/index.ts\";\nimport { ItemStatus } from \"../data/index.ts\";\n\nexport const noticeFilters = {\n id: {\n type: \"text\",\n },\n createdAt: {\n type: \"date\",\n },\n updatedAt: {\n type: \"date\",\n },\n name: {\n type: \"text\",\n },\n expires: {\n type: \"date\",\n nullable: true,\n },\n enabled: {\n type: \"boolean\",\n },\n text: {\n type: \"text\",\n },\n status: {\n type: \"enum\",\n options: [\n ItemStatus.Draft,\n ItemStatus.Scheduled,\n ItemStatus.Open,\n ItemStatus.Ended,\n ],\n },\n} as const satisfies Filters;\n", "import type { OperatorsByType } from \"../types/index.ts\";\n\nconst equalityOperators = {\n equal: { args: 1 },\n not_equal: { args: 1 },\n};\nconst stringOperators = {\n begins_with: { args: 1 },\n ends_with: { args: 1 },\n not_begins_with: { args: 1 },\n not_ends_with: { args: 1 },\n};\nconst numericOperators = {\n ...equalityOperators,\n between: { args: 2 },\n not_between: { args: 2 },\n less: { args: 1 },\n greater: { args: 1 },\n less_or_equal: { args: 1 },\n greater_or_equal: { args: 1 },\n};\nconst arrayOperators = {\n contains: { args: 1 },\n not_contains: { args: 1 },\n};\n// Special operator can be applied across all fields if they are nullable\nexport const nullableOperators = {\n is_empty: { args: 0 },\n is_not_empty: { args: 0 },\n};\n\nexport const operatorsByType = {\n text: { ...equalityOperators, ...arrayOperators, ...stringOperators },\n blob: arrayOperators,\n date: numericOperators,\n number: numericOperators,\n boolean: { equal: equalityOperators.equal },\n array: arrayOperators,\n enum: equalityOperators,\n contact: equalityOperators,\n} as const satisfies OperatorsByType;\n\n// More general type to allow mapping while maintaining full type above\nexport const operatorsByTypeMap: OperatorsByType = operatorsByType;\n\nexport const ruleOperators = [\n \"equal\",\n \"not_equal\",\n \"less\",\n \"less_or_equal\",\n \"greater\",\n \"greater_or_equal\",\n \"between\",\n \"not_between\",\n \"begins_with\",\n \"not_begins_with\",\n \"contains\",\n \"not_contains\",\n \"ends_with\",\n \"not_ends_with\",\n \"is_empty\",\n \"is_not_empty\",\n] as const;\n", "import type { Filters } from \"../types/index.ts\";\nimport { PaymentStatus } from \"../data/index.ts\";\n\nexport const paymentFilters = {\n id: {\n type: \"text\",\n },\n contact: {\n type: \"contact\",\n },\n chargeDate: {\n type: \"date\",\n },\n amount: {\n type: \"number\",\n },\n status: {\n type: \"enum\",\n options: [\n PaymentStatus.Successful,\n PaymentStatus.Pending,\n PaymentStatus.Failed,\n PaymentStatus.Cancelled,\n ],\n },\n} as const satisfies Filters;\n", "import type { Filters } from \"../types/index.ts\";\n\nexport const segmentFilters = {\n id: {\n type: \"text\",\n },\n name: {\n type: \"text\",\n },\n description: {\n type: \"text\",\n },\n} as const satisfies Filters;\n", "import {\n CalloutComponentBaseType,\n calloutComponentInputSelectableTypes,\n calloutComponentInputTextTypes,\n calloutComponentInputTypes,\n calloutComponentNestableTypes,\n CalloutComponentType,\n} from \"../data/index.ts\";\n\nimport type {\n CalloutComponentBaseMap,\n CalloutComponentBaseSchema,\n CalloutComponentMap,\n CalloutComponentSchema,\n CalloutResponseAnswer,\n CalloutResponseAnswerAddress,\n CalloutResponseAnswerFileUpload,\n FilterArgs,\n SetCalloutFormSchema,\n} from \"../types/index.ts\";\n\nfunction convertValuesToOptions(\n values: { value: string; label: string }[],\n): string[] {\n return values.map(({ value }) => value);\n}\n\nfunction convertComponentToFilter(\n component: CalloutComponentSchema & { fullKey: string },\n): FilterArgs & { label: string } {\n const baseItem = {\n label: component.label || component.fullKey,\n nullable: true,\n };\n\n if (\n isCalloutComponentOfType(component, CalloutComponentType.INPUT_CHECKBOX)\n ) {\n return { ...baseItem, type: \"boolean\", nullable: false };\n }\n\n if (isCalloutComponentOfType(component, CalloutComponentType.INPUT_NUMBER)) {\n return { ...baseItem, type: \"number\" };\n }\n\n if (\n isCalloutComponentOfType(\n component,\n CalloutComponentType.INPUT_SELECT,\n )\n ) {\n return {\n ...baseItem,\n type: \"enum\",\n options: convertValuesToOptions(component.data.values),\n };\n }\n\n if (\n isCalloutComponentOfType(component, CalloutComponentType.INPUT_TEXT_AREA)\n ) {\n return { ...baseItem, type: \"blob\" };\n }\n\n return { ...baseItem, type: \"text\" };\n}\n\nfunction getSelectableLabelFromValue(\n component: CalloutComponentSchema,\n value: string,\n): string {\n if (\n isCalloutComponentOfBaseType(\n component,\n CalloutComponentBaseType.INPUT_SELECTABLE,\n )\n ) {\n return component.values.find((v) => v.value === value)?.label || value;\n }\n\n if (isCalloutComponentOfType(component, CalloutComponentType.INPUT_SELECT)) {\n return (\n component.data.values.find((v) => v.value === value)?.label || value\n );\n }\n\n return value;\n}\n\n/**\n * Check if a component is a specific component type\n *\n * @param component The component to check\n * @param type The type of component to check\n * @returns Ensure that the component is of the specific type\n */\nexport function isCalloutComponentOfType<T extends CalloutComponentType>(\n component: CalloutComponentBaseSchema,\n type: T,\n): component is CalloutComponentMap[T] {\n return \"type\" in component &&\n component.type === type;\n}\n\n/**\n * Check if a component is a specific base component type\n *\n * @param component The component to check\n * @param type The type of component to check\n * @returns Ensure that the component is of the specific base type\n */\nexport function isCalloutComponentOfBaseType<\n T extends CalloutComponentBaseType,\n>(\n component: CalloutComponentBaseSchema,\n type: T,\n): component is CalloutComponentBaseMap[T] {\n if (!(\"type\" in component)) {\n return false;\n }\n\n // `content` has only one schema\n if (type === CalloutComponentBaseType.CONTENT) {\n return isCalloutComponentOfType(\n component,\n CalloutComponentType.CONTENT,\n );\n }\n\n if (type === CalloutComponentBaseType.INPUT) {\n return (calloutComponentInputTypes as string[]).includes(\n component.type,\n );\n }\n\n if (type === CalloutComponentBaseType.INPUT_TEXT) {\n return (calloutComponentInputTextTypes as string[]).includes(\n component.type,\n );\n }\n\n if (type === CalloutComponentBaseType.INPUT_SELECTABLE) {\n return (calloutComponentInputSelectableTypes as string[]).includes(\n component.type,\n );\n }\n\n if (type === CalloutComponentBaseType.NESTABLE) {\n return (calloutComponentNestableTypes as string[]).includes(\n component.type,\n );\n }\n\n return false;\n}\n\nexport function flattenComponents(\n components: CalloutComponentSchema[],\n): CalloutComponentSchema[] {\n return components.flatMap((component) =>\n isCalloutComponentOfBaseType(component, CalloutComponentBaseType.NESTABLE)\n ? [component, ...flattenComponents(component.components)]\n : [component]\n );\n}\n\nexport function filterComponents(\n components: CalloutComponentSchema[],\n filterFn: (component: CalloutComponentSchema) => boolean,\n): CalloutComponentSchema[] {\n return components.filter(filterFn).map((component) => {\n return {\n ...component,\n ...(isCalloutComponentOfBaseType(\n component,\n CalloutComponentBaseType.NESTABLE,\n ) && {\n components: filterComponents(component.components, filterFn),\n }),\n };\n });\n}\n\nexport function getCalloutComponents(\n formSchema: SetCalloutFormSchema,\n): (CalloutComponentSchema & { slideId: string; fullKey: string })[] {\n return formSchema.slides.flatMap((slide) =>\n flattenComponents(slide.components).map((component) => ({\n ...component,\n slideId: slide.id,\n fullKey: `${slide.id}.${component.key}`,\n }))\n );\n}\n\nexport function getCalloutFilters(\n formSchema: SetCalloutFormSchema,\n): Record<string, FilterArgs & { label: string }> {\n const items = getCalloutComponents(formSchema)\n .filter((c) => c.input)\n .map((c) => [`answers.${c.fullKey}`, convertComponentToFilter(c)]);\n\n return Object.fromEntries(items);\n}\n\nexport function isAddressAnswer(\n answer: CalloutResponseAnswer,\n): answer is CalloutResponseAnswerAddress {\n return !!answer && typeof answer === \"object\" && \"geometry\" in answer;\n}\n\nexport function isFileUploadAnswer(\n answer: CalloutResponseAnswer | undefined,\n): answer is CalloutResponseAnswerFileUpload {\n return !!answer && typeof answer === \"object\" && \"url\" in answer;\n}\n\nexport function stringifyAnswer(\n component: CalloutComponentSchema,\n answer: CalloutResponseAnswer | CalloutResponseAnswer[] | undefined,\n): string {\n if (Array.isArray(answer)) {\n return answer.map((a) => stringifyAnswer(component, a)).join(\", \");\n } else if (!answer) {\n return \"\";\n } else if (isAddressAnswer(answer)) {\n return answer.geometry.location.lat + \", \" + answer.geometry.location.lng;\n } else if (isFileUploadAnswer(answer)) {\n return answer.url;\n } else if (typeof answer === \"object\") {\n // Checkboxes\n return Object.entries(answer)\n .filter(([, selected]) => selected)\n .map(([value]) => getSelectableLabelFromValue(component, value))\n .join(\", \");\n } else if (typeof answer === \"string\") {\n return getSelectableLabelFromValue(component, answer);\n } else {\n return answer.toString();\n }\n}\n", "// Adapted from https://github.com/Trott/slug/issues/new\n\n// Technically should be Record<string, string | undefined> but makes\n// the code a bit simpler as TypeScript doesn't narrow if (charmap[char])\ntype CharMap = Record<string, string>;\n\ninterface Mode {\n charmap: CharMap;\n lower: boolean;\n multicharmap: CharMap;\n remove: RegExp | null;\n replacement: string;\n trim: boolean;\n}\n\ninterface Options {\n locale: string;\n mode: \"pretty\" | \"rfc3986\";\n fallback: boolean;\n}\n\n// This function's sole purpose is to help us ignore lone surrogates so that\n// malformed strings don't throw in the browser while being processed\n// permissively in Node.js. If we didn't care about parity, we could get rid\n// of it.\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt\nfunction getWholeCharAndI(str: string, i: number): [string, number] {\n const code = str.charCodeAt(i);\n\n // This is a coherence check. `code` should never be `NaN`.\n /* istanbul ignore if */\n if (isNaN(code)) {\n throw new RangeError(\n \"Index \" +\n i +\n ' out of range for string \"' +\n str +\n '\"; please open an issue at https://github.com/Trott/slug/issues/new',\n );\n }\n if (code < 0xd800 || code > 0xdfff) {\n return [str.charAt(i), i]; // Non-surrogate character, keeping 'i' the same\n }\n\n // High surrogate\n if (code >= 0xd800 && code <= 0xdbff) {\n if (str.length <= i + 1) {\n // High surrogate without following low surrogate\n return [\" \", i];\n }\n const next = str.charCodeAt(i + 1);\n if (next < 0xdc00 || next > 0xdfff) {\n // High surrogate without following low surrogate\n return [\" \", i];\n }\n return [str.charAt(i) + str.charAt(i + 1), i + 1];\n }\n\n // Low surrogate (0xDC00 <= code && code <= 0xDFFF)\n if (i === 0) {\n // Low surrogate without preceding high surrogate\n return [\" \", i];\n }\n\n const prev = str.charCodeAt(i - 1);\n\n /* istanbul ignore else */\n if (prev < 0xd800 || prev > 0xdbff) {\n // Low surrogate without preceding high surrogate\n return [\" \", i];\n }\n\n /* istanbul ignore next */\n throw new Error(\n 'String \"' +\n str +\n '\" reaches code believed to be unreachable; please open an issue at https://github.com/Trott/slug/issues/new',\n );\n}\n\nfunction base64(input: string) {\n return btoa(unescape(encodeURIComponent(input)));\n}\n\nexport function slug(s: string, opts?: Partial<Options & Mode>) {\n let result = slugify(s, opts);\n const fallback = opts && opts.fallback !== undefined\n ? opts.fallback\n : defaults.fallback;\n // If output is an empty string, try slug for base64 of string.\n if (fallback === true && result === \"\") {\n // Get rid of lone surrogates.\n let input = \"\";\n for (let i = 0; i < s.length; i++) {\n const charAndI = getWholeCharAndI(s, i);\n i = charAndI[1];\n input += charAndI[0];\n }\n result = slugify(base64(input), opts);\n }\n return result;\n}\n\nconst locales: Record<string, CharMap | undefined> = {\n // http://www.eki.ee/wgrs/rom1_bg.pdf\n bg: {\n \u0419: \"Y\",\n \u0439: \"y\",\n X: \"H\",\n x: \"h\",\n \u0426: \"Ts\",\n \u0446: \"ts\",\n \u0429: \"Sht\",\n \u0449: \"sht\",\n \u042A: \"A\",\n \u044A: \"a\",\n \u042C: \"Y\",\n \u044C: \"y\",\n },\n // Need a reference URL for German, although this is pretty well-known.\n de: { \u00C4: \"AE\", \u00E4: \"ae\", \u00D6: \"OE\", \u00F6: \"oe\", \u00DC: \"UE\", \u00FC: \"ue\" },\n // Need a reference URL for Serbian.\n sr: { \u0111: \"dj\", \u0110: \"DJ\" },\n // https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/864314/ROMANIZATION_OF_UKRAINIAN.pdf\n uk: {\n \u0418: \"Y\",\n \u0438: \"y\",\n \u0419: \"Y\",\n \u0439: \"y\",\n \u0426: \"Ts\",\n \u0446: \"ts\",\n \u0425: \"Kh\",\n \u0445: \"kh\",\n \u0429: \"Shch\",\n \u0449: \"shch\",\n \u0413: \"H\",\n \u0433: \"h\",\n },\n};\n\nfunction slugify(str: string, partialOpts?: Partial<Options & Mode>) {\n const mode = partialOpts?.mode || defaults.mode;\n const opts = { ...defaults.modes[mode], ...partialOpts };\n const localeMap = (!!opts.locale && locales[opts.locale]) || {};\n\n let lengths = [];\n for (const key in opts.multicharmap) {\n if (!Object.prototype.hasOwnProperty.call(opts.multicharmap, key)) {\n continue;\n }\n\n const len = key.length;\n if (lengths.indexOf(len) === -1) {\n lengths.push(len);\n }\n }\n\n // We want to match the longest string if there are multiple matches, so\n // sort lengths in descending order.\n lengths = lengths.sort(function (a, b) {\n return b - a;\n });\n\n const disallowedChars = opts.mode === \"rfc3986\"\n ? /[^\\w\\s\\-.~]/\n : /[^A-Za-z0-9\\s]/;\n\n let result = \"\";\n for (let char, i = 0, l = str.length; i < l; i++) {\n char = str[i];\n let matchedMultichar = false;\n for (let j = 0; j < lengths.length; j++) {\n const len = lengths[j];\n const substr = str.substr(i, len);\n if (opts.multicharmap[substr]) {\n i += len - 1;\n char = opts.multicharmap[substr];\n matchedMultichar = true;\n break;\n }\n }\n if (!matchedMultichar) {\n if (localeMap[char]) {\n char = localeMap[char];\n } else if (opts.charmap[char]) {\n char = opts.charmap[char].replace(opts.replacement, \" \");\n } else if (char.includes(opts.replacement)) {\n // preserve the replacement character in case it is excluded by disallowedChars\n char = char.replace(opts.replacement, \" \");\n } else {\n char = char.replace(disallowedChars, \"\");\n }\n }\n result += char;\n }\n\n if (opts.remove) {\n result = result.replace(opts.remove, \"\");\n }\n if (opts.trim) {\n result = result.trim();\n }\n result = result.replace(/\\s+/g, opts.replacement); // convert spaces\n if (opts.lower) {\n result = result.toLowerCase();\n }\n return result;\n}\n\nconst initialMulticharmap: CharMap = {\n // multibyte devanagari characters (hindi, sanskrit, etc.)\n \u092B\u093C: \"Fi\",\n \u0917\u093C: \"Ghi\",\n \u0916\u093C: \"Khi\",\n \u0915\u093C: \"Qi\",\n \u0921\u093C: \"ugDha\",\n \u0922\u093C: \"ugDhha\",\n \u092F\u093C: \"Yi\",\n \u091C\u093C: \"Za\",\n // hebrew\n // Refs: http://www.eki.ee/wgrs/rom1_he.pdf\n // Refs: https://en.wikipedia.org/wiki/Niqqud\n \u05D1\u05B4\u05D9: \"i\",\n \u05D1\u05B5: \"e\",\n \u05D1\u05B5\u05D9: \"e\",\n \u05D1\u05B6: \"e\",\n \u05D1\u05B7: \"a\",\n \u05D1\u05B8: \"a\",\n \u05D1\u05B9: \"o\",\n \u05D5\u05B9: \"o\",\n \u05D1\u05BB: \"u\",\n \u05D5\u05BC: \"u\",\n \u05D1\u05BC: \"b\",\n \u05DB\u05BC: \"k\",\n \u05DA\u05BC: \"k\",\n \u05E4\u05BC: \"p\",\n \u05E9\u05C1: \"sh\",\n \u05E9\u05C2: \"s\",\n \u05D1\u05B0: \"e\",\n \u05D7\u05B1: \"e\",\n \u05D7\u05B2: \"a\",\n \u05D7\u05B3: \"o\",\n \u05D1\u05B4: \"i\",\n};\n\n// https://github.com/django/django/blob/master/django/contrib/admin/static/admin/js/urlify.js\nconst initialCharmap: CharMap = {\n // latin\n \u00C0: \"A\",\n \u00C1: \"A\",\n \u00C2: \"A\",\n \u00C3: \"A\",\n \u00C4: \"A\",\n \u00C5: \"A\",\n \u00C6: \"AE\",\n \u00C7: \"C\",\n \u00C8: \"E\",\n \u00C9: \"E\",\n \u00CA: \"E\",\n \u00CB: \"E\",\n \u00CC: \"I\",\n \u00CD: \"I\",\n \u00CE: \"I\",\n \u00CF: \"I\",\n \u00D0: \"D\",\n \u00D1: \"N\",\n \u00D2: \"O\",\n \u00D3: \"O\",\n \u00D4: \"O\",\n \u00D5: \"O\",\n \u00D6: \"O\",\n \u0150: \"O\",\n \u00D8: \"O\",\n \u014C: \"O\",\n \u00D9: \"U\",\n \u00DA: \"U\",\n \u00DB: \"U\",\n \u00DC: \"U\",\n \u0170: \"U\",\n \u00DD: \"Y\",\n \u00DE: \"TH\",\n \u00DF: \"ss\",\n \u00E0: \"a\",\n \u00E1: \"a\",\n \u00E2: \"a\",\n \u00E3: \"a\",\n \u00E4: \"a\",\n \u00E5: \"a\",\n \u00E6: \"ae\",\n \u00E7: \"c\",\n \u00E8: \"e\",\n \u00E9: \"e\",\n \u00EA: \"e\",\n \u00EB: \"e\",\n \u00EC: \"i\",\n \u00ED: \"i\",\n \u00EE: \"i\",\n \u00EF: \"i\",\n \u00F0: \"d\",\n \u00F1: \"n\",\n \u00F2: \"o\",\n \u00F3: \"o\",\n \u00F4: \"o\",\n \u00F5: \"o\",\n \u00F6: \"o\",\n \u0151: \"o\",\n \u00F8: \"o\",\n \u014D: \"o\",\n \u0152: \"OE\",\n \u0153: \"oe\",\n \u00F9: \"u\",\n \u00FA: \"u\",\n \u00FB: \"u\",\n \u00FC: \"u\",\n \u0171: \"u\",\n \u00FD: \"y\",\n \u00FE: \"th\",\n \u00FF: \"y\",\n \u1E9E: \"SS\",\n // greek\n \u03B1: \"a\",\n \u03B2: \"b\",\n \u03B3: \"g\",\n \u03B4: \"d\",\n \u03B5: \"e\",\n \u03B6: \"z\",\n \u03B7: \"h\",\n \u03B8: \"th\",\n \u03B9: \"i\",\n \u03BA: \"k\",\n \u03BB: \"l\",\n \u03BC: \"m\",\n \u03BD: \"n\",\n \u03BE: \"3\",\n \u03BF: \"o\",\n \u03C0: \"p\",\n \u03C1: \"r\",\n \u03C3: \"s\",\n \u03C4: \"t\",\n \u03C5: \"y\",\n \u03C6: \"f\",\n \u03C7: \"x\",\n \u03C8: \"ps\",\n \u03C9: \"w\",\n \u03AC: \"a\",\n \u03AD: \"e\",\n \u03AF: \"i\",\n \u03CC: \"o\",\n \u03CD: \"y\",\n \u03AE: \"h\",\n \u03CE: \"w\",\n \u03C2: \"s\",\n \u03CA: \"i\",\n \u03B0: \"y\",\n \u03CB: \"y\",\n \u0390: \"i\",\n \u0391: \"A\",\n \u0392: \"B\",\n \u0393: \"G\",\n \u0394: \"D\",\n \u0395: \"E\",\n \u0396: \"Z\",\n \u0397: \"H\",\n \u0398: \"Th\",\n \u0399: \"I\",\n \u039A: \"K\",\n \u039B: \"L\",\n \u039C: \"M\",\n \u039D: \"N\",\n \u039E: \"3\",\n \u039F: \"O\",\n \u03A0: \"P\",\n \u03A1: \"R\",\n \u03A3: \"S\",\n \u03A4: \"T\",\n \u03A5: \"Y\",\n \u03A6: \"F\",\n \u03A7: \"X\",\n \u03A8: \"PS\",\n \u03A9: \"W\",\n \u0386: \"A\",\n \u0388: \"E\",\n \u038A: \"I\",\n \u038C: \"O\",\n \u038E: \"Y\",\n \u0389: \"H\",\n \u038F: \"W\",\n \u03AA: \"I\",\n \u03AB: \"Y\",\n // turkish\n \u015F: \"s\",\n \u015E: \"S\",\n \u0131: \"i\",\n \u0130: \"I\",\n \u011F: \"g\",\n \u011E: \"G\",\n // russian\n \u0430: \"a\",\n \u0431: \"b\",\n \u0432: \"v\",\n \u0433: \"g\",\n \u0434: \"d\",\n \u0435: \"e\",\n \u0451: \"yo\",\n \u0436: \"zh\",\n \u0437: \"z\",\n \u0438: \"i\",\n \u0439: \"j\",\n \u043A: \"k\",\n \u043B: \"l\",\n \u043C: \"m\",\n \u043D: \"n\",\n \u043E: \"o\",\n \u043F: \"p\",\n \u0440: \"r\",\n \u0441: \"s\",\n \u0442: \"t\",\n \u0443: \"u\",\n \u0444: \"f\",\n \u0445: \"h\",\n \u0446: \"c\",\n \u0447: \"ch\",\n \u0448: \"sh\",\n \u0449: \"sh\",\n \u044A: \"u\",\n \u044B: \"y\",\n \u044C: \"\",\n \u044D: \"e\",\n \u044E: \"yu\",\n \u044F: \"ya\",\n \u0410: \"A\",\n \u0411: \"B\",\n \u0412: \"V\",\n \u0413: \"G\",\n \u0414: \"D\",\n \u0415: \"E\",\n \u0401: \"Yo\",\n \u0416: \"Zh\",\n \u0417: \"Z\",\n \u0418: \"I\",\n \u0419: \"J\",\n \u041A: \"K\",\n \u041B: \"L\",\n \u041C: \"M\",\n \u041D: \"N\",\n \u041E: \"O\",\n \u041F: \"P\",\n \u0420: \"R\",\n \u0421: \"S\",\n \u0422: \"T\",\n \u0423: \"U\",\n \u0424: \"F\",\n \u0425: \"H\",\n \u0426: \"C\",\n \u0427: \"Ch\",\n \u0428: \"Sh\",\n \u0429: \"Sh\",\n \u042A: \"U\",\n \u042B: \"Y\",\n \u042C: \"\",\n \u042D: \"E\",\n \u042E: \"Yu\",\n \u042F: \"Ya\",\n // ukranian\n \u0404: \"Ye\",\n \u0406: \"I\",\n \u0407: \"Yi\",\n \u0490: \"G\",\n \u0454: \"ye\",\n \u0456: \"i\",\n \u0457: \"yi\",\n \u0491: \"g\",\n // czech\n \u010D: \"c\",\n \u010F: \"d\",\n \u011B: \"e\",\n \u0148: \"n\",\n \u0159: \"r\",\n \u0161: \"s\",\n \u0165: \"t\",\n \u016F: \"u\",\n \u017E: \"z\",\n \u010C: \"C\",\n \u010E: \"D\",\n \u011A: \"E\",\n \u0147: \"N\",\n \u0158: \"R\",\n \u0160: \"S\",\n \u0164: \"T\",\n \u016E: \"U\",\n \u017D: \"Z\",\n // slovak\n \u013E: \"l\",\n \u013A: \"l\",\n \u0155: \"r\",\n \u013D: \"L\",\n \u0139: \"L\",\n \u0154: \"R\",\n // polish\n \u0105: \"a\",\n \u0107: \"c\",\n \u0119: \"e\",\n \u0142: \"l\",\n \u0144: \"n\",\n \u015B: \"s\",\n \u017A: \"z\",\n \u017C: \"z\",\n \u0104: \"A\",\n \u0106: \"C\",\n \u0118: \"E\",\n \u0141: \"L\",\n \u0143: \"N\",\n \u015A: \"S\",\n \u0179: \"Z\",\n \u017B: \"Z\",\n // latvian\n \u0101: \"a\",\n \u0113: \"e\",\n \u0123: \"g\",\n \u012B: \"i\",\n \u0137: \"k\",\n \u013C: \"l\",\n \u0146: \"n\",\n \u016B: \"u\",\n \u0100: \"A\",\n \u0112: \"E\",\n \u0122: \"G\",\n \u012A: \"I\",\n \u0136: \"K\",\n \u013B: \"L\",\n \u0145: \"N\",\n \u016A: \"U\",\n // arabic\n \u0623: \"a\",\n \u0625: \"i\",\n \u0628: \"b\",\n \u062A: \"t\",\n \u062B: \"th\",\n \u062C: \"g\",\n \u062D: \"h\",\n \u062E: \"kh\",\n \u062F: \"d\",\n \u0630: \"th\",\n \u0631: \"r\",\n \u0632: \"z\",\n \u0633: \"s\",\n \u0634: \"sh\",\n \u0635: \"s\",\n \u0636: \"d\",\n \u0637: \"t\",\n \u0638: \"th\",\n \u0639: \"aa\",\n \u063A: \"gh\",\n \u0641: \"f\",\n \u0642: \"k\",\n \u0643: \"k\",\n \u0644: \"l\",\n \u0645: \"m\",\n \u0646: \"n\",\n \u0647: \"h\",\n \u0648: \"o\",\n \u064A: \"y\",\n \u0621: \"aa\",\n \u0629: \"a\",\n // farsi\n \u0622: \"a\",\n \u0627: \"a\",\n \u067E: \"p\",\n \u0698: \"zh\",\n \u06AF: \"g\",\n \u0686: \"ch\",\n \u06A9: \"k\",\n \u06CC: \"i\",\n // lithuanian\n \u0117: \"e\",\n \u012F: \"i\",\n \u0173: \"u\",\n \u0116: \"E\",\n \u012E: \"I\",\n \u0172: \"U\",\n // romanian\n \u021B: \"t\",\n \u021A: \"T\",\n \u0163: \"t\",\n \u0162: \"T\",\n \u0219: \"s\",\n \u0218: \"S\",\n \u0103: \"a\",\n \u0102: \"A\",\n // vietnamese\n \u1EA0: \"A\",\n \u1EA2: \"A\",\n \u1EA6: \"A\",\n \u1EA4: \"A\",\n \u1EAC: \"A\",\n \u1EA8: \"A\",\n \u1EAA: \"A\",\n \u1EB0: \"A\",\n \u1EAE: \"A\",\n \u1EB6: \"A\",\n \u1EB2: \"A\",\n \u1EB4: \"A\",\n \u1EB8: \"E\",\n \u1EBA: \"E\",\n \u1EBC: \"E\",\n \u1EC0: \"E\",\n \u1EBE: \"E\",\n \u1EC6: \"E\",\n \u1EC2: \"E\",\n \u1EC4: \"E\",\n \u1ECA: \"I\",\n \u1EC8: \"I\",\n \u0128: \"I\",\n \u1ECC: \"O\",\n \u1ECE: \"O\",\n \u1ED2: \"O\",\n \u1ED0: \"O\",\n \u1ED8: \"O\",\n \u1ED4: \"O\",\n \u1ED6: \"O\",\n \u01A0: \"O\",\n \u1EDC: \"O\",\n \u1EDA: \"O\",\n \u1EE2: \"O\",\n \u1EDE: \"O\",\n \u1EE0: \"O\",\n \u1EE4: \"U\",\n \u1EE6: \"U\",\n \u0168: \"U\",\n \u01AF: \"U\",\n \u1EEA: \"U\",\n \u1EE8: \"U\",\n \u1EF0: \"U\",\n \u1EEC: \"U\",\n \u1EEE: \"U\",\n \u1EF2: \"Y\",\n \u1EF4: \"Y\",\n \u1EF6: \"Y\",\n \u1EF8: \"Y\",\n \u0110: \"D\",\n \u1EA1: \"a\",\n \u1EA3: \"a\",\n \u1EA7: \"a\",\n \u1EA5: \"a\",\n \u1EAD: \"a\",\n \u1EA9: \"a\",\n \u1EAB: \"a\",\n \u1EB1: \"a\",\n \u1EAF: \"a\",\n \u1EB7: \"a\",\n \u1EB3: \"a\",\n \u1EB5: \"a\",\n \u1EB9: \"e\",\n \u1EBB: \"e\",\n \u1EBD: \"e\",\n \u1EC1: \"e\",\n \u1EBF: \"e\",\n \u1EC7: \"e\",\n \u1EC3: \"e\",\n \u1EC5: \"e\",\n \u1ECB: \"i\",\n \u1EC9: \"i\",\n \u0129: \"i\",\n \u1ECD: \"o\",\n \u1ECF: \"o\",\n \u1ED3: \"o\",\n \u1ED1: \"o\",\n \u1ED9: \"o\",\n \u1ED5: \"o\",\n \u1ED7: \"o\",\n \u01A1: \"o\",\n \u1EDD: \"o\",\n \u1EDB: \"o\",\n \u1EE3: \"o\",\n \u1EDF: \"o\",\n \u1EE1: \"o\",\n \u1EE5: \"u\",\n \u1EE7: \"u\",\n \u0169: \"u\",\n \u01B0: \"u\",\n \u1EEB: \"u\",\n \u1EE9: \"u\",\n \u1EF1: \"u\",\n \u1EED: \"u\",\n \u1EEF: \"u\",\n \u1EF3: \"y\",\n \u1EF5: \"y\",\n \u1EF7: \"y\",\n \u1EF9: \"y\",\n \u0111: \"d\",\n // kazakh\n \u04D8: \"AE\",\n \u04D9: \"ae\",\n \u0492: \"GH\",\n \u0493: \"gh\",\n \u049A: \"KH\",\n \u049B: \"kh\",\n \u04A2: \"NG\",\n \u04A3: \"ng\",\n \u04AE: \"UE\",\n \u04AF: \"ue\",\n \u04B0: \"U\",\n \u04B1: \"u\",\n \u04BA: \"H\",\n \u04BB: \"h\",\n \u04E8: \"OE\",\n \u04E9: \"oe\",\n // serbian\n \u0452: \"dj\",\n \u0458: \"j\",\n \u0459: \"lj\",\n \u045A: \"nj\",\n \u045B: \"c\",\n \u045F: \"dz\",\n \u0402: \"Dj\",\n \u0408: \"j\",\n \u0409: \"Lj\",\n \u040A: \"Nj\",\n \u040B: \"C\",\n \u040F: \"Dz\",\n \u01CC: \"nj\",\n \u01C9: \"lj\",\n \u01CB: \"NJ\",\n \u01C8: \"LJ\",\n // hindi\n \u0905: \"a\",\n \u0906: \"aa\",\n \u090F: \"e\",\n \u0908: \"ii\",\n \u090D: \"ei\",\n \u090E: \"ae\",\n \u0910: \"ai\",\n \u0907: \"i\",\n \u0913: \"o\",\n \u0911: \"oi\",\n \u0912: \"oii\",\n \u090A: \"uu\",\n \u0914: \"ou\",\n \u0909: \"u\",\n \u092C: \"B\",\n \u092D: \"Bha\",\n \u091A: \"Ca\",\n \u091B: \"Chha\",\n \u0921: \"Da\",\n \u0922: \"Dha\",\n \u092B: \"Fa\",\n \u0917: \"Ga\",\n \u0918: \"Gha\",\n \u0917\u093C: \"Ghi\",\n \u0939: \"Ha\",\n \u091C: \"Ja\",\n \u091D: \"Jha\",\n \u0915: \"Ka\",\n \u0916: \"Kha\",\n \u0916\u093C: \"Khi\",\n \u0932: \"L\",\n \u0933: \"Li\",\n \u090C: \"Li\",\n \u0934: \"Lii\",\n \u0961: \"Lii\",\n \u092E: \"Ma\",\n \u0928: \"Na\",\n \u0919: \"Na\",\n \u091E: \"Nia\",\n \u0923: \"Nae\",\n \u0929: \"Ni\",\n \u0950: \"oms\",\n \u092A: \"Pa\",\n \u0915\u093C: \"Qi\",\n \u0930: \"Ra\",\n \u090B: \"Ri\",\n \u0960: \"Ri\",\n \u0931: \"Ri\",\n \u0938: \"Sa\",\n \u0936: \"Sha\",\n \u0937: \"Shha\",\n \u091F: \"Ta\",\n \u0924: \"Ta\",\n \u0920: \"Tha\",\n \u0926: \"Tha\",\n \u0925: \"Tha\",\n \u0927: \"Thha\",\n \u0921\u093C: \"ugDha\",\n \u0922\u093C: \"ugDhha\",\n \u0935: \"Va\",\n \u092F: \"Ya\",\n \u092F\u093C: \"Yi\",\n \u091C\u093C: \"Za\",\n // azerbaijani\n \u0259: \"e\",\n \u018F: \"E\",\n // georgian\n \u10D0: \"a\",\n \u10D1: \"b\",\n \u10D2: \"g\",\n \u10D3: \"d\",\n \u10D4: \"e\",\n \u10D5: \"v\",\n \u10D6: \"z\",\n \u10D7: \"t\",\n \u10D8: \"i\",\n \u10D9: \"k\",\n \u10DA: \"l\",\n \u10DB: \"m\",\n \u10DC: \"n\",\n \u10DD: \"o\",\n \u10DE: \"p\",\n \u10DF: \"zh\",\n \u10E0: \"r\",\n \u10E1: \"s\",\n \u10E2: \"t\",\n \u10E3: \"u\",\n \u10E4: \"p\",\n \u10E5: \"k\",\n \u10E6: \"gh\",\n \u10E7: \"q\",\n \u10E8: \"sh\",\n \u10E9: \"ch\",\n \u10EA: \"ts\",\n \u10EB: \"dz\",\n \u10EC: \"ts\",\n \u10ED: \"ch\",\n \u10EE: \"kh\",\n \u10EF: \"j\",\n \u10F0: \"h\",\n // hebrew\n \u05D1: \"v\",\n \u05D2\u05BC: \"g\",\n \u05D2: \"g\",\n \u05D3: \"d\",\n \u05D3\u05BC: \"d\",\n \u05D4: \"h\",\n \u05D5: \"v\",\n \u05D6: \"z\",\n \u05D7: \"h\",\n \u05D8: \"t\",\n \u05D9: \"y\",\n \u05DB: \"kh\",\n \u05DA: \"kh\",\n \u05DC: \"l\",\n \u05DE: \"m\",\n \u05DD: \"m\",\n \u05E0: \"n\",\n \u05DF: \"n\",\n \u05E1: \"s\",\n \u05E4: \"f\",\n \u05E3: \"f\",\n \u05E5: \"ts\",\n \u05E6: \"ts\",\n \u05E7: \"k\",\n \u05E8: \"r\",\n \u05EA\u05BC: \"t\",\n \u05EA: \"t\",\n};\n\nconst defaults: Options & { modes: Record<string, Mode> } = {\n locale: \"\",\n mode: \"pretty\" as const,\n fallback: true,\n modes: {\n rfc3986: {\n replacement: \"-\",\n lower: true,\n charmap: initialCharmap,\n multicharmap: initialMulticharmap,\n remove: null,\n trim: true,\n },\n pretty: {\n replacement: \"-\",\n lower: true,\n charmap: initialCharmap,\n multicharmap: initialMulticharmap,\n remove: null,\n trim: true,\n },\n },\n};\n", "import { slug } from \"./slug.ts\";\nimport { ContributionPeriod } from \"../data/index.ts\";\n\n/**\n * Check if the value is a valid angle.\n * @param value The value to check\n */\nexport const isAngle = (value: unknown, span = 180): value is number => {\n return typeof value === \"number\" && value >= (span * -1) && value <= span;\n};\n\n/**\n * Check if the value is a valid email address.\n * @param value The value to check\n * @param span The span of the angle\n */\nexport const isEmail = (value: unknown): value is string => {\n if (typeof value !== \"string\" || value.length === 0) {\n return false;\n }\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailRegex.test(value);\n};\n\n/**\n * Check if the value is a valid longitude/latitude pair.\n * @param value The value to check\n */\nexport const isLngLat = (value: unknown): value is [number, number] => {\n if (!Array.isArray(value) || value.length !== 2) {\n return false;\n }\n const [longitude, latitude] = value;\n\n // Longitude should be between -180 and 180 and latitude should be between -90 and 90\n if (!isAngle(longitude, 180) || !isAngle(latitude, 90)) {\n return false;\n }\n\n return true;\n};\n\n/**\n * Check if the value is a valid map bounds.\n * @param value The value to check\n */\nexport const isMapBounds = (\n value: unknown,\n): value is [[number, number], [number, number]] => {\n return Array.isArray(value) && value.length === 2 && value.every(isLngLat);\n};\n\n/**\n * Check if the value is a valid password.\n * @param value The value to check\n */\nexport const isPassword = (value: unknown): value is string => {\n return (\n typeof value === \"string\" &&\n value.length >= 8 &&\n /[a-z]/.test(value) &&\n /[A-Z]/.test(value) &&\n /[0-9]/.test(value)\n );\n};\n\n/**\n * Check if the value is a valid period.\n * @param value The value to check\n */\nexport const isPeriod = (value: unknown): value is ContributionPeriod => {\n return (\n value === ContributionPeriod.Monthly ||\n value === ContributionPeriod.Annually\n );\n};\n\n/**\n * Check if the value is a valid slug.\n * @param value The value to check\n * @returns\n */\nexport const isSlug = (value: unknown): value is string => {\n return typeof value === \"string\" && value === slug(value);\n};\n\n/**\n * Check if the value is one of the given types\n * @param types The valid types\n * @param value The value to check\n */\nexport function isType(\n types: Array<\n | \"string\"\n | \"number\"\n | \"bigint\"\n | \"boolean\"\n | \"symbol\"\n | \"undefined\"\n | \"object\"\n | \"function\"\n >,\n value: unknown,\n): boolean {\n return types.includes(typeof value);\n}\n\n/**\n * Check if the value is a valid URL string\n * @param value The value to check\n */\nexport const isURL = (value: unknown): value is string => {\n if (typeof value !== \"string\" || !value.length) {\n return false;\n }\n const urlRegex =\n /^(https?:\\/\\/)([\\da-z\\-]+\\.)+[a-z]{2,6}(:[0-9]{1,5})?([\\/\\w \\.-]*)*\\/?(\\?[a-zA-Z0-9=&]*)?$/;\n return urlRegex.test(value);\n};\n\n/**\n * Check if the value is a valid number\n * @param value The value to check\n */\nexport const isNumber = (value: unknown): value is number => {\n return typeof value === \"number\" && !isNaN(value);\n};\n\nexport const isAmountOfMoney = (value: unknown): value is number => {\n if (!isNumber(value) || value < 0) {\n return false;\n }\n\n const decimalPart = value.toString().split(\".\")[1];\n // If the amount of money has decimal\n if (decimalPart && decimalPart.length > 2) {\n return false;\n }\n\n return true;\n};\n\n/**\n * Check if the value is a valid phone number with the following rules:\n * * Only uses numbers\n * * Optionally starts with a `+`\n * * Maximal length is 15 characters\n * * Minimal length is 5 characters\n * Note: This method is very generalised to work for as many countries as possible\n * and does not take into whitespace, brackets or other characters commonly used\n * in telephone number notation. To remove these, use `toPhoneNumber` instead.\n * @param value The value to check\n */\nexport const isPhoneNumber = (value: unknown): value is string => {\n if (typeof value !== \"string\" || !value.length) {\n return false;\n }\n if (value.length > 15 || value.length < 5) {\n return false;\n }\n const phoneRegex = /^(\\+?[0-9])\\d*$/;\n return phoneRegex.test(value);\n};\n\n/**\n * Check if the the pay fee value is correct for the given amount and period\n *\n * @param value The value to check\n * @param amount The amount\n * @param period The period\n */\nexport const isValidPayFee = (\n value: unknown,\n amount: unknown,\n period: unknown,\n): value is boolean => {\n if (\n typeof value !== \"boolean\" ||\n typeof amount !== \"number\" ||\n !isPeriod(period)\n ) {\n return false;\n }\n\n // Annual contributions don't pay a fee\n if (value && period === ContributionPeriod.Annually) {\n return false;\n }\n // \u00A31 monthly contributions must pay fee\n if (!value && period === ContributionPeriod.Monthly && amount === 1) {\n return false;\n }\n\n return true;\n};\n\nexport const isNumberInRange = (\n value: unknown,\n min?: number,\n max?: number,\n): boolean => {\n if (!isNumber(value)) {\n return false;\n }\n\n if (typeof min === \"number\") {\n if (value < min) {\n return false;\n }\n }\n\n if (typeof max === \"number\") {\n if (value > max) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * Checks if a value is a string and its length is in a range\n * @param value The value to check\n * @param minLength The minimum length\n * @param maxLength The maximum length\n */\nexport const isTextInRange = (\n value: unknown,\n minLength = 0,\n maxLength?: number,\n): boolean => {\n if (typeof value !== \"string\") {\n return false;\n }\n\n if (typeof minLength === \"number\" && value.length < minLength) {\n return false;\n }\n\n if (typeof maxLength === \"number\" && value.length > maxLength) {\n return false;\n }\n\n return true;\n};\n\n/**\n * Checks if a value is a string and its word length is in a range\n * @param value The value to check\n * @param minWordLength The minimum word length\n * @param maxWordLength The maximum word length\n */\nexport const isTextInWordRange = (\n value: unknown,\n minWordLength = 0,\n maxWordLength?: number,\n): boolean => {\n if (typeof value !== \"string\") {\n return false;\n }\n\n const words = value.length > 0 ? value.split(\" \") : [];\n\n if (typeof minWordLength === \"number\" && words.length < minWordLength) {\n return false;\n }\n\n if (typeof maxWordLength === \"number\" && words.length > maxWordLength) {\n return false;\n }\n\n return true;\n};\n", "import { isPhoneNumber } from \"./validations.ts\";\n\n/**\n * Convert the value to a valid phone number\n * @param value The value to convert\n * @returns The valid phone number or null if the value is not a valid phone number\n */\nexport const toPhoneNumber = (value: unknown): string | false => {\n if (typeof value !== \"string\" || !value.length) {\n return false;\n }\n const result = value.replace(/(?!^\\+)\\D/g, \"\");\n if (!isPhoneNumber(result)) {\n return false;\n }\n return result;\n};\n\n/**\n * Convert the value to a valid bytes number.\n * Note: This method ignores the text case of the unit, so b is always the same as B which means Byte and makes no different between Bytes and bits.\n * This method can be used to convert `fileMinSize` and `fileMaxSize` of a callout file component to bytes.\n * @param value E.g. \"0KB\", \"1GB\"\n * @returns The valid bytes number or null if the value is not a valid bytes number.\n */\nexport const toBytes = (value: unknown): number | null => {\n if (typeof value !== \"string\" || !value.length) {\n return null;\n }\n const lowerCase = value.toLowerCase();\n const units = [\"b\", \"kb\", \"mb\", \"gb\", \"tb\", \"pb\", \"eb\", \"zb\", \"yb\"];\n const [, num, unit] = lowerCase.match(/(\\d+)(\\w+)/)!;\n const unitIndex = units.indexOf(unit.toLowerCase());\n\n if (unitIndex === -1) {\n return null;\n }\n\n return Number(num) * Math.pow(1024, unitIndex);\n};\n", "/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @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).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n", "/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @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).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date(date: DateType): DateType {\n * return constructFrom(\n * date, // Use contrustor from the given date\n * date.getTime() // Use the date value to create a new date\n * )\n * }\n */\nexport function constructFrom(date, value) {\n if (date instanceof Date) {\n return new date.constructor(value);\n } else {\n return new Date(value);\n }\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n", "import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @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).\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be added.\n *\n * @returns The new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n", "import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @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).\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be added.\n *\n * @returns The new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n *\n * // Add one month to 30 January 2023:\n * const result = addMonths(new Date(2023, 0, 30), 1)\n * //=> Tue Feb 28 2023 00:00:00\n */\nexport function addMonths(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n const dayOfMonth = _date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n const endOfDesiredMonth = constructFrom(date, _date.getTime());\n endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);\n const daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n _date.setFullYear(\n endOfDesiredMonth.getFullYear(),\n endOfDesiredMonth.getMonth(),\n dayOfMonth,\n );\n return _date;\n }\n}\n\n// Fallback for modularized imports:\nexport default addMonths;\n", "import { addDays } from \"./addDays.mjs\";\nimport { addMonths } from \"./addMonths.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name add\n * @category Common Helpers\n * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @description\n * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @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).\n *\n * @param date - The date to be changed\n * @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added.\n *\n * | Key | Description |\n * |----------------|------------------------------------|\n * | years | Amount of years to be added |\n * | months | Amount of months to be added |\n * | weeks | Amount of weeks to be added |\n * | days | Amount of days to be added |\n * | hours | Amount of hours to be added |\n * | minutes | Amount of minutes to be added |\n * | seconds | Amount of seconds to be added |\n *\n * All values default to 0\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add the following duration to 1 September 2014, 10:19:50\n * const result = add(new Date(2014, 8, 1, 10, 19, 50), {\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\\\\-7\n * minutes: 9,\n * seconds: 30,\n * })\n * //=> Thu Jun 15 2017 15:29:20\n */\nexport function add(date, duration) {\n const {\n years = 0,\n months = 0,\n weeks = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n } = duration;\n\n // Add years and months\n const _date = toDate(date);\n const dateWithMonths =\n months || years ? addMonths(_date, months + years * 12) : _date;\n\n // Add weeks and days\n const dateWithDays =\n days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;\n\n // Add days, hours, minutes and seconds\n const minutesToAdd = minutes + hours * 60;\n const secondsToAdd = seconds + minutesToAdd * 60;\n const msToAdd = secondsToAdd * 1000;\n const finalDate = constructFrom(date, dateWithDays.getTime() + msToAdd);\n\n return finalDate;\n}\n\n// Fallback for modularized imports:\nexport default add;\n", "/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @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).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n", "/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n", "import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @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).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfMinute\n * @category Minute Helpers\n * @summary Return the start of a minute for the given date.\n *\n * @description\n * Return the start of a minute for the given date.\n * The result will be in the local timezone.\n *\n * @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).\n *\n * @param date - The original date\n *\n * @returns The start of a minute\n *\n * @example\n * // The start of a minute for 1 December 2014 22:15:45.400:\n * const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:00\n */\nexport function startOfMinute(date) {\n const _date = toDate(date);\n _date.setSeconds(0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfMinute;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfMonth\n * @category Month Helpers\n * @summary Return the start of a month for the given date.\n *\n * @description\n * Return the start of a month for the given date.\n * The result will be in the local timezone.\n *\n * @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).\n *\n * @param date - The original date\n *\n * @returns The start of a month\n *\n * @example\n * // The start of a month for 2 September 2014 11:55:00:\n * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfMonth(date) {\n const _date = toDate(date);\n _date.setDate(1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfMonth;\n", "import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @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).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfHour\n * @category Hour Helpers\n * @summary Return the start of an hour for the given date.\n *\n * @description\n * Return the start of an hour for the given date.\n * The result will be in the local timezone.\n *\n * @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).\n *\n * @param date - The original date\n *\n * @returns The start of an hour\n *\n * @example\n * // The start of an hour for 2 September 2014 11:55:00:\n * const result = startOfHour(new Date(2014, 8, 2, 11, 55))\n * //=> Tue Sep 02 2014 11:00:00\n */\nexport function startOfHour(date) {\n const _date = toDate(date);\n _date.setMinutes(0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfHour;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfSecond\n * @category Second Helpers\n * @summary Return the start of a second for the given date.\n *\n * @description\n * Return the start of a second for the given date.\n * The result will be in the local timezone.\n *\n * @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).\n *\n * @param date - The original date\n *\n * @returns The start of a second\n *\n * @example\n * // The start of a second for 1 December 2014 22:15:45.400:\n * const result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:45.000\n */\nexport function startOfSecond(date) {\n const _date = toDate(date);\n _date.setMilliseconds(0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfSecond;\n", "import { millisecondsInHour, millisecondsInMinute } from \"./constants.mjs\";\n\n/**\n * The {@link parseISO} function options.\n */\n\n/**\n * @name parseISO\n * @category Common Helpers\n * @summary Parse ISO string\n *\n * @description\n * Parse the given string in ISO 8601 format and return an instance of Date.\n *\n * Function accepts complete ISO 8601 formats as well as partial implementations.\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\n *\n * If the argument isn't a string, the function cannot parse the string or\n * the values are invalid, it returns Invalid Date.\n *\n * @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).\n *\n * @param argument - The value to convert\n * @param options - An object with options\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Convert string '2014-02-11T11:30:30' to date:\n * const result = parseISO('2014-02-11T11:30:30')\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert string '+02014101' to date,\n * // if the additional number of digits in the extended year format is 1:\n * const result = parseISO('+02014101', { additionalDigits: 1 })\n * //=> Fri Apr 11 2014 00:00:00\n */\nexport function parseISO(argument, options) {\n const additionalDigits = options?.additionalDigits ?? 2;\n const dateStrings = splitDateString(argument);\n\n let date;\n if (dateStrings.date) {\n const parseYearResult = parseYear(dateStrings.date, additionalDigits);\n date = parseDate(parseYearResult.restDateString, parseYearResult.year);\n }\n\n if (!date || isNaN(date.getTime())) {\n return new Date(NaN);\n }\n\n const timestamp = date.getTime();\n let time = 0;\n let offset;\n\n if (dateStrings.time) {\n time = parseTime(dateStrings.time);\n if (isNaN(time)) {\n return new Date(NaN);\n }\n }\n\n if (dateStrings.timezone) {\n offset = parseTimezone(dateStrings.timezone);\n if (isNaN(offset)) {\n return new Date(NaN);\n }\n } else {\n const dirtyDate = new Date(timestamp + time);\n // JS parsed string assuming it's in UTC timezone\n // but we need it to be parsed in our timezone\n // so we use utc values to build date in our timezone.\n // Year values from 0 to 99 map to the years 1900 to 1999\n // so set year explicitly with setFullYear.\n const result = new Date(0);\n result.setFullYear(\n dirtyDate.getUTCFullYear(),\n dirtyDate.getUTCMonth(),\n dirtyDate.getUTCDate(),\n );\n result.setHours(\n dirtyDate.getUTCHours(),\n dirtyDate.getUTCMinutes(),\n dirtyDate.getUTCSeconds(),\n dirtyDate.getUTCMilliseconds(),\n );\n return result;\n }\n\n return new Date(timestamp + time + offset);\n}\n\nconst patterns = {\n dateTimeDelimiter: /[T ]/,\n timeZoneDelimiter: /[Z ]/i,\n timezone: /([Z+-].*)$/,\n};\n\nconst dateRegex =\n /^-?(?:(\\d{3})|(\\d{2})(?:-?(\\d{2}))?|W(\\d{2})(?:-?(\\d{1}))?|)$/;\nconst timeRegex =\n /^(\\d{2}(?:[.,]\\d*)?)(?::?(\\d{2}(?:[.,]\\d*)?))?(?::?(\\d{2}(?:[.,]\\d*)?))?$/;\nconst timezoneRegex = /^([+-])(\\d{2})(?::?(\\d{2}))?$/;\n\nfunction splitDateString(dateString) {\n const dateStrings = {};\n const array = dateString.split(patterns.dateTimeDelimiter);\n let timeString;\n\n // The regex match should only return at maximum two array elements.\n // [date], [time], or [date, time].\n if (array.length > 2) {\n return dateStrings;\n }\n\n if (/:/.test(array[0])) {\n timeString = array[0];\n } else {\n dateStrings.date = array[0];\n timeString = array[1];\n if (patterns.timeZoneDelimiter.test(dateStrings.date)) {\n dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];\n timeString = dateString.substr(\n dateStrings.date.length,\n dateString.length,\n );\n }\n }\n\n if (timeString) {\n const token = patterns.timezone.exec(timeString);\n if (token) {\n dateStrings.time = timeString.replace(token[1], \"\");\n dateStrings.timezone = token[1];\n } else {\n dateStrings.time = timeString;\n }\n }\n\n return dateStrings;\n}\n\nfunction parseYear(dateString, additionalDigits) {\n const regex = new RegExp(\n \"^(?:(\\\\d{4}|[+-]\\\\d{\" +\n (4 + additionalDigits) +\n \"})|(\\\\d{2}|[+-]\\\\d{\" +\n (2 + additionalDigits) +\n \"})$)\",\n );\n\n const captures = dateString.match(regex);\n // Invalid ISO-formatted year\n if (!captures) return { year: NaN, restDateString: \"\" };\n\n const year = captures[1] ? parseInt(captures[1]) : null;\n const century = captures[2] ? parseInt(captures[2]) : null;\n\n // either year or century is null, not both\n return {\n year: century === null ? year : century * 100,\n restDateString: dateString.slice((captures[1] || captures[2]).length),\n };\n}\n\nfunction parseDate(dateString, year) {\n // Invalid ISO-formatted year\n if (year === null) return new Date(NaN);\n\n const captures = dateString.match(dateRegex);\n // Invalid ISO-formatted string\n if (!captures) return new Date(NaN);\n\n const isWeekDate = !!captures[4];\n const dayOfYear = parseDateUnit(captures[1]);\n const month = parseDateUnit(captures[2]) - 1;\n const day = parseDateUnit(captures[3]);\n const week = parseDateUnit(captures[4]);\n const dayOfWeek = parseDateUnit(captures[5]) - 1;\n\n if (isWeekDate) {\n if (!validateWeekDate(year, week, dayOfWeek)) {\n return new Date(NaN);\n }\n return dayOfISOWeekYear(year, week, dayOfWeek);\n } else {\n const date = new Date(0);\n if (\n !validateDate(year, month, day) ||\n !validateDayOfYearDate(year, dayOfYear)\n ) {\n return new Date(NaN);\n }\n date.setUTCFullYear(year, month, Math.max(dayOfYear, day));\n return date;\n }\n}\n\nfunction parseDateUnit(value) {\n return value ? parseInt(value) : 1;\n}\n\nfunction parseTime(timeString) {\n const captures = timeString.match(timeRegex);\n if (!captures) return NaN; // Invalid ISO-formatted time\n\n const hours = parseTimeUnit(captures[1]);\n const minutes = parseTimeUnit(captures[2]);\n const seconds = parseTimeUnit(captures[3]);\n\n if (!validateTime(hours, minutes, seconds)) {\n return NaN;\n }\n\n return (\n hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000\n );\n}\n\nfunction parseTimeUnit(value) {\n return (value && parseFloat(value.replace(\",\", \".\"))) || 0;\n}\n\nfunction parseTimezone(timezoneString) {\n if (timezoneString === \"Z\") return 0;\n\n const captures = timezoneString.match(timezoneRegex);\n if (!captures) return 0;\n\n const sign = captures[1] === \"+\" ? -1 : 1;\n const hours = parseInt(captures[2]);\n const minutes = (captures[3] && parseInt(captures[3])) || 0;\n\n if (!validateTimezone(hours, minutes)) {\n return NaN;\n }\n\n return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);\n}\n\nfunction dayOfISOWeekYear(isoWeekYear, week, day) {\n const date = new Date(0);\n date.setUTCFullYear(isoWeekYear, 0, 4);\n const fourthOfJanuaryDay = date.getUTCDay() || 7;\n const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}\n\n// Validation functions\n\n// February is null to handle the leap year (using ||)\nconst daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n\nfunction validateDate(year, month, date) {\n return (\n month >= 0 &&\n month <= 11 &&\n date >= 1 &&\n date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28))\n );\n}\n\nfunction validateDayOfYearDate(year, dayOfYear) {\n return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);\n}\n\nfunction validateWeekDate(_year, week, day) {\n return week >= 1 && week <= 53 && day >= 0 && day <= 6;\n}\n\nfunction validateTime(hours, minutes, seconds) {\n if (hours === 24) {\n return minutes === 0 && seconds === 0;\n }\n\n return (\n seconds >= 0 &&\n seconds < 60 &&\n minutes >= 0 &&\n minutes < 60 &&\n hours >= 0 &&\n hours < 25\n );\n}\n\nfunction validateTimezone(_hours, minutes) {\n return minutes >= 0 && minutes <= 59;\n}\n\n// Fallback for modularized imports:\nexport default parseISO;\n", "import {\n add,\n isValid,\n parseISO,\n startOfDay,\n startOfHour,\n startOfMinute,\n startOfMonth,\n startOfSecond,\n startOfYear,\n} from \"date-fns\";\n\nimport type { DateUnit, Duration, UnitMatches } from \"../types/index.ts\";\n\n// Must be ordered from highest resolution to lowest (seconds to years)\nexport const dateUnits = [\"s\", \"m\", \"h\", \"d\", \"M\", \"y\"] as const;\n\nexport const dateUnitMap: Record<DateUnit, keyof Duration> = {\n y: \"years\",\n M: \"months\",\n d: \"days\",\n h: \"hours\",\n m: \"minutes\",\n s: \"seconds\",\n};\n\nconst startOf: Record<DateUnit, (d: Date) => Date> = {\n y: startOfYear,\n M: startOfMonth,\n d: startOfDay,\n h: startOfHour,\n m: startOfMinute,\n s: startOfSecond,\n};\n\nconst relativeDate = /^\\$now(?<units>\\(((y|M|d|h|m|s):(-?\\d+),?)+\\))?$/;\nconst relativeUnit = /(y|M|d|h|m|s):(-?\\d+)/g;\n\n// Matches the different parts of an ISO 8601 date. Note we don't validate the\n// pattern properly as that is handled by parseISO, we just want to know which\n// parts of the date were specified\nconst absoluteDate =\n /^(?<y>\\d{4,})(-(?<M>\\d\\d)(-(?<d>\\d\\d)([T ](?<h>\\d\\d)(:(?<m>\\d\\d)(:(?<s>\\d\\d))?)?)?)?)?/;\n\n// Convert relative dates and returns the minimum date unit specified\nexport function parseDate(value: string, now = new Date()): [Date, DateUnit] {\n let date: Date;\n let units: DateUnit[];\n\n const relativeMatch = relativeDate.exec(value);\n if (relativeMatch) {\n date = now;\n const unitsGroup = relativeMatch.groups?.units;\n if (unitsGroup) {\n const unitMatches = unitsGroup.matchAll(\n relativeUnit,\n ) as UnitMatches;\n units = [];\n for (const [_, unit, delta] of unitMatches) {\n date = add(date, { [dateUnitMap[unit]]: Number(delta) });\n units.push(unit);\n }\n } else {\n units = [\"d\"];\n }\n } else {\n date = parseISO(value);\n units = Object.entries(absoluteDate.exec(value)?.groups || {})\n .filter(([_, n]) => !!n)\n .map(([unit]) => unit) as DateUnit[];\n }\n\n const minUnit = getMinDateUnit(units) || \"s\";\n return [startOf[minUnit](date), minUnit];\n}\n\nexport function getMinDateUnit(units: [DateUnit, ...DateUnit[]]): DateUnit;\nexport function getMinDateUnit(units: DateUnit[]): DateUnit | undefined;\nexport function getMinDateUnit(units: DateUnit[]): DateUnit | undefined {\n return dateUnits.find((unit) => units.includes(unit));\n}\n\nexport function isValidDate(s: string | Date) {\n if (typeof s === \"string\") {\n return relativeDate.test(s) || isValid(parseISO(s));\n }\n return isValid(s);\n}\n\nexport function isDateBetween(\n date: string | Date,\n start?: string | Date | null,\n end?: string | Date | null,\n): boolean {\n let valid = isValidDate(date);\n if (start) {\n start = typeof start === \"string\" ? parseISO(start) : start;\n valid = valid && date >= start!;\n }\n if (end) {\n end = typeof end === \"string\" ? parseISO(end) : end;\n valid = valid && date <= end!;\n }\n return valid;\n}\n", "import { ContributionPeriod, PaymentMethod } from \"../data/index.ts\";\n\nimport type { Feeable, StripeFeeCountry } from \"../types/index.ts\";\n\nconst stripeFees = {\n gb: {\n [PaymentMethod.StripeCard]: (amount: number) => 0.2 + 0.015 * amount,\n [PaymentMethod.StripeSEPA]: () => 0.3,\n [PaymentMethod.StripeBACS]: (amount: number) =>\n Math.min(2, Math.max(0.2, 0.01 * amount)),\n [PaymentMethod.StripePayPal]: (amount: number) => 0.1 + 0.020 * amount,\n },\n eu: {\n [PaymentMethod.StripeCard]: (amount: number) => 0.25 + 0.015 * amount,\n [PaymentMethod.StripeSEPA]: () => 0.35,\n [PaymentMethod.StripeBACS]: () => 0, // Not available\n [PaymentMethod.StripePayPal]: (amount: number) => 0.1 + 0.020 * amount,\n },\n ca: {\n [PaymentMethod.StripeCard]: (amount: number) => 0.3 + 0.029 * amount,\n [PaymentMethod.StripeSEPA]: () => 0, // Not available\n [PaymentMethod.StripeBACS]: () => 0, // Not available\n [PaymentMethod.StripePayPal]: () => 0, // Not available\n },\n} as const;\n\nconst gcFee = (amount: number) => 0.2 + amount * 0.01;\n\nexport function calcPaymentFee(\n feeable: Feeable,\n country: StripeFeeCountry,\n): number {\n const feeFn = feeable.paymentMethod === PaymentMethod.GoCardlessDirectDebit\n ? gcFee\n : stripeFees[country][feeable.paymentMethod];\n\n return feeable.period === ContributionPeriod.Annually\n ? 0\n : feeFn(feeable.amount);\n}\n", "import { InvalidRule } from \"../error/index.ts\";\nimport { nullableOperators, operatorsByTypeMap } from \"../search/index.ts\";\nimport { isValidDate } from \"./date.ts\";\n\nimport type {\n Filters,\n Rule,\n RuleGroup,\n ValidatedRule,\n ValidatedRuleGroup,\n} from \"../types/index.ts\";\n\nexport function isRuleGroup(\n ruleOrGroup: Rule | RuleGroup,\n): ruleOrGroup is RuleGroup {\n return \"condition\" in ruleOrGroup;\n}\n\nexport function validateRule<Field extends string>(\n filters: Filters<Field>,\n rule: Rule,\n): ValidatedRule<Field> {\n const filter = filters[rule.field as Field];\n if (!filter) {\n throw new InvalidRule(rule, `Invalid field: ${rule.field}`);\n }\n\n let expectedArgs = 0;\n if (rule.operator in nullableOperators) {\n // Field cannot be empty (except text which can always be empty)\n if (!filter.nullable && filter.type !== \"text\") {\n throw new InvalidRule(\n rule,\n `Invalid nullable operator: field is not nullable`,\n );\n }\n } else {\n const operator = operatorsByTypeMap[filter.type][rule.operator];\n if (!operator) {\n throw new InvalidRule(\n rule,\n `Invalid operator for type: ${filter.type} type doesn't define ${rule.operator}`,\n );\n }\n expectedArgs = operator.args;\n }\n\n if (expectedArgs !== rule.value.length) {\n throw new InvalidRule(\n rule,\n `Invalid operator argument count: ${rule.operator} needs ${expectedArgs}, ${rule.value.length} given`,\n );\n }\n\n const expectedType = filter.type === \"boolean\" || filter.type === \"number\"\n ? filter.type\n : \"string\";\n\n // deno-lint-ignore valid-typeof\n if (rule.value.some((v) => typeof v !== expectedType)) {\n throw new InvalidRule(\n rule,\n `Invalid operator argument type: ${rule.operator} needs ${expectedType}, ${\n rule.value.map(\n (v) => typeof v,\n )\n } given`,\n );\n }\n if (\n filter.type === \"date\" &&\n rule.value.some((v) => !isValidDate(v as string))\n ) {\n throw new InvalidRule(\n rule,\n `Invalid operator argument: date type needs valid absolute or relative date, ${rule.value} given`,\n );\n }\n\n if (\n (filter.type === \"enum\" || filter.type === \"array\") &&\n rule.value.some((v) => filter.options?.indexOf(v as string) === -1)\n ) {\n throw new InvalidRule(\n rule,\n `Invalid operator argument: ${filter.type} type expected ${filter.options}, ${rule.value} given`,\n );\n }\n\n return {\n field: rule.field,\n type: filter.type,\n nullable: !!filter.nullable,\n operator: rule.operator,\n value: rule.value,\n } as ValidatedRule<Field>;\n}\n\nexport function validateRuleGroup<Field extends string>(\n filters: Filters<Field>,\n ruleGroup: RuleGroup,\n): ValidatedRuleGroup<Field> {\n const validatedRuleGroup: ValidatedRuleGroup<Field> = {\n condition: ruleGroup.condition,\n rules: [],\n };\n\n for (const rule of ruleGroup.rules) {\n const valid = isRuleGroup(rule)\n ? validateRuleGroup(filters, rule)\n : validateRule(filters, rule);\n validatedRuleGroup.rules.push(valid);\n }\n return validatedRuleGroup;\n}\n", "import type {\n CalloutComponentContentSchema,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentContentValidator: ValidatorCalloutComponent<\n CalloutComponentContentSchema,\n unknown\n> = (\n _: CalloutComponentContentSchema,\n answer: unknown,\n): boolean => {\n // Content components have no answer, so answer should be falsy\n return !answer;\n};\n", "import type {\n CalloutComponentInputAddressSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputAddressValidator: ValidatorCalloutComponent<\n CalloutComponentInputAddressSchema\n> = (\n _schema: CalloutComponentInputAddressSchema,\n _answer: CalloutResponseAnswer,\n): boolean => {\n throw new Error(\n `[calloutComponentInputAddressValidator] Not implemented yet`,\n );\n};\n", "import type {\n CalloutComponentInputCheckboxSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputCheckboxValidator: ValidatorCalloutComponent<\n CalloutComponentInputCheckboxSchema\n> = (\n _schema: CalloutComponentInputCheckboxSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n return typeof answer === \"boolean\";\n};\n", "import { isAmountOfMoney } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputCurrencySchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputCurrencyValidator: ValidatorCalloutComponent<\n CalloutComponentInputCurrencySchema\n> = (\n _schema: CalloutComponentInputCurrencySchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n return isAmountOfMoney(answer);\n};\n", "import { isDateBetween } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputDateTimeSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputDateTimeValidator: ValidatorCalloutComponent<\n CalloutComponentInputDateTimeSchema\n> = (\n schema: CalloutComponentInputDateTimeSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n if (typeof answer !== \"string\") {\n return false;\n }\n\n return isDateBetween(answer, schema.widget.minDate, schema.widget.maxDate);\n};\n", "import { isEmail } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputEmailSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputEmailValidator: ValidatorCalloutComponent<\n CalloutComponentInputEmailSchema\n> = (\n _schema: CalloutComponentInputEmailSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n return isEmail(answer);\n};\n", "import { isURL } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputFileSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\nimport { isFileUploadAnswer } from \"../utils/callouts.ts\";\n\nexport const calloutComponentInputFileValidator: ValidatorCalloutComponent<\n CalloutComponentInputFileSchema\n> = (\n _schema: CalloutComponentInputFileSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n // TODO: We just check the file URL at the moment, but we need to check the file size and type too\n\n if (isFileUploadAnswer(answer)) {\n return isURL(answer.url);\n }\n\n return false;\n};\n", "import { isNumber, isNumberInRange } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputNumberSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputNumberValidator: ValidatorCalloutComponent<\n CalloutComponentInputNumberSchema\n> = (\n schema: CalloutComponentInputNumberSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n if (\n schema.validate &&\n !isNumberInRange(answer, schema.validate.min, schema.validate.max)\n ) {\n return false;\n }\n\n return isNumber(answer);\n};\n", "import { isPhoneNumber } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputPhoneNumberSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputPhoneNumberValidator:\n ValidatorCalloutComponent<CalloutComponentInputPhoneNumberSchema> = (\n _schema: CalloutComponentInputPhoneNumberSchema,\n answer: CalloutResponseAnswer,\n ): boolean => {\n return isPhoneNumber(answer);\n };\n", "import type {\n CalloutComponentInputSelectSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputSelectValidator: ValidatorCalloutComponent<\n CalloutComponentInputSelectSchema\n> = (\n schema: CalloutComponentInputSelectSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n const optionValue = schema.data.values.find((v) => v.value === answer);\n return !!optionValue;\n};\n", "import type {\n CalloutComponentInputSelectableSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputSelectableValidator:\n ValidatorCalloutComponent<CalloutComponentInputSelectableSchema> = (\n schema: CalloutComponentInputSelectableSchema,\n answer: CalloutResponseAnswer,\n ): boolean => {\n const optionValue = schema.values.find((v) => v.value === answer);\n return !!optionValue;\n };\n", "import type {\n CalloutComponentInputSignatureSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputSignatureValidator: ValidatorCalloutComponent<\n CalloutComponentInputSignatureSchema\n> = (\n _: CalloutComponentInputSignatureSchema,\n _answer: CalloutResponseAnswer,\n): boolean => {\n throw new Error(\n `[calloutComponentInputSignatureValidator] Not implemented yet`,\n );\n};\n", "import { isTextInRange, isTextInWordRange } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputTextRules,\n CalloutComponentInputTextSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nconst validateRules = (\n rules: CalloutComponentInputTextRules | undefined,\n answer: string | undefined,\n): boolean => {\n // Nothing to do..\n if (!rules) {\n return true;\n }\n\n if (!answer && rules.required) {\n return false;\n }\n\n // Check if the answer matches the provided pattern\n if (\n typeof rules.pattern === \"string\" && rules.pattern.length &&\n !new RegExp(rules.pattern).test(answer || \"\")\n ) {\n return false;\n }\n\n // Check word range if defined\n if (\n !isTextInWordRange(answer, rules.minWords, rules.maxWords)\n ) {\n return false;\n }\n\n // Check length range if defined\n if (\n !isTextInRange(answer, rules.minLength, rules.maxLength)\n ) {\n return false;\n }\n\n // If all checks pass, return true\n return true;\n};\n\nexport const calloutComponentInputTextValidator: ValidatorCalloutComponent<\n CalloutComponentInputTextSchema\n> = (\n schema: CalloutComponentInputTextSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n if (typeof answer !== \"string\") {\n return false;\n }\n\n return validateRules(schema?.validate, answer);\n};\n", "import type {\n CalloutComponentInputTimeSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputTimeValidator: ValidatorCalloutComponent<\n CalloutComponentInputTimeSchema\n> = (\n _schema: CalloutComponentInputTimeSchema,\n _answer: CalloutResponseAnswer,\n): boolean => {\n throw new Error(\n `[calloutComponentInputTimeValidator] Not implemented yet`,\n );\n};\n", "import { isURL } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputUrlSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputUrlValidator: ValidatorCalloutComponent<\n CalloutComponentInputUrlSchema\n> = (\n _schema: CalloutComponentInputUrlSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n return isURL(answer);\n};\n", "import { calloutComponentContentValidator } from \"./callout-component-content.validator.ts\";\nimport { calloutComponentInputAddressValidator } from \"./callout-component-input-address.validator.ts\";\nimport { calloutComponentInputCheckboxValidator } from \"./callout-component-input-checkbox.validator.ts\";\nimport { calloutComponentInputCurrencyValidator } from \"./callout-component-input-currency.validator.ts\";\nimport { calloutComponentInputDateTimeValidator } from \"./callout-component-input-date-time.validator.ts\";\nimport { calloutComponentInputEmailValidator } from \"./callout-component-input-email.validator.ts\";\nimport { calloutComponentInputFileValidator } from \"./callout-component-input-file.validator.ts\";\nimport { calloutComponentInputNumberValidator } from \"./callout-component-input-number.validator.ts\";\nimport { calloutComponentInputSelectValidator } from \"./callout-component-input-select.validator.ts\";\nimport { calloutComponentInputPhoneNumberValidator } from \"./callout-component-input-phone-number.validator.ts\";\nimport { calloutComponentInputSelectableValidator } from \"./callout-component-input-selectable.validator.ts\";\nimport { calloutComponentInputSignatureValidator } from \"./callout-component-input-signature.validator.ts\";\nimport { calloutComponentInputTextValidator } from \"./callout-component-input-text.validator.ts\";\nimport { calloutComponentInputTimeValidator } from \"./callout-component-input-time.validator.ts\";\nimport { calloutComponentInputUrlValidator } from \"./callout-component-input-url.validator.ts\";\n\nimport {\n CalloutComponentBaseType,\n CalloutComponentType,\n} from \"../data/index.ts\";\nimport { isCalloutComponentOfBaseType } from \"../utils/callouts.ts\";\n\nimport type {\n CalloutComponentInputSchema,\n CalloutComponentNestableSchema,\n CalloutComponentSchema,\n CalloutResponseAnswer,\n CalloutResponseAnswers,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentNestableValidator = (\n schema: CalloutComponentNestableSchema,\n answers: CalloutResponseAnswers,\n): boolean => {\n for (const component of schema.components) {\n const valid = calloutComponentValidator(\n component,\n answers[component.key],\n );\n if (!valid) {\n return false;\n }\n }\n return true;\n};\n\n/**\n * A map of validator classes to be used for Callout component.\n */\nconst calloutInputValidatorsMap: Record<\n CalloutComponentInputSchema[\"type\"],\n // deno-lint-ignore no-explicit-any\n ValidatorCalloutComponent<any>\n> = {\n // Input\n [CalloutComponentType.INPUT_EMAIL]: calloutComponentInputEmailValidator,\n [CalloutComponentType.INPUT_ADDRESS]: calloutComponentInputAddressValidator,\n [CalloutComponentType.INPUT_CHECKBOX]: calloutComponentInputCheckboxValidator,\n [CalloutComponentType.INPUT_CURRENCY]: calloutComponentInputCurrencyValidator,\n [CalloutComponentType.INPUT_DATE_TIME]:\n calloutComponentInputDateTimeValidator,\n [CalloutComponentType.INPUT_NUMBER]: calloutComponentInputNumberValidator,\n [CalloutComponentType.INPUT_PHONE_NUMBER]:\n calloutComponentInputPhoneNumberValidator,\n [CalloutComponentType.INPUT_SIGNATURE]:\n calloutComponentInputSignatureValidator,\n [CalloutComponentType.INPUT_TIME]: calloutComponentInputTimeValidator,\n [CalloutComponentType.INPUT_URL]: calloutComponentInputUrlValidator,\n [CalloutComponentType.INPUT_FILE]: calloutComponentInputFileValidator,\n [CalloutComponentType.INPUT_SELECT]: calloutComponentInputSelectValidator,\n\n // Text\n [CalloutComponentType.INPUT_TEXT_FIELD]: calloutComponentInputTextValidator,\n [CalloutComponentType.INPUT_TEXT_AREA]: calloutComponentInputTextValidator,\n\n // Selectable\n [CalloutComponentType.INPUT_SELECTABLE_RADIO]:\n calloutComponentInputSelectableValidator,\n [CalloutComponentType.INPUT_SELECTABLE_SELECTBOXES]:\n calloutComponentInputSelectableValidator,\n};\nexport function calloutComponentInputValidator(\n schema: CalloutComponentInputSchema,\n answer:\n | CalloutResponseAnswer\n | CalloutResponseAnswer[]\n | undefined,\n): boolean {\n const validator = calloutInputValidatorsMap[schema.type];\n if (!validator) {\n console.error(`No validator found for ${schema.type}`);\n return false;\n }\n\n if (answer === undefined) {\n return schema.validate?.required ? false : true;\n }\n\n const values = Array.isArray(answer) ? answer : [answer];\n for (const value of values) {\n const valid = validator(schema, value);\n if (!valid) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function calloutComponentValidator(\n schema: CalloutComponentSchema,\n answer:\n | CalloutResponseAnswer\n | CalloutResponseAnswer[]\n | undefined,\n): boolean;\n\nexport function calloutComponentValidator(\n schema: CalloutComponentNestableSchema,\n answer: CalloutResponseAnswers,\n): boolean;\n\nexport function calloutComponentValidator(\n schema: CalloutComponentSchema,\n answer:\n | CalloutResponseAnswer\n | CalloutResponseAnswer[]\n | undefined\n | CalloutResponseAnswers,\n): boolean {\n if (isCalloutComponentOfBaseType(schema, CalloutComponentBaseType.NESTABLE)) {\n return calloutComponentNestableValidator(\n schema,\n answer as CalloutResponseAnswers,\n );\n }\n\n if (isCalloutComponentOfBaseType(schema, CalloutComponentBaseType.INPUT)) {\n return calloutComponentInputValidator(\n schema,\n answer as CalloutResponseAnswer | CalloutResponseAnswer[] | undefined,\n );\n }\n\n if (isCalloutComponentOfBaseType(schema, CalloutComponentBaseType.CONTENT)) {\n return calloutComponentContentValidator(schema, answer as unknown);\n }\n\n throw new Error(\"Invalid schema type\");\n}\n", "// deno-lint-ignore-file\nimport * as BeabeeCommon from \"./index.ts\";\n\n(globalThis as any).Beabee ||= {};\n(globalThis as any).Beabee.Common = BeabeeCommon;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAAA;AAAA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,MAAK,gBAAL,kBAAKC,mBAAL;AACL,IAAAA,eAAA,YAAS;AACT,IAAAA,eAAA,WAAQ;AACR,IAAAA,eAAA,eAAY;AACZ,IAAAA,eAAA,mBAAgB;AAJN,WAAA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wBAAgC,GAAG;AAAA,IACnC,4BAAkC,GAAG;AAAA;AAAA,IAGrC,mCAAsC,GAAG;AAAA,IACzC,iCAAqC,GAAG;AAAA;AAAA,IAGxC,qCAA4C,GAC1C;AAAA,IACF,iDAAkD,GAChD;AAAA,EACJ;AACO,WAAS,+BACd,QACA,QAIS;AACT,UAAM,YAAY,0BAA0B,OAAO,IAAI;AACvD,QAAI,CAAC,WAAW;AACd,cAAQ,MAAM,0BAA0B,OAAO,IAAI,EAAE;AACrD,aAAO;AAAA,IACT;AAEA,QAAI,WAAW,QAAW;AACxB,aAAO,OAAO,UAAU,WAAW,QAAQ;AAAA,IAC7C;AAEA,UAAM,SAAS,MAAM,QAAQ,MAAM,IAAI,SAAS,CAAC,MAAM;AACvD,eAAW,SAAS,QAAQ;AAC1B,YAAM,QAAQ,UAAU,QAAQ,KAAK;AACrC,UAAI,CAAC,OAAO;AACV,eAAO;AAAA,MACT;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AAeO,WAAS,0BACd,QACA,QAKS;AACT,QAAI,6BAA6B,wBAAyC,GAAG;AAC3E,aAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAEA,QAAI,6BAA6B,qBAAsC,GAAG;AACxE,aAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAEA,QAAI,6BAA6B,uBAAwC,GAAG;AAC1E,aAAO,iCAAiC,QAAQ,MAAiB;AAAA,IACnE;AAEA,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;;;ACnJA,EAAC,WAAmB,WAAW,CAAC;AAChC,EAAC,WAAmB,OAAO,SAAS;",
|
|
4
|
+
"sourcesContent": ["export * from \"./data/index.ts\";\nexport * from \"./error/index.ts\";\nexport * from \"./search/index.ts\";\nexport * from \"./utils/index.ts\";\nexport * from \"./validators/index.ts\";\n\nexport type * from \"./types/index.ts\";\n", "export enum CalloutAccess {\n Member = \"member\",\n Guest = \"guest\",\n Anonymous = \"anonymous\",\n OnlyAnonymous = \"only-anonymous\",\n}\n", "export enum CalloutCaptcha {\n None = \"none\",\n Guest = \"guest\",\n All = \"all\",\n}\n", "export enum CalloutChannel {\n // WEB = 'web',\n TELEGRAM = \"telegram\",\n}\n", "/** Enumeration of base callout component types */\nexport enum CalloutComponentBaseType {\n CONTENT,\n INPUT,\n INPUT_TEXT,\n INPUT_SELECTABLE,\n NESTABLE,\n}\n", "/** Enumeration of all possible callout component types */\nexport enum CalloutComponentType {\n CONTENT = \"content\",\n INPUT_ADDRESS = \"address\",\n INPUT_CHECKBOX = \"checkbox\",\n INPUT_CURRENCY = \"currency\",\n INPUT_DATE_TIME = \"datetime\",\n INPUT_EMAIL = \"email\",\n INPUT_FILE = \"file\",\n INPUT_NUMBER = \"number\",\n INPUT_PHONE_NUMBER = \"phoneNumber\",\n INPUT_SELECT = \"select\",\n INPUT_SELECTABLE_RADIO = \"radio\",\n INPUT_SELECTABLE_SELECTBOXES = \"selectboxes\",\n INPUT_SIGNATURE = \"signature\",\n INPUT_TEXT_AREA = \"textarea\",\n INPUT_TEXT_FIELD = \"textfield\",\n INPUT_TIME = \"time\",\n INPUT_URL = \"url\",\n NESTABLE_PANEL = \"panel\",\n NESTABLE_TABS = \"tabs\",\n NESTABLE_WELL = \"well\",\n}\n", "import { CalloutComponentType } from \"./callout-component-type.ts\";\n\nimport type { CalloutComponentBaseInputSelectableSchema } from \"../types/index.ts\";\n\n/** Array of all possible callout nestable component types */\nexport const calloutComponentInputSelectableTypes: Array<\n CalloutComponentBaseInputSelectableSchema[\"type\"]\n> = [\n CalloutComponentType.INPUT_SELECTABLE_RADIO,\n CalloutComponentType.INPUT_SELECTABLE_SELECTBOXES,\n];\n", "import { CalloutComponentType } from \"./callout-component-type.ts\";\n\nimport type { CalloutComponentBaseInputTextSchema } from \"../types/index.ts\";\n\n/** Array of all possible callout input component types */\nexport const calloutComponentInputTextTypes: Array<\n CalloutComponentBaseInputTextSchema[\"type\"]\n> = [\n CalloutComponentType.INPUT_TEXT_AREA,\n CalloutComponentType.INPUT_TEXT_FIELD,\n];\n", "import { CalloutComponentType } from \"./callout-component-type.ts\";\nimport { calloutComponentInputSelectableTypes } from \"./callout-component-input-selectable-types.ts\";\nimport { calloutComponentInputTextTypes } from \"./callout-component-input-text-types.ts\";\n\nimport type { CalloutComponentBaseInputSchema } from \"../types/index.ts\";\n\n/** Array of all possible callout input component types */\nexport const calloutComponentInputTypes: Array<\n CalloutComponentBaseInputSchema[\"type\"]\n> = [\n ...calloutComponentInputSelectableTypes,\n ...calloutComponentInputTextTypes,\n CalloutComponentType.INPUT_ADDRESS,\n CalloutComponentType.INPUT_CHECKBOX,\n CalloutComponentType.INPUT_CURRENCY,\n CalloutComponentType.INPUT_DATE_TIME,\n CalloutComponentType.INPUT_EMAIL,\n CalloutComponentType.INPUT_FILE,\n CalloutComponentType.INPUT_NUMBER,\n CalloutComponentType.INPUT_PHONE_NUMBER,\n CalloutComponentType.INPUT_SELECT,\n CalloutComponentType.INPUT_SIGNATURE,\n CalloutComponentType.INPUT_TIME,\n CalloutComponentType.INPUT_URL,\n];\n", "import { CalloutComponentType } from \"./callout-component-type.ts\";\n\nimport type { CalloutComponentBaseNestableSchema } from \"../types/index.ts\";\n\n/** Array of all possible callout nestable component types */\nexport const calloutComponentNestableTypes: Array<\n CalloutComponentBaseNestableSchema[\"type\"]\n> = [\n CalloutComponentType.NESTABLE_PANEL,\n CalloutComponentType.NESTABLE_WELL,\n CalloutComponentType.NESTABLE_TABS,\n];\n", "import { calloutComponentNestableTypes } from \"./callout-component-nestable-types.ts\";\nimport { calloutComponentInputTypes } from \"./callout-component-input-types.ts\";\nimport { CalloutComponentType } from \"./callout-component-type.ts\";\n\n/** Array of all possible callout component types */\nexport const calloutComponentTypes: CalloutComponentType[] = [\n ...calloutComponentNestableTypes,\n ...calloutComponentInputTypes,\n CalloutComponentType.CONTENT,\n];\n", "import type { ContentId } from \"../types/index.ts\";\n\n/** All possible strings that can be passed to the content get controller to retrieve Beabee content data */\nexport const contentIds = [\n \"contacts\",\n \"email\",\n \"general\",\n \"join\",\n \"join/setup\",\n \"profile\",\n \"share\",\n \"payment\",\n \"telegram\",\n] satisfies ContentId[];\n", "export enum ContributionPeriod {\n Monthly = \"monthly\",\n Annually = \"annually\",\n}\n", "export enum ContributionType {\n Automatic = \"Automatic\",\n Manual = \"Manual\",\n Gift = \"Gift\",\n None = \"None\",\n}\n", "export enum ItemStatus {\n Draft = \"draft\",\n Scheduled = \"scheduled\",\n Open = \"open\",\n Ended = \"ended\",\n}\n", "export enum MembershipStatus {\n Active = \"active\",\n Expiring = \"expiring\",\n Expired = \"expired\",\n None = \"none\",\n}\n", "export enum NewsletterStatus {\n Subscribed = \"subscribed\",\n Unsubscribed = \"unsubscribed\",\n Cleaned = \"cleaned\",\n Pending = \"pending\",\n None = \"none\",\n}\n", "export enum PaymentMethod {\n StripeCard = \"s_card\",\n StripeSEPA = \"s_sepa\",\n StripeBACS = \"s_bacs\",\n StripePayPal = \"s_paypal\",\n GoCardlessDirectDebit = \"gc_direct-debit\",\n}\n", "export enum PaymentStatus {\n Draft = \"draft\",\n Pending = \"pending\",\n Successful = \"successful\",\n Failed = \"failed\",\n Cancelled = \"cancelled\",\n}\n", "import { Rule } from \"../types/index.ts\";\n\nexport class InvalidRule extends Error {\n constructor(\n readonly rule: Rule,\n readonly message: string,\n ) {\n super();\n Object.setPrototypeOf(this, InvalidRule.prototype);\n }\n}\n", "import type { Filters } from \"../types/index.ts\";\n\nexport const apiKeyFilters = {\n id: {\n type: \"text\",\n },\n createdAt: {\n type: \"date\",\n },\n} as const satisfies Filters;\n", "import type { Filters } from \"../types/index.ts\";\nimport { ItemStatus } from \"../data/index.ts\";\n\nexport const calloutFilters = {\n id: {\n type: \"text\",\n },\n slug: {\n type: \"text\",\n },\n title: {\n type: \"text\",\n },\n status: {\n type: \"enum\",\n options: [\n ItemStatus.Draft,\n ItemStatus.Scheduled,\n ItemStatus.Open,\n ItemStatus.Ended,\n ],\n },\n answeredBy: {\n type: \"contact\",\n },\n starts: {\n type: \"date\",\n nullable: true,\n },\n expires: {\n type: \"date\",\n nullable: true,\n },\n hidden: {\n type: \"boolean\",\n },\n channels: {\n type: \"array\",\n nullable: true,\n },\n} as const satisfies Filters;\n\nexport const calloutResponseFilters = {\n id: {\n type: \"text\",\n },\n contact: {\n type: \"contact\",\n nullable: true,\n },\n calloutId: {\n type: \"text\",\n },\n createdAt: {\n type: \"date\",\n },\n updatedAt: {\n type: \"date\",\n },\n bucket: {\n type: \"text\",\n nullable: true,\n },\n tags: {\n type: \"array\",\n },\n assignee: {\n type: \"contact\",\n nullable: true,\n },\n answers: {\n type: \"blob\",\n },\n} as const satisfies Filters;\n\nexport const calloutResponseCommentFilters = {\n id: {\n type: \"text\",\n },\n responseId: {\n type: \"text\",\n },\n contact: {\n type: \"contact\",\n },\n createdAt: {\n type: \"date\",\n },\n updatedAt: {\n type: \"date\",\n },\n text: {\n type: \"text\",\n },\n} as const satisfies Filters;\n\nexport const calloutTagFilters = {\n id: {\n type: \"text\",\n },\n name: {\n type: \"text\",\n },\n description: {\n type: \"text\",\n },\n calloutId: {\n type: \"text\",\n },\n} as const satisfies Filters;\n\nexport const calloutChannelFilters = {\n id: {\n type: \"text\",\n },\n name: {\n type: \"text\",\n },\n description: {\n type: \"text\",\n },\n calloutId: {\n type: \"text\",\n },\n} as const satisfies Filters;\n", "import type { Filters } from \"../types/index.ts\";\nimport {\n ContributionPeriod,\n ContributionType,\n NewsletterStatus,\n} from \"../data/index.ts\";\n\nexport const RoleTypes = [\"member\", \"admin\", \"superadmin\"] as const;\n\nexport const contactFilters = {\n id: {\n type: \"contact\",\n },\n firstname: {\n type: \"text\",\n },\n lastname: {\n type: \"text\",\n },\n email: {\n type: \"text\",\n },\n joined: {\n type: \"date\",\n },\n lastSeen: {\n type: \"date\",\n },\n contributionCancelled: {\n type: \"date\",\n nullable: true,\n },\n contributionType: {\n type: \"enum\",\n options: [\n ContributionType.Automatic,\n ContributionType.Gift,\n ContributionType.Manual,\n ContributionType.None,\n ],\n },\n contributionMonthlyAmount: {\n type: \"number\",\n },\n contributionPeriod: {\n type: \"enum\",\n options: [ContributionPeriod.Monthly, ContributionPeriod.Annually],\n },\n deliveryOptIn: {\n type: \"boolean\",\n },\n newsletterStatus: {\n type: \"enum\",\n options: [\n NewsletterStatus.Subscribed,\n NewsletterStatus.Unsubscribed,\n NewsletterStatus.Cleaned,\n NewsletterStatus.Pending,\n NewsletterStatus.None,\n ],\n },\n activePermission: {\n type: \"enum\",\n options: RoleTypes,\n },\n activeMembership: {\n type: \"boolean\",\n },\n membershipStarts: {\n type: \"date\",\n },\n membershipExpires: {\n type: \"date\",\n },\n manualPaymentSource: {\n type: \"text\",\n nullable: true,\n },\n tags: {\n type: \"array\",\n nullable: true,\n },\n} as const satisfies Filters;\n\nexport type ContactFilterName = keyof typeof contactFilters;\n\nexport const contactCalloutFilters = {\n hasAnswered: {\n type: \"boolean\",\n },\n} as const satisfies Filters;\n\nexport type ContactCalloutFilterName = keyof typeof contactCalloutFilters;\n", "import type { Filters } from \"../types/index.ts\";\nimport { ItemStatus } from \"../data/index.ts\";\n\nexport const noticeFilters = {\n id: {\n type: \"text\",\n },\n createdAt: {\n type: \"date\",\n },\n updatedAt: {\n type: \"date\",\n },\n name: {\n type: \"text\",\n },\n expires: {\n type: \"date\",\n nullable: true,\n },\n enabled: {\n type: \"boolean\",\n },\n text: {\n type: \"text\",\n },\n status: {\n type: \"enum\",\n options: [\n ItemStatus.Draft,\n ItemStatus.Scheduled,\n ItemStatus.Open,\n ItemStatus.Ended,\n ],\n },\n} as const satisfies Filters;\n", "import type { OperatorsByType } from \"../types/index.ts\";\n\nconst equalityOperators = {\n equal: { args: 1 },\n not_equal: { args: 1 },\n};\nconst stringOperators = {\n begins_with: { args: 1 },\n ends_with: { args: 1 },\n not_begins_with: { args: 1 },\n not_ends_with: { args: 1 },\n};\nconst numericOperators = {\n ...equalityOperators,\n between: { args: 2 },\n not_between: { args: 2 },\n less: { args: 1 },\n greater: { args: 1 },\n less_or_equal: { args: 1 },\n greater_or_equal: { args: 1 },\n};\nconst arrayOperators = {\n contains: { args: 1 },\n not_contains: { args: 1 },\n};\n// Special operator can be applied across all fields if they are nullable\nexport const nullableOperators = {\n is_empty: { args: 0 },\n is_not_empty: { args: 0 },\n};\n\nexport const operatorsByType = {\n text: { ...equalityOperators, ...arrayOperators, ...stringOperators },\n blob: arrayOperators,\n date: numericOperators,\n number: numericOperators,\n boolean: { equal: equalityOperators.equal },\n array: arrayOperators,\n enum: equalityOperators,\n contact: equalityOperators,\n} as const satisfies OperatorsByType;\n\n// More general type to allow mapping while maintaining full type above\nexport const operatorsByTypeMap: OperatorsByType = operatorsByType;\n\nexport const ruleOperators = [\n \"equal\",\n \"not_equal\",\n \"less\",\n \"less_or_equal\",\n \"greater\",\n \"greater_or_equal\",\n \"between\",\n \"not_between\",\n \"begins_with\",\n \"not_begins_with\",\n \"contains\",\n \"not_contains\",\n \"ends_with\",\n \"not_ends_with\",\n \"is_empty\",\n \"is_not_empty\",\n] as const;\n", "import type { Filters } from \"../types/index.ts\";\nimport { PaymentStatus } from \"../data/index.ts\";\n\nexport const paymentFilters = {\n id: {\n type: \"text\",\n },\n contact: {\n type: \"contact\",\n },\n chargeDate: {\n type: \"date\",\n },\n amount: {\n type: \"number\",\n },\n status: {\n type: \"enum\",\n options: [\n PaymentStatus.Draft,\n PaymentStatus.Pending,\n PaymentStatus.Successful,\n PaymentStatus.Failed,\n PaymentStatus.Cancelled,\n ],\n },\n} as const satisfies Filters;\n", "import type { Filters } from \"../types/index.ts\";\n\nexport const segmentFilters = {\n id: {\n type: \"text\",\n },\n name: {\n type: \"text\",\n },\n description: {\n type: \"text\",\n },\n} as const satisfies Filters;\n", "import {\n CalloutComponentBaseType,\n calloutComponentInputSelectableTypes,\n calloutComponentInputTextTypes,\n calloutComponentInputTypes,\n calloutComponentNestableTypes,\n CalloutComponentType,\n} from \"../data/index.ts\";\n\nimport type {\n CalloutComponentBaseMap,\n CalloutComponentBaseSchema,\n CalloutComponentMap,\n CalloutComponentSchema,\n CalloutResponseAnswer,\n CalloutResponseAnswerAddress,\n CalloutResponseAnswerFileUpload,\n FilterArgs,\n SetCalloutFormSchema,\n} from \"../types/index.ts\";\n\nfunction convertValuesToOptions(\n values: { value: string; label: string }[],\n): string[] {\n return values.map(({ value }) => value);\n}\n\nfunction convertComponentToFilter(\n component: CalloutComponentSchema & { fullKey: string },\n): FilterArgs & { label: string } {\n const baseItem = {\n label: component.label || component.fullKey,\n nullable: true,\n };\n\n if (\n isCalloutComponentOfType(component, CalloutComponentType.INPUT_CHECKBOX)\n ) {\n return { ...baseItem, type: \"boolean\", nullable: false };\n }\n\n if (isCalloutComponentOfType(component, CalloutComponentType.INPUT_NUMBER)) {\n return { ...baseItem, type: \"number\" };\n }\n\n if (\n isCalloutComponentOfType(\n component,\n CalloutComponentType.INPUT_SELECT,\n )\n ) {\n return {\n ...baseItem,\n type: \"enum\",\n options: convertValuesToOptions(component.data.values),\n };\n }\n\n if (\n isCalloutComponentOfType(component, CalloutComponentType.INPUT_TEXT_AREA)\n ) {\n return { ...baseItem, type: \"blob\" };\n }\n\n return { ...baseItem, type: \"text\" };\n}\n\nfunction getSelectableLabelFromValue(\n component: CalloutComponentSchema,\n value: string,\n): string {\n if (\n isCalloutComponentOfBaseType(\n component,\n CalloutComponentBaseType.INPUT_SELECTABLE,\n )\n ) {\n return component.values.find((v) => v.value === value)?.label || value;\n }\n\n if (isCalloutComponentOfType(component, CalloutComponentType.INPUT_SELECT)) {\n return (\n component.data.values.find((v) => v.value === value)?.label || value\n );\n }\n\n return value;\n}\n\n/**\n * Check if a component is a specific component type\n *\n * @param component The component to check\n * @param type The type of component to check\n * @returns Ensure that the component is of the specific type\n */\nexport function isCalloutComponentOfType<T extends CalloutComponentType>(\n component: CalloutComponentBaseSchema,\n type: T,\n): component is CalloutComponentMap[T] {\n return \"type\" in component &&\n component.type === type;\n}\n\n/**\n * Check if a component is a specific base component type\n *\n * @param component The component to check\n * @param type The type of component to check\n * @returns Ensure that the component is of the specific base type\n */\nexport function isCalloutComponentOfBaseType<\n T extends CalloutComponentBaseType,\n>(\n component: CalloutComponentBaseSchema,\n type: T,\n): component is CalloutComponentBaseMap[T] {\n if (!(\"type\" in component)) {\n return false;\n }\n\n // `content` has only one schema\n if (type === CalloutComponentBaseType.CONTENT) {\n return isCalloutComponentOfType(\n component,\n CalloutComponentType.CONTENT,\n );\n }\n\n if (type === CalloutComponentBaseType.INPUT) {\n return (calloutComponentInputTypes as string[]).includes(\n component.type,\n );\n }\n\n if (type === CalloutComponentBaseType.INPUT_TEXT) {\n return (calloutComponentInputTextTypes as string[]).includes(\n component.type,\n );\n }\n\n if (type === CalloutComponentBaseType.INPUT_SELECTABLE) {\n return (calloutComponentInputSelectableTypes as string[]).includes(\n component.type,\n );\n }\n\n if (type === CalloutComponentBaseType.NESTABLE) {\n return (calloutComponentNestableTypes as string[]).includes(\n component.type,\n );\n }\n\n return false;\n}\n\nexport function flattenComponents(\n components: CalloutComponentSchema[],\n): CalloutComponentSchema[] {\n return components.flatMap((component) =>\n isCalloutComponentOfBaseType(component, CalloutComponentBaseType.NESTABLE)\n ? [component, ...flattenComponents(component.components)]\n : [component]\n );\n}\n\nexport function filterComponents(\n components: CalloutComponentSchema[],\n filterFn: (component: CalloutComponentSchema) => boolean,\n): CalloutComponentSchema[] {\n return components.filter(filterFn).map((component) => {\n return {\n ...component,\n ...(isCalloutComponentOfBaseType(\n component,\n CalloutComponentBaseType.NESTABLE,\n ) && {\n components: filterComponents(component.components, filterFn),\n }),\n };\n });\n}\n\nexport function getCalloutComponents(\n formSchema: SetCalloutFormSchema,\n): (CalloutComponentSchema & { slideId: string; fullKey: string })[] {\n return formSchema.slides.flatMap((slide) =>\n flattenComponents(slide.components).map((component) => ({\n ...component,\n slideId: slide.id,\n fullKey: `${slide.id}.${component.key}`,\n }))\n );\n}\n\nexport function getCalloutFilters(\n formSchema: SetCalloutFormSchema,\n): Record<string, FilterArgs & { label: string }> {\n const items = getCalloutComponents(formSchema)\n .filter((c) => c.input)\n .map((c) => [`answers.${c.fullKey}`, convertComponentToFilter(c)]);\n\n return Object.fromEntries(items);\n}\n\nexport function isAddressAnswer(\n answer: CalloutResponseAnswer,\n): answer is CalloutResponseAnswerAddress {\n return !!answer && typeof answer === \"object\" && \"geometry\" in answer;\n}\n\nexport function isFileUploadAnswer(\n answer: CalloutResponseAnswer | undefined,\n): answer is CalloutResponseAnswerFileUpload {\n return !!answer && typeof answer === \"object\" && \"url\" in answer;\n}\n\nexport function stringifyAnswer(\n component: CalloutComponentSchema,\n answer: CalloutResponseAnswer | CalloutResponseAnswer[] | undefined,\n): string {\n if (Array.isArray(answer)) {\n return answer.map((a) => stringifyAnswer(component, a)).join(\", \");\n } else if (!answer) {\n return \"\";\n } else if (isAddressAnswer(answer)) {\n return answer.geometry.location.lat + \", \" + answer.geometry.location.lng;\n } else if (isFileUploadAnswer(answer)) {\n return answer.url;\n } else if (typeof answer === \"object\") {\n // Checkboxes\n return Object.entries(answer)\n .filter(([, selected]) => selected)\n .map(([value]) => getSelectableLabelFromValue(component, value))\n .join(\", \");\n } else if (typeof answer === \"string\") {\n return getSelectableLabelFromValue(component, answer);\n } else {\n return answer.toString();\n }\n}\n", "// Adapted from https://github.com/Trott/slug/issues/new\n\n// Technically should be Record<string, string | undefined> but makes\n// the code a bit simpler as TypeScript doesn't narrow if (charmap[char])\ntype CharMap = Record<string, string>;\n\ninterface Mode {\n charmap: CharMap;\n lower: boolean;\n multicharmap: CharMap;\n remove: RegExp | null;\n replacement: string;\n trim: boolean;\n}\n\ninterface Options {\n locale: string;\n mode: \"pretty\" | \"rfc3986\";\n fallback: boolean;\n}\n\n// This function's sole purpose is to help us ignore lone surrogates so that\n// malformed strings don't throw in the browser while being processed\n// permissively in Node.js. If we didn't care about parity, we could get rid\n// of it.\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt\nfunction getWholeCharAndI(str: string, i: number): [string, number] {\n const code = str.charCodeAt(i);\n\n // This is a coherence check. `code` should never be `NaN`.\n /* istanbul ignore if */\n if (isNaN(code)) {\n throw new RangeError(\n \"Index \" +\n i +\n ' out of range for string \"' +\n str +\n '\"; please open an issue at https://github.com/Trott/slug/issues/new',\n );\n }\n if (code < 0xd800 || code > 0xdfff) {\n return [str.charAt(i), i]; // Non-surrogate character, keeping 'i' the same\n }\n\n // High surrogate\n if (code >= 0xd800 && code <= 0xdbff) {\n if (str.length <= i + 1) {\n // High surrogate without following low surrogate\n return [\" \", i];\n }\n const next = str.charCodeAt(i + 1);\n if (next < 0xdc00 || next > 0xdfff) {\n // High surrogate without following low surrogate\n return [\" \", i];\n }\n return [str.charAt(i) + str.charAt(i + 1), i + 1];\n }\n\n // Low surrogate (0xDC00 <= code && code <= 0xDFFF)\n if (i === 0) {\n // Low surrogate without preceding high surrogate\n return [\" \", i];\n }\n\n const prev = str.charCodeAt(i - 1);\n\n /* istanbul ignore else */\n if (prev < 0xd800 || prev > 0xdbff) {\n // Low surrogate without preceding high surrogate\n return [\" \", i];\n }\n\n /* istanbul ignore next */\n throw new Error(\n 'String \"' +\n str +\n '\" reaches code believed to be unreachable; please open an issue at https://github.com/Trott/slug/issues/new',\n );\n}\n\nfunction base64(input: string) {\n return btoa(unescape(encodeURIComponent(input)));\n}\n\nexport function slug(s: string, opts?: Partial<Options & Mode>) {\n let result = slugify(s, opts);\n const fallback = opts && opts.fallback !== undefined\n ? opts.fallback\n : defaults.fallback;\n // If output is an empty string, try slug for base64 of string.\n if (fallback === true && result === \"\") {\n // Get rid of lone surrogates.\n let input = \"\";\n for (let i = 0; i < s.length; i++) {\n const charAndI = getWholeCharAndI(s, i);\n i = charAndI[1];\n input += charAndI[0];\n }\n result = slugify(base64(input), opts);\n }\n return result;\n}\n\nconst locales: Record<string, CharMap | undefined> = {\n // http://www.eki.ee/wgrs/rom1_bg.pdf\n bg: {\n \u0419: \"Y\",\n \u0439: \"y\",\n X: \"H\",\n x: \"h\",\n \u0426: \"Ts\",\n \u0446: \"ts\",\n \u0429: \"Sht\",\n \u0449: \"sht\",\n \u042A: \"A\",\n \u044A: \"a\",\n \u042C: \"Y\",\n \u044C: \"y\",\n },\n // Need a reference URL for German, although this is pretty well-known.\n de: { \u00C4: \"AE\", \u00E4: \"ae\", \u00D6: \"OE\", \u00F6: \"oe\", \u00DC: \"UE\", \u00FC: \"ue\" },\n // Need a reference URL for Serbian.\n sr: { \u0111: \"dj\", \u0110: \"DJ\" },\n // https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/864314/ROMANIZATION_OF_UKRAINIAN.pdf\n uk: {\n \u0418: \"Y\",\n \u0438: \"y\",\n \u0419: \"Y\",\n \u0439: \"y\",\n \u0426: \"Ts\",\n \u0446: \"ts\",\n \u0425: \"Kh\",\n \u0445: \"kh\",\n \u0429: \"Shch\",\n \u0449: \"shch\",\n \u0413: \"H\",\n \u0433: \"h\",\n },\n};\n\nfunction slugify(str: string, partialOpts?: Partial<Options & Mode>) {\n const mode = partialOpts?.mode || defaults.mode;\n const opts = { ...defaults.modes[mode], ...partialOpts };\n const localeMap = (!!opts.locale && locales[opts.locale]) || {};\n\n let lengths = [];\n for (const key in opts.multicharmap) {\n if (!Object.prototype.hasOwnProperty.call(opts.multicharmap, key)) {\n continue;\n }\n\n const len = key.length;\n if (lengths.indexOf(len) === -1) {\n lengths.push(len);\n }\n }\n\n // We want to match the longest string if there are multiple matches, so\n // sort lengths in descending order.\n lengths = lengths.sort(function (a, b) {\n return b - a;\n });\n\n const disallowedChars = opts.mode === \"rfc3986\"\n ? /[^\\w\\s\\-.~]/\n : /[^A-Za-z0-9\\s]/;\n\n let result = \"\";\n for (let char, i = 0, l = str.length; i < l; i++) {\n char = str[i];\n let matchedMultichar = false;\n for (let j = 0; j < lengths.length; j++) {\n const len = lengths[j];\n const substr = str.substr(i, len);\n if (opts.multicharmap[substr]) {\n i += len - 1;\n char = opts.multicharmap[substr];\n matchedMultichar = true;\n break;\n }\n }\n if (!matchedMultichar) {\n if (localeMap[char]) {\n char = localeMap[char];\n } else if (opts.charmap[char]) {\n char = opts.charmap[char].replace(opts.replacement, \" \");\n } else if (char.includes(opts.replacement)) {\n // preserve the replacement character in case it is excluded by disallowedChars\n char = char.replace(opts.replacement, \" \");\n } else {\n char = char.replace(disallowedChars, \"\");\n }\n }\n result += char;\n }\n\n if (opts.remove) {\n result = result.replace(opts.remove, \"\");\n }\n if (opts.trim) {\n result = result.trim();\n }\n result = result.replace(/\\s+/g, opts.replacement); // convert spaces\n if (opts.lower) {\n result = result.toLowerCase();\n }\n return result;\n}\n\nconst initialMulticharmap: CharMap = {\n // multibyte devanagari characters (hindi, sanskrit, etc.)\n \u092B\u093C: \"Fi\",\n \u0917\u093C: \"Ghi\",\n \u0916\u093C: \"Khi\",\n \u0915\u093C: \"Qi\",\n \u0921\u093C: \"ugDha\",\n \u0922\u093C: \"ugDhha\",\n \u092F\u093C: \"Yi\",\n \u091C\u093C: \"Za\",\n // hebrew\n // Refs: http://www.eki.ee/wgrs/rom1_he.pdf\n // Refs: https://en.wikipedia.org/wiki/Niqqud\n \u05D1\u05B4\u05D9: \"i\",\n \u05D1\u05B5: \"e\",\n \u05D1\u05B5\u05D9: \"e\",\n \u05D1\u05B6: \"e\",\n \u05D1\u05B7: \"a\",\n \u05D1\u05B8: \"a\",\n \u05D1\u05B9: \"o\",\n \u05D5\u05B9: \"o\",\n \u05D1\u05BB: \"u\",\n \u05D5\u05BC: \"u\",\n \u05D1\u05BC: \"b\",\n \u05DB\u05BC: \"k\",\n \u05DA\u05BC: \"k\",\n \u05E4\u05BC: \"p\",\n \u05E9\u05C1: \"sh\",\n \u05E9\u05C2: \"s\",\n \u05D1\u05B0: \"e\",\n \u05D7\u05B1: \"e\",\n \u05D7\u05B2: \"a\",\n \u05D7\u05B3: \"o\",\n \u05D1\u05B4: \"i\",\n};\n\n// https://github.com/django/django/blob/master/django/contrib/admin/static/admin/js/urlify.js\nconst initialCharmap: CharMap = {\n // latin\n \u00C0: \"A\",\n \u00C1: \"A\",\n \u00C2: \"A\",\n \u00C3: \"A\",\n \u00C4: \"A\",\n \u00C5: \"A\",\n \u00C6: \"AE\",\n \u00C7: \"C\",\n \u00C8: \"E\",\n \u00C9: \"E\",\n \u00CA: \"E\",\n \u00CB: \"E\",\n \u00CC: \"I\",\n \u00CD: \"I\",\n \u00CE: \"I\",\n \u00CF: \"I\",\n \u00D0: \"D\",\n \u00D1: \"N\",\n \u00D2: \"O\",\n \u00D3: \"O\",\n \u00D4: \"O\",\n \u00D5: \"O\",\n \u00D6: \"O\",\n \u0150: \"O\",\n \u00D8: \"O\",\n \u014C: \"O\",\n \u00D9: \"U\",\n \u00DA: \"U\",\n \u00DB: \"U\",\n \u00DC: \"U\",\n \u0170: \"U\",\n \u00DD: \"Y\",\n \u00DE: \"TH\",\n \u00DF: \"ss\",\n \u00E0: \"a\",\n \u00E1: \"a\",\n \u00E2: \"a\",\n \u00E3: \"a\",\n \u00E4: \"a\",\n \u00E5: \"a\",\n \u00E6: \"ae\",\n \u00E7: \"c\",\n \u00E8: \"e\",\n \u00E9: \"e\",\n \u00EA: \"e\",\n \u00EB: \"e\",\n \u00EC: \"i\",\n \u00ED: \"i\",\n \u00EE: \"i\",\n \u00EF: \"i\",\n \u00F0: \"d\",\n \u00F1: \"n\",\n \u00F2: \"o\",\n \u00F3: \"o\",\n \u00F4: \"o\",\n \u00F5: \"o\",\n \u00F6: \"o\",\n \u0151: \"o\",\n \u00F8: \"o\",\n \u014D: \"o\",\n \u0152: \"OE\",\n \u0153: \"oe\",\n \u00F9: \"u\",\n \u00FA: \"u\",\n \u00FB: \"u\",\n \u00FC: \"u\",\n \u0171: \"u\",\n \u00FD: \"y\",\n \u00FE: \"th\",\n \u00FF: \"y\",\n \u1E9E: \"SS\",\n // greek\n \u03B1: \"a\",\n \u03B2: \"b\",\n \u03B3: \"g\",\n \u03B4: \"d\",\n \u03B5: \"e\",\n \u03B6: \"z\",\n \u03B7: \"h\",\n \u03B8: \"th\",\n \u03B9: \"i\",\n \u03BA: \"k\",\n \u03BB: \"l\",\n \u03BC: \"m\",\n \u03BD: \"n\",\n \u03BE: \"3\",\n \u03BF: \"o\",\n \u03C0: \"p\",\n \u03C1: \"r\",\n \u03C3: \"s\",\n \u03C4: \"t\",\n \u03C5: \"y\",\n \u03C6: \"f\",\n \u03C7: \"x\",\n \u03C8: \"ps\",\n \u03C9: \"w\",\n \u03AC: \"a\",\n \u03AD: \"e\",\n \u03AF: \"i\",\n \u03CC: \"o\",\n \u03CD: \"y\",\n \u03AE: \"h\",\n \u03CE: \"w\",\n \u03C2: \"s\",\n \u03CA: \"i\",\n \u03B0: \"y\",\n \u03CB: \"y\",\n \u0390: \"i\",\n \u0391: \"A\",\n \u0392: \"B\",\n \u0393: \"G\",\n \u0394: \"D\",\n \u0395: \"E\",\n \u0396: \"Z\",\n \u0397: \"H\",\n \u0398: \"Th\",\n \u0399: \"I\",\n \u039A: \"K\",\n \u039B: \"L\",\n \u039C: \"M\",\n \u039D: \"N\",\n \u039E: \"3\",\n \u039F: \"O\",\n \u03A0: \"P\",\n \u03A1: \"R\",\n \u03A3: \"S\",\n \u03A4: \"T\",\n \u03A5: \"Y\",\n \u03A6: \"F\",\n \u03A7: \"X\",\n \u03A8: \"PS\",\n \u03A9: \"W\",\n \u0386: \"A\",\n \u0388: \"E\",\n \u038A: \"I\",\n \u038C: \"O\",\n \u038E: \"Y\",\n \u0389: \"H\",\n \u038F: \"W\",\n \u03AA: \"I\",\n \u03AB: \"Y\",\n // turkish\n \u015F: \"s\",\n \u015E: \"S\",\n \u0131: \"i\",\n \u0130: \"I\",\n \u011F: \"g\",\n \u011E: \"G\",\n // russian\n \u0430: \"a\",\n \u0431: \"b\",\n \u0432: \"v\",\n \u0433: \"g\",\n \u0434: \"d\",\n \u0435: \"e\",\n \u0451: \"yo\",\n \u0436: \"zh\",\n \u0437: \"z\",\n \u0438: \"i\",\n \u0439: \"j\",\n \u043A: \"k\",\n \u043B: \"l\",\n \u043C: \"m\",\n \u043D: \"n\",\n \u043E: \"o\",\n \u043F: \"p\",\n \u0440: \"r\",\n \u0441: \"s\",\n \u0442: \"t\",\n \u0443: \"u\",\n \u0444: \"f\",\n \u0445: \"h\",\n \u0446: \"c\",\n \u0447: \"ch\",\n \u0448: \"sh\",\n \u0449: \"sh\",\n \u044A: \"u\",\n \u044B: \"y\",\n \u044C: \"\",\n \u044D: \"e\",\n \u044E: \"yu\",\n \u044F: \"ya\",\n \u0410: \"A\",\n \u0411: \"B\",\n \u0412: \"V\",\n \u0413: \"G\",\n \u0414: \"D\",\n \u0415: \"E\",\n \u0401: \"Yo\",\n \u0416: \"Zh\",\n \u0417: \"Z\",\n \u0418: \"I\",\n \u0419: \"J\",\n \u041A: \"K\",\n \u041B: \"L\",\n \u041C: \"M\",\n \u041D: \"N\",\n \u041E: \"O\",\n \u041F: \"P\",\n \u0420: \"R\",\n \u0421: \"S\",\n \u0422: \"T\",\n \u0423: \"U\",\n \u0424: \"F\",\n \u0425: \"H\",\n \u0426: \"C\",\n \u0427: \"Ch\",\n \u0428: \"Sh\",\n \u0429: \"Sh\",\n \u042A: \"U\",\n \u042B: \"Y\",\n \u042C: \"\",\n \u042D: \"E\",\n \u042E: \"Yu\",\n \u042F: \"Ya\",\n // ukranian\n \u0404: \"Ye\",\n \u0406: \"I\",\n \u0407: \"Yi\",\n \u0490: \"G\",\n \u0454: \"ye\",\n \u0456: \"i\",\n \u0457: \"yi\",\n \u0491: \"g\",\n // czech\n \u010D: \"c\",\n \u010F: \"d\",\n \u011B: \"e\",\n \u0148: \"n\",\n \u0159: \"r\",\n \u0161: \"s\",\n \u0165: \"t\",\n \u016F: \"u\",\n \u017E: \"z\",\n \u010C: \"C\",\n \u010E: \"D\",\n \u011A: \"E\",\n \u0147: \"N\",\n \u0158: \"R\",\n \u0160: \"S\",\n \u0164: \"T\",\n \u016E: \"U\",\n \u017D: \"Z\",\n // slovak\n \u013E: \"l\",\n \u013A: \"l\",\n \u0155: \"r\",\n \u013D: \"L\",\n \u0139: \"L\",\n \u0154: \"R\",\n // polish\n \u0105: \"a\",\n \u0107: \"c\",\n \u0119: \"e\",\n \u0142: \"l\",\n \u0144: \"n\",\n \u015B: \"s\",\n \u017A: \"z\",\n \u017C: \"z\",\n \u0104: \"A\",\n \u0106: \"C\",\n \u0118: \"E\",\n \u0141: \"L\",\n \u0143: \"N\",\n \u015A: \"S\",\n \u0179: \"Z\",\n \u017B: \"Z\",\n // latvian\n \u0101: \"a\",\n \u0113: \"e\",\n \u0123: \"g\",\n \u012B: \"i\",\n \u0137: \"k\",\n \u013C: \"l\",\n \u0146: \"n\",\n \u016B: \"u\",\n \u0100: \"A\",\n \u0112: \"E\",\n \u0122: \"G\",\n \u012A: \"I\",\n \u0136: \"K\",\n \u013B: \"L\",\n \u0145: \"N\",\n \u016A: \"U\",\n // arabic\n \u0623: \"a\",\n \u0625: \"i\",\n \u0628: \"b\",\n \u062A: \"t\",\n \u062B: \"th\",\n \u062C: \"g\",\n \u062D: \"h\",\n \u062E: \"kh\",\n \u062F: \"d\",\n \u0630: \"th\",\n \u0631: \"r\",\n \u0632: \"z\",\n \u0633: \"s\",\n \u0634: \"sh\",\n \u0635: \"s\",\n \u0636: \"d\",\n \u0637: \"t\",\n \u0638: \"th\",\n \u0639: \"aa\",\n \u063A: \"gh\",\n \u0641: \"f\",\n \u0642: \"k\",\n \u0643: \"k\",\n \u0644: \"l\",\n \u0645: \"m\",\n \u0646: \"n\",\n \u0647: \"h\",\n \u0648: \"o\",\n \u064A: \"y\",\n \u0621: \"aa\",\n \u0629: \"a\",\n // farsi\n \u0622: \"a\",\n \u0627: \"a\",\n \u067E: \"p\",\n \u0698: \"zh\",\n \u06AF: \"g\",\n \u0686: \"ch\",\n \u06A9: \"k\",\n \u06CC: \"i\",\n // lithuanian\n \u0117: \"e\",\n \u012F: \"i\",\n \u0173: \"u\",\n \u0116: \"E\",\n \u012E: \"I\",\n \u0172: \"U\",\n // romanian\n \u021B: \"t\",\n \u021A: \"T\",\n \u0163: \"t\",\n \u0162: \"T\",\n \u0219: \"s\",\n \u0218: \"S\",\n \u0103: \"a\",\n \u0102: \"A\",\n // vietnamese\n \u1EA0: \"A\",\n \u1EA2: \"A\",\n \u1EA6: \"A\",\n \u1EA4: \"A\",\n \u1EAC: \"A\",\n \u1EA8: \"A\",\n \u1EAA: \"A\",\n \u1EB0: \"A\",\n \u1EAE: \"A\",\n \u1EB6: \"A\",\n \u1EB2: \"A\",\n \u1EB4: \"A\",\n \u1EB8: \"E\",\n \u1EBA: \"E\",\n \u1EBC: \"E\",\n \u1EC0: \"E\",\n \u1EBE: \"E\",\n \u1EC6: \"E\",\n \u1EC2: \"E\",\n \u1EC4: \"E\",\n \u1ECA: \"I\",\n \u1EC8: \"I\",\n \u0128: \"I\",\n \u1ECC: \"O\",\n \u1ECE: \"O\",\n \u1ED2: \"O\",\n \u1ED0: \"O\",\n \u1ED8: \"O\",\n \u1ED4: \"O\",\n \u1ED6: \"O\",\n \u01A0: \"O\",\n \u1EDC: \"O\",\n \u1EDA: \"O\",\n \u1EE2: \"O\",\n \u1EDE: \"O\",\n \u1EE0: \"O\",\n \u1EE4: \"U\",\n \u1EE6: \"U\",\n \u0168: \"U\",\n \u01AF: \"U\",\n \u1EEA: \"U\",\n \u1EE8: \"U\",\n \u1EF0: \"U\",\n \u1EEC: \"U\",\n \u1EEE: \"U\",\n \u1EF2: \"Y\",\n \u1EF4: \"Y\",\n \u1EF6: \"Y\",\n \u1EF8: \"Y\",\n \u0110: \"D\",\n \u1EA1: \"a\",\n \u1EA3: \"a\",\n \u1EA7: \"a\",\n \u1EA5: \"a\",\n \u1EAD: \"a\",\n \u1EA9: \"a\",\n \u1EAB: \"a\",\n \u1EB1: \"a\",\n \u1EAF: \"a\",\n \u1EB7: \"a\",\n \u1EB3: \"a\",\n \u1EB5: \"a\",\n \u1EB9: \"e\",\n \u1EBB: \"e\",\n \u1EBD: \"e\",\n \u1EC1: \"e\",\n \u1EBF: \"e\",\n \u1EC7: \"e\",\n \u1EC3: \"e\",\n \u1EC5: \"e\",\n \u1ECB: \"i\",\n \u1EC9: \"i\",\n \u0129: \"i\",\n \u1ECD: \"o\",\n \u1ECF: \"o\",\n \u1ED3: \"o\",\n \u1ED1: \"o\",\n \u1ED9: \"o\",\n \u1ED5: \"o\",\n \u1ED7: \"o\",\n \u01A1: \"o\",\n \u1EDD: \"o\",\n \u1EDB: \"o\",\n \u1EE3: \"o\",\n \u1EDF: \"o\",\n \u1EE1: \"o\",\n \u1EE5: \"u\",\n \u1EE7: \"u\",\n \u0169: \"u\",\n \u01B0: \"u\",\n \u1EEB: \"u\",\n \u1EE9: \"u\",\n \u1EF1: \"u\",\n \u1EED: \"u\",\n \u1EEF: \"u\",\n \u1EF3: \"y\",\n \u1EF5: \"y\",\n \u1EF7: \"y\",\n \u1EF9: \"y\",\n \u0111: \"d\",\n // kazakh\n \u04D8: \"AE\",\n \u04D9: \"ae\",\n \u0492: \"GH\",\n \u0493: \"gh\",\n \u049A: \"KH\",\n \u049B: \"kh\",\n \u04A2: \"NG\",\n \u04A3: \"ng\",\n \u04AE: \"UE\",\n \u04AF: \"ue\",\n \u04B0: \"U\",\n \u04B1: \"u\",\n \u04BA: \"H\",\n \u04BB: \"h\",\n \u04E8: \"OE\",\n \u04E9: \"oe\",\n // serbian\n \u0452: \"dj\",\n \u0458: \"j\",\n \u0459: \"lj\",\n \u045A: \"nj\",\n \u045B: \"c\",\n \u045F: \"dz\",\n \u0402: \"Dj\",\n \u0408: \"j\",\n \u0409: \"Lj\",\n \u040A: \"Nj\",\n \u040B: \"C\",\n \u040F: \"Dz\",\n \u01CC: \"nj\",\n \u01C9: \"lj\",\n \u01CB: \"NJ\",\n \u01C8: \"LJ\",\n // hindi\n \u0905: \"a\",\n \u0906: \"aa\",\n \u090F: \"e\",\n \u0908: \"ii\",\n \u090D: \"ei\",\n \u090E: \"ae\",\n \u0910: \"ai\",\n \u0907: \"i\",\n \u0913: \"o\",\n \u0911: \"oi\",\n \u0912: \"oii\",\n \u090A: \"uu\",\n \u0914: \"ou\",\n \u0909: \"u\",\n \u092C: \"B\",\n \u092D: \"Bha\",\n \u091A: \"Ca\",\n \u091B: \"Chha\",\n \u0921: \"Da\",\n \u0922: \"Dha\",\n \u092B: \"Fa\",\n \u0917: \"Ga\",\n \u0918: \"Gha\",\n \u0917\u093C: \"Ghi\",\n \u0939: \"Ha\",\n \u091C: \"Ja\",\n \u091D: \"Jha\",\n \u0915: \"Ka\",\n \u0916: \"Kha\",\n \u0916\u093C: \"Khi\",\n \u0932: \"L\",\n \u0933: \"Li\",\n \u090C: \"Li\",\n \u0934: \"Lii\",\n \u0961: \"Lii\",\n \u092E: \"Ma\",\n \u0928: \"Na\",\n \u0919: \"Na\",\n \u091E: \"Nia\",\n \u0923: \"Nae\",\n \u0929: \"Ni\",\n \u0950: \"oms\",\n \u092A: \"Pa\",\n \u0915\u093C: \"Qi\",\n \u0930: \"Ra\",\n \u090B: \"Ri\",\n \u0960: \"Ri\",\n \u0931: \"Ri\",\n \u0938: \"Sa\",\n \u0936: \"Sha\",\n \u0937: \"Shha\",\n \u091F: \"Ta\",\n \u0924: \"Ta\",\n \u0920: \"Tha\",\n \u0926: \"Tha\",\n \u0925: \"Tha\",\n \u0927: \"Thha\",\n \u0921\u093C: \"ugDha\",\n \u0922\u093C: \"ugDhha\",\n \u0935: \"Va\",\n \u092F: \"Ya\",\n \u092F\u093C: \"Yi\",\n \u091C\u093C: \"Za\",\n // azerbaijani\n \u0259: \"e\",\n \u018F: \"E\",\n // georgian\n \u10D0: \"a\",\n \u10D1: \"b\",\n \u10D2: \"g\",\n \u10D3: \"d\",\n \u10D4: \"e\",\n \u10D5: \"v\",\n \u10D6: \"z\",\n \u10D7: \"t\",\n \u10D8: \"i\",\n \u10D9: \"k\",\n \u10DA: \"l\",\n \u10DB: \"m\",\n \u10DC: \"n\",\n \u10DD: \"o\",\n \u10DE: \"p\",\n \u10DF: \"zh\",\n \u10E0: \"r\",\n \u10E1: \"s\",\n \u10E2: \"t\",\n \u10E3: \"u\",\n \u10E4: \"p\",\n \u10E5: \"k\",\n \u10E6: \"gh\",\n \u10E7: \"q\",\n \u10E8: \"sh\",\n \u10E9: \"ch\",\n \u10EA: \"ts\",\n \u10EB: \"dz\",\n \u10EC: \"ts\",\n \u10ED: \"ch\",\n \u10EE: \"kh\",\n \u10EF: \"j\",\n \u10F0: \"h\",\n // hebrew\n \u05D1: \"v\",\n \u05D2\u05BC: \"g\",\n \u05D2: \"g\",\n \u05D3: \"d\",\n \u05D3\u05BC: \"d\",\n \u05D4: \"h\",\n \u05D5: \"v\",\n \u05D6: \"z\",\n \u05D7: \"h\",\n \u05D8: \"t\",\n \u05D9: \"y\",\n \u05DB: \"kh\",\n \u05DA: \"kh\",\n \u05DC: \"l\",\n \u05DE: \"m\",\n \u05DD: \"m\",\n \u05E0: \"n\",\n \u05DF: \"n\",\n \u05E1: \"s\",\n \u05E4: \"f\",\n \u05E3: \"f\",\n \u05E5: \"ts\",\n \u05E6: \"ts\",\n \u05E7: \"k\",\n \u05E8: \"r\",\n \u05EA\u05BC: \"t\",\n \u05EA: \"t\",\n};\n\nconst defaults: Options & { modes: Record<string, Mode> } = {\n locale: \"\",\n mode: \"pretty\" as const,\n fallback: true,\n modes: {\n rfc3986: {\n replacement: \"-\",\n lower: true,\n charmap: initialCharmap,\n multicharmap: initialMulticharmap,\n remove: null,\n trim: true,\n },\n pretty: {\n replacement: \"-\",\n lower: true,\n charmap: initialCharmap,\n multicharmap: initialMulticharmap,\n remove: null,\n trim: true,\n },\n },\n};\n", "import { slug } from \"./slug.ts\";\nimport { ContributionPeriod } from \"../data/index.ts\";\n\n/**\n * Check if the value is a valid angle.\n * @param value The value to check\n */\nexport const isAngle = (value: unknown, span = 180): value is number => {\n return typeof value === \"number\" && value >= (span * -1) && value <= span;\n};\n\n/**\n * Check if the value is a valid email address.\n * @param value The value to check\n * @param span The span of the angle\n */\nexport const isEmail = (value: unknown): value is string => {\n if (typeof value !== \"string\" || value.length === 0) {\n return false;\n }\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailRegex.test(value);\n};\n\n/**\n * Check if the value is a valid longitude/latitude pair.\n * @param value The value to check\n */\nexport const isLngLat = (value: unknown): value is [number, number] => {\n if (!Array.isArray(value) || value.length !== 2) {\n return false;\n }\n const [longitude, latitude] = value;\n\n // Longitude should be between -180 and 180 and latitude should be between -90 and 90\n if (!isAngle(longitude, 180) || !isAngle(latitude, 90)) {\n return false;\n }\n\n return true;\n};\n\n/**\n * Check if the value is a valid map bounds.\n * @param value The value to check\n */\nexport const isMapBounds = (\n value: unknown,\n): value is [[number, number], [number, number]] => {\n return Array.isArray(value) && value.length === 2 && value.every(isLngLat);\n};\n\n/**\n * Check if the value is a valid password.\n * @param value The value to check\n */\nexport const isPassword = (value: unknown): value is string => {\n return (\n typeof value === \"string\" &&\n value.length >= 8 &&\n /[a-z]/.test(value) &&\n /[A-Z]/.test(value) &&\n /[0-9]/.test(value)\n );\n};\n\n/**\n * Check if the value is a valid period.\n * @param value The value to check\n */\nexport const isPeriod = (value: unknown): value is ContributionPeriod => {\n return (\n value === ContributionPeriod.Monthly ||\n value === ContributionPeriod.Annually\n );\n};\n\n/**\n * Check if the value is a valid slug.\n * @param value The value to check\n * @returns\n */\nexport const isSlug = (value: unknown): value is string => {\n return typeof value === \"string\" && value === slug(value);\n};\n\n/**\n * Check if the value is one of the given types\n * @param types The valid types\n * @param value The value to check\n */\nexport function isType(\n types: Array<\n | \"string\"\n | \"number\"\n | \"bigint\"\n | \"boolean\"\n | \"symbol\"\n | \"undefined\"\n | \"object\"\n | \"function\"\n >,\n value: unknown,\n): boolean {\n return types.includes(typeof value);\n}\n\n/**\n * Check if the value is a valid URL string\n * @param value The value to check\n */\nexport const isURL = (value: unknown): value is string => {\n if (typeof value !== \"string\" || !value.length) {\n return false;\n }\n const urlRegex =\n /^(https?:\\/\\/)([\\da-z\\-]+\\.)+[a-z]{2,6}(:[0-9]{1,5})?([\\/\\w \\.-]*)*\\/?(\\?[a-zA-Z0-9=&]*)?$/;\n return urlRegex.test(value);\n};\n\n/**\n * Check if the value is a valid number\n * @param value The value to check\n */\nexport const isNumber = (value: unknown): value is number => {\n return typeof value === \"number\" && !isNaN(value);\n};\n\nexport const isAmountOfMoney = (value: unknown): value is number => {\n if (!isNumber(value) || value < 0) {\n return false;\n }\n\n const decimalPart = value.toString().split(\".\")[1];\n // If the amount of money has decimal\n if (decimalPart && decimalPart.length > 2) {\n return false;\n }\n\n return true;\n};\n\n/**\n * Check if the value is a valid phone number with the following rules:\n * * Only uses numbers\n * * Optionally starts with a `+`\n * * Maximal length is 15 characters\n * * Minimal length is 5 characters\n * Note: This method is very generalised to work for as many countries as possible\n * and does not take into whitespace, brackets or other characters commonly used\n * in telephone number notation. To remove these, use `toPhoneNumber` instead.\n * @param value The value to check\n */\nexport const isPhoneNumber = (value: unknown): value is string => {\n if (typeof value !== \"string\" || !value.length) {\n return false;\n }\n if (value.length > 15 || value.length < 5) {\n return false;\n }\n const phoneRegex = /^(\\+?[0-9])\\d*$/;\n return phoneRegex.test(value);\n};\n\n/**\n * Check if the the pay fee value is correct for the given amount and period\n *\n * @param value The value to check\n * @param amount The amount\n * @param period The period\n */\nexport const isValidPayFee = (\n value: unknown,\n amount: unknown,\n period: unknown,\n): value is boolean => {\n if (\n typeof value !== \"boolean\" ||\n typeof amount !== \"number\" ||\n !isPeriod(period)\n ) {\n return false;\n }\n\n // Annual contributions don't pay a fee\n if (value && period === ContributionPeriod.Annually) {\n return false;\n }\n // \u00A31 monthly contributions must pay fee\n if (!value && period === ContributionPeriod.Monthly && amount === 1) {\n return false;\n }\n\n return true;\n};\n\nexport const isNumberInRange = (\n value: unknown,\n min?: number,\n max?: number,\n): boolean => {\n if (!isNumber(value)) {\n return false;\n }\n\n if (typeof min === \"number\") {\n if (value < min) {\n return false;\n }\n }\n\n if (typeof max === \"number\") {\n if (value > max) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * Checks if a value is a string and its length is in a range\n * @param value The value to check\n * @param minLength The minimum length\n * @param maxLength The maximum length\n */\nexport const isTextInRange = (\n value: unknown,\n minLength = 0,\n maxLength?: number,\n): boolean => {\n if (typeof value !== \"string\") {\n return false;\n }\n\n if (typeof minLength === \"number\" && value.length < minLength) {\n return false;\n }\n\n if (typeof maxLength === \"number\" && value.length > maxLength) {\n return false;\n }\n\n return true;\n};\n\n/**\n * Checks if a value is a string and its word length is in a range\n * @param value The value to check\n * @param minWordLength The minimum word length\n * @param maxWordLength The maximum word length\n */\nexport const isTextInWordRange = (\n value: unknown,\n minWordLength = 0,\n maxWordLength?: number,\n): boolean => {\n if (typeof value !== \"string\") {\n return false;\n }\n\n const words = value.length > 0 ? value.split(\" \") : [];\n\n if (typeof minWordLength === \"number\" && words.length < minWordLength) {\n return false;\n }\n\n if (typeof maxWordLength === \"number\" && words.length > maxWordLength) {\n return false;\n }\n\n return true;\n};\n", "import { isPhoneNumber } from \"./validations.ts\";\n\n/**\n * Convert the value to a valid phone number\n * @param value The value to convert\n * @returns The valid phone number or null if the value is not a valid phone number\n */\nexport const toPhoneNumber = (value: unknown): string | false => {\n if (typeof value !== \"string\" || !value.length) {\n return false;\n }\n const result = value.replace(/(?!^\\+)\\D/g, \"\");\n if (!isPhoneNumber(result)) {\n return false;\n }\n return result;\n};\n\n/**\n * Convert the value to a valid bytes number.\n * Note: This method ignores the text case of the unit, so b is always the same as B which means Byte and makes no different between Bytes and bits.\n * This method can be used to convert `fileMinSize` and `fileMaxSize` of a callout file component to bytes.\n * @param value E.g. \"0KB\", \"1GB\"\n * @returns The valid bytes number or null if the value is not a valid bytes number.\n */\nexport const toBytes = (value: unknown): number | null => {\n if (typeof value !== \"string\" || !value.length) {\n return null;\n }\n const lowerCase = value.toLowerCase();\n const units = [\"b\", \"kb\", \"mb\", \"gb\", \"tb\", \"pb\", \"eb\", \"zb\", \"yb\"];\n const [, num, unit] = lowerCase.match(/(\\d+)(\\w+)/)!;\n const unitIndex = units.indexOf(unit.toLowerCase());\n\n if (unitIndex === -1) {\n return null;\n }\n\n return Number(num) * Math.pow(1024, unitIndex);\n};\n", "/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @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).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n", "/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @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).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date(date: DateType): DateType {\n * return constructFrom(\n * date, // Use contrustor from the given date\n * date.getTime() // Use the date value to create a new date\n * )\n * }\n */\nexport function constructFrom(date, value) {\n if (date instanceof Date) {\n return new date.constructor(value);\n } else {\n return new Date(value);\n }\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n", "import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @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).\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be added.\n *\n * @returns The new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n", "import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @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).\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be added.\n *\n * @returns The new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n *\n * // Add one month to 30 January 2023:\n * const result = addMonths(new Date(2023, 0, 30), 1)\n * //=> Tue Feb 28 2023 00:00:00\n */\nexport function addMonths(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n const dayOfMonth = _date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n const endOfDesiredMonth = constructFrom(date, _date.getTime());\n endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);\n const daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n _date.setFullYear(\n endOfDesiredMonth.getFullYear(),\n endOfDesiredMonth.getMonth(),\n dayOfMonth,\n );\n return _date;\n }\n}\n\n// Fallback for modularized imports:\nexport default addMonths;\n", "import { addDays } from \"./addDays.mjs\";\nimport { addMonths } from \"./addMonths.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name add\n * @category Common Helpers\n * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @description\n * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @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).\n *\n * @param date - The date to be changed\n * @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added.\n *\n * | Key | Description |\n * |----------------|------------------------------------|\n * | years | Amount of years to be added |\n * | months | Amount of months to be added |\n * | weeks | Amount of weeks to be added |\n * | days | Amount of days to be added |\n * | hours | Amount of hours to be added |\n * | minutes | Amount of minutes to be added |\n * | seconds | Amount of seconds to be added |\n *\n * All values default to 0\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add the following duration to 1 September 2014, 10:19:50\n * const result = add(new Date(2014, 8, 1, 10, 19, 50), {\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\\\\-7\n * minutes: 9,\n * seconds: 30,\n * })\n * //=> Thu Jun 15 2017 15:29:20\n */\nexport function add(date, duration) {\n const {\n years = 0,\n months = 0,\n weeks = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n } = duration;\n\n // Add years and months\n const _date = toDate(date);\n const dateWithMonths =\n months || years ? addMonths(_date, months + years * 12) : _date;\n\n // Add weeks and days\n const dateWithDays =\n days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;\n\n // Add days, hours, minutes and seconds\n const minutesToAdd = minutes + hours * 60;\n const secondsToAdd = seconds + minutesToAdd * 60;\n const msToAdd = secondsToAdd * 1000;\n const finalDate = constructFrom(date, dateWithDays.getTime() + msToAdd);\n\n return finalDate;\n}\n\n// Fallback for modularized imports:\nexport default add;\n", "/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @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).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n", "/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n", "import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @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).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfMinute\n * @category Minute Helpers\n * @summary Return the start of a minute for the given date.\n *\n * @description\n * Return the start of a minute for the given date.\n * The result will be in the local timezone.\n *\n * @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).\n *\n * @param date - The original date\n *\n * @returns The start of a minute\n *\n * @example\n * // The start of a minute for 1 December 2014 22:15:45.400:\n * const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:00\n */\nexport function startOfMinute(date) {\n const _date = toDate(date);\n _date.setSeconds(0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfMinute;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfMonth\n * @category Month Helpers\n * @summary Return the start of a month for the given date.\n *\n * @description\n * Return the start of a month for the given date.\n * The result will be in the local timezone.\n *\n * @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).\n *\n * @param date - The original date\n *\n * @returns The start of a month\n *\n * @example\n * // The start of a month for 2 September 2014 11:55:00:\n * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfMonth(date) {\n const _date = toDate(date);\n _date.setDate(1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfMonth;\n", "import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @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).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfHour\n * @category Hour Helpers\n * @summary Return the start of an hour for the given date.\n *\n * @description\n * Return the start of an hour for the given date.\n * The result will be in the local timezone.\n *\n * @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).\n *\n * @param date - The original date\n *\n * @returns The start of an hour\n *\n * @example\n * // The start of an hour for 2 September 2014 11:55:00:\n * const result = startOfHour(new Date(2014, 8, 2, 11, 55))\n * //=> Tue Sep 02 2014 11:00:00\n */\nexport function startOfHour(date) {\n const _date = toDate(date);\n _date.setMinutes(0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfHour;\n", "import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfSecond\n * @category Second Helpers\n * @summary Return the start of a second for the given date.\n *\n * @description\n * Return the start of a second for the given date.\n * The result will be in the local timezone.\n *\n * @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).\n *\n * @param date - The original date\n *\n * @returns The start of a second\n *\n * @example\n * // The start of a second for 1 December 2014 22:15:45.400:\n * const result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:45.000\n */\nexport function startOfSecond(date) {\n const _date = toDate(date);\n _date.setMilliseconds(0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfSecond;\n", "import { millisecondsInHour, millisecondsInMinute } from \"./constants.mjs\";\n\n/**\n * The {@link parseISO} function options.\n */\n\n/**\n * @name parseISO\n * @category Common Helpers\n * @summary Parse ISO string\n *\n * @description\n * Parse the given string in ISO 8601 format and return an instance of Date.\n *\n * Function accepts complete ISO 8601 formats as well as partial implementations.\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\n *\n * If the argument isn't a string, the function cannot parse the string or\n * the values are invalid, it returns Invalid Date.\n *\n * @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).\n *\n * @param argument - The value to convert\n * @param options - An object with options\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Convert string '2014-02-11T11:30:30' to date:\n * const result = parseISO('2014-02-11T11:30:30')\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert string '+02014101' to date,\n * // if the additional number of digits in the extended year format is 1:\n * const result = parseISO('+02014101', { additionalDigits: 1 })\n * //=> Fri Apr 11 2014 00:00:00\n */\nexport function parseISO(argument, options) {\n const additionalDigits = options?.additionalDigits ?? 2;\n const dateStrings = splitDateString(argument);\n\n let date;\n if (dateStrings.date) {\n const parseYearResult = parseYear(dateStrings.date, additionalDigits);\n date = parseDate(parseYearResult.restDateString, parseYearResult.year);\n }\n\n if (!date || isNaN(date.getTime())) {\n return new Date(NaN);\n }\n\n const timestamp = date.getTime();\n let time = 0;\n let offset;\n\n if (dateStrings.time) {\n time = parseTime(dateStrings.time);\n if (isNaN(time)) {\n return new Date(NaN);\n }\n }\n\n if (dateStrings.timezone) {\n offset = parseTimezone(dateStrings.timezone);\n if (isNaN(offset)) {\n return new Date(NaN);\n }\n } else {\n const dirtyDate = new Date(timestamp + time);\n // JS parsed string assuming it's in UTC timezone\n // but we need it to be parsed in our timezone\n // so we use utc values to build date in our timezone.\n // Year values from 0 to 99 map to the years 1900 to 1999\n // so set year explicitly with setFullYear.\n const result = new Date(0);\n result.setFullYear(\n dirtyDate.getUTCFullYear(),\n dirtyDate.getUTCMonth(),\n dirtyDate.getUTCDate(),\n );\n result.setHours(\n dirtyDate.getUTCHours(),\n dirtyDate.getUTCMinutes(),\n dirtyDate.getUTCSeconds(),\n dirtyDate.getUTCMilliseconds(),\n );\n return result;\n }\n\n return new Date(timestamp + time + offset);\n}\n\nconst patterns = {\n dateTimeDelimiter: /[T ]/,\n timeZoneDelimiter: /[Z ]/i,\n timezone: /([Z+-].*)$/,\n};\n\nconst dateRegex =\n /^-?(?:(\\d{3})|(\\d{2})(?:-?(\\d{2}))?|W(\\d{2})(?:-?(\\d{1}))?|)$/;\nconst timeRegex =\n /^(\\d{2}(?:[.,]\\d*)?)(?::?(\\d{2}(?:[.,]\\d*)?))?(?::?(\\d{2}(?:[.,]\\d*)?))?$/;\nconst timezoneRegex = /^([+-])(\\d{2})(?::?(\\d{2}))?$/;\n\nfunction splitDateString(dateString) {\n const dateStrings = {};\n const array = dateString.split(patterns.dateTimeDelimiter);\n let timeString;\n\n // The regex match should only return at maximum two array elements.\n // [date], [time], or [date, time].\n if (array.length > 2) {\n return dateStrings;\n }\n\n if (/:/.test(array[0])) {\n timeString = array[0];\n } else {\n dateStrings.date = array[0];\n timeString = array[1];\n if (patterns.timeZoneDelimiter.test(dateStrings.date)) {\n dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];\n timeString = dateString.substr(\n dateStrings.date.length,\n dateString.length,\n );\n }\n }\n\n if (timeString) {\n const token = patterns.timezone.exec(timeString);\n if (token) {\n dateStrings.time = timeString.replace(token[1], \"\");\n dateStrings.timezone = token[1];\n } else {\n dateStrings.time = timeString;\n }\n }\n\n return dateStrings;\n}\n\nfunction parseYear(dateString, additionalDigits) {\n const regex = new RegExp(\n \"^(?:(\\\\d{4}|[+-]\\\\d{\" +\n (4 + additionalDigits) +\n \"})|(\\\\d{2}|[+-]\\\\d{\" +\n (2 + additionalDigits) +\n \"})$)\",\n );\n\n const captures = dateString.match(regex);\n // Invalid ISO-formatted year\n if (!captures) return { year: NaN, restDateString: \"\" };\n\n const year = captures[1] ? parseInt(captures[1]) : null;\n const century = captures[2] ? parseInt(captures[2]) : null;\n\n // either year or century is null, not both\n return {\n year: century === null ? year : century * 100,\n restDateString: dateString.slice((captures[1] || captures[2]).length),\n };\n}\n\nfunction parseDate(dateString, year) {\n // Invalid ISO-formatted year\n if (year === null) return new Date(NaN);\n\n const captures = dateString.match(dateRegex);\n // Invalid ISO-formatted string\n if (!captures) return new Date(NaN);\n\n const isWeekDate = !!captures[4];\n const dayOfYear = parseDateUnit(captures[1]);\n const month = parseDateUnit(captures[2]) - 1;\n const day = parseDateUnit(captures[3]);\n const week = parseDateUnit(captures[4]);\n const dayOfWeek = parseDateUnit(captures[5]) - 1;\n\n if (isWeekDate) {\n if (!validateWeekDate(year, week, dayOfWeek)) {\n return new Date(NaN);\n }\n return dayOfISOWeekYear(year, week, dayOfWeek);\n } else {\n const date = new Date(0);\n if (\n !validateDate(year, month, day) ||\n !validateDayOfYearDate(year, dayOfYear)\n ) {\n return new Date(NaN);\n }\n date.setUTCFullYear(year, month, Math.max(dayOfYear, day));\n return date;\n }\n}\n\nfunction parseDateUnit(value) {\n return value ? parseInt(value) : 1;\n}\n\nfunction parseTime(timeString) {\n const captures = timeString.match(timeRegex);\n if (!captures) return NaN; // Invalid ISO-formatted time\n\n const hours = parseTimeUnit(captures[1]);\n const minutes = parseTimeUnit(captures[2]);\n const seconds = parseTimeUnit(captures[3]);\n\n if (!validateTime(hours, minutes, seconds)) {\n return NaN;\n }\n\n return (\n hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000\n );\n}\n\nfunction parseTimeUnit(value) {\n return (value && parseFloat(value.replace(\",\", \".\"))) || 0;\n}\n\nfunction parseTimezone(timezoneString) {\n if (timezoneString === \"Z\") return 0;\n\n const captures = timezoneString.match(timezoneRegex);\n if (!captures) return 0;\n\n const sign = captures[1] === \"+\" ? -1 : 1;\n const hours = parseInt(captures[2]);\n const minutes = (captures[3] && parseInt(captures[3])) || 0;\n\n if (!validateTimezone(hours, minutes)) {\n return NaN;\n }\n\n return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);\n}\n\nfunction dayOfISOWeekYear(isoWeekYear, week, day) {\n const date = new Date(0);\n date.setUTCFullYear(isoWeekYear, 0, 4);\n const fourthOfJanuaryDay = date.getUTCDay() || 7;\n const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}\n\n// Validation functions\n\n// February is null to handle the leap year (using ||)\nconst daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n\nfunction validateDate(year, month, date) {\n return (\n month >= 0 &&\n month <= 11 &&\n date >= 1 &&\n date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28))\n );\n}\n\nfunction validateDayOfYearDate(year, dayOfYear) {\n return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);\n}\n\nfunction validateWeekDate(_year, week, day) {\n return week >= 1 && week <= 53 && day >= 0 && day <= 6;\n}\n\nfunction validateTime(hours, minutes, seconds) {\n if (hours === 24) {\n return minutes === 0 && seconds === 0;\n }\n\n return (\n seconds >= 0 &&\n seconds < 60 &&\n minutes >= 0 &&\n minutes < 60 &&\n hours >= 0 &&\n hours < 25\n );\n}\n\nfunction validateTimezone(_hours, minutes) {\n return minutes >= 0 && minutes <= 59;\n}\n\n// Fallback for modularized imports:\nexport default parseISO;\n", "import {\n add,\n isValid,\n parseISO,\n startOfDay,\n startOfHour,\n startOfMinute,\n startOfMonth,\n startOfSecond,\n startOfYear,\n} from \"date-fns\";\n\nimport type { DateUnit, Duration, UnitMatches } from \"../types/index.ts\";\n\n// Must be ordered from highest resolution to lowest (seconds to years)\nexport const dateUnits = [\"s\", \"m\", \"h\", \"d\", \"M\", \"y\"] as const;\n\nexport const dateUnitMap: Record<DateUnit, keyof Duration> = {\n y: \"years\",\n M: \"months\",\n d: \"days\",\n h: \"hours\",\n m: \"minutes\",\n s: \"seconds\",\n};\n\nconst startOf: Record<DateUnit, (d: Date) => Date> = {\n y: startOfYear,\n M: startOfMonth,\n d: startOfDay,\n h: startOfHour,\n m: startOfMinute,\n s: startOfSecond,\n};\n\nconst relativeDate = /^\\$now(?<units>\\(((y|M|d|h|m|s):(-?\\d+),?)+\\))?$/;\nconst relativeUnit = /(y|M|d|h|m|s):(-?\\d+)/g;\n\n// Matches the different parts of an ISO 8601 date. Note we don't validate the\n// pattern properly as that is handled by parseISO, we just want to know which\n// parts of the date were specified\nconst absoluteDate =\n /^(?<y>\\d{4,})(-(?<M>\\d\\d)(-(?<d>\\d\\d)([T ](?<h>\\d\\d)(:(?<m>\\d\\d)(:(?<s>\\d\\d))?)?)?)?)?/;\n\n// Convert relative dates and returns the minimum date unit specified\nexport function parseDate(value: string, now = new Date()): [Date, DateUnit] {\n let date: Date;\n let units: DateUnit[];\n\n const relativeMatch = relativeDate.exec(value);\n if (relativeMatch) {\n date = now;\n const unitsGroup = relativeMatch.groups?.units;\n if (unitsGroup) {\n const unitMatches = unitsGroup.matchAll(\n relativeUnit,\n ) as UnitMatches;\n units = [];\n for (const [_, unit, delta] of unitMatches) {\n date = add(date, { [dateUnitMap[unit]]: Number(delta) });\n units.push(unit);\n }\n } else {\n units = [\"d\"];\n }\n } else {\n date = parseISO(value);\n units = Object.entries(absoluteDate.exec(value)?.groups || {})\n .filter(([_, n]) => !!n)\n .map(([unit]) => unit) as DateUnit[];\n }\n\n const minUnit = getMinDateUnit(units) || \"s\";\n return [startOf[minUnit](date), minUnit];\n}\n\nexport function getMinDateUnit(units: [DateUnit, ...DateUnit[]]): DateUnit;\nexport function getMinDateUnit(units: DateUnit[]): DateUnit | undefined;\nexport function getMinDateUnit(units: DateUnit[]): DateUnit | undefined {\n return dateUnits.find((unit) => units.includes(unit));\n}\n\nexport function isValidDate(s: string | Date) {\n if (typeof s === \"string\") {\n return relativeDate.test(s) || isValid(parseISO(s));\n }\n return isValid(s);\n}\n\nexport function isDateBetween(\n date: string | Date,\n start?: string | Date | null,\n end?: string | Date | null,\n): boolean {\n let valid = isValidDate(date);\n if (start) {\n start = typeof start === \"string\" ? parseISO(start) : start;\n valid = valid && date >= start!;\n }\n if (end) {\n end = typeof end === \"string\" ? parseISO(end) : end;\n valid = valid && date <= end!;\n }\n return valid;\n}\n", "import { ContributionPeriod, PaymentMethod } from \"../data/index.ts\";\n\nimport type { Feeable, StripeFeeCountry } from \"../types/index.ts\";\n\nconst stripeFees = {\n gb: {\n [PaymentMethod.StripeCard]: (amount: number) => 0.2 + 0.015 * amount,\n [PaymentMethod.StripeSEPA]: () => 0.3,\n [PaymentMethod.StripeBACS]: (amount: number) =>\n Math.min(2, Math.max(0.2, 0.01 * amount)),\n [PaymentMethod.StripePayPal]: (amount: number) => 0.1 + 0.020 * amount,\n },\n eu: {\n [PaymentMethod.StripeCard]: (amount: number) => 0.25 + 0.015 * amount,\n [PaymentMethod.StripeSEPA]: () => 0.35,\n [PaymentMethod.StripeBACS]: () => 0, // Not available\n [PaymentMethod.StripePayPal]: (amount: number) => 0.1 + 0.020 * amount,\n },\n ca: {\n [PaymentMethod.StripeCard]: (amount: number) => 0.3 + 0.029 * amount,\n [PaymentMethod.StripeSEPA]: () => 0, // Not available\n [PaymentMethod.StripeBACS]: () => 0, // Not available\n [PaymentMethod.StripePayPal]: () => 0, // Not available\n },\n} as const;\n\nconst gcFee = (amount: number) => 0.2 + amount * 0.01;\n\nexport function calcPaymentFee(\n feeable: Feeable,\n country: StripeFeeCountry,\n): number {\n const feeFn = feeable.paymentMethod === PaymentMethod.GoCardlessDirectDebit\n ? gcFee\n : stripeFees[country][feeable.paymentMethod];\n\n return feeable.period === ContributionPeriod.Annually\n ? 0\n : feeFn(feeable.amount);\n}\n", "import { InvalidRule } from \"../error/index.ts\";\nimport { nullableOperators, operatorsByTypeMap } from \"../search/index.ts\";\nimport { isValidDate } from \"./date.ts\";\n\nimport type {\n Filters,\n Rule,\n RuleGroup,\n ValidatedRule,\n ValidatedRuleGroup,\n} from \"../types/index.ts\";\n\nexport function isRuleGroup(\n ruleOrGroup: Rule | RuleGroup,\n): ruleOrGroup is RuleGroup {\n return \"condition\" in ruleOrGroup;\n}\n\nexport function validateRule<Field extends string>(\n filters: Filters<Field>,\n rule: Rule,\n): ValidatedRule<Field> {\n const filter = filters[rule.field as Field];\n if (!filter) {\n throw new InvalidRule(rule, `Invalid field: ${rule.field}`);\n }\n\n let expectedArgs = 0;\n if (rule.operator in nullableOperators) {\n // Field cannot be empty (except text which can always be empty)\n if (!filter.nullable && filter.type !== \"text\") {\n throw new InvalidRule(\n rule,\n `Invalid nullable operator: field is not nullable`,\n );\n }\n } else {\n const operator = operatorsByTypeMap[filter.type][rule.operator];\n if (!operator) {\n throw new InvalidRule(\n rule,\n `Invalid operator for type: ${filter.type} type doesn't define ${rule.operator}`,\n );\n }\n expectedArgs = operator.args;\n }\n\n if (expectedArgs !== rule.value.length) {\n throw new InvalidRule(\n rule,\n `Invalid operator argument count: ${rule.operator} needs ${expectedArgs}, ${rule.value.length} given`,\n );\n }\n\n const expectedType = filter.type === \"boolean\" || filter.type === \"number\"\n ? filter.type\n : \"string\";\n\n // deno-lint-ignore valid-typeof\n if (rule.value.some((v) => typeof v !== expectedType)) {\n throw new InvalidRule(\n rule,\n `Invalid operator argument type: ${rule.operator} needs ${expectedType}, ${\n rule.value.map(\n (v) => typeof v,\n )\n } given`,\n );\n }\n if (\n filter.type === \"date\" &&\n rule.value.some((v) => !isValidDate(v as string))\n ) {\n throw new InvalidRule(\n rule,\n `Invalid operator argument: date type needs valid absolute or relative date, ${rule.value} given`,\n );\n }\n\n if (\n (filter.type === \"enum\" || filter.type === \"array\") &&\n rule.value.some((v) => filter.options?.indexOf(v as string) === -1)\n ) {\n throw new InvalidRule(\n rule,\n `Invalid operator argument: ${filter.type} type expected ${filter.options}, ${rule.value} given`,\n );\n }\n\n return {\n field: rule.field,\n type: filter.type,\n nullable: !!filter.nullable,\n operator: rule.operator,\n value: rule.value,\n } as ValidatedRule<Field>;\n}\n\nexport function validateRuleGroup<Field extends string>(\n filters: Filters<Field>,\n ruleGroup: RuleGroup,\n): ValidatedRuleGroup<Field> {\n const validatedRuleGroup: ValidatedRuleGroup<Field> = {\n condition: ruleGroup.condition,\n rules: [],\n };\n\n for (const rule of ruleGroup.rules) {\n const valid = isRuleGroup(rule)\n ? validateRuleGroup(filters, rule)\n : validateRule(filters, rule);\n validatedRuleGroup.rules.push(valid);\n }\n return validatedRuleGroup;\n}\n", "import type {\n CalloutComponentContentSchema,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentContentValidator: ValidatorCalloutComponent<\n CalloutComponentContentSchema,\n unknown\n> = (\n _: CalloutComponentContentSchema,\n answer: unknown,\n): boolean => {\n // Content components have no answer, so answer should be falsy\n return !answer;\n};\n", "import type {\n CalloutComponentInputAddressSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputAddressValidator: ValidatorCalloutComponent<\n CalloutComponentInputAddressSchema\n> = (\n _schema: CalloutComponentInputAddressSchema,\n _answer: CalloutResponseAnswer,\n): boolean => {\n throw new Error(\n `[calloutComponentInputAddressValidator] Not implemented yet`,\n );\n};\n", "import type {\n CalloutComponentInputCheckboxSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputCheckboxValidator: ValidatorCalloutComponent<\n CalloutComponentInputCheckboxSchema\n> = (\n _schema: CalloutComponentInputCheckboxSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n return typeof answer === \"boolean\";\n};\n", "import { isAmountOfMoney } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputCurrencySchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputCurrencyValidator: ValidatorCalloutComponent<\n CalloutComponentInputCurrencySchema\n> = (\n _schema: CalloutComponentInputCurrencySchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n return isAmountOfMoney(answer);\n};\n", "import { isDateBetween } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputDateTimeSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputDateTimeValidator: ValidatorCalloutComponent<\n CalloutComponentInputDateTimeSchema\n> = (\n schema: CalloutComponentInputDateTimeSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n if (typeof answer !== \"string\") {\n return false;\n }\n\n return isDateBetween(answer, schema.widget.minDate, schema.widget.maxDate);\n};\n", "import { isEmail } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputEmailSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputEmailValidator: ValidatorCalloutComponent<\n CalloutComponentInputEmailSchema\n> = (\n _schema: CalloutComponentInputEmailSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n return isEmail(answer);\n};\n", "import { isURL } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputFileSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\nimport { isFileUploadAnswer } from \"../utils/callouts.ts\";\n\nexport const calloutComponentInputFileValidator: ValidatorCalloutComponent<\n CalloutComponentInputFileSchema\n> = (\n _schema: CalloutComponentInputFileSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n // TODO: We just check the file URL at the moment, but we need to check the file size and type too\n\n if (isFileUploadAnswer(answer)) {\n return isURL(answer.url);\n }\n\n return false;\n};\n", "import { isNumber, isNumberInRange } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputNumberSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputNumberValidator: ValidatorCalloutComponent<\n CalloutComponentInputNumberSchema\n> = (\n schema: CalloutComponentInputNumberSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n if (\n schema.validate &&\n !isNumberInRange(answer, schema.validate.min, schema.validate.max)\n ) {\n return false;\n }\n\n return isNumber(answer);\n};\n", "import { isPhoneNumber } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputPhoneNumberSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputPhoneNumberValidator:\n ValidatorCalloutComponent<CalloutComponentInputPhoneNumberSchema> = (\n _schema: CalloutComponentInputPhoneNumberSchema,\n answer: CalloutResponseAnswer,\n ): boolean => {\n return isPhoneNumber(answer);\n };\n", "import type {\n CalloutComponentInputSelectSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputSelectValidator: ValidatorCalloutComponent<\n CalloutComponentInputSelectSchema\n> = (\n schema: CalloutComponentInputSelectSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n const optionValue = schema.data.values.find((v) => v.value === answer);\n return !!optionValue;\n};\n", "import type {\n CalloutComponentInputSelectableSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputSelectableValidator:\n ValidatorCalloutComponent<CalloutComponentInputSelectableSchema> = (\n schema: CalloutComponentInputSelectableSchema,\n answer: CalloutResponseAnswer,\n ): boolean => {\n const optionValue = schema.values.find((v) => v.value === answer);\n return !!optionValue;\n };\n", "import type {\n CalloutComponentInputSignatureSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputSignatureValidator: ValidatorCalloutComponent<\n CalloutComponentInputSignatureSchema\n> = (\n _: CalloutComponentInputSignatureSchema,\n _answer: CalloutResponseAnswer,\n): boolean => {\n throw new Error(\n `[calloutComponentInputSignatureValidator] Not implemented yet`,\n );\n};\n", "import { isTextInRange, isTextInWordRange } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputTextRules,\n CalloutComponentInputTextSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nconst validateRules = (\n rules: CalloutComponentInputTextRules | undefined,\n answer: string | undefined,\n): boolean => {\n // Nothing to do..\n if (!rules) {\n return true;\n }\n\n if (!answer && rules.required) {\n return false;\n }\n\n // Check if the answer matches the provided pattern\n if (\n typeof rules.pattern === \"string\" && rules.pattern.length &&\n !new RegExp(rules.pattern).test(answer || \"\")\n ) {\n return false;\n }\n\n // Check word range if defined\n if (\n !isTextInWordRange(answer, rules.minWords, rules.maxWords)\n ) {\n return false;\n }\n\n // Check length range if defined\n if (\n !isTextInRange(answer, rules.minLength, rules.maxLength)\n ) {\n return false;\n }\n\n // If all checks pass, return true\n return true;\n};\n\nexport const calloutComponentInputTextValidator: ValidatorCalloutComponent<\n CalloutComponentInputTextSchema\n> = (\n schema: CalloutComponentInputTextSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n if (typeof answer !== \"string\") {\n return false;\n }\n\n return validateRules(schema?.validate, answer);\n};\n", "import type {\n CalloutComponentInputTimeSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputTimeValidator: ValidatorCalloutComponent<\n CalloutComponentInputTimeSchema\n> = (\n _schema: CalloutComponentInputTimeSchema,\n _answer: CalloutResponseAnswer,\n): boolean => {\n throw new Error(\n `[calloutComponentInputTimeValidator] Not implemented yet`,\n );\n};\n", "import { isURL } from \"../utils/index.ts\";\n\nimport type {\n CalloutComponentInputUrlSchema,\n CalloutResponseAnswer,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentInputUrlValidator: ValidatorCalloutComponent<\n CalloutComponentInputUrlSchema\n> = (\n _schema: CalloutComponentInputUrlSchema,\n answer: CalloutResponseAnswer,\n): boolean => {\n return isURL(answer);\n};\n", "import { calloutComponentContentValidator } from \"./callout-component-content.validator.ts\";\nimport { calloutComponentInputAddressValidator } from \"./callout-component-input-address.validator.ts\";\nimport { calloutComponentInputCheckboxValidator } from \"./callout-component-input-checkbox.validator.ts\";\nimport { calloutComponentInputCurrencyValidator } from \"./callout-component-input-currency.validator.ts\";\nimport { calloutComponentInputDateTimeValidator } from \"./callout-component-input-date-time.validator.ts\";\nimport { calloutComponentInputEmailValidator } from \"./callout-component-input-email.validator.ts\";\nimport { calloutComponentInputFileValidator } from \"./callout-component-input-file.validator.ts\";\nimport { calloutComponentInputNumberValidator } from \"./callout-component-input-number.validator.ts\";\nimport { calloutComponentInputSelectValidator } from \"./callout-component-input-select.validator.ts\";\nimport { calloutComponentInputPhoneNumberValidator } from \"./callout-component-input-phone-number.validator.ts\";\nimport { calloutComponentInputSelectableValidator } from \"./callout-component-input-selectable.validator.ts\";\nimport { calloutComponentInputSignatureValidator } from \"./callout-component-input-signature.validator.ts\";\nimport { calloutComponentInputTextValidator } from \"./callout-component-input-text.validator.ts\";\nimport { calloutComponentInputTimeValidator } from \"./callout-component-input-time.validator.ts\";\nimport { calloutComponentInputUrlValidator } from \"./callout-component-input-url.validator.ts\";\n\nimport {\n CalloutComponentBaseType,\n CalloutComponentType,\n} from \"../data/index.ts\";\nimport { isCalloutComponentOfBaseType } from \"../utils/callouts.ts\";\n\nimport type {\n CalloutComponentInputSchema,\n CalloutComponentNestableSchema,\n CalloutComponentSchema,\n CalloutResponseAnswer,\n CalloutResponseAnswers,\n ValidatorCalloutComponent,\n} from \"../types/index.ts\";\n\nexport const calloutComponentNestableValidator = (\n schema: CalloutComponentNestableSchema,\n answers: CalloutResponseAnswers,\n): boolean => {\n for (const component of schema.components) {\n const valid = calloutComponentValidator(\n component,\n answers[component.key],\n );\n if (!valid) {\n return false;\n }\n }\n return true;\n};\n\n/**\n * A map of validator classes to be used for Callout component.\n */\nconst calloutInputValidatorsMap: Record<\n CalloutComponentInputSchema[\"type\"],\n // deno-lint-ignore no-explicit-any\n ValidatorCalloutComponent<any>\n> = {\n // Input\n [CalloutComponentType.INPUT_EMAIL]: calloutComponentInputEmailValidator,\n [CalloutComponentType.INPUT_ADDRESS]: calloutComponentInputAddressValidator,\n [CalloutComponentType.INPUT_CHECKBOX]: calloutComponentInputCheckboxValidator,\n [CalloutComponentType.INPUT_CURRENCY]: calloutComponentInputCurrencyValidator,\n [CalloutComponentType.INPUT_DATE_TIME]:\n calloutComponentInputDateTimeValidator,\n [CalloutComponentType.INPUT_NUMBER]: calloutComponentInputNumberValidator,\n [CalloutComponentType.INPUT_PHONE_NUMBER]:\n calloutComponentInputPhoneNumberValidator,\n [CalloutComponentType.INPUT_SIGNATURE]:\n calloutComponentInputSignatureValidator,\n [CalloutComponentType.INPUT_TIME]: calloutComponentInputTimeValidator,\n [CalloutComponentType.INPUT_URL]: calloutComponentInputUrlValidator,\n [CalloutComponentType.INPUT_FILE]: calloutComponentInputFileValidator,\n [CalloutComponentType.INPUT_SELECT]: calloutComponentInputSelectValidator,\n\n // Text\n [CalloutComponentType.INPUT_TEXT_FIELD]: calloutComponentInputTextValidator,\n [CalloutComponentType.INPUT_TEXT_AREA]: calloutComponentInputTextValidator,\n\n // Selectable\n [CalloutComponentType.INPUT_SELECTABLE_RADIO]:\n calloutComponentInputSelectableValidator,\n [CalloutComponentType.INPUT_SELECTABLE_SELECTBOXES]:\n calloutComponentInputSelectableValidator,\n};\nexport function calloutComponentInputValidator(\n schema: CalloutComponentInputSchema,\n answer:\n | CalloutResponseAnswer\n | CalloutResponseAnswer[]\n | undefined,\n): boolean {\n const validator = calloutInputValidatorsMap[schema.type];\n if (!validator) {\n console.error(`No validator found for ${schema.type}`);\n return false;\n }\n\n if (answer === undefined) {\n return schema.validate?.required ? false : true;\n }\n\n const values = Array.isArray(answer) ? answer : [answer];\n for (const value of values) {\n const valid = validator(schema, value);\n if (!valid) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function calloutComponentValidator(\n schema: CalloutComponentSchema,\n answer:\n | CalloutResponseAnswer\n | CalloutResponseAnswer[]\n | undefined,\n): boolean;\n\nexport function calloutComponentValidator(\n schema: CalloutComponentNestableSchema,\n answer: CalloutResponseAnswers,\n): boolean;\n\nexport function calloutComponentValidator(\n schema: CalloutComponentSchema,\n answer:\n | CalloutResponseAnswer\n | CalloutResponseAnswer[]\n | undefined\n | CalloutResponseAnswers,\n): boolean {\n if (isCalloutComponentOfBaseType(schema, CalloutComponentBaseType.NESTABLE)) {\n return calloutComponentNestableValidator(\n schema,\n answer as CalloutResponseAnswers,\n );\n }\n\n if (isCalloutComponentOfBaseType(schema, CalloutComponentBaseType.INPUT)) {\n return calloutComponentInputValidator(\n schema,\n answer as CalloutResponseAnswer | CalloutResponseAnswer[] | undefined,\n );\n }\n\n if (isCalloutComponentOfBaseType(schema, CalloutComponentBaseType.CONTENT)) {\n return calloutComponentContentValidator(schema, answer as unknown);\n }\n\n throw new Error(\"Invalid schema type\");\n}\n", "// deno-lint-ignore-file\nimport * as BeabeeCommon from \"./index.ts\";\n\n(globalThis as any).Beabee ||= {};\n(globalThis as any).Beabee.Common = BeabeeCommon;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAAA;AAAA,IAAA;AAAA;A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,SAAS;",
|
|
6
6
|
"names": ["parseDate", "CalloutAccess", "CalloutCaptcha", "CalloutChannel", "CalloutComponentBaseType", "CalloutComponentType", "ContributionPeriod", "ContributionType", "ItemStatus", "MembershipStatus", "NewsletterStatus", "PaymentMethod", "PaymentStatus", "parseDate"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var se=Object.defineProperty;var le=(t,e)=>{for(var o in e)se(t,o,{get:e[o],enumerable:!0})};var gt={};le(gt,{CalloutAccess:()=>It,CalloutCaptcha:()=>Tt,CalloutChannel:()=>St,CalloutComponentBaseType:()=>O,CalloutComponentType:()=>f,ContributionPeriod:()=>S,ContributionType:()=>v,InvalidRule:()=>c,ItemStatus:()=>P,MembershipStatus:()=>At,NewsletterStatus:()=>Y,PaymentMethod:()=>j,PaymentStatus:()=>G,RoleTypes:()=>Nt,apiKeyFilters:()=>ue,calcPaymentFee:()=>lo,calloutChannelFilters:()=>Ce,calloutComponentContentValidator:()=>lt,calloutComponentInputAddressValidator:()=>it,calloutComponentInputCheckboxValidator:()=>pt,calloutComponentInputCurrencyValidator:()=>ut,calloutComponentInputDateTimeValidator:()=>mt,calloutComponentInputEmailValidator:()=>ct,calloutComponentInputFileValidator:()=>ft,calloutComponentInputNumberValidator:()=>dt,calloutComponentInputPhoneNumberValidator:()=>Ct,calloutComponentInputSelectValidator:()=>yt,calloutComponentInputSelectableTypes:()=>b,calloutComponentInputSelectableValidator:()=>L,calloutComponentInputSignatureValidator:()=>xt,calloutComponentInputTextTypes:()=>g,calloutComponentInputTextValidator:()=>k,calloutComponentInputTimeValidator:()=>ht,calloutComponentInputTypes:()=>I,calloutComponentInputUrlValidator:()=>bt,calloutComponentInputValidator:()=>re,calloutComponentNestableTypes:()=>T,calloutComponentNestableValidator:()=>ne,calloutComponentTypes:()=>ie,calloutComponentValidator:()=>ae,calloutFilters:()=>me,calloutResponseCommentFilters:()=>fe,calloutResponseFilters:()=>ce,calloutTagFilters:()=>de,contactCalloutFilters:()=>xe,contactFilters:()=>ye,contentIds:()=>pe,dateUnitMap:()=>qt,dateUnits:()=>Zt,filterComponents:()=>_t,flattenComponents:()=>K,getCalloutComponents:()=>Rt,getCalloutFilters:()=>Ne,getMinDateUnit:()=>Qt,isAddressAnswer:()=>wt,isAmountOfMoney:()=>J,isAngle:()=>Z,isCalloutComponentOfBaseType:()=>C,isCalloutComponentOfType:()=>y,isDateBetween:()=>st,isEmail:()=>q,isFileUploadAnswer:()=>F,isLngLat:()=>Vt,isMapBounds:()=>_e,isNumber:()=>E,isNumberInRange:()=>Q,isPassword:()=>Re,isPeriod:()=>Lt,isPhoneNumber:()=>D,isRuleGroup:()=>te,isSlug:()=>we,isTextInRange:()=>tt,isTextInWordRange:()=>et,isType:()=>Oe,isURL:()=>N,isValidDate:()=>V,isValidPayFee:()=>Pe,noticeFilters:()=>he,nullableOperators:()=>z,operatorsByType:()=>Dt,operatorsByTypeMap:()=>$,parseDate:()=>ro,paymentFilters:()=>Ie,ruleOperators:()=>ge,segmentFilters:()=>Te,slug:()=>W,stringifyAnswer:()=>Ot,toBytes:()=>Me,toPhoneNumber:()=>Fe,validateRule:()=>ee,validateRuleGroup:()=>oe});var It=(r=>(r.Member="member",r.Guest="guest",r.Anonymous="anonymous",r.OnlyAnonymous="only-anonymous",r))(It||{});var Tt=(n=>(n.None="none",n.Guest="guest",n.All="all",n))(Tt||{});var St=(e=>(e.TELEGRAM="telegram",e))(St||{});var O=(a=>(a[a.CONTENT=0]="CONTENT",a[a.INPUT=1]="INPUT",a[a.INPUT_TEXT=2]="INPUT_TEXT",a[a.INPUT_SELECTABLE=3]="INPUT_SELECTABLE",a[a.NESTABLE=4]="NESTABLE",a))(O||{});var f=(u=>(u.CONTENT="content",u.INPUT_ADDRESS="address",u.INPUT_CHECKBOX="checkbox",u.INPUT_CURRENCY="currency",u.INPUT_DATE_TIME="datetime",u.INPUT_EMAIL="email",u.INPUT_FILE="file",u.INPUT_NUMBER="number",u.INPUT_PHONE_NUMBER="phoneNumber",u.INPUT_SELECT="select",u.INPUT_SELECTABLE_RADIO="radio",u.INPUT_SELECTABLE_SELECTBOXES="selectboxes",u.INPUT_SIGNATURE="signature",u.INPUT_TEXT_AREA="textarea",u.INPUT_TEXT_FIELD="textfield",u.INPUT_TIME="time",u.INPUT_URL="url",u.NESTABLE_PANEL="panel",u.NESTABLE_TABS="tabs",u.NESTABLE_WELL="well",u))(f||{});var b=["radio","selectboxes"];var g=["textarea","textfield"];var I=[...b,...g,"address","checkbox","currency","datetime","email","file","number","phoneNumber","select","signature","time","url"];var T=["panel","well","tabs"];var ie=[...T,...I,"content"];var pe=["contacts","email","general","join","join/setup","profile","share","payment","telegram"];var S=(o=>(o.Monthly="monthly",o.Annually="annually",o))(S||{});var v=(r=>(r.Automatic="Automatic",r.Manual="Manual",r.Gift="Gift",r.None="None",r))(v||{});var P=(r=>(r.Draft="draft",r.Scheduled="scheduled",r.Open="open",r.Ended="ended",r))(P||{});var At=(r=>(r.Active="active",r.Expiring="expiring",r.Expired="expired",r.None="none",r))(At||{});var Y=(a=>(a.Subscribed="subscribed",a.Unsubscribed="unsubscribed",a.Cleaned="cleaned",a.Pending="pending",a.None="none",a))(Y||{});var j=(a=>(a.StripeCard="s_card",a.StripeSEPA="s_sepa",a.StripeBACS="s_bacs",a.StripePayPal="s_paypal",a.GoCardlessDirectDebit="gc_direct-debit",a))(j||{});var G=(r=>(r.Pending="pending",r.Successful="successful",r.Failed="failed",r.Cancelled="cancelled",r))(G||{});var c=class t extends Error{constructor(o,n){super();this.rule=o;this.message=n;Object.setPrototypeOf(this,t.prototype)}};var ue={id:{type:"text"},createdAt:{type:"date"}};var me={id:{type:"text"},slug:{type:"text"},title:{type:"text"},status:{type:"enum",options:["draft","scheduled","open","ended"]},answeredBy:{type:"contact"},starts:{type:"date",nullable:!0},expires:{type:"date",nullable:!0},hidden:{type:"boolean"},channels:{type:"array",nullable:!0}},ce={id:{type:"text"},contact:{type:"contact",nullable:!0},calloutId:{type:"text"},createdAt:{type:"date"},updatedAt:{type:"date"},bucket:{type:"text",nullable:!0},tags:{type:"array"},assignee:{type:"contact",nullable:!0},answers:{type:"blob"}},fe={id:{type:"text"},responseId:{type:"text"},contact:{type:"contact"},createdAt:{type:"date"},updatedAt:{type:"date"},text:{type:"text"}},de={id:{type:"text"},name:{type:"text"},description:{type:"text"},calloutId:{type:"text"}},Ce={id:{type:"text"},name:{type:"text"},description:{type:"text"},calloutId:{type:"text"}};var Nt=["member","admin","superadmin"],ye={id:{type:"contact"},firstname:{type:"text"},lastname:{type:"text"},email:{type:"text"},joined:{type:"date"},lastSeen:{type:"date"},contributionCancelled:{type:"date",nullable:!0},contributionType:{type:"enum",options:["Automatic","Gift","Manual","None"]},contributionMonthlyAmount:{type:"number"},contributionPeriod:{type:"enum",options:["monthly","annually"]},deliveryOptIn:{type:"boolean"},newsletterStatus:{type:"enum",options:["subscribed","unsubscribed","cleaned","pending","none"]},activePermission:{type:"enum",options:Nt},activeMembership:{type:"boolean"},membershipStarts:{type:"date"},membershipExpires:{type:"date"},manualPaymentSource:{type:"text",nullable:!0},tags:{type:"array",nullable:!0}},xe={hasAnswered:{type:"boolean"}};var he={id:{type:"text"},createdAt:{type:"date"},updatedAt:{type:"date"},name:{type:"text"},expires:{type:"date",nullable:!0},enabled:{type:"boolean"},text:{type:"text"},status:{type:"enum",options:["draft","scheduled","open","ended"]}};var A={equal:{args:1},not_equal:{args:1}},be={begins_with:{args:1},ends_with:{args:1},not_begins_with:{args:1},not_ends_with:{args:1}},Et={...A,between:{args:2},not_between:{args:2},less:{args:1},greater:{args:1},less_or_equal:{args:1},greater_or_equal:{args:1}},H={contains:{args:1},not_contains:{args:1}},z={is_empty:{args:0},is_not_empty:{args:0}},Dt={text:{...A,...H,...be},blob:H,date:Et,number:Et,boolean:{equal:A.equal},array:H,enum:A,contact:A},$=Dt,ge=["equal","not_equal","less","less_or_equal","greater","greater_or_equal","between","not_between","begins_with","not_begins_with","contains","not_contains","ends_with","not_ends_with","is_empty","is_not_empty"];var Ie={id:{type:"text"},contact:{type:"contact"},chargeDate:{type:"date"},amount:{type:"number"},status:{type:"enum",options:["successful","pending","failed","cancelled"]}};var Te={id:{type:"text"},name:{type:"text"},description:{type:"text"}};function Se(t){return t.map(({value:e})=>e)}function Ae(t){let e={label:t.label||t.fullKey,nullable:!0};return y(t,"checkbox")?{...e,type:"boolean",nullable:!1}:y(t,"number")?{...e,type:"number"}:y(t,"select")?{...e,type:"enum",options:Se(t.data.values)}:y(t,"textarea")?{...e,type:"blob"}:{...e,type:"text"}}function Ut(t,e){return C(t,3)?t.values.find(o=>o.value===e)?.label||e:y(t,"select")&&t.data.values.find(o=>o.value===e)?.label||e}function y(t,e){return"type"in t&&t.type===e}function C(t,e){return"type"in t?e===0?y(t,"content"):e===1?I.includes(t.type):e===2?g.includes(t.type):e===3?b.includes(t.type):e===4?T.includes(t.type):!1:!1}function K(t){return t.flatMap(e=>C(e,4)?[e,...K(e.components)]:[e])}function _t(t,e){return t.filter(e).map(o=>({...o,...C(o,4)&&{components:_t(o.components,e)}}))}function Rt(t){return t.slides.flatMap(e=>K(e.components).map(o=>({...o,slideId:e.id,fullKey:`${e.id}.${o.key}`})))}function Ne(t){let e=Rt(t).filter(o=>o.input).map(o=>[`answers.${o.fullKey}`,Ae(o)]);return Object.fromEntries(e)}function wt(t){return!!t&&typeof t=="object"&&"geometry"in t}function F(t){return!!t&&typeof t=="object"&&"url"in t}function Ot(t,e){return Array.isArray(e)?e.map(o=>Ot(t,o)).join(", "):e?wt(e)?e.geometry.location.lat+", "+e.geometry.location.lng:F(e)?e.url:typeof e=="object"?Object.entries(e).filter(([,o])=>o).map(([o])=>Ut(t,o)).join(", "):typeof e=="string"?Ut(t,e):e.toString():""}function Ee(t,e){let o=t.charCodeAt(e);if(isNaN(o))throw new RangeError("Index "+e+' out of range for string "'+t+'"; please open an issue at https://github.com/Trott/slug/issues/new');if(o<55296||o>57343)return[t.charAt(e),e];if(o>=55296&&o<=56319){if(t.length<=e+1)return[" ",e];let r=t.charCodeAt(e+1);return r<56320||r>57343?[" ",e]:[t.charAt(e)+t.charAt(e+1),e+1]}if(e===0)return[" ",e];let n=t.charCodeAt(e-1);if(n<55296||n>56319)return[" ",e];throw new Error('String "'+t+'" reaches code believed to be unreachable; please open an issue at https://github.com/Trott/slug/issues/new')}function De(t){return btoa(unescape(encodeURIComponent(t)))}function W(t,e){let o=Pt(t,e);if((e&&e.fallback!==void 0?e.fallback:X.fallback)===!0&&o===""){let r="";for(let a=0;a<t.length;a++){let p=Ee(t,a);a=p[1],r+=p[0]}o=Pt(De(r),e)}return o}var Ue={bg:{\u0419:"Y",\u0439:"y",X:"H",x:"h",\u0426:"Ts",\u0446:"ts",\u0429:"Sht",\u0449:"sht",\u042A:"A",\u044A:"a",\u042C:"Y",\u044C:"y"},de:{\u00C4:"AE",\u00E4:"ae",\u00D6:"OE",\u00F6:"oe",\u00DC:"UE",\u00FC:"ue"},sr:{\u0111:"dj",\u0110:"DJ"},uk:{\u0418:"Y",\u0438:"y",\u0419:"Y",\u0439:"y",\u0426:"Ts",\u0446:"ts",\u0425:"Kh",\u0445:"kh",\u0429:"Shch",\u0449:"shch",\u0413:"H",\u0433:"h"}};function Pt(t,e){let o=e?.mode||X.mode,n={...X.modes[o],...e},r=!!n.locale&&Ue[n.locale]||{},a=[];for(let s in n.multicharmap){if(!Object.prototype.hasOwnProperty.call(n.multicharmap,s))continue;let i=s.length;a.indexOf(i)===-1&&a.push(i)}a=a.sort(function(s,i){return i-s});let p=n.mode==="rfc3986"?/[^\w\s\-.~]/:/[^A-Za-z0-9\s]/,l="";for(let s,i=0,x=t.length;i<x;i++){s=t[i];let R=!1;for(let h=0;h<a.length;h++){let B=a[h],w=t.substr(i,B);if(n.multicharmap[w]){i+=B-1,s=n.multicharmap[w],R=!0;break}}R||(r[s]?s=r[s]:n.charmap[s]?s=n.charmap[s].replace(n.replacement," "):s.includes(n.replacement)?s=s.replace(n.replacement," "):s=s.replace(p,"")),l+=s}return n.remove&&(l=l.replace(n.remove,"")),n.trim&&(l=l.trim()),l=l.replace(/\s+/g,n.replacement),n.lower&&(l=l.toLowerCase()),l}var Ft={\u092B\u093C:"Fi",\u0917\u093C:"Ghi",\u0916\u093C:"Khi",\u0915\u093C:"Qi",\u0921\u093C:"ugDha",\u0922\u093C:"ugDhha",\u092F\u093C:"Yi",\u091C\u093C:"Za",\u05D1\u05B4\u05D9:"i",\u05D1\u05B5:"e",\u05D1\u05B5\u05D9:"e",\u05D1\u05B6:"e",\u05D1\u05B7:"a",\u05D1\u05B8:"a",\u05D1\u05B9:"o",\u05D5\u05B9:"o",\u05D1\u05BB:"u",\u05D5\u05BC:"u",\u05D1\u05BC:"b",\u05DB\u05BC:"k",\u05DA\u05BC:"k",\u05E4\u05BC:"p",\u05E9\u05C1:"sh",\u05E9\u05C2:"s",\u05D1\u05B0:"e",\u05D7\u05B1:"e",\u05D7\u05B2:"a",\u05D7\u05B3:"o",\u05D1\u05B4:"i"},Mt={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00C6:"AE",\u00C7:"C",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00D0:"D",\u00D1:"N",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u0150:"O",\u00D8:"O",\u014C:"O",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u0170:"U",\u00DD:"Y",\u00DE:"TH",\u00DF:"ss",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00E6:"ae",\u00E7:"c",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00F0:"d",\u00F1:"n",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u0151:"o",\u00F8:"o",\u014D:"o",\u0152:"OE",\u0153:"oe",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u0171:"u",\u00FD:"y",\u00FE:"th",\u00FF:"y","\u1E9E":"SS",\u03B1:"a",\u03B2:"b",\u03B3:"g",\u03B4:"d",\u03B5:"e",\u03B6:"z",\u03B7:"h",\u03B8:"th",\u03B9:"i",\u03BA:"k",\u03BB:"l",\u03BC:"m",\u03BD:"n",\u03BE:"3",\u03BF:"o",\u03C0:"p",\u03C1:"r",\u03C3:"s",\u03C4:"t",\u03C5:"y",\u03C6:"f",\u03C7:"x",\u03C8:"ps",\u03C9:"w",\u03AC:"a",\u03AD:"e",\u03AF:"i",\u03CC:"o",\u03CD:"y",\u03AE:"h",\u03CE:"w",\u03C2:"s",\u03CA:"i",\u03B0:"y",\u03CB:"y",\u0390:"i",\u0391:"A",\u0392:"B",\u0393:"G",\u0394:"D",\u0395:"E",\u0396:"Z",\u0397:"H",\u0398:"Th",\u0399:"I",\u039A:"K",\u039B:"L",\u039C:"M",\u039D:"N",\u039E:"3",\u039F:"O",\u03A0:"P",\u03A1:"R",\u03A3:"S",\u03A4:"T",\u03A5:"Y",\u03A6:"F",\u03A7:"X",\u03A8:"PS",\u03A9:"W",\u0386:"A",\u0388:"E",\u038A:"I",\u038C:"O",\u038E:"Y",\u0389:"H",\u038F:"W",\u03AA:"I",\u03AB:"Y",\u015F:"s",\u015E:"S",\u0131:"i",\u0130:"I",\u011F:"g",\u011E:"G",\u0430:"a",\u0431:"b",\u0432:"v",\u0433:"g",\u0434:"d",\u0435:"e",\u0451:"yo",\u0436:"zh",\u0437:"z",\u0438:"i",\u0439:"j",\u043A:"k",\u043B:"l",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"p",\u0440:"r",\u0441:"s",\u0442:"t",\u0443:"u",\u0444:"f",\u0445:"h",\u0446:"c",\u0447:"ch",\u0448:"sh",\u0449:"sh",\u044A:"u",\u044B:"y",\u044C:"",\u044D:"e",\u044E:"yu",\u044F:"ya",\u0410:"A",\u0411:"B",\u0412:"V",\u0413:"G",\u0414:"D",\u0415:"E",\u0401:"Yo",\u0416:"Zh",\u0417:"Z",\u0418:"I",\u0419:"J",\u041A:"K",\u041B:"L",\u041C:"M",\u041D:"N",\u041E:"O",\u041F:"P",\u0420:"R",\u0421:"S",\u0422:"T",\u0423:"U",\u0424:"F",\u0425:"H",\u0426:"C",\u0427:"Ch",\u0428:"Sh",\u0429:"Sh",\u042A:"U",\u042B:"Y",\u042C:"",\u042D:"E",\u042E:"Yu",\u042F:"Ya",\u0404:"Ye",\u0406:"I",\u0407:"Yi",\u0490:"G",\u0454:"ye",\u0456:"i",\u0457:"yi",\u0491:"g",\u010D:"c",\u010F:"d",\u011B:"e",\u0148:"n",\u0159:"r",\u0161:"s",\u0165:"t",\u016F:"u",\u017E:"z",\u010C:"C",\u010E:"D",\u011A:"E",\u0147:"N",\u0158:"R",\u0160:"S",\u0164:"T",\u016E:"U",\u017D:"Z",\u013E:"l",\u013A:"l",\u0155:"r",\u013D:"L",\u0139:"L",\u0154:"R",\u0105:"a",\u0107:"c",\u0119:"e",\u0142:"l",\u0144:"n",\u015B:"s",\u017A:"z",\u017C:"z",\u0104:"A",\u0106:"C",\u0118:"E",\u0141:"L",\u0143:"N",\u015A:"S",\u0179:"Z",\u017B:"Z",\u0101:"a",\u0113:"e",\u0123:"g",\u012B:"i",\u0137:"k",\u013C:"l",\u0146:"n",\u016B:"u",\u0100:"A",\u0112:"E",\u0122:"G",\u012A:"I",\u0136:"K",\u013B:"L",\u0145:"N",\u016A:"U",\u0623:"a",\u0625:"i",\u0628:"b",\u062A:"t",\u062B:"th",\u062C:"g",\u062D:"h",\u062E:"kh",\u062F:"d",\u0630:"th",\u0631:"r",\u0632:"z",\u0633:"s",\u0634:"sh",\u0635:"s",\u0636:"d",\u0637:"t",\u0638:"th",\u0639:"aa",\u063A:"gh",\u0641:"f",\u0642:"k",\u0643:"k",\u0644:"l",\u0645:"m",\u0646:"n",\u0647:"h",\u0648:"o",\u064A:"y",\u0621:"aa",\u0629:"a",\u0622:"a",\u0627:"a",\u067E:"p",\u0698:"zh",\u06AF:"g",\u0686:"ch",\u06A9:"k",\u06CC:"i",\u0117:"e",\u012F:"i",\u0173:"u",\u0116:"E",\u012E:"I",\u0172:"U",\u021B:"t",\u021A:"T",\u0163:"t",\u0162:"T",\u0219:"s",\u0218:"S",\u0103:"a",\u0102:"A",\u1EA0:"A",\u1EA2:"A",\u1EA6:"A",\u1EA4:"A",\u1EAC:"A",\u1EA8:"A",\u1EAA:"A",\u1EB0:"A",\u1EAE:"A",\u1EB6:"A",\u1EB2:"A",\u1EB4:"A",\u1EB8:"E",\u1EBA:"E",\u1EBC:"E",\u1EC0:"E",\u1EBE:"E",\u1EC6:"E",\u1EC2:"E",\u1EC4:"E",\u1ECA:"I",\u1EC8:"I",\u0128:"I",\u1ECC:"O",\u1ECE:"O",\u1ED2:"O",\u1ED0:"O",\u1ED8:"O",\u1ED4:"O",\u1ED6:"O",\u01A0:"O",\u1EDC:"O",\u1EDA:"O",\u1EE2:"O",\u1EDE:"O",\u1EE0:"O",\u1EE4:"U",\u1EE6:"U",\u0168:"U",\u01AF:"U",\u1EEA:"U",\u1EE8:"U",\u1EF0:"U",\u1EEC:"U",\u1EEE:"U",\u1EF2:"Y",\u1EF4:"Y",\u1EF6:"Y",\u1EF8:"Y",\u0110:"D",\u1EA1:"a",\u1EA3:"a",\u1EA7:"a",\u1EA5:"a",\u1EAD:"a",\u1EA9:"a",\u1EAB:"a",\u1EB1:"a",\u1EAF:"a",\u1EB7:"a",\u1EB3:"a",\u1EB5:"a",\u1EB9:"e",\u1EBB:"e",\u1EBD:"e",\u1EC1:"e",\u1EBF:"e",\u1EC7:"e",\u1EC3:"e",\u1EC5:"e",\u1ECB:"i",\u1EC9:"i",\u0129:"i",\u1ECD:"o",\u1ECF:"o",\u1ED3:"o",\u1ED1:"o",\u1ED9:"o",\u1ED5:"o",\u1ED7:"o",\u01A1:"o",\u1EDD:"o",\u1EDB:"o",\u1EE3:"o",\u1EDF:"o",\u1EE1:"o",\u1EE5:"u",\u1EE7:"u",\u0169:"u",\u01B0:"u",\u1EEB:"u",\u1EE9:"u",\u1EF1:"u",\u1EED:"u",\u1EEF:"u",\u1EF3:"y",\u1EF5:"y",\u1EF7:"y",\u1EF9:"y",\u0111:"d",\u04D8:"AE",\u04D9:"ae",\u0492:"GH",\u0493:"gh",\u049A:"KH",\u049B:"kh",\u04A2:"NG",\u04A3:"ng",\u04AE:"UE",\u04AF:"ue",\u04B0:"U",\u04B1:"u",\u04BA:"H",\u04BB:"h",\u04E8:"OE",\u04E9:"oe",\u0452:"dj",\u0458:"j",\u0459:"lj",\u045A:"nj",\u045B:"c",\u045F:"dz",\u0402:"Dj",\u0408:"j",\u0409:"Lj",\u040A:"Nj",\u040B:"C",\u040F:"Dz",\u01CC:"nj",\u01C9:"lj",\u01CB:"NJ",\u01C8:"LJ",\u0905:"a",\u0906:"aa",\u090F:"e",\u0908:"ii",\u090D:"ei",\u090E:"ae",\u0910:"ai",\u0907:"i",\u0913:"o",\u0911:"oi",\u0912:"oii",\u090A:"uu",\u0914:"ou",\u0909:"u",\u092C:"B",\u092D:"Bha",\u091A:"Ca",\u091B:"Chha",\u0921:"Da",\u0922:"Dha",\u092B:"Fa",\u0917:"Ga",\u0918:"Gha",\u0917\u093C:"Ghi",\u0939:"Ha",\u091C:"Ja",\u091D:"Jha",\u0915:"Ka",\u0916:"Kha",\u0916\u093C:"Khi",\u0932:"L",\u0933:"Li",\u090C:"Li",\u0934:"Lii",\u0961:"Lii",\u092E:"Ma",\u0928:"Na",\u0919:"Na",\u091E:"Nia",\u0923:"Nae",\u0929:"Ni",\u0950:"oms",\u092A:"Pa",\u0915\u093C:"Qi",\u0930:"Ra",\u090B:"Ri",\u0960:"Ri",\u0931:"Ri",\u0938:"Sa",\u0936:"Sha",\u0937:"Shha",\u091F:"Ta",\u0924:"Ta",\u0920:"Tha",\u0926:"Tha",\u0925:"Tha",\u0927:"Thha",\u0921\u093C:"ugDha",\u0922\u093C:"ugDhha",\u0935:"Va",\u092F:"Ya",\u092F\u093C:"Yi",\u091C\u093C:"Za",\u0259:"e",\u018F:"E",\u10D0:"a",\u10D1:"b",\u10D2:"g",\u10D3:"d",\u10D4:"e",\u10D5:"v",\u10D6:"z",\u10D7:"t",\u10D8:"i",\u10D9:"k",\u10DA:"l",\u10DB:"m",\u10DC:"n",\u10DD:"o",\u10DE:"p",\u10DF:"zh",\u10E0:"r",\u10E1:"s",\u10E2:"t",\u10E3:"u",\u10E4:"p",\u10E5:"k",\u10E6:"gh",\u10E7:"q",\u10E8:"sh",\u10E9:"ch",\u10EA:"ts",\u10EB:"dz",\u10EC:"ts",\u10ED:"ch",\u10EE:"kh",\u10EF:"j",\u10F0:"h",\u05D1:"v",\u05D2\u05BC:"g",\u05D2:"g",\u05D3:"d",\u05D3\u05BC:"d",\u05D4:"h",\u05D5:"v",\u05D6:"z",\u05D7:"h",\u05D8:"t",\u05D9:"y",\u05DB:"kh",\u05DA:"kh",\u05DC:"l",\u05DE:"m",\u05DD:"m",\u05E0:"n",\u05DF:"n",\u05E1:"s",\u05E4:"f",\u05E3:"f",\u05E5:"ts",\u05E6:"ts",\u05E7:"k",\u05E8:"r",\u05EA\u05BC:"t",\u05EA:"t"},X={locale:"",mode:"pretty",fallback:!0,modes:{rfc3986:{replacement:"-",lower:!0,charmap:Mt,multicharmap:Ft,remove:null,trim:!0},pretty:{replacement:"-",lower:!0,charmap:Mt,multicharmap:Ft,remove:null,trim:!0}}};var Z=(t,e=180)=>typeof t=="number"&&t>=e*-1&&t<=e,q=t=>typeof t!="string"||t.length===0?!1:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),Vt=t=>{if(!Array.isArray(t)||t.length!==2)return!1;let[e,o]=t;return!(!Z(e,180)||!Z(o,90))},_e=t=>Array.isArray(t)&&t.length===2&&t.every(Vt),Re=t=>typeof t=="string"&&t.length>=8&&/[a-z]/.test(t)&&/[A-Z]/.test(t)&&/[0-9]/.test(t),Lt=t=>t==="monthly"||t==="annually",we=t=>typeof t=="string"&&t===W(t);function Oe(t,e){return t.includes(typeof e)}var N=t=>typeof t!="string"||!t.length?!1:/^(https?:\/\/)([\da-z\-]+\.)+[a-z]{2,6}(:[0-9]{1,5})?([\/\w \.-]*)*\/?(\?[a-zA-Z0-9=&]*)?$/.test(t),E=t=>typeof t=="number"&&!isNaN(t),J=t=>{if(!E(t)||t<0)return!1;let e=t.toString().split(".")[1];return!(e&&e.length>2)},D=t=>typeof t!="string"||!t.length||t.length>15||t.length<5?!1:/^(\+?[0-9])\d*$/.test(t),Pe=(t,e,o)=>!(typeof t!="boolean"||typeof e!="number"||!Lt(o)||t&&o==="annually"||!t&&o==="monthly"&&e===1),Q=(t,e,o)=>!(!E(t)||typeof e=="number"&&t<e||typeof o=="number"&&t>o),tt=(t,e=0,o)=>!(typeof t!="string"||typeof e=="number"&&t.length<e||typeof o=="number"&&t.length>o),et=(t,e=0,o)=>{if(typeof t!="string")return!1;let n=t.length>0?t.split(" "):[];return!(typeof e=="number"&&n.length<e||typeof o=="number"&&n.length>o)};var Fe=t=>{if(typeof t!="string"||!t.length)return!1;let e=t.replace(/(?!^\+)\D/g,"");return D(e)?e:!1},Me=t=>{if(typeof t!="string"||!t.length)return null;let e=t.toLowerCase(),o=["b","kb","mb","gb","tb","pb","eb","zb","yb"],[,n,r]=e.match(/(\d+)(\w+)/),a=o.indexOf(r.toLowerCase());return a===-1?null:Number(n)*Math.pow(1024,a)};function m(t){let e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function d(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function kt(t,e){let o=m(t);return isNaN(e)?d(t,NaN):(e&&o.setDate(o.getDate()+e),o)}function Bt(t,e){let o=m(t);if(isNaN(e))return d(t,NaN);if(!e)return o;let n=o.getDate(),r=d(t,o.getTime());r.setMonth(o.getMonth()+e+1,0);let a=r.getDate();return n>=a?r:(o.setFullYear(r.getFullYear(),r.getMonth(),n),o)}function vt(t,e){let{years:o=0,months:n=0,weeks:r=0,days:a=0,hours:p=0,minutes:l=0,seconds:s=0}=e,i=m(t),x=n||o?Bt(i,n+o*12):i,R=a||r?kt(x,a+r*7):x,h=l+p*60,w=(s+h*60)*1e3;return d(t,R.getTime()+w)}var Ve=Math.pow(10,8)*24*60*60*1e3,Wn=-Ve;var ot=6e4,nt=36e5;var Le=3600;var Yt=Le*24,Zn=Yt*7,ke=Yt*365.2425,Be=ke/12,qn=Be*3;function jt(t){let e=m(t);return e.setHours(0,0,0,0),e}function Gt(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function rt(t){if(!Gt(t)&&typeof t!="number")return!1;let e=m(t);return!isNaN(Number(e))}function Ht(t){let e=m(t);return e.setSeconds(0,0),e}function zt(t){let e=m(t);return e.setDate(1),e.setHours(0,0,0,0),e}function $t(t){let e=m(t),o=d(t,0);return o.setFullYear(e.getFullYear(),0,1),o.setHours(0,0,0,0),o}function Kt(t){let e=m(t);return e.setMinutes(0,0,0),e}function Xt(t){let e=m(t);return e.setMilliseconds(0),e}function _(t,e){let o=e?.additionalDigits??2,n=Ge(t),r;if(n.date){let s=He(n.date,o);r=ze(s.restDateString,s.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);let a=r.getTime(),p=0,l;if(n.time&&(p=$e(n.time),isNaN(p)))return new Date(NaN);if(n.timezone){if(l=Ke(n.timezone),isNaN(l))return new Date(NaN)}else{let s=new Date(a+p),i=new Date(0);return i.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),i.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),i}return new Date(a+p+l)}var M={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ve=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ye=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,je=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Ge(t){let e={},o=t.split(M.dateTimeDelimiter),n;if(o.length>2)return e;if(/:/.test(o[0])?n=o[0]:(e.date=o[0],n=o[1],M.timeZoneDelimiter.test(e.date)&&(e.date=t.split(M.timeZoneDelimiter)[0],n=t.substr(e.date.length,t.length))),n){let r=M.timezone.exec(n);r?(e.time=n.replace(r[1],""),e.timezone=r[1]):e.time=n}return e}function He(t,e){let o=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(o);if(!n)return{year:NaN,restDateString:""};let r=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?r:a*100,restDateString:t.slice((n[1]||n[2]).length)}}function ze(t,e){if(e===null)return new Date(NaN);let o=t.match(ve);if(!o)return new Date(NaN);let n=!!o[4],r=U(o[1]),a=U(o[2])-1,p=U(o[3]),l=U(o[4]),s=U(o[5])-1;if(n)return Je(e,l,s)?Xe(e,l,s):new Date(NaN);{let i=new Date(0);return!Ze(e,a,p)||!qe(e,r)?new Date(NaN):(i.setUTCFullYear(e,a,Math.max(r,p)),i)}}function U(t){return t?parseInt(t):1}function $e(t){let e=t.match(Ye);if(!e)return NaN;let o=at(e[1]),n=at(e[2]),r=at(e[3]);return Qe(o,n,r)?o*nt+n*ot+r*1e3:NaN}function at(t){return t&&parseFloat(t.replace(",","."))||0}function Ke(t){if(t==="Z")return 0;let e=t.match(je);if(!e)return 0;let o=e[1]==="+"?-1:1,n=parseInt(e[2]),r=e[3]&&parseInt(e[3])||0;return to(n,r)?o*(n*nt+r*ot):NaN}function Xe(t,e,o){let n=new Date(0);n.setUTCFullYear(t,0,4);let r=n.getUTCDay()||7,a=(e-1)*7+o+1-r;return n.setUTCDate(n.getUTCDate()+a),n}var We=[31,null,31,30,31,30,31,31,30,31,30,31];function Wt(t){return t%400===0||t%4===0&&t%100!==0}function Ze(t,e,o){return e>=0&&e<=11&&o>=1&&o<=(We[e]||(Wt(t)?29:28))}function qe(t,e){return e>=1&&e<=(Wt(t)?366:365)}function Je(t,e,o){return e>=1&&e<=53&&o>=0&&o<=6}function Qe(t,e,o){return t===24?e===0&&o===0:o>=0&&o<60&&e>=0&&e<60&&t>=0&&t<25}function to(t,e){return e>=0&&e<=59}var Zt=["s","m","h","d","M","y"],qt={y:"years",M:"months",d:"days",h:"hours",m:"minutes",s:"seconds"},eo={y:$t,M:zt,d:jt,h:Kt,m:Ht,s:Xt},Jt=/^\$now(?<units>\(((y|M|d|h|m|s):(-?\d+),?)+\))?$/,oo=/(y|M|d|h|m|s):(-?\d+)/g,no=/^(?<y>\d{4,})(-(?<M>\d\d)(-(?<d>\d\d)([T ](?<h>\d\d)(:(?<m>\d\d)(:(?<s>\d\d))?)?)?)?)?/;function ro(t,e=new Date){let o,n,r=Jt.exec(t);if(r){o=e;let p=r.groups?.units;if(p){let l=p.matchAll(oo);n=[];for(let[s,i,x]of l)o=vt(o,{[qt[i]]:Number(x)}),n.push(i)}else n=["d"]}else o=_(t),n=Object.entries(no.exec(t)?.groups||{}).filter(([p,l])=>!!l).map(([p])=>p);let a=Qt(n)||"s";return[eo[a](o),a]}function Qt(t){return Zt.find(e=>t.includes(e))}function V(t){return typeof t=="string"?Jt.test(t)||rt(_(t)):rt(t)}function st(t,e,o){let n=V(t);return e&&(e=typeof e=="string"?_(e):e,n=n&&t>=e),o&&(o=typeof o=="string"?_(o):o,n=n&&t<=o),n}var ao={gb:{s_card:t=>.2+.015*t,s_sepa:()=>.3,s_bacs:t=>Math.min(2,Math.max(.2,.01*t)),s_paypal:t=>.1+.02*t},eu:{s_card:t=>.25+.015*t,s_sepa:()=>.35,s_bacs:()=>0,s_paypal:t=>.1+.02*t},ca:{s_card:t=>.3+.029*t,s_sepa:()=>0,s_bacs:()=>0,s_paypal:()=>0}},so=t=>.2+t*.01;function lo(t,e){let o=t.paymentMethod==="gc_direct-debit"?so:ao[e][t.paymentMethod];return t.period==="annually"?0:o(t.amount)}function te(t){return"condition"in t}function ee(t,e){let o=t[e.field];if(!o)throw new c(e,`Invalid field: ${e.field}`);let n=0;if(e.operator in z){if(!o.nullable&&o.type!=="text")throw new c(e,"Invalid nullable operator: field is not nullable")}else{let a=$[o.type][e.operator];if(!a)throw new c(e,`Invalid operator for type: ${o.type} type doesn't define ${e.operator}`);n=a.args}if(n!==e.value.length)throw new c(e,`Invalid operator argument count: ${e.operator} needs ${n}, ${e.value.length} given`);let r=o.type==="boolean"||o.type==="number"?o.type:"string";if(e.value.some(a=>typeof a!==r))throw new c(e,`Invalid operator argument type: ${e.operator} needs ${r}, ${e.value.map(a=>typeof a)} given`);if(o.type==="date"&&e.value.some(a=>!V(a)))throw new c(e,`Invalid operator argument: date type needs valid absolute or relative date, ${e.value} given`);if((o.type==="enum"||o.type==="array")&&e.value.some(a=>o.options?.indexOf(a)===-1))throw new c(e,`Invalid operator argument: ${o.type} type expected ${o.options}, ${e.value} given`);return{field:e.field,type:o.type,nullable:!!o.nullable,operator:e.operator,value:e.value}}function oe(t,e){let o={condition:e.condition,rules:[]};for(let n of e.rules){let r=te(n)?oe(t,n):ee(t,n);o.rules.push(r)}return o}var lt=(t,e)=>!e;var it=(t,e)=>{throw new Error("[calloutComponentInputAddressValidator] Not implemented yet")};var pt=(t,e)=>typeof e=="boolean";var ut=(t,e)=>J(e);var mt=(t,e)=>typeof e!="string"?!1:st(e,t.widget.minDate,t.widget.maxDate);var ct=(t,e)=>q(e);var ft=(t,e)=>F(e)?N(e.url):!1;var dt=(t,e)=>t.validate&&!Q(e,t.validate.min,t.validate.max)?!1:E(e);var Ct=(t,e)=>D(e);var yt=(t,e)=>!!t.data.values.find(n=>n.value===e);var L=(t,e)=>!!t.values.find(n=>n.value===e);var xt=(t,e)=>{throw new Error("[calloutComponentInputSignatureValidator] Not implemented yet")};var io=(t,e)=>t?!(!e&&t.required||typeof t.pattern=="string"&&t.pattern.length&&!new RegExp(t.pattern).test(e||"")||!et(e,t.minWords,t.maxWords)||!tt(e,t.minLength,t.maxLength)):!0,k=(t,e)=>typeof e!="string"?!1:io(t?.validate,e);var ht=(t,e)=>{throw new Error("[calloutComponentInputTimeValidator] Not implemented yet")};var bt=(t,e)=>N(e);var ne=(t,e)=>{for(let o of t.components)if(!ae(o,e[o.key]))return!1;return!0},po={email:ct,address:it,checkbox:pt,currency:ut,datetime:mt,number:dt,phoneNumber:Ct,signature:xt,time:ht,url:bt,file:ft,select:yt,textfield:k,textarea:k,radio:L,selectboxes:L};function re(t,e){let o=po[t.type];if(!o)return console.error(`No validator found for ${t.type}`),!1;if(e===void 0)return!t.validate?.required;let n=Array.isArray(e)?e:[e];for(let r of n)if(!o(t,r))return!1;return!0}function ae(t,e){if(C(t,4))return ne(t,e);if(C(t,1))return re(t,e);if(C(t,0))return lt(t,e);throw new Error("Invalid schema type")}globalThis.Beabee||={};globalThis.Beabee.Common=gt;})();
|
|
1
|
+
(()=>{var se=Object.defineProperty;var le=(t,e)=>{for(var o in e)se(t,o,{get:e[o],enumerable:!0})};var gt={};le(gt,{CalloutAccess:()=>It,CalloutCaptcha:()=>Tt,CalloutChannel:()=>St,CalloutComponentBaseType:()=>O,CalloutComponentType:()=>f,ContributionPeriod:()=>S,ContributionType:()=>v,InvalidRule:()=>c,ItemStatus:()=>P,MembershipStatus:()=>At,NewsletterStatus:()=>Y,PaymentMethod:()=>j,PaymentStatus:()=>G,RoleTypes:()=>Nt,apiKeyFilters:()=>ue,calcPaymentFee:()=>lo,calloutChannelFilters:()=>Ce,calloutComponentContentValidator:()=>lt,calloutComponentInputAddressValidator:()=>it,calloutComponentInputCheckboxValidator:()=>pt,calloutComponentInputCurrencyValidator:()=>ut,calloutComponentInputDateTimeValidator:()=>mt,calloutComponentInputEmailValidator:()=>ct,calloutComponentInputFileValidator:()=>ft,calloutComponentInputNumberValidator:()=>dt,calloutComponentInputPhoneNumberValidator:()=>Ct,calloutComponentInputSelectValidator:()=>yt,calloutComponentInputSelectableTypes:()=>b,calloutComponentInputSelectableValidator:()=>L,calloutComponentInputSignatureValidator:()=>xt,calloutComponentInputTextTypes:()=>g,calloutComponentInputTextValidator:()=>k,calloutComponentInputTimeValidator:()=>ht,calloutComponentInputTypes:()=>I,calloutComponentInputUrlValidator:()=>bt,calloutComponentInputValidator:()=>re,calloutComponentNestableTypes:()=>T,calloutComponentNestableValidator:()=>ne,calloutComponentTypes:()=>ie,calloutComponentValidator:()=>ae,calloutFilters:()=>me,calloutResponseCommentFilters:()=>fe,calloutResponseFilters:()=>ce,calloutTagFilters:()=>de,contactCalloutFilters:()=>xe,contactFilters:()=>ye,contentIds:()=>pe,dateUnitMap:()=>qt,dateUnits:()=>Zt,filterComponents:()=>_t,flattenComponents:()=>K,getCalloutComponents:()=>Rt,getCalloutFilters:()=>Ne,getMinDateUnit:()=>Qt,isAddressAnswer:()=>wt,isAmountOfMoney:()=>J,isAngle:()=>Z,isCalloutComponentOfBaseType:()=>C,isCalloutComponentOfType:()=>y,isDateBetween:()=>st,isEmail:()=>q,isFileUploadAnswer:()=>F,isLngLat:()=>Vt,isMapBounds:()=>_e,isNumber:()=>E,isNumberInRange:()=>Q,isPassword:()=>Re,isPeriod:()=>Lt,isPhoneNumber:()=>D,isRuleGroup:()=>te,isSlug:()=>we,isTextInRange:()=>tt,isTextInWordRange:()=>et,isType:()=>Oe,isURL:()=>N,isValidDate:()=>V,isValidPayFee:()=>Pe,noticeFilters:()=>he,nullableOperators:()=>z,operatorsByType:()=>Dt,operatorsByTypeMap:()=>$,parseDate:()=>ro,paymentFilters:()=>Ie,ruleOperators:()=>ge,segmentFilters:()=>Te,slug:()=>W,stringifyAnswer:()=>Ot,toBytes:()=>Me,toPhoneNumber:()=>Fe,validateRule:()=>ee,validateRuleGroup:()=>oe});var It=(a=>(a.Member="member",a.Guest="guest",a.Anonymous="anonymous",a.OnlyAnonymous="only-anonymous",a))(It||{});var Tt=(n=>(n.None="none",n.Guest="guest",n.All="all",n))(Tt||{});var St=(e=>(e.TELEGRAM="telegram",e))(St||{});var O=(r=>(r[r.CONTENT=0]="CONTENT",r[r.INPUT=1]="INPUT",r[r.INPUT_TEXT=2]="INPUT_TEXT",r[r.INPUT_SELECTABLE=3]="INPUT_SELECTABLE",r[r.NESTABLE=4]="NESTABLE",r))(O||{});var f=(u=>(u.CONTENT="content",u.INPUT_ADDRESS="address",u.INPUT_CHECKBOX="checkbox",u.INPUT_CURRENCY="currency",u.INPUT_DATE_TIME="datetime",u.INPUT_EMAIL="email",u.INPUT_FILE="file",u.INPUT_NUMBER="number",u.INPUT_PHONE_NUMBER="phoneNumber",u.INPUT_SELECT="select",u.INPUT_SELECTABLE_RADIO="radio",u.INPUT_SELECTABLE_SELECTBOXES="selectboxes",u.INPUT_SIGNATURE="signature",u.INPUT_TEXT_AREA="textarea",u.INPUT_TEXT_FIELD="textfield",u.INPUT_TIME="time",u.INPUT_URL="url",u.NESTABLE_PANEL="panel",u.NESTABLE_TABS="tabs",u.NESTABLE_WELL="well",u))(f||{});var b=["radio","selectboxes"];var g=["textarea","textfield"];var I=[...b,...g,"address","checkbox","currency","datetime","email","file","number","phoneNumber","select","signature","time","url"];var T=["panel","well","tabs"];var ie=[...T,...I,"content"];var pe=["contacts","email","general","join","join/setup","profile","share","payment","telegram"];var S=(o=>(o.Monthly="monthly",o.Annually="annually",o))(S||{});var v=(a=>(a.Automatic="Automatic",a.Manual="Manual",a.Gift="Gift",a.None="None",a))(v||{});var P=(a=>(a.Draft="draft",a.Scheduled="scheduled",a.Open="open",a.Ended="ended",a))(P||{});var At=(a=>(a.Active="active",a.Expiring="expiring",a.Expired="expired",a.None="none",a))(At||{});var Y=(r=>(r.Subscribed="subscribed",r.Unsubscribed="unsubscribed",r.Cleaned="cleaned",r.Pending="pending",r.None="none",r))(Y||{});var j=(r=>(r.StripeCard="s_card",r.StripeSEPA="s_sepa",r.StripeBACS="s_bacs",r.StripePayPal="s_paypal",r.GoCardlessDirectDebit="gc_direct-debit",r))(j||{});var G=(r=>(r.Draft="draft",r.Pending="pending",r.Successful="successful",r.Failed="failed",r.Cancelled="cancelled",r))(G||{});var c=class t extends Error{constructor(o,n){super();this.rule=o;this.message=n;Object.setPrototypeOf(this,t.prototype)}};var ue={id:{type:"text"},createdAt:{type:"date"}};var me={id:{type:"text"},slug:{type:"text"},title:{type:"text"},status:{type:"enum",options:["draft","scheduled","open","ended"]},answeredBy:{type:"contact"},starts:{type:"date",nullable:!0},expires:{type:"date",nullable:!0},hidden:{type:"boolean"},channels:{type:"array",nullable:!0}},ce={id:{type:"text"},contact:{type:"contact",nullable:!0},calloutId:{type:"text"},createdAt:{type:"date"},updatedAt:{type:"date"},bucket:{type:"text",nullable:!0},tags:{type:"array"},assignee:{type:"contact",nullable:!0},answers:{type:"blob"}},fe={id:{type:"text"},responseId:{type:"text"},contact:{type:"contact"},createdAt:{type:"date"},updatedAt:{type:"date"},text:{type:"text"}},de={id:{type:"text"},name:{type:"text"},description:{type:"text"},calloutId:{type:"text"}},Ce={id:{type:"text"},name:{type:"text"},description:{type:"text"},calloutId:{type:"text"}};var Nt=["member","admin","superadmin"],ye={id:{type:"contact"},firstname:{type:"text"},lastname:{type:"text"},email:{type:"text"},joined:{type:"date"},lastSeen:{type:"date"},contributionCancelled:{type:"date",nullable:!0},contributionType:{type:"enum",options:["Automatic","Gift","Manual","None"]},contributionMonthlyAmount:{type:"number"},contributionPeriod:{type:"enum",options:["monthly","annually"]},deliveryOptIn:{type:"boolean"},newsletterStatus:{type:"enum",options:["subscribed","unsubscribed","cleaned","pending","none"]},activePermission:{type:"enum",options:Nt},activeMembership:{type:"boolean"},membershipStarts:{type:"date"},membershipExpires:{type:"date"},manualPaymentSource:{type:"text",nullable:!0},tags:{type:"array",nullable:!0}},xe={hasAnswered:{type:"boolean"}};var he={id:{type:"text"},createdAt:{type:"date"},updatedAt:{type:"date"},name:{type:"text"},expires:{type:"date",nullable:!0},enabled:{type:"boolean"},text:{type:"text"},status:{type:"enum",options:["draft","scheduled","open","ended"]}};var A={equal:{args:1},not_equal:{args:1}},be={begins_with:{args:1},ends_with:{args:1},not_begins_with:{args:1},not_ends_with:{args:1}},Et={...A,between:{args:2},not_between:{args:2},less:{args:1},greater:{args:1},less_or_equal:{args:1},greater_or_equal:{args:1}},H={contains:{args:1},not_contains:{args:1}},z={is_empty:{args:0},is_not_empty:{args:0}},Dt={text:{...A,...H,...be},blob:H,date:Et,number:Et,boolean:{equal:A.equal},array:H,enum:A,contact:A},$=Dt,ge=["equal","not_equal","less","less_or_equal","greater","greater_or_equal","between","not_between","begins_with","not_begins_with","contains","not_contains","ends_with","not_ends_with","is_empty","is_not_empty"];var Ie={id:{type:"text"},contact:{type:"contact"},chargeDate:{type:"date"},amount:{type:"number"},status:{type:"enum",options:["draft","pending","successful","failed","cancelled"]}};var Te={id:{type:"text"},name:{type:"text"},description:{type:"text"}};function Se(t){return t.map(({value:e})=>e)}function Ae(t){let e={label:t.label||t.fullKey,nullable:!0};return y(t,"checkbox")?{...e,type:"boolean",nullable:!1}:y(t,"number")?{...e,type:"number"}:y(t,"select")?{...e,type:"enum",options:Se(t.data.values)}:y(t,"textarea")?{...e,type:"blob"}:{...e,type:"text"}}function Ut(t,e){return C(t,3)?t.values.find(o=>o.value===e)?.label||e:y(t,"select")&&t.data.values.find(o=>o.value===e)?.label||e}function y(t,e){return"type"in t&&t.type===e}function C(t,e){return"type"in t?e===0?y(t,"content"):e===1?I.includes(t.type):e===2?g.includes(t.type):e===3?b.includes(t.type):e===4?T.includes(t.type):!1:!1}function K(t){return t.flatMap(e=>C(e,4)?[e,...K(e.components)]:[e])}function _t(t,e){return t.filter(e).map(o=>({...o,...C(o,4)&&{components:_t(o.components,e)}}))}function Rt(t){return t.slides.flatMap(e=>K(e.components).map(o=>({...o,slideId:e.id,fullKey:`${e.id}.${o.key}`})))}function Ne(t){let e=Rt(t).filter(o=>o.input).map(o=>[`answers.${o.fullKey}`,Ae(o)]);return Object.fromEntries(e)}function wt(t){return!!t&&typeof t=="object"&&"geometry"in t}function F(t){return!!t&&typeof t=="object"&&"url"in t}function Ot(t,e){return Array.isArray(e)?e.map(o=>Ot(t,o)).join(", "):e?wt(e)?e.geometry.location.lat+", "+e.geometry.location.lng:F(e)?e.url:typeof e=="object"?Object.entries(e).filter(([,o])=>o).map(([o])=>Ut(t,o)).join(", "):typeof e=="string"?Ut(t,e):e.toString():""}function Ee(t,e){let o=t.charCodeAt(e);if(isNaN(o))throw new RangeError("Index "+e+' out of range for string "'+t+'"; please open an issue at https://github.com/Trott/slug/issues/new');if(o<55296||o>57343)return[t.charAt(e),e];if(o>=55296&&o<=56319){if(t.length<=e+1)return[" ",e];let a=t.charCodeAt(e+1);return a<56320||a>57343?[" ",e]:[t.charAt(e)+t.charAt(e+1),e+1]}if(e===0)return[" ",e];let n=t.charCodeAt(e-1);if(n<55296||n>56319)return[" ",e];throw new Error('String "'+t+'" reaches code believed to be unreachable; please open an issue at https://github.com/Trott/slug/issues/new')}function De(t){return btoa(unescape(encodeURIComponent(t)))}function W(t,e){let o=Pt(t,e);if((e&&e.fallback!==void 0?e.fallback:X.fallback)===!0&&o===""){let a="";for(let r=0;r<t.length;r++){let p=Ee(t,r);r=p[1],a+=p[0]}o=Pt(De(a),e)}return o}var Ue={bg:{\u0419:"Y",\u0439:"y",X:"H",x:"h",\u0426:"Ts",\u0446:"ts",\u0429:"Sht",\u0449:"sht",\u042A:"A",\u044A:"a",\u042C:"Y",\u044C:"y"},de:{\u00C4:"AE",\u00E4:"ae",\u00D6:"OE",\u00F6:"oe",\u00DC:"UE",\u00FC:"ue"},sr:{\u0111:"dj",\u0110:"DJ"},uk:{\u0418:"Y",\u0438:"y",\u0419:"Y",\u0439:"y",\u0426:"Ts",\u0446:"ts",\u0425:"Kh",\u0445:"kh",\u0429:"Shch",\u0449:"shch",\u0413:"H",\u0433:"h"}};function Pt(t,e){let o=e?.mode||X.mode,n={...X.modes[o],...e},a=!!n.locale&&Ue[n.locale]||{},r=[];for(let s in n.multicharmap){if(!Object.prototype.hasOwnProperty.call(n.multicharmap,s))continue;let i=s.length;r.indexOf(i)===-1&&r.push(i)}r=r.sort(function(s,i){return i-s});let p=n.mode==="rfc3986"?/[^\w\s\-.~]/:/[^A-Za-z0-9\s]/,l="";for(let s,i=0,x=t.length;i<x;i++){s=t[i];let R=!1;for(let h=0;h<r.length;h++){let B=r[h],w=t.substr(i,B);if(n.multicharmap[w]){i+=B-1,s=n.multicharmap[w],R=!0;break}}R||(a[s]?s=a[s]:n.charmap[s]?s=n.charmap[s].replace(n.replacement," "):s.includes(n.replacement)?s=s.replace(n.replacement," "):s=s.replace(p,"")),l+=s}return n.remove&&(l=l.replace(n.remove,"")),n.trim&&(l=l.trim()),l=l.replace(/\s+/g,n.replacement),n.lower&&(l=l.toLowerCase()),l}var Ft={\u092B\u093C:"Fi",\u0917\u093C:"Ghi",\u0916\u093C:"Khi",\u0915\u093C:"Qi",\u0921\u093C:"ugDha",\u0922\u093C:"ugDhha",\u092F\u093C:"Yi",\u091C\u093C:"Za",\u05D1\u05B4\u05D9:"i",\u05D1\u05B5:"e",\u05D1\u05B5\u05D9:"e",\u05D1\u05B6:"e",\u05D1\u05B7:"a",\u05D1\u05B8:"a",\u05D1\u05B9:"o",\u05D5\u05B9:"o",\u05D1\u05BB:"u",\u05D5\u05BC:"u",\u05D1\u05BC:"b",\u05DB\u05BC:"k",\u05DA\u05BC:"k",\u05E4\u05BC:"p",\u05E9\u05C1:"sh",\u05E9\u05C2:"s",\u05D1\u05B0:"e",\u05D7\u05B1:"e",\u05D7\u05B2:"a",\u05D7\u05B3:"o",\u05D1\u05B4:"i"},Mt={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00C6:"AE",\u00C7:"C",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00D0:"D",\u00D1:"N",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u0150:"O",\u00D8:"O",\u014C:"O",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u0170:"U",\u00DD:"Y",\u00DE:"TH",\u00DF:"ss",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00E6:"ae",\u00E7:"c",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00F0:"d",\u00F1:"n",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u0151:"o",\u00F8:"o",\u014D:"o",\u0152:"OE",\u0153:"oe",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u0171:"u",\u00FD:"y",\u00FE:"th",\u00FF:"y","\u1E9E":"SS",\u03B1:"a",\u03B2:"b",\u03B3:"g",\u03B4:"d",\u03B5:"e",\u03B6:"z",\u03B7:"h",\u03B8:"th",\u03B9:"i",\u03BA:"k",\u03BB:"l",\u03BC:"m",\u03BD:"n",\u03BE:"3",\u03BF:"o",\u03C0:"p",\u03C1:"r",\u03C3:"s",\u03C4:"t",\u03C5:"y",\u03C6:"f",\u03C7:"x",\u03C8:"ps",\u03C9:"w",\u03AC:"a",\u03AD:"e",\u03AF:"i",\u03CC:"o",\u03CD:"y",\u03AE:"h",\u03CE:"w",\u03C2:"s",\u03CA:"i",\u03B0:"y",\u03CB:"y",\u0390:"i",\u0391:"A",\u0392:"B",\u0393:"G",\u0394:"D",\u0395:"E",\u0396:"Z",\u0397:"H",\u0398:"Th",\u0399:"I",\u039A:"K",\u039B:"L",\u039C:"M",\u039D:"N",\u039E:"3",\u039F:"O",\u03A0:"P",\u03A1:"R",\u03A3:"S",\u03A4:"T",\u03A5:"Y",\u03A6:"F",\u03A7:"X",\u03A8:"PS",\u03A9:"W",\u0386:"A",\u0388:"E",\u038A:"I",\u038C:"O",\u038E:"Y",\u0389:"H",\u038F:"W",\u03AA:"I",\u03AB:"Y",\u015F:"s",\u015E:"S",\u0131:"i",\u0130:"I",\u011F:"g",\u011E:"G",\u0430:"a",\u0431:"b",\u0432:"v",\u0433:"g",\u0434:"d",\u0435:"e",\u0451:"yo",\u0436:"zh",\u0437:"z",\u0438:"i",\u0439:"j",\u043A:"k",\u043B:"l",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"p",\u0440:"r",\u0441:"s",\u0442:"t",\u0443:"u",\u0444:"f",\u0445:"h",\u0446:"c",\u0447:"ch",\u0448:"sh",\u0449:"sh",\u044A:"u",\u044B:"y",\u044C:"",\u044D:"e",\u044E:"yu",\u044F:"ya",\u0410:"A",\u0411:"B",\u0412:"V",\u0413:"G",\u0414:"D",\u0415:"E",\u0401:"Yo",\u0416:"Zh",\u0417:"Z",\u0418:"I",\u0419:"J",\u041A:"K",\u041B:"L",\u041C:"M",\u041D:"N",\u041E:"O",\u041F:"P",\u0420:"R",\u0421:"S",\u0422:"T",\u0423:"U",\u0424:"F",\u0425:"H",\u0426:"C",\u0427:"Ch",\u0428:"Sh",\u0429:"Sh",\u042A:"U",\u042B:"Y",\u042C:"",\u042D:"E",\u042E:"Yu",\u042F:"Ya",\u0404:"Ye",\u0406:"I",\u0407:"Yi",\u0490:"G",\u0454:"ye",\u0456:"i",\u0457:"yi",\u0491:"g",\u010D:"c",\u010F:"d",\u011B:"e",\u0148:"n",\u0159:"r",\u0161:"s",\u0165:"t",\u016F:"u",\u017E:"z",\u010C:"C",\u010E:"D",\u011A:"E",\u0147:"N",\u0158:"R",\u0160:"S",\u0164:"T",\u016E:"U",\u017D:"Z",\u013E:"l",\u013A:"l",\u0155:"r",\u013D:"L",\u0139:"L",\u0154:"R",\u0105:"a",\u0107:"c",\u0119:"e",\u0142:"l",\u0144:"n",\u015B:"s",\u017A:"z",\u017C:"z",\u0104:"A",\u0106:"C",\u0118:"E",\u0141:"L",\u0143:"N",\u015A:"S",\u0179:"Z",\u017B:"Z",\u0101:"a",\u0113:"e",\u0123:"g",\u012B:"i",\u0137:"k",\u013C:"l",\u0146:"n",\u016B:"u",\u0100:"A",\u0112:"E",\u0122:"G",\u012A:"I",\u0136:"K",\u013B:"L",\u0145:"N",\u016A:"U",\u0623:"a",\u0625:"i",\u0628:"b",\u062A:"t",\u062B:"th",\u062C:"g",\u062D:"h",\u062E:"kh",\u062F:"d",\u0630:"th",\u0631:"r",\u0632:"z",\u0633:"s",\u0634:"sh",\u0635:"s",\u0636:"d",\u0637:"t",\u0638:"th",\u0639:"aa",\u063A:"gh",\u0641:"f",\u0642:"k",\u0643:"k",\u0644:"l",\u0645:"m",\u0646:"n",\u0647:"h",\u0648:"o",\u064A:"y",\u0621:"aa",\u0629:"a",\u0622:"a",\u0627:"a",\u067E:"p",\u0698:"zh",\u06AF:"g",\u0686:"ch",\u06A9:"k",\u06CC:"i",\u0117:"e",\u012F:"i",\u0173:"u",\u0116:"E",\u012E:"I",\u0172:"U",\u021B:"t",\u021A:"T",\u0163:"t",\u0162:"T",\u0219:"s",\u0218:"S",\u0103:"a",\u0102:"A",\u1EA0:"A",\u1EA2:"A",\u1EA6:"A",\u1EA4:"A",\u1EAC:"A",\u1EA8:"A",\u1EAA:"A",\u1EB0:"A",\u1EAE:"A",\u1EB6:"A",\u1EB2:"A",\u1EB4:"A",\u1EB8:"E",\u1EBA:"E",\u1EBC:"E",\u1EC0:"E",\u1EBE:"E",\u1EC6:"E",\u1EC2:"E",\u1EC4:"E",\u1ECA:"I",\u1EC8:"I",\u0128:"I",\u1ECC:"O",\u1ECE:"O",\u1ED2:"O",\u1ED0:"O",\u1ED8:"O",\u1ED4:"O",\u1ED6:"O",\u01A0:"O",\u1EDC:"O",\u1EDA:"O",\u1EE2:"O",\u1EDE:"O",\u1EE0:"O",\u1EE4:"U",\u1EE6:"U",\u0168:"U",\u01AF:"U",\u1EEA:"U",\u1EE8:"U",\u1EF0:"U",\u1EEC:"U",\u1EEE:"U",\u1EF2:"Y",\u1EF4:"Y",\u1EF6:"Y",\u1EF8:"Y",\u0110:"D",\u1EA1:"a",\u1EA3:"a",\u1EA7:"a",\u1EA5:"a",\u1EAD:"a",\u1EA9:"a",\u1EAB:"a",\u1EB1:"a",\u1EAF:"a",\u1EB7:"a",\u1EB3:"a",\u1EB5:"a",\u1EB9:"e",\u1EBB:"e",\u1EBD:"e",\u1EC1:"e",\u1EBF:"e",\u1EC7:"e",\u1EC3:"e",\u1EC5:"e",\u1ECB:"i",\u1EC9:"i",\u0129:"i",\u1ECD:"o",\u1ECF:"o",\u1ED3:"o",\u1ED1:"o",\u1ED9:"o",\u1ED5:"o",\u1ED7:"o",\u01A1:"o",\u1EDD:"o",\u1EDB:"o",\u1EE3:"o",\u1EDF:"o",\u1EE1:"o",\u1EE5:"u",\u1EE7:"u",\u0169:"u",\u01B0:"u",\u1EEB:"u",\u1EE9:"u",\u1EF1:"u",\u1EED:"u",\u1EEF:"u",\u1EF3:"y",\u1EF5:"y",\u1EF7:"y",\u1EF9:"y",\u0111:"d",\u04D8:"AE",\u04D9:"ae",\u0492:"GH",\u0493:"gh",\u049A:"KH",\u049B:"kh",\u04A2:"NG",\u04A3:"ng",\u04AE:"UE",\u04AF:"ue",\u04B0:"U",\u04B1:"u",\u04BA:"H",\u04BB:"h",\u04E8:"OE",\u04E9:"oe",\u0452:"dj",\u0458:"j",\u0459:"lj",\u045A:"nj",\u045B:"c",\u045F:"dz",\u0402:"Dj",\u0408:"j",\u0409:"Lj",\u040A:"Nj",\u040B:"C",\u040F:"Dz",\u01CC:"nj",\u01C9:"lj",\u01CB:"NJ",\u01C8:"LJ",\u0905:"a",\u0906:"aa",\u090F:"e",\u0908:"ii",\u090D:"ei",\u090E:"ae",\u0910:"ai",\u0907:"i",\u0913:"o",\u0911:"oi",\u0912:"oii",\u090A:"uu",\u0914:"ou",\u0909:"u",\u092C:"B",\u092D:"Bha",\u091A:"Ca",\u091B:"Chha",\u0921:"Da",\u0922:"Dha",\u092B:"Fa",\u0917:"Ga",\u0918:"Gha",\u0917\u093C:"Ghi",\u0939:"Ha",\u091C:"Ja",\u091D:"Jha",\u0915:"Ka",\u0916:"Kha",\u0916\u093C:"Khi",\u0932:"L",\u0933:"Li",\u090C:"Li",\u0934:"Lii",\u0961:"Lii",\u092E:"Ma",\u0928:"Na",\u0919:"Na",\u091E:"Nia",\u0923:"Nae",\u0929:"Ni",\u0950:"oms",\u092A:"Pa",\u0915\u093C:"Qi",\u0930:"Ra",\u090B:"Ri",\u0960:"Ri",\u0931:"Ri",\u0938:"Sa",\u0936:"Sha",\u0937:"Shha",\u091F:"Ta",\u0924:"Ta",\u0920:"Tha",\u0926:"Tha",\u0925:"Tha",\u0927:"Thha",\u0921\u093C:"ugDha",\u0922\u093C:"ugDhha",\u0935:"Va",\u092F:"Ya",\u092F\u093C:"Yi",\u091C\u093C:"Za",\u0259:"e",\u018F:"E",\u10D0:"a",\u10D1:"b",\u10D2:"g",\u10D3:"d",\u10D4:"e",\u10D5:"v",\u10D6:"z",\u10D7:"t",\u10D8:"i",\u10D9:"k",\u10DA:"l",\u10DB:"m",\u10DC:"n",\u10DD:"o",\u10DE:"p",\u10DF:"zh",\u10E0:"r",\u10E1:"s",\u10E2:"t",\u10E3:"u",\u10E4:"p",\u10E5:"k",\u10E6:"gh",\u10E7:"q",\u10E8:"sh",\u10E9:"ch",\u10EA:"ts",\u10EB:"dz",\u10EC:"ts",\u10ED:"ch",\u10EE:"kh",\u10EF:"j",\u10F0:"h",\u05D1:"v",\u05D2\u05BC:"g",\u05D2:"g",\u05D3:"d",\u05D3\u05BC:"d",\u05D4:"h",\u05D5:"v",\u05D6:"z",\u05D7:"h",\u05D8:"t",\u05D9:"y",\u05DB:"kh",\u05DA:"kh",\u05DC:"l",\u05DE:"m",\u05DD:"m",\u05E0:"n",\u05DF:"n",\u05E1:"s",\u05E4:"f",\u05E3:"f",\u05E5:"ts",\u05E6:"ts",\u05E7:"k",\u05E8:"r",\u05EA\u05BC:"t",\u05EA:"t"},X={locale:"",mode:"pretty",fallback:!0,modes:{rfc3986:{replacement:"-",lower:!0,charmap:Mt,multicharmap:Ft,remove:null,trim:!0},pretty:{replacement:"-",lower:!0,charmap:Mt,multicharmap:Ft,remove:null,trim:!0}}};var Z=(t,e=180)=>typeof t=="number"&&t>=e*-1&&t<=e,q=t=>typeof t!="string"||t.length===0?!1:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),Vt=t=>{if(!Array.isArray(t)||t.length!==2)return!1;let[e,o]=t;return!(!Z(e,180)||!Z(o,90))},_e=t=>Array.isArray(t)&&t.length===2&&t.every(Vt),Re=t=>typeof t=="string"&&t.length>=8&&/[a-z]/.test(t)&&/[A-Z]/.test(t)&&/[0-9]/.test(t),Lt=t=>t==="monthly"||t==="annually",we=t=>typeof t=="string"&&t===W(t);function Oe(t,e){return t.includes(typeof e)}var N=t=>typeof t!="string"||!t.length?!1:/^(https?:\/\/)([\da-z\-]+\.)+[a-z]{2,6}(:[0-9]{1,5})?([\/\w \.-]*)*\/?(\?[a-zA-Z0-9=&]*)?$/.test(t),E=t=>typeof t=="number"&&!isNaN(t),J=t=>{if(!E(t)||t<0)return!1;let e=t.toString().split(".")[1];return!(e&&e.length>2)},D=t=>typeof t!="string"||!t.length||t.length>15||t.length<5?!1:/^(\+?[0-9])\d*$/.test(t),Pe=(t,e,o)=>!(typeof t!="boolean"||typeof e!="number"||!Lt(o)||t&&o==="annually"||!t&&o==="monthly"&&e===1),Q=(t,e,o)=>!(!E(t)||typeof e=="number"&&t<e||typeof o=="number"&&t>o),tt=(t,e=0,o)=>!(typeof t!="string"||typeof e=="number"&&t.length<e||typeof o=="number"&&t.length>o),et=(t,e=0,o)=>{if(typeof t!="string")return!1;let n=t.length>0?t.split(" "):[];return!(typeof e=="number"&&n.length<e||typeof o=="number"&&n.length>o)};var Fe=t=>{if(typeof t!="string"||!t.length)return!1;let e=t.replace(/(?!^\+)\D/g,"");return D(e)?e:!1},Me=t=>{if(typeof t!="string"||!t.length)return null;let e=t.toLowerCase(),o=["b","kb","mb","gb","tb","pb","eb","zb","yb"],[,n,a]=e.match(/(\d+)(\w+)/),r=o.indexOf(a.toLowerCase());return r===-1?null:Number(n)*Math.pow(1024,r)};function m(t){let e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function d(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function kt(t,e){let o=m(t);return isNaN(e)?d(t,NaN):(e&&o.setDate(o.getDate()+e),o)}function Bt(t,e){let o=m(t);if(isNaN(e))return d(t,NaN);if(!e)return o;let n=o.getDate(),a=d(t,o.getTime());a.setMonth(o.getMonth()+e+1,0);let r=a.getDate();return n>=r?a:(o.setFullYear(a.getFullYear(),a.getMonth(),n),o)}function vt(t,e){let{years:o=0,months:n=0,weeks:a=0,days:r=0,hours:p=0,minutes:l=0,seconds:s=0}=e,i=m(t),x=n||o?Bt(i,n+o*12):i,R=r||a?kt(x,r+a*7):x,h=l+p*60,w=(s+h*60)*1e3;return d(t,R.getTime()+w)}var Ve=Math.pow(10,8)*24*60*60*1e3,Wn=-Ve;var ot=6e4,nt=36e5;var Le=3600;var Yt=Le*24,Zn=Yt*7,ke=Yt*365.2425,Be=ke/12,qn=Be*3;function jt(t){let e=m(t);return e.setHours(0,0,0,0),e}function Gt(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function rt(t){if(!Gt(t)&&typeof t!="number")return!1;let e=m(t);return!isNaN(Number(e))}function Ht(t){let e=m(t);return e.setSeconds(0,0),e}function zt(t){let e=m(t);return e.setDate(1),e.setHours(0,0,0,0),e}function $t(t){let e=m(t),o=d(t,0);return o.setFullYear(e.getFullYear(),0,1),o.setHours(0,0,0,0),o}function Kt(t){let e=m(t);return e.setMinutes(0,0,0),e}function Xt(t){let e=m(t);return e.setMilliseconds(0),e}function _(t,e){let o=e?.additionalDigits??2,n=Ge(t),a;if(n.date){let s=He(n.date,o);a=ze(s.restDateString,s.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);let r=a.getTime(),p=0,l;if(n.time&&(p=$e(n.time),isNaN(p)))return new Date(NaN);if(n.timezone){if(l=Ke(n.timezone),isNaN(l))return new Date(NaN)}else{let s=new Date(r+p),i=new Date(0);return i.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),i.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),i}return new Date(r+p+l)}var M={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ve=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ye=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,je=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Ge(t){let e={},o=t.split(M.dateTimeDelimiter),n;if(o.length>2)return e;if(/:/.test(o[0])?n=o[0]:(e.date=o[0],n=o[1],M.timeZoneDelimiter.test(e.date)&&(e.date=t.split(M.timeZoneDelimiter)[0],n=t.substr(e.date.length,t.length))),n){let a=M.timezone.exec(n);a?(e.time=n.replace(a[1],""),e.timezone=a[1]):e.time=n}return e}function He(t,e){let o=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(o);if(!n)return{year:NaN,restDateString:""};let a=n[1]?parseInt(n[1]):null,r=n[2]?parseInt(n[2]):null;return{year:r===null?a:r*100,restDateString:t.slice((n[1]||n[2]).length)}}function ze(t,e){if(e===null)return new Date(NaN);let o=t.match(ve);if(!o)return new Date(NaN);let n=!!o[4],a=U(o[1]),r=U(o[2])-1,p=U(o[3]),l=U(o[4]),s=U(o[5])-1;if(n)return Je(e,l,s)?Xe(e,l,s):new Date(NaN);{let i=new Date(0);return!Ze(e,r,p)||!qe(e,a)?new Date(NaN):(i.setUTCFullYear(e,r,Math.max(a,p)),i)}}function U(t){return t?parseInt(t):1}function $e(t){let e=t.match(Ye);if(!e)return NaN;let o=at(e[1]),n=at(e[2]),a=at(e[3]);return Qe(o,n,a)?o*nt+n*ot+a*1e3:NaN}function at(t){return t&&parseFloat(t.replace(",","."))||0}function Ke(t){if(t==="Z")return 0;let e=t.match(je);if(!e)return 0;let o=e[1]==="+"?-1:1,n=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return to(n,a)?o*(n*nt+a*ot):NaN}function Xe(t,e,o){let n=new Date(0);n.setUTCFullYear(t,0,4);let a=n.getUTCDay()||7,r=(e-1)*7+o+1-a;return n.setUTCDate(n.getUTCDate()+r),n}var We=[31,null,31,30,31,30,31,31,30,31,30,31];function Wt(t){return t%400===0||t%4===0&&t%100!==0}function Ze(t,e,o){return e>=0&&e<=11&&o>=1&&o<=(We[e]||(Wt(t)?29:28))}function qe(t,e){return e>=1&&e<=(Wt(t)?366:365)}function Je(t,e,o){return e>=1&&e<=53&&o>=0&&o<=6}function Qe(t,e,o){return t===24?e===0&&o===0:o>=0&&o<60&&e>=0&&e<60&&t>=0&&t<25}function to(t,e){return e>=0&&e<=59}var Zt=["s","m","h","d","M","y"],qt={y:"years",M:"months",d:"days",h:"hours",m:"minutes",s:"seconds"},eo={y:$t,M:zt,d:jt,h:Kt,m:Ht,s:Xt},Jt=/^\$now(?<units>\(((y|M|d|h|m|s):(-?\d+),?)+\))?$/,oo=/(y|M|d|h|m|s):(-?\d+)/g,no=/^(?<y>\d{4,})(-(?<M>\d\d)(-(?<d>\d\d)([T ](?<h>\d\d)(:(?<m>\d\d)(:(?<s>\d\d))?)?)?)?)?/;function ro(t,e=new Date){let o,n,a=Jt.exec(t);if(a){o=e;let p=a.groups?.units;if(p){let l=p.matchAll(oo);n=[];for(let[s,i,x]of l)o=vt(o,{[qt[i]]:Number(x)}),n.push(i)}else n=["d"]}else o=_(t),n=Object.entries(no.exec(t)?.groups||{}).filter(([p,l])=>!!l).map(([p])=>p);let r=Qt(n)||"s";return[eo[r](o),r]}function Qt(t){return Zt.find(e=>t.includes(e))}function V(t){return typeof t=="string"?Jt.test(t)||rt(_(t)):rt(t)}function st(t,e,o){let n=V(t);return e&&(e=typeof e=="string"?_(e):e,n=n&&t>=e),o&&(o=typeof o=="string"?_(o):o,n=n&&t<=o),n}var ao={gb:{s_card:t=>.2+.015*t,s_sepa:()=>.3,s_bacs:t=>Math.min(2,Math.max(.2,.01*t)),s_paypal:t=>.1+.02*t},eu:{s_card:t=>.25+.015*t,s_sepa:()=>.35,s_bacs:()=>0,s_paypal:t=>.1+.02*t},ca:{s_card:t=>.3+.029*t,s_sepa:()=>0,s_bacs:()=>0,s_paypal:()=>0}},so=t=>.2+t*.01;function lo(t,e){let o=t.paymentMethod==="gc_direct-debit"?so:ao[e][t.paymentMethod];return t.period==="annually"?0:o(t.amount)}function te(t){return"condition"in t}function ee(t,e){let o=t[e.field];if(!o)throw new c(e,`Invalid field: ${e.field}`);let n=0;if(e.operator in z){if(!o.nullable&&o.type!=="text")throw new c(e,"Invalid nullable operator: field is not nullable")}else{let r=$[o.type][e.operator];if(!r)throw new c(e,`Invalid operator for type: ${o.type} type doesn't define ${e.operator}`);n=r.args}if(n!==e.value.length)throw new c(e,`Invalid operator argument count: ${e.operator} needs ${n}, ${e.value.length} given`);let a=o.type==="boolean"||o.type==="number"?o.type:"string";if(e.value.some(r=>typeof r!==a))throw new c(e,`Invalid operator argument type: ${e.operator} needs ${a}, ${e.value.map(r=>typeof r)} given`);if(o.type==="date"&&e.value.some(r=>!V(r)))throw new c(e,`Invalid operator argument: date type needs valid absolute or relative date, ${e.value} given`);if((o.type==="enum"||o.type==="array")&&e.value.some(r=>o.options?.indexOf(r)===-1))throw new c(e,`Invalid operator argument: ${o.type} type expected ${o.options}, ${e.value} given`);return{field:e.field,type:o.type,nullable:!!o.nullable,operator:e.operator,value:e.value}}function oe(t,e){let o={condition:e.condition,rules:[]};for(let n of e.rules){let a=te(n)?oe(t,n):ee(t,n);o.rules.push(a)}return o}var lt=(t,e)=>!e;var it=(t,e)=>{throw new Error("[calloutComponentInputAddressValidator] Not implemented yet")};var pt=(t,e)=>typeof e=="boolean";var ut=(t,e)=>J(e);var mt=(t,e)=>typeof e!="string"?!1:st(e,t.widget.minDate,t.widget.maxDate);var ct=(t,e)=>q(e);var ft=(t,e)=>F(e)?N(e.url):!1;var dt=(t,e)=>t.validate&&!Q(e,t.validate.min,t.validate.max)?!1:E(e);var Ct=(t,e)=>D(e);var yt=(t,e)=>!!t.data.values.find(n=>n.value===e);var L=(t,e)=>!!t.values.find(n=>n.value===e);var xt=(t,e)=>{throw new Error("[calloutComponentInputSignatureValidator] Not implemented yet")};var io=(t,e)=>t?!(!e&&t.required||typeof t.pattern=="string"&&t.pattern.length&&!new RegExp(t.pattern).test(e||"")||!et(e,t.minWords,t.maxWords)||!tt(e,t.minLength,t.maxLength)):!0,k=(t,e)=>typeof e!="string"?!1:io(t?.validate,e);var ht=(t,e)=>{throw new Error("[calloutComponentInputTimeValidator] Not implemented yet")};var bt=(t,e)=>N(e);var ne=(t,e)=>{for(let o of t.components)if(!ae(o,e[o.key]))return!1;return!0},po={email:ct,address:it,checkbox:pt,currency:ut,datetime:mt,number:dt,phoneNumber:Ct,signature:xt,time:ht,url:bt,file:ft,select:yt,textfield:k,textarea:k,radio:L,selectboxes:L};function re(t,e){let o=po[t.type];if(!o)return console.error(`No validator found for ${t.type}`),!1;if(e===void 0)return!t.validate?.required;let n=Array.isArray(e)?e:[e];for(let a of n)if(!o(t,a))return!1;return!0}function ae(t,e){if(C(t,4))return ne(t,e);if(C(t,1))return re(t,e);if(C(t,0))return lt(t,e);throw new Error("Invalid schema type")}globalThis.Beabee||={};globalThis.Beabee.Common=gt;})();
|
package/dist/browser/index.js
CHANGED
|
@@ -169,6 +169,7 @@ var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
|
169
169
|
|
|
170
170
|
// src/data/payment-status.ts
|
|
171
171
|
var PaymentStatus = /* @__PURE__ */ ((PaymentStatus2) => {
|
|
172
|
+
PaymentStatus2["Draft"] = "draft";
|
|
172
173
|
PaymentStatus2["Pending"] = "pending";
|
|
173
174
|
PaymentStatus2["Successful"] = "successful";
|
|
174
175
|
PaymentStatus2["Failed"] = "failed";
|
|
@@ -508,8 +509,9 @@ var paymentFilters = {
|
|
|
508
509
|
status: {
|
|
509
510
|
type: "enum",
|
|
510
511
|
options: [
|
|
511
|
-
"
|
|
512
|
+
"draft" /* Draft */,
|
|
512
513
|
"pending" /* Pending */,
|
|
514
|
+
"successful" /* Successful */,
|
|
513
515
|
"failed" /* Failed */,
|
|
514
516
|
"cancelled" /* Cancelled */
|
|
515
517
|
]
|
|
@@ -22,6 +22,7 @@ __export(payment_status_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(payment_status_exports);
|
|
24
24
|
var PaymentStatus = /* @__PURE__ */ ((PaymentStatus2) => {
|
|
25
|
+
PaymentStatus2["Draft"] = "draft";
|
|
25
26
|
PaymentStatus2["Pending"] = "pending";
|
|
26
27
|
PaymentStatus2["Successful"] = "successful";
|
|
27
28
|
PaymentStatus2["Failed"] = "failed";
|
|
@@ -38,8 +38,9 @@ const paymentFilters = {
|
|
|
38
38
|
status: {
|
|
39
39
|
type: "enum",
|
|
40
40
|
options: [
|
|
41
|
-
import_data.PaymentStatus.
|
|
41
|
+
import_data.PaymentStatus.Draft,
|
|
42
42
|
import_data.PaymentStatus.Pending,
|
|
43
|
+
import_data.PaymentStatus.Successful,
|
|
43
44
|
import_data.PaymentStatus.Failed,
|
|
44
45
|
import_data.PaymentStatus.Cancelled
|
|
45
46
|
]
|
package/dist/cjs/types/index.cjs
CHANGED
|
@@ -167,6 +167,7 @@ __reExport(types_exports, require("./payment-source-go-cardless-direct-debit.cjs
|
|
|
167
167
|
__reExport(types_exports, require("./payment-source-manual.cjs"), module.exports);
|
|
168
168
|
__reExport(types_exports, require("./payment-source-stripe-bacs.cjs"), module.exports);
|
|
169
169
|
__reExport(types_exports, require("./payment-source-stripe-card.cjs"), module.exports);
|
|
170
|
+
__reExport(types_exports, require("./payment-source-stripe-link.cjs"), module.exports);
|
|
170
171
|
__reExport(types_exports, require("./payment-source-stripe-paypal.cjs"), module.exports);
|
|
171
172
|
__reExport(types_exports, require("./payment-source-stripe-sepa.cjs"), module.exports);
|
|
172
173
|
__reExport(types_exports, require("./payment-source.cjs"), module.exports);
|
|
@@ -358,6 +359,7 @@ __reExport(types_exports, require("./validator.cjs"), module.exports);
|
|
|
358
359
|
...require("./payment-source-manual.cjs"),
|
|
359
360
|
...require("./payment-source-stripe-bacs.cjs"),
|
|
360
361
|
...require("./payment-source-stripe-card.cjs"),
|
|
362
|
+
...require("./payment-source-stripe-link.cjs"),
|
|
361
363
|
...require("./payment-source-stripe-paypal.cjs"),
|
|
362
364
|
...require("./payment-source-stripe-sepa.cjs"),
|
|
363
365
|
...require("./payment-source.cjs"),
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var payment_source_stripe_link_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(payment_source_stripe_link_exports);
|
package/dist/esm/types/index.js
CHANGED
|
@@ -150,6 +150,7 @@ export * from "./payment-source-go-cardless-direct-debit.js";
|
|
|
150
150
|
export * from "./payment-source-manual.js";
|
|
151
151
|
export * from "./payment-source-stripe-bacs.js";
|
|
152
152
|
export * from "./payment-source-stripe-card.js";
|
|
153
|
+
export * from "./payment-source-stripe-link.js";
|
|
153
154
|
export * from "./payment-source-stripe-paypal.js";
|
|
154
155
|
export * from "./payment-source-stripe-sepa.js";
|
|
155
156
|
export * from "./payment-source.js";
|
|
File without changes
|
|
@@ -65,8 +65,8 @@ export declare const contactFilters: {
|
|
|
65
65
|
};
|
|
66
66
|
export type ContactFilterName = keyof typeof contactFilters;
|
|
67
67
|
export declare const contactCalloutFilters: {
|
|
68
|
-
hasAnswered: {
|
|
69
|
-
type:
|
|
68
|
+
readonly hasAnswered: {
|
|
69
|
+
readonly type: "boolean";
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
72
|
export type ContactCalloutFilterName = keyof typeof contactCalloutFilters;
|
|
@@ -14,6 +14,6 @@ export declare const paymentFilters: {
|
|
|
14
14
|
};
|
|
15
15
|
readonly status: {
|
|
16
16
|
readonly type: "enum";
|
|
17
|
-
readonly options: readonly [PaymentStatus.
|
|
17
|
+
readonly options: readonly [PaymentStatus.Draft, PaymentStatus.Pending, PaymentStatus.Successful, PaymentStatus.Failed, PaymentStatus.Cancelled];
|
|
18
18
|
};
|
|
19
19
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CalloutResponseViewSchema } from "./index.ts";
|
|
2
|
-
import type { CalloutAccess, CalloutCaptcha } from "../data/index.ts";
|
|
2
|
+
import type { CalloutAccess, CalloutCaptcha, CalloutChannel } from "../data/index.ts";
|
|
3
3
|
export interface CalloutData {
|
|
4
4
|
slug?: string;
|
|
5
5
|
image: string;
|
|
@@ -11,4 +11,5 @@ export interface CalloutData {
|
|
|
11
11
|
captcha: CalloutCaptcha;
|
|
12
12
|
hidden: boolean;
|
|
13
13
|
responseViewSchema?: CalloutResponseViewSchema | null;
|
|
14
|
+
channels: CalloutChannel[] | null;
|
|
14
15
|
}
|
|
@@ -150,6 +150,7 @@ export * from "./payment-source-go-cardless-direct-debit.ts";
|
|
|
150
150
|
export * from "./payment-source-manual.ts";
|
|
151
151
|
export * from "./payment-source-stripe-bacs.ts";
|
|
152
152
|
export * from "./payment-source-stripe-card.ts";
|
|
153
|
+
export * from "./payment-source-stripe-link.ts";
|
|
153
154
|
export * from "./payment-source-stripe-paypal.ts";
|
|
154
155
|
export * from "./payment-source-stripe-sepa.ts";
|
|
155
156
|
export * from "./payment-source.ts";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { PaymentSourceGoCardlessDirectDebit, PaymentSourceManual, PaymentSourceStripeBACS, PaymentSourceStripeCard, PaymentSourceStripePayPal, PaymentSourceStripeSEPA } from "./index.ts";
|
|
2
|
-
export type PaymentSource =
|
|
1
|
+
import type { PaymentSourceGoCardlessDirectDebit, PaymentSourceManual, PaymentSourceStripeBACS, PaymentSourceStripeCard, PaymentSourceStripeLink, PaymentSourceStripePayPal, PaymentSourceStripeSEPA } from "./index.ts";
|
|
2
|
+
export type PaymentSource = PaymentSourceGoCardlessDirectDebit | PaymentSourceManual | PaymentSourceStripeBACS | PaymentSourceStripeCard | PaymentSourceStripeLink | PaymentSourceStripePayPal | PaymentSourceStripeSEPA;
|
package/package.json
CHANGED