denwa-web-shared 1.0.8 → 1.0.10

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.
Files changed (33) hide show
  1. package/dist/client/hooks/index.d.ts +3 -0
  2. package/dist/client/hooks/use-disable-scroll.d.ts +1 -0
  3. package/dist/client/hooks/use-is-client.d.ts +1 -0
  4. package/dist/{client.d.ts → client/hooks/use-view-port.d.ts} +24 -48
  5. package/dist/client/index.d.ts +2 -0
  6. package/dist/client/ui/index.d.ts +1 -0
  7. package/dist/client/ui/infinity-list.d.ts +10 -0
  8. package/dist/denwa-web-shared.cjs.js +6830 -1
  9. package/dist/denwa-web-shared.es.js +6828 -30
  10. package/dist/index.d.ts +2 -0
  11. package/dist/server/constants/index.d.ts +39 -0
  12. package/dist/server/index.d.ts +5 -0
  13. package/dist/server/lib/css.d.ts +2 -0
  14. package/dist/server/lib/images.d.ts +46 -0
  15. package/dist/server/lib/index.d.ts +3 -0
  16. package/dist/server/lib/utils.d.ts +116 -0
  17. package/dist/server/schemas/index.d.ts +13 -0
  18. package/dist/server/types/index.d.ts +42 -0
  19. package/dist/server/ui/image.d.ts +20 -0
  20. package/dist/server/ui/index.d.ts +1 -0
  21. package/package.json +12 -10
  22. package/dist/client/denwa-web-shared.client.cjs.js +0 -1
  23. package/dist/client/denwa-web-shared.client.es.js +0 -12
  24. package/dist/image-CRxiqKd9.cjs +0 -18
  25. package/dist/image-CeUbwO13.js +0 -2575
  26. package/dist/infinity-list-BqhNmBDM.cjs +0 -1
  27. package/dist/infinity-list-ChtJSexP.js +0 -118
  28. package/dist/jsx-runtime-BgsXhnJy.js +0 -3065
  29. package/dist/jsx-runtime-Cgef3_fl.cjs +0 -22
  30. package/dist/main.d.ts +0 -349
  31. package/dist/server/denwa-web-shared.server.cjs.js +0 -1
  32. package/dist/server/denwa-web-shared.server.es.js +0 -22
  33. package/dist/server.d.ts +0 -304
@@ -0,0 +1,2 @@
1
+ export * from './server';
2
+ export * from './client';
@@ -0,0 +1,39 @@
1
+ export declare const TIME: {
2
+ seconds: {
3
+ minutes10: number;
4
+ };
5
+ milliseconds: {
6
+ milliseconds100: number;
7
+ milliseconds200: number;
8
+ milliseconds500: number;
9
+ seconds1: number;
10
+ seconds2: number;
11
+ seconds5: number;
12
+ minutes1: number;
13
+ };
14
+ };
15
+ export declare const THEME: {
16
+ VIEW_PORT: {
17
+ EXTRA_SMALL: number;
18
+ SMALL: number;
19
+ SMALL_MOBILE: number;
20
+ MOBILE: number;
21
+ MEDIUM: number;
22
+ EXTRA_MEDIUM: number;
23
+ TABLET: number;
24
+ LAPTOP: number;
25
+ LAPTOP_BIG: number;
26
+ BIG: number;
27
+ VERY_BIG: number;
28
+ };
29
+ OFFSET: {
30
+ 1: number;
31
+ 2: number;
32
+ 3: number;
33
+ 4: number;
34
+ 5: number;
35
+ 6: number;
36
+ 7: number;
37
+ 8: number;
38
+ };
39
+ };
@@ -0,0 +1,5 @@
1
+ export * from './constants';
2
+ export * from './lib';
3
+ export * from './schemas';
4
+ export * from './types';
5
+ export * from './ui';
@@ -0,0 +1,2 @@
1
+ import { ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,46 @@
1
+ import { IPreparedServerImage, IServerImage } from '../types';
2
+ /**
3
+ * @description Создает url картинки
4
+ * @param {string} name - название картинки
5
+ * @param {string} extension - расширение картинки
6
+ * @param {string} entityId - id сущности
7
+ * @param {string} bucketName - название бакета картинки
8
+ * @param {string} prefixe - префикс файла
9
+ * @param {string} uploadUrl - url бакета
10
+ * @param bucketFolder - enum с папкой бакета
11
+ * @response Возвращает url
12
+ */
13
+ export declare const getUploadImageUrl: <T>({ name, extension, entityId, prefixe, bucketFolder, uploadUrl, }: {
14
+ name: string;
15
+ extension: string;
16
+ entityId: string;
17
+ prefixe: string;
18
+ uploadUrl: string;
19
+ bucketFolder: T;
20
+ }) => string;
21
+ /**
22
+ * @description Проверяет валидность объекта картинки по схеме
23
+ * @param {object} object - объект с информацией о картинке
24
+ * @param getError - функция обработки ошибок
25
+ * @response Возвращает true/false
26
+ */
27
+ export declare const checkCorrectImageObject: (object: IServerImage, getError: ({ error }: {
28
+ error: unknown;
29
+ }) => void) => boolean;
30
+ /**
31
+ * @description Преобразует фотографии с сервера в формат для работы
32
+ * @param {string | undefined | null} images - json stringify строка с информацией
33
+ * @param bucketFolder - название папки в бакете
34
+ * @param uploadUrl - url бакета
35
+ * @param getError - функция обработки ошибок
36
+ * @response Возвращает массив с подготовленными картинками
37
+ */
38
+ export declare const prepareServerImages: <T>({ images, bucketFolder, uploadUrl, getError, }: {
39
+ images: string | undefined | null;
40
+ bucketFolder: T;
41
+ uploadUrl: string;
42
+ getError: ({ error }: {
43
+ error: unknown;
44
+ }) => void;
45
+ }) => IPreparedServerImage[];
46
+ export declare const getImagePrefix: (prefixes: string[], type: "original" | "0.25hd" | "0.5hd" | "1hd" | "2hd" | "4hd") => string;
@@ -0,0 +1,3 @@
1
+ export * from './utils';
2
+ export * from './css';
3
+ export * from './images';
@@ -0,0 +1,116 @@
1
+ import { IPaginate, PaginationResult } from '../types';
2
+ /**
3
+ * @description Получить Intl для нужного языка
4
+ * @param local - Локаль
5
+ */
6
+ export declare const getNumberFormatter: (local: string) => Intl.NumberFormat;
7
+ /**
8
+ * @description Получить значение по ключу
9
+ * @param obj - Объект
10
+ * @param key - Ключ
11
+ */
12
+ export declare const getByKey: <T extends object, K extends keyof T>(obj: T, key: K) => T[K];
13
+ /**
14
+ * @description Преобразует value у инпута в поле маски телефона
15
+ * @param eventValue - исходное значение инпута
16
+ * @response Возвращает либо обработанную строку, либо пустую строку
17
+ * @example
18
+ * 79881234567 -> +79881234567
19
+ * 89881234567 -> +79881234567
20
+ * 19881234567 -> +19881234567
21
+ */
22
+ export declare const convertPhoneMask: (eventValue: string) => string;
23
+ /**
24
+ * @description Получить корректный поддомен из адреса хоста
25
+ * @param host - url хоста
26
+ * @param SUB_DOMAIN - Объект ключ-значение со списком поддоменов
27
+ */
28
+ export declare const getSubdomain: (host: string, SUB_DOMAIN: Record<string, string>) => string;
29
+ /**
30
+ * @description Заменяет текст по маске {{}}
31
+ * @param text - Исходный текст
32
+ * @param subdomain - Значение города, которое подставится
33
+ * @param SUBDOMAIN_NAME - Объект ключ-значение со списком поддоменов
34
+ * @param SUBDOMAIN_MASK - Объект ключ-значение со списком масок поддоменов
35
+ * @return Обновленная строка
36
+ */
37
+ export declare const updateTextByTemplate: ({ text, subdomain, SUBDOMAIN_NAME, SUBDOMAIN_MASK, }: {
38
+ text: string;
39
+ subdomain: string;
40
+ SUBDOMAIN_NAME: Record<string, {
41
+ name: string;
42
+ declination: string;
43
+ region: string;
44
+ regionDeclination: string;
45
+ }>;
46
+ SUBDOMAIN_MASK: {
47
+ CITY: string;
48
+ CITY_DECL: string;
49
+ CITY_REGION: string;
50
+ CITY_REGION_DECL: string;
51
+ };
52
+ }) => string;
53
+ /**
54
+ * @description Заменят мета текст по маске, переданный напрямую
55
+ * @param subdomain - Поддомен
56
+ * @param metaData - Объект с title, descrption, keywords
57
+ * @param host - Хост сайта
58
+ * @param SUBDOMAIN_NAME - Объект ключ-значение со списком поддоменов
59
+ * @param SUBDOMAIN_MASK - Объект ключ-значение со списком масок поддоменов
60
+ * @param DEFAULT_SEO_TEXT - Объект ключ-значение со списком масок поддоменов
61
+ * @return Объект с мета тегами
62
+ */
63
+ export declare const prepareLocalMetaData: <T extends object>({ subdomain, metaData, host, SUBDOMAIN_NAME, SUBDOMAIN_MASK, DEFAULT_SEO_TEXT, }: {
64
+ subdomain: string;
65
+ metaData: {
66
+ title: string;
67
+ description: string;
68
+ keywords: string;
69
+ canonical?: string;
70
+ };
71
+ host: string;
72
+ SUBDOMAIN_NAME: Record<string, {
73
+ name: string;
74
+ declination: string;
75
+ region: string;
76
+ regionDeclination: string;
77
+ }>;
78
+ SUBDOMAIN_MASK: {
79
+ CITY: string;
80
+ CITY_DECL: string;
81
+ CITY_REGION: string;
82
+ CITY_REGION_DECL: string;
83
+ };
84
+ DEFAULT_SEO_TEXT: {
85
+ title: string;
86
+ description: string;
87
+ keywords: string;
88
+ };
89
+ }) => T;
90
+ /**
91
+ * @description Превращает строку формата /catalog/price-from__1000--price-to__5000 в { price-from: '1000', price-to: '5000' }
92
+ * @param input - изначальная строка
93
+ * @return Объект с парами ключ-значение
94
+ */
95
+ export declare const parseStringToKeyValue: <T extends object>(input: string) => T;
96
+ /**
97
+ * @description Конвентирует цвет из enum в строку
98
+ * @param color1 - цвет 1
99
+ * @param color2 - цвет 2
100
+ * @param notFoundText - текст при отсутствии цвета
101
+ * @param COLORS_NAMES - Объект ключ-значение со списком названий цветов
102
+ * @return Строка с названием цветов
103
+ */
104
+ export declare const prepareColor: ({ color1, color2, notFoundText, COLORS_NAMES, }: {
105
+ color1: string;
106
+ color2?: string | null;
107
+ notFoundText: string;
108
+ COLORS_NAMES: Record<string, string>;
109
+ }) => string;
110
+ /**
111
+ * @description Подготавливает серверную пагинацию для клиента
112
+ * @param pagination - Серверная пагинация
113
+ * @param baseUrl - Url страницы
114
+ * @param initialParams - Параметры url
115
+ */
116
+ export declare const generatePaginationArray: (pagination: IPaginate | null, baseUrl: string, initialParams: Record<string, string>) => PaginationResult;
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare const responseSchema: z.ZodObject<{
3
+ statusCode: z.ZodOptional<z.ZodNumber>;
4
+ message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
5
+ messages: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
6
+ data: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
7
+ error: z.ZodNullable<z.ZodOptional<z.ZodObject<{
8
+ statusCode: z.ZodNumber;
9
+ message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
10
+ messages: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
11
+ }, z.core.$strip>>>;
12
+ response: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
13
+ }, z.core.$strip>;
@@ -0,0 +1,42 @@
1
+ export interface IServerImage {
2
+ altRU?: string;
3
+ altEN?: string;
4
+ name: string;
5
+ originalFileExtension: string;
6
+ entityId: string;
7
+ fullPathExample: string;
8
+ prefixes: string[];
9
+ fileExtensions: string[];
10
+ }
11
+ export interface IPreparedServerImage {
12
+ image1x: string;
13
+ image2x: string;
14
+ image1xWebp: string;
15
+ image2xWebp: string;
16
+ mobileImage1x?: string;
17
+ mobileImage2x?: string;
18
+ mobileImage1xWebp?: string;
19
+ mobileImage2xWebp?: string;
20
+ altRU?: string;
21
+ altEN?: string;
22
+ type: ImageType;
23
+ }
24
+ export type ImageType = 'image/png' | 'image/jpeg';
25
+ export interface IPaginate {
26
+ page: number;
27
+ pages: number;
28
+ previous?: number;
29
+ next?: number;
30
+ count: number;
31
+ limit: number;
32
+ }
33
+ export interface PaginationButton {
34
+ label: string;
35
+ href: string;
36
+ isActive: boolean;
37
+ }
38
+ export interface PaginationResult {
39
+ buttons: PaginationButton[];
40
+ firstPage?: PaginationButton;
41
+ lastPage?: PaginationButton;
42
+ }
@@ -0,0 +1,20 @@
1
+ import { DetailedHTMLProps, FC, HTMLAttributes, ImgHTMLAttributes } from '../../../node_modules/react';
2
+ import { ImageType } from '../types';
3
+ interface BasePictureProps extends DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> {
4
+ imgProps?: DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
5
+ image1x: string;
6
+ image2x?: string;
7
+ image1xWebp?: string;
8
+ image2xWebp?: string;
9
+ mobileImage1x?: string;
10
+ mobileImage2x?: string;
11
+ mobileImage1xWebp?: string;
12
+ mobileImage2xWebp?: string;
13
+ type: ImageType;
14
+ alt: string;
15
+ bgColorClass: string;
16
+ mobileMaxWidth?: number;
17
+ loading?: 'eager' | 'lazy';
18
+ }
19
+ export declare const BasePicture: FC<BasePictureProps>;
20
+ export {};
@@ -0,0 +1 @@
1
+ export * from './image';
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "denwa-web-shared",
3
3
  "private": false,
4
- "version": "1.0.8",
4
+ "version": "1.0.10",
5
5
  "type": "module",
6
6
  "author": "Denwa",
7
- "main": "dist/denwa-web-shared.umd.js",
7
+ "main": "dist/denwa-web-shared.cjs.js",
8
8
  "module": "dist/denwa-web-shared.es.js",
9
9
  "files": [
10
10
  "dist"
@@ -16,20 +16,22 @@
16
16
  "import": "./dist/denwa-web-shared.es.js",
17
17
  "require": "./dist/denwa-web-shared.cjs.js"
18
18
  },
19
- "./client": {
20
- "types": "./dist/client/denwa-web-shared.client.d.ts",
21
- "import": "./dist/client/denwa-web-shared.client.es.js",
22
- "require": "./dist/client/denwa-web-shared.client.cjs.js"
23
- },
24
19
  "./server": {
25
- "types": "./dist/server/denwa-web-shared.server.d.ts",
26
- "import": "./dist/server/denwa-web-shared.server.es.js",
27
- "require": "./dist/server/denwa-web-shared.server.cjs.js"
20
+ "types": "./dist/server/index.d.ts",
21
+ "import": "./dist/server/index.es.js",
22
+ "require": "./dist/server/index.cjs.js"
23
+ },
24
+ "./client": {
25
+ "types": "./dist/client/index.d.ts",
26
+ "import": "./dist/client/index.es.js",
27
+ "require": "./dist/client/index.cjs.js"
28
28
  }
29
29
  },
30
30
  "scripts": {
31
31
  "dev": "vite",
32
32
  "build": "tsc -b && vite build",
33
+ "build:client": "vite build --config vite.client.config.ts",
34
+ "build:server": "vite build --config vite.server.config.ts",
33
35
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix",
34
36
  "preview": "vite preview",
35
37
  "prepare-push": "npm run lint && npm run build",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../infinity-list-BqhNmBDM.cjs");exports.InfinityList=e.InfinityList;exports.useDisableScroll=e.useDisableScroll;exports.useExtraMediumViewPort=e.useExtraMediumViewPort;exports.useIsClient=e.useIsClient;exports.useLaptopBigViewPort=e.useLaptopBigViewPort;exports.useLaptopViewPort=e.useLaptopViewPort;exports.useMobileViewPort=e.useMobileViewPort;exports.useSmallViewPort=e.useSmallViewPort;exports.useTabletViewPort=e.useTabletViewPort;
@@ -1,12 +0,0 @@
1
- import { I as a, u as i, e as t, a as o, b as r, c as u, f as l, g as w, d as P } from "../infinity-list-ChtJSexP.js";
2
- export {
3
- a as InfinityList,
4
- i as useDisableScroll,
5
- t as useExtraMediumViewPort,
6
- o as useIsClient,
7
- r as useLaptopBigViewPort,
8
- u as useLaptopViewPort,
9
- l as useMobileViewPort,
10
- w as useSmallViewPort,
11
- P as useTabletViewPort
12
- };
@@ -1,18 +0,0 @@
1
- "use strict";const O=require("./jsx-runtime-Cgef3_fl.cjs"),dn=e=>new Intl.NumberFormat(e),Fe=(e,n)=>e[n],hn=e=>{let n=e;if(n!=="+"&&Number.isNaN(Number(n))||n.length>12)return"";const t=n.split(""),r=t[0],o=t[1];return r==="7"||r==="8"?t[0]="+7":`${r}${o}`=="+8"?t[1]="7":r&&r!=="+"&&(t[0]=`+${r}`),n=t.join("").trim(),n},pn=(e,n)=>{if(!e)return n.main;const t=e.split(".")[0],r=n[t];return r||n.main},S=({text:e,subdomain:n,SUBDOMAIN_NAME:t,SUBDOMAIN_MASK:r})=>{const o=Fe(t,n);if(!n)return e;let i=e;const{name:c,declination:u,region:a,regionDeclination:l}=o,d=new RegExp(r.CITY,"g"),p=new RegExp(r.CITY_DECL,"g"),m=new RegExp(r.CITY_REGION,"g"),h=new RegExp(r.CITY_REGION_DECL,"g");return i=i.replace(d,c),i=i.replace(p,u),i=i.replace(m,a),i=i.replace(h,l),i},mn=({subdomain:e,metaData:n,host:t,SUBDOMAIN_NAME:r,SUBDOMAIN_MASK:o,DEFAULT_SEO_TEXT:i})=>{const{title:c,description:u,keywords:a,canonical:l}=n,d=e==="main"?t:`${e}.${t}`;let p=c,m=u,h=a;const z={};return c?p=S({text:c,subdomain:e,SUBDOMAIN_MASK:o,SUBDOMAIN_NAME:r}):p=S({text:i.title,subdomain:e,SUBDOMAIN_MASK:o,SUBDOMAIN_NAME:r}),u?m=S({text:u,subdomain:e,SUBDOMAIN_MASK:o,SUBDOMAIN_NAME:r}):m=S({text:i.description,subdomain:e,SUBDOMAIN_MASK:o,SUBDOMAIN_NAME:r}),a?h=S({text:a,subdomain:e,SUBDOMAIN_MASK:o,SUBDOMAIN_NAME:r}):h=S({text:i.keywords,subdomain:e,SUBDOMAIN_MASK:o,SUBDOMAIN_NAME:r}),l!==void 0&&(z.canonical=`https://${d}${l}`),{title:p,description:m,keywords:h,alternates:Object.keys(z).length?z:void 0}},_n=e=>{const r=decodeURI(e).replace(/^\/[^\/]*\//,"").split("--"),o={};return r.forEach(i=>{const[c,u]=i.split("__");c&&u&&(o[c]=u.replace(/_/g," "))}),o},gn=({color1:e,color2:n,notFoundText:t,COLORS_NAMES:r})=>{const o=r[e],i=n?r[n]:null;return o&&i?`${o}/${i}`:o||t},vn=(e,n,t)=>{if(!e)return{buttons:[]};const{page:r,pages:o}=e;if(!r||!o)return{buttons:[]};const i=new URLSearchParams(t),c=[],u=8,a=Math.floor(u/2);let l=Math.max(1,r-a),d=Math.min(o,r+a);d-l+1<u&&(l=Math.max(1,d-u+1),d=Math.min(o,l+u-1));for(let $=l;$<=d;$++){const j=new URLSearchParams(i);j.set("page",$.toString()),c.push({label:$.toString(),href:`${n}?${j.toString()}`,isActive:$===r})}const m=c.some($=>$.label==="1")?void 0:{label:"1",href:`${n}?${new URLSearchParams({...Object.fromEntries(i),page:"1"}).toString()}`,isActive:r===1},z=c.some($=>$.label===o.toString())?void 0:{label:o.toString(),href:`${n}?${new URLSearchParams({...Object.fromEntries(i),page:o.toString()}).toString()}`,isActive:r===o};return{buttons:c,firstPage:m,lastPage:z}};function s(e,n,t){function r(u,a){var l;Object.defineProperty(u,"_zod",{value:u._zod??{},enumerable:!1}),(l=u._zod).traits??(l.traits=new Set),u._zod.traits.add(e),n(u,a);for(const d in c.prototype)d in u||Object.defineProperty(u,d,{value:c.prototype[d].bind(u)});u._zod.constr=c,u._zod.def=a}const o=(t==null?void 0:t.Parent)??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function c(u){var a;const l=t!=null&&t.Parent?new i:this;r(l,u),(a=l._zod).deferred??(a.deferred=[]);for(const d of l._zod.deferred)d();return l}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:u=>{var a,l;return t!=null&&t.Parent&&u instanceof t.Parent?!0:(l=(a=u==null?void 0:u._zod)==null?void 0:a.traits)==null?void 0:l.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class D extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ue extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const Le={};function C(e){return Le}function zn(e){const n=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>n.indexOf(+r)===-1).map(([r,o])=>o)}function ie(e,n){return typeof n=="bigint"?n.toString():n}function ae(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function le(e){return e==null}function fe(e){const n=e.startsWith("^")?1:0,t=e.endsWith("$")?e.length-1:e.length;return e.slice(n,t)}function bn(e,n){const t=(e.toString().split(".")[1]||"").length,r=n.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const a=r.match(/\d?e-(\d?)/);a!=null&&a[1]&&(o=Number.parseInt(a[1]))}const i=t>o?t:o,c=Number.parseInt(e.toFixed(i).replace(".","")),u=Number.parseInt(n.toFixed(i).replace(".",""));return c%u/10**i}const _e=Symbol("evaluating");function _(e,n,t){let r;Object.defineProperty(e,n,{get(){if(r!==_e)return r===void 0&&(r=_e,r=t()),r},set(o){Object.defineProperty(e,n,{value:o})},configurable:!0})}function wn(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function P(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function F(...e){const n={};for(const t of e){const r=Object.getOwnPropertyDescriptors(t);Object.assign(n,r)}return Object.defineProperties({},n)}function ge(e){return JSON.stringify(e)}const Ve="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function K(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const $n=ae(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function L(e){if(K(e)===!1)return!1;const n=e.constructor;if(n===void 0)return!0;const t=n.prototype;return!(K(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Ge(e){return L(e)?{...e}:e}const kn=new Set(["string","number","symbol"]);function X(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function T(e,n,t){const r=new e._zod.constr(n??e._zod.def);return(!n||t!=null&&t.parent)&&(r._zod.parent=e),r}function f(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if((n==null?void 0:n.message)!==void 0){if((n==null?void 0:n.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function Zn(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const yn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function In(e,n){const t=e._zod.def,r=F(e._zod.def,{get shape(){const o={};for(const i in n){if(!(i in t.shape))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=t.shape[i])}return P(this,"shape",o),o},checks:[]});return T(e,r)}function En(e,n){const t=e._zod.def,r=F(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const i in n){if(!(i in t.shape))throw new Error(`Unrecognized key: "${i}"`);n[i]&&delete o[i]}return P(this,"shape",o),o},checks:[]});return T(e,r)}function xn(e,n){if(!L(n))throw new Error("Invalid input to extend: expected a plain object");const t=e._zod.def.checks;if(t&&t.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=F(e._zod.def,{get shape(){const i={...e._zod.def.shape,...n};return P(this,"shape",i),i},checks:[]});return T(e,o)}function Pn(e,n){if(!L(n))throw new Error("Invalid input to safeExtend: expected a plain object");const t={...e._zod.def,get shape(){const r={...e._zod.def.shape,...n};return P(this,"shape",r),r},checks:e._zod.def.checks};return T(e,t)}function Tn(e,n){const t=F(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n._zod.def.shape};return P(this,"shape",r),r},get catchall(){return n._zod.def.catchall},checks:[]});return T(e,t)}function jn(e,n,t){const r=F(n._zod.def,{get shape(){const o=n._zod.def.shape,i={...o};if(t)for(const c in t){if(!(c in o))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(i[c]=e?new e({type:"optional",innerType:o[c]}):o[c])}else for(const c in o)i[c]=e?new e({type:"optional",innerType:o[c]}):o[c];return P(this,"shape",i),i},checks:[]});return T(n,r)}function Rn(e,n,t){const r=F(n._zod.def,{get shape(){const o=n._zod.def.shape,i={...o};if(t)for(const c in t){if(!(c in i))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(i[c]=new e({type:"nonoptional",innerType:o[c]}))}else for(const c in o)i[c]=new e({type:"nonoptional",innerType:o[c]});return P(this,"shape",i),i},checks:[]});return T(n,r)}function N(e,n=0){var t;if(e.aborted===!0)return!0;for(let r=n;r<e.issues.length;r++)if(((t=e.issues[r])==null?void 0:t.continue)!==!0)return!0;return!1}function Me(e,n){return n.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function M(e){return typeof e=="string"?e:e==null?void 0:e.message}function A(e,n,t){var o,i,c,u,a,l;const r={...e,path:e.path??[]};if(!e.message){const d=M((c=(i=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:i.error)==null?void 0:c.call(i,e))??M((u=n==null?void 0:n.error)==null?void 0:u.call(n,e))??M((a=t.customError)==null?void 0:a.call(t,e))??M((l=t.localeError)==null?void 0:l.call(t,e))??"Invalid input";r.message=d}return delete r.inst,delete r.continue,n!=null&&n.reportInput||delete r.input,r}function de(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function V(...e){const[n,t,r]=e;return typeof n=="string"?{message:n,code:"custom",input:t,inst:r}:{...n}}const We=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,ie,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Je=s("$ZodError",We),Ye=s("$ZodError",We,{Parent:Error});function On(e,n=t=>t.message){const t={},r=[];for(const o of e.issues)o.path.length>0?(t[o.path[0]]=t[o.path[0]]||[],t[o.path[0]].push(n(o))):r.push(n(o));return{formErrors:r,fieldErrors:t}}function Sn(e,n){const t=n||function(i){return i.message},r={_errors:[]},o=i=>{for(const c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>o({issues:u}));else if(c.code==="invalid_key")o({issues:c.issues});else if(c.code==="invalid_element")o({issues:c.issues});else if(c.path.length===0)r._errors.push(t(c));else{let u=r,a=0;for(;a<c.path.length;){const l=c.path[a];a===c.path.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(t(c))):u[l]=u[l]||{_errors:[]},u=u[l],a++}}};return o(e),r}const he=e=>(n,t,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},c=n._zod.run({value:t,issues:[]},i);if(c instanceof Promise)throw new D;if(c.issues.length){const u=new((o==null?void 0:o.Err)??e)(c.issues.map(a=>A(a,i,C())));throw Ve(u,o==null?void 0:o.callee),u}return c.value},pe=e=>async(n,t,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let c=n._zod.run({value:t,issues:[]},i);if(c instanceof Promise&&(c=await c),c.issues.length){const u=new((o==null?void 0:o.Err)??e)(c.issues.map(a=>A(a,i,C())));throw Ve(u,o==null?void 0:o.callee),u}return c.value},H=e=>(n,t,r)=>{const o=r?{...r,async:!1}:{async:!1},i=n._zod.run({value:t,issues:[]},o);if(i instanceof Promise)throw new D;return i.issues.length?{success:!1,error:new(e??Je)(i.issues.map(c=>A(c,o,C())))}:{success:!0,data:i.value}},Cn=H(Ye),Q=e=>async(n,t,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=n._zod.run({value:t,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(c=>A(c,o,C())))}:{success:!0,data:i.value}},An=Q(Ye),Nn=e=>(n,t,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return he(e)(n,t,o)},Dn=e=>(n,t,r)=>he(e)(n,t,r),Fn=e=>async(n,t,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return pe(e)(n,t,o)},Un=e=>async(n,t,r)=>pe(e)(n,t,r),Ln=e=>(n,t,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return H(e)(n,t,o)},Vn=e=>(n,t,r)=>H(e)(n,t,r),Gn=e=>async(n,t,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Q(e)(n,t,o)},Mn=e=>async(n,t,r)=>Q(e)(n,t,r),Wn=/^[cC][^\s-]{8,}$/,Jn=/^[0-9a-z]+$/,Yn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Kn=/^[0-9a-vA-V]{20}$/,Bn=/^[A-Za-z0-9]{27}$/,qn=/^[a-zA-Z0-9_-]{21}$/,Xn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Hn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ve=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Qn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,et="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function nt(){return new RegExp(et,"u")}const tt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,ot=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,it=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ct=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ke=/^[A-Za-z0-9_-]*$/,ut=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,st=/^\+(?:[0-9]){6,14}[0-9]$/,Be="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",at=new RegExp(`^${Be}$`);function qe(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function lt(e){return new RegExp(`^${qe(e)}$`)}function ft(e){const n=qe({precision:e.precision}),t=["Z"];e.local&&t.push(""),e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${n}(?:${t.join("|")})`;return new RegExp(`^${Be}T(?:${r})$`)}const dt=e=>{const n=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},ht=/^\d+$/,pt=/^-?\d+(?:\.\d+)?/i,mt=/^[^A-Z]*$/,_t=/^[^a-z]*$/,k=s("$ZodCheck",(e,n)=>{var t;e._zod??(e._zod={}),e._zod.def=n,(t=e._zod).onattach??(t.onattach=[])}),Xe={number:"number",bigint:"bigint",object:"date"},He=s("$ZodCheckLessThan",(e,n)=>{k.init(e,n);const t=Xe[typeof n.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(n.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<i&&(n.inclusive?o.maximum=n.value:o.exclusiveMaximum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value<=n.value:r.value<n.value)||r.issues.push({origin:t,code:"too_big",maximum:n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Qe=s("$ZodCheckGreaterThan",(e,n)=>{k.init(e,n);const t=Xe[typeof n.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(n.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>i&&(n.inclusive?o.minimum=n.value:o.exclusiveMinimum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value>=n.value:r.value>n.value)||r.issues.push({origin:t,code:"too_small",minimum:n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),gt=s("$ZodCheckMultipleOf",(e,n)=>{k.init(e,n),e._zod.onattach.push(t=>{var r;(r=t._zod.bag).multipleOf??(r.multipleOf=n.value)}),e._zod.check=t=>{if(typeof t.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%n.value===BigInt(0):bn(t.value,n.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:n.value,input:t.value,inst:e,continue:!n.abort})}}),vt=s("$ZodCheckNumberFormat",(e,n)=>{var c;k.init(e,n),n.format=n.format||"float64";const t=(c=n.format)==null?void 0:c.includes("int"),r=t?"int":"number",[o,i]=yn[n.format];e._zod.onattach.push(u=>{const a=u._zod.bag;a.format=n.format,a.minimum=o,a.maximum=i,t&&(a.pattern=ht)}),e._zod.check=u=>{const a=u.value;if(t){if(!Number.isInteger(a)){u.issues.push({expected:r,format:n.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?u.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!n.abort}):u.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!n.abort});return}}a<o&&u.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!n.abort}),a>i&&u.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inst:e})}}),zt=s("$ZodCheckMaxLength",(e,n)=>{var t;k.init(e,n),(t=e._zod.def).when??(t.when=r=>{const o=r.value;return!le(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<o&&(r._zod.bag.maximum=n.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=n.maximum)return;const c=de(o);r.issues.push({origin:c,code:"too_big",maximum:n.maximum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),bt=s("$ZodCheckMinLength",(e,n)=>{var t;k.init(e,n),(t=e._zod.def).when??(t.when=r=>{const o=r.value;return!le(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>o&&(r._zod.bag.minimum=n.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=n.minimum)return;const c=de(o);r.issues.push({origin:c,code:"too_small",minimum:n.minimum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),wt=s("$ZodCheckLengthEquals",(e,n)=>{var t;k.init(e,n),(t=e._zod.def).when??(t.when=r=>{const o=r.value;return!le(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=n.length,o.maximum=n.length,o.length=n.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===n.length)return;const c=de(o),u=i>n.length;r.issues.push({origin:c,...u?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!n.abort})}}),ee=s("$ZodCheckStringFormat",(e,n)=>{var t,r;k.init(e,n),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=n.format,n.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(n.pattern))}),n.pattern?(t=e._zod).check??(t.check=o=>{n.pattern.lastIndex=0,!n.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:n.format,input:o.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(r=e._zod).check??(r.check=()=>{})}),$t=s("$ZodCheckRegex",(e,n)=>{ee.init(e,n),e._zod.check=t=>{n.pattern.lastIndex=0,!n.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),kt=s("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=mt),ee.init(e,n)}),Zt=s("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=_t),ee.init(e,n)}),yt=s("$ZodCheckIncludes",(e,n)=>{k.init(e,n);const t=X(n.includes),r=new RegExp(typeof n.position=="number"?`^.{${n.position}}${t}`:t);n.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(n.includes,n.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:o.value,inst:e,continue:!n.abort})}}),It=s("$ZodCheckStartsWith",(e,n)=>{k.init(e,n);const t=new RegExp(`^${X(n.prefix)}.*`);n.pattern??(n.pattern=t),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(t)}),e._zod.check=r=>{r.value.startsWith(n.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:r.value,inst:e,continue:!n.abort})}}),Et=s("$ZodCheckEndsWith",(e,n)=>{k.init(e,n);const t=new RegExp(`.*${X(n.suffix)}$`);n.pattern??(n.pattern=t),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(t)}),e._zod.check=r=>{r.value.endsWith(n.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:r.value,inst:e,continue:!n.abort})}}),xt=s("$ZodCheckOverwrite",(e,n)=>{k.init(e,n),e._zod.check=t=>{t.value=n.tx(t.value)}});class Pt{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const r=n.split(`
2
- `).filter(c=>c),o=Math.min(...r.map(c=>c.length-c.trimStart().length)),i=r.map(c=>c.slice(o)).map(c=>" ".repeat(this.indent*2)+c);for(const c of i)this.content.push(c)}compile(){const n=Function,t=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(i=>` ${i}`)];return new n(...t,o.join(`
3
- `))}}const Tt={major:4,minor:1,patch:5},b=s("$ZodType",(e,n)=>{var o;var t;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=Tt;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const c of i._zod.onattach)c(e);if(r.length===0)(t=e._zod).deferred??(t.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const i=(u,a,l)=>{let d=N(u),p;for(const m of a){if(m._zod.def.when){if(!m._zod.def.when(u))continue}else if(d)continue;const h=u.issues.length,z=m._zod.check(u);if(z instanceof Promise&&(l==null?void 0:l.async)===!1)throw new D;if(p||z instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await z,u.issues.length!==h&&(d||(d=N(u,h)))});else{if(u.issues.length===h)continue;d||(d=N(u,h))}}return p?p.then(()=>u):u},c=(u,a,l)=>{if(N(u))return u.aborted=!0,u;const d=i(a,r,l);if(d instanceof Promise){if(l.async===!1)throw new D;return d.then(p=>e._zod.parse(p,l))}return e._zod.parse(d,l)};e._zod.run=(u,a)=>{if(a.skipChecks)return e._zod.parse(u,a);if(a.direction==="backward"){const d=e._zod.parse({value:u.value,issues:[]},{...a,skipChecks:!0});return d instanceof Promise?d.then(p=>c(p,u,a)):c(d,u,a)}const l=e._zod.parse(u,a);if(l instanceof Promise){if(a.async===!1)throw new D;return l.then(d=>i(d,r,a))}return i(l,r,a)}}e["~standard"]={validate:i=>{var c;try{const u=Cn(e,i);return u.success?{value:u.data}:{issues:(c=u.error)==null?void 0:c.issues}}catch{return An(e,i).then(a=>{var l;return a.success?{value:a.data}:{issues:(l=a.error)==null?void 0:l.issues}})}},vendor:"zod",version:1}}),me=s("$ZodString",(e,n)=>{var t;b.init(e,n),e._zod.pattern=[...((t=e==null?void 0:e._zod.bag)==null?void 0:t.patterns)??[]].pop()??dt(e._zod.bag),e._zod.parse=(r,o)=>{if(n.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),g=s("$ZodStringFormat",(e,n)=>{ee.init(e,n),me.init(e,n)}),jt=s("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=Hn),g.init(e,n)}),Rt=s("$ZodUUID",(e,n)=>{if(n.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(r===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=ve(r))}else n.pattern??(n.pattern=ve());g.init(e,n)}),Ot=s("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=Qn),g.init(e,n)}),St=s("$ZodURL",(e,n)=>{g.init(e,n),e._zod.check=t=>{try{const r=t.value.trim(),o=new URL(r);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(o.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:ut.source,input:t.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:t.value,inst:e,continue:!n.abort})),n.normalize?t.value=o.href:t.value=r;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:e,continue:!n.abort})}}}),Ct=s("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=nt()),g.init(e,n)}),At=s("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=qn),g.init(e,n)}),Nt=s("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=Wn),g.init(e,n)}),Dt=s("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=Jn),g.init(e,n)}),Ft=s("$ZodULID",(e,n)=>{n.pattern??(n.pattern=Yn),g.init(e,n)}),Ut=s("$ZodXID",(e,n)=>{n.pattern??(n.pattern=Kn),g.init(e,n)}),Lt=s("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=Bn),g.init(e,n)}),Vt=s("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=ft(n)),g.init(e,n)}),Gt=s("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=at),g.init(e,n)}),Mt=s("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=lt(n)),g.init(e,n)}),Wt=s("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=Xn),g.init(e,n)}),Jt=s("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=tt),g.init(e,n),e._zod.onattach.push(t=>{const r=t._zod.bag;r.format="ipv4"})}),Yt=s("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=rt),g.init(e,n),e._zod.onattach.push(t=>{const r=t._zod.bag;r.format="ipv6"}),e._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:e,continue:!n.abort})}}}),Kt=s("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=ot),g.init(e,n)}),Bt=s("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=it),g.init(e,n),e._zod.check=t=>{const[r,o]=t.value.split("/");try{if(!o)throw new Error;const i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${r}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:e,continue:!n.abort})}}});function en(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const qt=s("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=ct),g.init(e,n),e._zod.onattach.push(t=>{t._zod.bag.contentEncoding="base64"}),e._zod.check=t=>{en(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:e,continue:!n.abort})}});function Xt(e){if(!Ke.test(e))return!1;const n=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),t=n.padEnd(Math.ceil(n.length/4)*4,"=");return en(t)}const Ht=s("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=Ke),g.init(e,n),e._zod.onattach.push(t=>{t._zod.bag.contentEncoding="base64url"}),e._zod.check=t=>{Xt(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:e,continue:!n.abort})}}),Qt=s("$ZodE164",(e,n)=>{n.pattern??(n.pattern=st),g.init(e,n)});function er(e,n=null){try{const t=e.split(".");if(t.length!==3)return!1;const[r]=t;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||n&&(!("alg"in o)||o.alg!==n))}catch{return!1}}const nr=s("$ZodJWT",(e,n)=>{g.init(e,n),e._zod.check=t=>{er(t.value,n.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:e,continue:!n.abort})}}),nn=s("$ZodNumber",(e,n)=>{b.init(e,n),e._zod.pattern=e._zod.bag.pattern??pt,e._zod.parse=(t,r)=>{if(n.coerce)try{t.value=Number(t.value)}catch{}const o=t.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return t;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),t}}),tr=s("$ZodNumber",(e,n)=>{vt.init(e,n),nn.init(e,n)}),rr=s("$ZodAny",(e,n)=>{b.init(e,n),e._zod.parse=t=>t}),or=s("$ZodUnknown",(e,n)=>{b.init(e,n),e._zod.parse=t=>t}),ir=s("$ZodNever",(e,n)=>{b.init(e,n),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function ze(e,n,t){e.issues.length&&n.issues.push(...Me(t,e.issues)),n.value[t]=e.value}const cr=s("$ZodArray",(e,n)=>{b.init(e,n),e._zod.parse=(t,r)=>{const o=t.value;if(!Array.isArray(o))return t.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),t;t.value=Array(o.length);const i=[];for(let c=0;c<o.length;c++){const u=o[c],a=n.element._zod.run({value:u,issues:[]},r);a instanceof Promise?i.push(a.then(l=>ze(l,t,c))):ze(a,t,c)}return i.length?Promise.all(i).then(()=>t):t}});function B(e,n,t,r){e.issues.length&&n.issues.push(...Me(t,e.issues)),e.value===void 0?t in r&&(n.value[t]=void 0):n.value[t]=e.value}function tn(e){const n=Object.keys(e.shape);for(const r of n)if(!e.shape[r]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const t=Zn(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(t)}}function rn(e,n,t,r,o,i){const c=[],u=o.keySet,a=o.catchall._zod,l=a.def.type;for(const d of Object.keys(n)){if(u.has(d))continue;if(l==="never"){c.push(d);continue}const p=a.run({value:n[d],issues:[]},r);p instanceof Promise?e.push(p.then(m=>B(m,t,d,n))):B(p,t,d,n)}return c.length&&t.issues.push({code:"unrecognized_keys",keys:c,input:n,inst:i}),e.length?Promise.all(e).then(()=>t):t}const ur=s("$ZodObject",(e,n)=>{b.init(e,n);const t=ae(()=>tn(n));_(e._zod,"propValues",()=>{const c=n.shape,u={};for(const a in c){const l=c[a]._zod;if(l.values){u[a]??(u[a]=new Set);for(const d of l.values)u[a].add(d)}}return u});const r=K,o=n.catchall;let i;e._zod.parse=(c,u)=>{i??(i=t.value);const a=c.value;if(!r(a))return c.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),c;c.value={};const l=[],d=i.shape;for(const p of i.keys){const h=d[p]._zod.run({value:a[p],issues:[]},u);h instanceof Promise?l.push(h.then(z=>B(z,c,p,a))):B(h,c,p,a)}return o?rn(l,a,c,u,t.value,e):l.length?Promise.all(l).then(()=>c):c}}),sr=s("$ZodObjectJIT",(e,n)=>{ur.init(e,n);const t=e._zod.parse,r=ae(()=>tn(n)),o=m=>{const h=new Pt(["shape","payload","ctx"]),z=r.value,$=I=>{const Z=ge(I);return`shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`};h.write("const input = payload.value;");const j=Object.create(null);let ne=0;for(const I of z.keys)j[I]=`key_${ne++}`;h.write("const newResult = {}");for(const I of z.keys){const Z=j[I],R=ge(I);h.write(`const ${Z} = ${$(I)};`),h.write(`
4
- if (${Z}.issues.length) {
5
- payload.issues = payload.issues.concat(${Z}.issues.map(iss => ({
6
- ...iss,
7
- path: iss.path ? [${R}, ...iss.path] : [${R}]
8
- })));
9
- }
10
-
11
- if (${Z}.value === undefined) {
12
- if (${R} in input) {
13
- newResult[${R}] = undefined;
14
- }
15
- } else {
16
- newResult[${R}] = ${Z}.value;
17
- }
18
- `)}h.write("payload.value = newResult;"),h.write("return payload;");const te=h.compile();return(I,Z)=>te(m,I,Z)};let i;const c=K,u=!Le.jitless,l=u&&$n.value,d=n.catchall;let p;e._zod.parse=(m,h)=>{p??(p=r.value);const z=m.value;return c(z)?u&&l&&(h==null?void 0:h.async)===!1&&h.jitless!==!0?(i||(i=o(n.shape)),m=i(m,h),d?rn([],z,m,h,p,e):m):t(m,h):(m.issues.push({expected:"object",code:"invalid_type",input:z,inst:e}),m)}});function be(e,n,t,r){for(const i of e)if(i.issues.length===0)return n.value=i.value,n;const o=e.filter(i=>!N(i));return o.length===1?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:t,errors:e.map(i=>i.issues.map(c=>A(c,r,C())))}),n)}const ar=s("$ZodUnion",(e,n)=>{b.init(e,n),_(e._zod,"optin",()=>n.options.some(o=>o._zod.optin==="optional")?"optional":void 0),_(e._zod,"optout",()=>n.options.some(o=>o._zod.optout==="optional")?"optional":void 0),_(e._zod,"values",()=>{if(n.options.every(o=>o._zod.values))return new Set(n.options.flatMap(o=>Array.from(o._zod.values)))}),_(e._zod,"pattern",()=>{if(n.options.every(o=>o._zod.pattern)){const o=n.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>fe(i.source)).join("|")})$`)}});const t=n.options.length===1,r=n.options[0]._zod.run;e._zod.parse=(o,i)=>{if(t)return r(o,i);let c=!1;const u=[];for(const a of n.options){const l=a._zod.run({value:o.value,issues:[]},i);if(l instanceof Promise)u.push(l),c=!0;else{if(l.issues.length===0)return l;u.push(l)}}return c?Promise.all(u).then(a=>be(a,o,e,i)):be(u,o,e,i)}}),lr=s("$ZodIntersection",(e,n)=>{b.init(e,n),e._zod.parse=(t,r)=>{const o=t.value,i=n.left._zod.run({value:o,issues:[]},r),c=n.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||c instanceof Promise?Promise.all([i,c]).then(([a,l])=>we(t,a,l)):we(t,i,c)}});function ce(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(L(e)&&L(n)){const t=Object.keys(n),r=Object.keys(e).filter(i=>t.indexOf(i)!==-1),o={...e,...n};for(const i of r){const c=ce(e[i],n[i]);if(!c.valid)return{valid:!1,mergeErrorPath:[i,...c.mergeErrorPath]};o[i]=c.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let r=0;r<e.length;r++){const o=e[r],i=n[r],c=ce(o,i);if(!c.valid)return{valid:!1,mergeErrorPath:[r,...c.mergeErrorPath]};t.push(c.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function we(e,n,t){if(n.issues.length&&e.issues.push(...n.issues),t.issues.length&&e.issues.push(...t.issues),N(e))return e;const r=ce(n.value,t.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const fr=s("$ZodEnum",(e,n)=>{b.init(e,n);const t=zn(n.entries),r=new Set(t);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.filter(o=>kn.has(typeof o)).map(o=>typeof o=="string"?X(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const c=o.value;return r.has(c)||o.issues.push({code:"invalid_value",values:t,input:c,inst:e}),o}}),dr=s("$ZodTransform",(e,n)=>{b.init(e,n),e._zod.parse=(t,r)=>{if(r.direction==="backward")throw new Ue(e.constructor.name);const o=n.transform(t.value,t);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(t.value=c,t));if(o instanceof Promise)throw new D;return t.value=o,t}});function $e(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const hr=s("$ZodOptional",(e,n)=>{b.init(e,n),e._zod.optin="optional",e._zod.optout="optional",_(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),_(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${fe(t.source)})?$`):void 0}),e._zod.parse=(t,r)=>{if(n.innerType._zod.optin==="optional"){const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(i=>$e(i,t.value)):$e(o,t.value)}return t.value===void 0?t:n.innerType._zod.run(t,r)}}),pr=s("$ZodNullable",(e,n)=>{b.init(e,n),_(e._zod,"optin",()=>n.innerType._zod.optin),_(e._zod,"optout",()=>n.innerType._zod.optout),_(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${fe(t.source)}|null)$`):void 0}),_(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(t,r)=>t.value===null?t:n.innerType._zod.run(t,r)}),mr=s("$ZodDefault",(e,n)=>{b.init(e,n),e._zod.optin="optional",_(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);if(t.value===void 0)return t.value=n.defaultValue,t;const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(i=>ke(i,n)):ke(o,n)}});function ke(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const _r=s("$ZodPrefault",(e,n)=>{b.init(e,n),e._zod.optin="optional",_(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>(r.direction==="backward"||t.value===void 0&&(t.value=n.defaultValue),n.innerType._zod.run(t,r))}),gr=s("$ZodNonOptional",(e,n)=>{b.init(e,n),_(e._zod,"values",()=>{const t=n.innerType._zod.values;return t?new Set([...t].filter(r=>r!==void 0)):void 0}),e._zod.parse=(t,r)=>{const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(i=>Ze(i,e)):Ze(o,e)}});function Ze(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const vr=s("$ZodCatch",(e,n)=>{b.init(e,n),_(e._zod,"optin",()=>n.innerType._zod.optin),_(e._zod,"optout",()=>n.innerType._zod.optout),_(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(i=>(t.value=i.value,i.issues.length&&(t.value=n.catchValue({...t,error:{issues:i.issues.map(c=>A(c,r,C()))},input:t.value}),t.issues=[]),t)):(t.value=o.value,o.issues.length&&(t.value=n.catchValue({...t,error:{issues:o.issues.map(i=>A(i,r,C()))},input:t.value}),t.issues=[]),t)}}),zr=s("$ZodPipe",(e,n)=>{b.init(e,n),_(e._zod,"values",()=>n.in._zod.values),_(e._zod,"optin",()=>n.in._zod.optin),_(e._zod,"optout",()=>n.out._zod.optout),_(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(t,r)=>{if(r.direction==="backward"){const i=n.out._zod.run(t,r);return i instanceof Promise?i.then(c=>W(c,n.in,r)):W(i,n.in,r)}const o=n.in._zod.run(t,r);return o instanceof Promise?o.then(i=>W(i,n.out,r)):W(o,n.out,r)}});function W(e,n,t){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},t)}const br=s("$ZodReadonly",(e,n)=>{b.init(e,n),_(e._zod,"propValues",()=>n.innerType._zod.propValues),_(e._zod,"values",()=>n.innerType._zod.values),_(e._zod,"optin",()=>n.innerType._zod.optin),_(e._zod,"optout",()=>n.innerType._zod.optout),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(ye):ye(o)}});function ye(e){return e.value=Object.freeze(e.value),e}const wr=s("$ZodCustom",(e,n)=>{k.init(e,n),b.init(e,n),e._zod.parse=(t,r)=>t,e._zod.check=t=>{const r=t.value,o=n.fn(r);if(o instanceof Promise)return o.then(i=>Ie(i,t,r,e));Ie(o,t,r,e)}});function Ie(e,n,t,r){if(!e){const o={code:"custom",input:t,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),n.issues.push(V(o))}}class $r{constructor(){this._map=new Map,this._idmap=new Map}add(n,...t){const r=t[0];if(this._map.set(n,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,n)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(n){const t=this._map.get(n);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(n),this}get(n){const t=n._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const o={...r,...this._map.get(n)};return Object.keys(o).length?o:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function kr(){return new $r}const J=kr();function Zr(e,n){return new e({type:"string",...f(n)})}function yr(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...f(n)})}function Ee(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...f(n)})}function Ir(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...f(n)})}function Er(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...f(n)})}function xr(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...f(n)})}function Pr(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...f(n)})}function Tr(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...f(n)})}function jr(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...f(n)})}function Rr(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...f(n)})}function Or(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...f(n)})}function Sr(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...f(n)})}function Cr(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...f(n)})}function Ar(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...f(n)})}function Nr(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...f(n)})}function Dr(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...f(n)})}function Fr(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...f(n)})}function Ur(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...f(n)})}function Lr(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...f(n)})}function Vr(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...f(n)})}function Gr(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...f(n)})}function Mr(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...f(n)})}function Wr(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...f(n)})}function Jr(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...f(n)})}function Yr(e,n){return new e({type:"string",format:"date",check:"string_format",...f(n)})}function Kr(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...f(n)})}function Br(e,n){return new e({type:"string",format:"duration",check:"string_format",...f(n)})}function qr(e,n){return new e({type:"number",checks:[],...f(n)})}function Xr(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...f(n)})}function Hr(e){return new e({type:"any"})}function Qr(e){return new e({type:"unknown"})}function eo(e,n){return new e({type:"never",...f(n)})}function xe(e,n){return new He({check:"less_than",...f(n),value:e,inclusive:!1})}function re(e,n){return new He({check:"less_than",...f(n),value:e,inclusive:!0})}function Pe(e,n){return new Qe({check:"greater_than",...f(n),value:e,inclusive:!1})}function oe(e,n){return new Qe({check:"greater_than",...f(n),value:e,inclusive:!0})}function Te(e,n){return new gt({check:"multiple_of",...f(n),value:e})}function on(e,n){return new zt({check:"max_length",...f(n),maximum:e})}function q(e,n){return new bt({check:"min_length",...f(n),minimum:e})}function cn(e,n){return new wt({check:"length_equals",...f(n),length:e})}function no(e,n){return new $t({check:"string_format",format:"regex",...f(n),pattern:e})}function to(e){return new kt({check:"string_format",format:"lowercase",...f(e)})}function ro(e){return new Zt({check:"string_format",format:"uppercase",...f(e)})}function oo(e,n){return new yt({check:"string_format",format:"includes",...f(n),includes:e})}function io(e,n){return new It({check:"string_format",format:"starts_with",...f(n),prefix:e})}function co(e,n){return new Et({check:"string_format",format:"ends_with",...f(n),suffix:e})}function G(e){return new xt({check:"overwrite",tx:e})}function uo(e){return G(n=>n.normalize(e))}function so(){return G(e=>e.trim())}function ao(){return G(e=>e.toLowerCase())}function lo(){return G(e=>e.toUpperCase())}function fo(e,n,t){return new e({type:"array",element:n,...f(t)})}function ho(e,n,t){return new e({type:"custom",check:"custom",fn:n,...f(t)})}function po(e){const n=mo(t=>(t.addIssue=r=>{if(typeof r=="string")t.issues.push(V(r,t.value,n._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=t.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),t.issues.push(V(o))}},e(t.value,t)));return n}function mo(e,n){const t=new k({check:"custom",...f(n)});return t._zod.check=e,t}const _o=s("ZodISODateTime",(e,n)=>{Vt.init(e,n),v.init(e,n)});function go(e){return Jr(_o,e)}const vo=s("ZodISODate",(e,n)=>{Gt.init(e,n),v.init(e,n)});function zo(e){return Yr(vo,e)}const bo=s("ZodISOTime",(e,n)=>{Mt.init(e,n),v.init(e,n)});function wo(e){return Kr(bo,e)}const $o=s("ZodISODuration",(e,n)=>{Wt.init(e,n),v.init(e,n)});function ko(e){return Br($o,e)}const Zo=(e,n)=>{Je.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>Sn(e,t)},flatten:{value:t=>On(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ie,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ie,2)}},isEmpty:{get(){return e.issues.length===0}}})},y=s("ZodError",Zo,{Parent:Error}),yo=he(y),Io=pe(y),Eo=H(y),xo=Q(y),Po=Nn(y),To=Dn(y),jo=Fn(y),Ro=Un(y),Oo=Ln(y),So=Vn(y),Co=Gn(y),Ao=Mn(y),w=s("ZodType",(e,n)=>(b.init(e,n),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...t)=>e.clone({...n,checks:[...n.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(t,r)=>T(e,t,r),e.brand=()=>e,e.register=((t,r)=>(t.add(e,r),e)),e.parse=(t,r)=>yo(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>Eo(e,t,r),e.parseAsync=async(t,r)=>Io(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>xo(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Po(e,t,r),e.decode=(t,r)=>To(e,t,r),e.encodeAsync=async(t,r)=>jo(e,t,r),e.decodeAsync=async(t,r)=>Ro(e,t,r),e.safeEncode=(t,r)=>Oo(e,t,r),e.safeDecode=(t,r)=>So(e,t,r),e.safeEncodeAsync=async(t,r)=>Co(e,t,r),e.safeDecodeAsync=async(t,r)=>Ao(e,t,r),e.refine=(t,r)=>e.check(xi(t,r)),e.superRefine=t=>e.check(Pi(t)),e.overwrite=t=>e.check(G(t)),e.optional=()=>Ae(e),e.nullable=()=>Ne(e),e.nullish=()=>Ae(Ne(e)),e.nonoptional=t=>wi(e,t),e.array=()=>ui(e),e.or=t=>li([e,t]),e.and=t=>di(e,t),e.transform=t=>De(e,mi(t)),e.default=t=>vi(e,t),e.prefault=t=>bi(e,t),e.catch=t=>ki(e,t),e.pipe=t=>De(e,t),e.readonly=()=>Ii(e),e.describe=t=>{const r=e.clone();return J.add(r,{description:t}),r},Object.defineProperty(e,"description",{get(){var t;return(t=J.get(e))==null?void 0:t.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return J.get(e);const r=e.clone();return J.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),un=s("_ZodString",(e,n)=>{me.init(e,n),w.init(e,n);const t=e._zod.bag;e.format=t.format??null,e.minLength=t.minimum??null,e.maxLength=t.maximum??null,e.regex=(...r)=>e.check(no(...r)),e.includes=(...r)=>e.check(oo(...r)),e.startsWith=(...r)=>e.check(io(...r)),e.endsWith=(...r)=>e.check(co(...r)),e.min=(...r)=>e.check(q(...r)),e.max=(...r)=>e.check(on(...r)),e.length=(...r)=>e.check(cn(...r)),e.nonempty=(...r)=>e.check(q(1,...r)),e.lowercase=r=>e.check(to(r)),e.uppercase=r=>e.check(ro(r)),e.trim=()=>e.check(so()),e.normalize=(...r)=>e.check(uo(...r)),e.toLowerCase=()=>e.check(ao()),e.toUpperCase=()=>e.check(lo())}),No=s("ZodString",(e,n)=>{me.init(e,n),un.init(e,n),e.email=t=>e.check(yr(Do,t)),e.url=t=>e.check(Tr(Fo,t)),e.jwt=t=>e.check(Wr(ei,t)),e.emoji=t=>e.check(jr(Uo,t)),e.guid=t=>e.check(Ee(je,t)),e.uuid=t=>e.check(Ir(Y,t)),e.uuidv4=t=>e.check(Er(Y,t)),e.uuidv6=t=>e.check(xr(Y,t)),e.uuidv7=t=>e.check(Pr(Y,t)),e.nanoid=t=>e.check(Rr(Lo,t)),e.guid=t=>e.check(Ee(je,t)),e.cuid=t=>e.check(Or(Vo,t)),e.cuid2=t=>e.check(Sr(Go,t)),e.ulid=t=>e.check(Cr(Mo,t)),e.base64=t=>e.check(Vr(Xo,t)),e.base64url=t=>e.check(Gr(Ho,t)),e.xid=t=>e.check(Ar(Wo,t)),e.ksuid=t=>e.check(Nr(Jo,t)),e.ipv4=t=>e.check(Dr(Yo,t)),e.ipv6=t=>e.check(Fr(Ko,t)),e.cidrv4=t=>e.check(Ur(Bo,t)),e.cidrv6=t=>e.check(Lr(qo,t)),e.e164=t=>e.check(Mr(Qo,t)),e.datetime=t=>e.check(go(t)),e.date=t=>e.check(zo(t)),e.time=t=>e.check(wo(t)),e.duration=t=>e.check(ko(t))});function x(e){return Zr(No,e)}const v=s("ZodStringFormat",(e,n)=>{g.init(e,n),un.init(e,n)}),Do=s("ZodEmail",(e,n)=>{Ot.init(e,n),v.init(e,n)}),je=s("ZodGUID",(e,n)=>{jt.init(e,n),v.init(e,n)}),Y=s("ZodUUID",(e,n)=>{Rt.init(e,n),v.init(e,n)}),Fo=s("ZodURL",(e,n)=>{St.init(e,n),v.init(e,n)}),Uo=s("ZodEmoji",(e,n)=>{Ct.init(e,n),v.init(e,n)}),Lo=s("ZodNanoID",(e,n)=>{At.init(e,n),v.init(e,n)}),Vo=s("ZodCUID",(e,n)=>{Nt.init(e,n),v.init(e,n)}),Go=s("ZodCUID2",(e,n)=>{Dt.init(e,n),v.init(e,n)}),Mo=s("ZodULID",(e,n)=>{Ft.init(e,n),v.init(e,n)}),Wo=s("ZodXID",(e,n)=>{Ut.init(e,n),v.init(e,n)}),Jo=s("ZodKSUID",(e,n)=>{Lt.init(e,n),v.init(e,n)}),Yo=s("ZodIPv4",(e,n)=>{Jt.init(e,n),v.init(e,n)}),Ko=s("ZodIPv6",(e,n)=>{Yt.init(e,n),v.init(e,n)}),Bo=s("ZodCIDRv4",(e,n)=>{Kt.init(e,n),v.init(e,n)}),qo=s("ZodCIDRv6",(e,n)=>{Bt.init(e,n),v.init(e,n)}),Xo=s("ZodBase64",(e,n)=>{qt.init(e,n),v.init(e,n)}),Ho=s("ZodBase64URL",(e,n)=>{Ht.init(e,n),v.init(e,n)}),Qo=s("ZodE164",(e,n)=>{Qt.init(e,n),v.init(e,n)}),ei=s("ZodJWT",(e,n)=>{nr.init(e,n),v.init(e,n)}),sn=s("ZodNumber",(e,n)=>{nn.init(e,n),w.init(e,n),e.gt=(r,o)=>e.check(Pe(r,o)),e.gte=(r,o)=>e.check(oe(r,o)),e.min=(r,o)=>e.check(oe(r,o)),e.lt=(r,o)=>e.check(xe(r,o)),e.lte=(r,o)=>e.check(re(r,o)),e.max=(r,o)=>e.check(re(r,o)),e.int=r=>e.check(Oe(r)),e.safe=r=>e.check(Oe(r)),e.positive=r=>e.check(Pe(0,r)),e.nonnegative=r=>e.check(oe(0,r)),e.negative=r=>e.check(xe(0,r)),e.nonpositive=r=>e.check(re(0,r)),e.multipleOf=(r,o)=>e.check(Te(r,o)),e.step=(r,o)=>e.check(Te(r,o)),e.finite=()=>e;const t=e._zod.bag;e.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),e.isFinite=!0,e.format=t.format??null});function Re(e){return qr(sn,e)}const ni=s("ZodNumberFormat",(e,n)=>{tr.init(e,n),sn.init(e,n)});function Oe(e){return Xr(ni,e)}const ti=s("ZodAny",(e,n)=>{rr.init(e,n),w.init(e,n)});function Se(){return Hr(ti)}const ri=s("ZodUnknown",(e,n)=>{or.init(e,n),w.init(e,n)});function Ce(){return Qr(ri)}const oi=s("ZodNever",(e,n)=>{ir.init(e,n),w.init(e,n)});function ii(e){return eo(oi,e)}const ci=s("ZodArray",(e,n)=>{cr.init(e,n),w.init(e,n),e.element=n.element,e.min=(t,r)=>e.check(q(t,r)),e.nonempty=t=>e.check(q(1,t)),e.max=(t,r)=>e.check(on(t,r)),e.length=(t,r)=>e.check(cn(t,r)),e.unwrap=()=>e.element});function ui(e,n){return fo(ci,e,n)}const si=s("ZodObject",(e,n)=>{sr.init(e,n),w.init(e,n),_(e,"shape",()=>n.shape),e.keyof=()=>hi(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ce()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ce()}),e.strict=()=>e.clone({...e._zod.def,catchall:ii()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>xn(e,t),e.safeExtend=t=>Pn(e,t),e.merge=t=>Tn(e,t),e.pick=t=>In(e,t),e.omit=t=>En(e,t),e.partial=(...t)=>jn(an,e,t[0]),e.required=(...t)=>Rn(ln,e,t[0])});function ue(e,n){const t={type:"object",get shape(){return P(this,"shape",e?wn(e):{}),this.shape},...f(n)};return new si(t)}const ai=s("ZodUnion",(e,n)=>{ar.init(e,n),w.init(e,n),e.options=n.options});function li(e,n){return new ai({type:"union",options:e,...f(n)})}const fi=s("ZodIntersection",(e,n)=>{lr.init(e,n),w.init(e,n)});function di(e,n){return new fi({type:"intersection",left:e,right:n})}const se=s("ZodEnum",(e,n)=>{fr.init(e,n),w.init(e,n),e.enum=n.entries,e.options=Object.values(n.entries);const t=new Set(Object.keys(n.entries));e.extract=(r,o)=>{const i={};for(const c of r)if(t.has(c))i[c]=n.entries[c];else throw new Error(`Key ${c} not found in enum`);return new se({...n,checks:[],...f(o),entries:i})},e.exclude=(r,o)=>{const i={...n.entries};for(const c of r)if(t.has(c))delete i[c];else throw new Error(`Key ${c} not found in enum`);return new se({...n,checks:[],...f(o),entries:i})}});function hi(e,n){const t=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new se({type:"enum",entries:t,...f(n)})}const pi=s("ZodTransform",(e,n)=>{dr.init(e,n),w.init(e,n),e._zod.parse=(t,r)=>{if(r.direction==="backward")throw new Ue(e.constructor.name);t.addIssue=i=>{if(typeof i=="string")t.issues.push(V(i,t.value,n));else{const c=i;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=t.value),c.inst??(c.inst=e),t.issues.push(V(c))}};const o=n.transform(t.value,t);return o instanceof Promise?o.then(i=>(t.value=i,t)):(t.value=o,t)}});function mi(e){return new pi({type:"transform",transform:e})}const an=s("ZodOptional",(e,n)=>{hr.init(e,n),w.init(e,n),e.unwrap=()=>e._zod.def.innerType});function Ae(e){return new an({type:"optional",innerType:e})}const _i=s("ZodNullable",(e,n)=>{pr.init(e,n),w.init(e,n),e.unwrap=()=>e._zod.def.innerType});function Ne(e){return new _i({type:"nullable",innerType:e})}const gi=s("ZodDefault",(e,n)=>{mr.init(e,n),w.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function vi(e,n){return new gi({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():Ge(n)}})}const zi=s("ZodPrefault",(e,n)=>{_r.init(e,n),w.init(e,n),e.unwrap=()=>e._zod.def.innerType});function bi(e,n){return new zi({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():Ge(n)}})}const ln=s("ZodNonOptional",(e,n)=>{gr.init(e,n),w.init(e,n),e.unwrap=()=>e._zod.def.innerType});function wi(e,n){return new ln({type:"nonoptional",innerType:e,...f(n)})}const $i=s("ZodCatch",(e,n)=>{vr.init(e,n),w.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ki(e,n){return new $i({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const Zi=s("ZodPipe",(e,n)=>{zr.init(e,n),w.init(e,n),e.in=n.in,e.out=n.out});function De(e,n){return new Zi({type:"pipe",in:e,out:n})}const yi=s("ZodReadonly",(e,n)=>{br.init(e,n),w.init(e,n),e.unwrap=()=>e._zod.def.innerType});function Ii(e){return new yi({type:"readonly",innerType:e})}const Ei=s("ZodCustom",(e,n)=>{wr.init(e,n),w.init(e,n)});function xi(e,n={}){return ho(Ei,e,n)}function Pi(e){return po(e)}const E=({name:e,extension:n,entityId:t,prefixe:r,bucketFolder:o,uploadUrl:i})=>`${i}/${o}/${t}/${e}-${r}.${n}`,fn=(e,n)=>{try{return ue({altRU:x().optional().nullable(),altEN:x().optional().nullable(),name:x(),originalFileExtension:x(),fileExtensions:x().array()}).parse(e),!0}catch(t){return n({error:t}),!1}},Ti=({images:e,bucketFolder:n,uploadUrl:t,getError:r})=>{if(!e)return[];try{const o=JSON.parse(e);return Array.isArray(o)?o.map(c=>{if(!fn(c,r))return null;const u=c.originalFileExtension==="png"?"image/png":"image/jpeg",a=c.fileExtensions[0],l=c.fileExtensions[1],d=U(c.prefixes,"1hd"),p=U(c.prefixes,"2hd"),m=U(c.prefixes,"0.5hd"),h=U(c.prefixes,"1hd"),z=E({name:c.name,extension:l,entityId:c.entityId,prefixe:d,bucketFolder:n,uploadUrl:t}),$=E({name:c.name,extension:a,entityId:c.entityId,prefixe:d,bucketFolder:n,uploadUrl:t}),j=E({name:c.name,extension:l,entityId:c.entityId,prefixe:p,bucketFolder:n,uploadUrl:t}),ne=E({name:c.name,extension:a,entityId:c.entityId,prefixe:p,bucketFolder:n,uploadUrl:t}),te=E({name:c.name,extension:l,entityId:c.entityId,prefixe:m,bucketFolder:n,uploadUrl:t}),I=E({name:c.name,extension:a,entityId:c.entityId,prefixe:m,bucketFolder:n,uploadUrl:t}),Z=E({name:c.name,extension:l,entityId:c.entityId,prefixe:h,bucketFolder:n,uploadUrl:t}),R=E({name:c.name,extension:a,entityId:c.entityId,prefixe:h,bucketFolder:n,uploadUrl:t});return{image1x:z,image2x:j,image1xWebp:$,image2xWebp:ne,mobileImage1x:te,mobileImage2x:Z,mobileImage1xWebp:I,mobileImage2xWebp:R,altRU:c.altRU,altEN:c.altEN,type:u}}).filter(c=>!!c):[]}catch(o){return r({error:o}),[]}},U=(e,n)=>{switch(n){case"original":return e[0]??"";case"0.25hd":return e[1]??"";case"0.5hd":return e[2]??"";case"1hd":return e[3]??"";case"2hd":return e[4]??"";case"4hd":return e[5]??""}},ji=ue({statusCode:Re().optional(),message:x().optional().nullable(),messages:x().array().optional().nullable(),data:Se().optional().nullable(),error:ue({statusCode:Re(),message:x().optional().nullable(),messages:x().array().optional().nullable()}).optional().nullable(),response:Se().optional().nullable()}),Ri=({imgProps:e,image1x:n,image2x:t,image1xWebp:r,image2xWebp:o,mobileImage1x:i,mobileImage2x:c,mobileImage1xWebp:u,mobileImage2xWebp:a,type:l,alt:d,bgColorClass:p,mobileMaxWidth:m=450,loading:h="lazy",...z})=>O.jsxRuntimeExports.jsxs("picture",{...z,children:[i&&O.jsxRuntimeExports.jsx("source",{srcSet:`${i} 1x${c?`, ${c} 2x`:""}`,media:`(max-width: ${m}px)`,type:l}),u&&O.jsxRuntimeExports.jsx("source",{srcSet:`${u} 1x${a?`, ${a} 2x`:""}`,media:`(max-width: ${m}px)`,type:"image/webp"}),r&&O.jsxRuntimeExports.jsx("source",{srcSet:`${r} 1x${o?`, ${o} 2x`:""}`,type:"image/webp"}),O.jsxRuntimeExports.jsx("source",{srcSet:`${n} 1x${t?`, ${t} 2x`:""}`,type:l}),O.jsxRuntimeExports.jsx("img",{...e,className:O.cn(p,e==null?void 0:e.className),src:r||n,alt:d,loading:h})]});exports.BasePicture=Ri;exports.checkCorrectImageObject=fn;exports.convertPhoneMask=hn;exports.generatePaginationArray=vn;exports.getByKey=Fe;exports.getImagePrefix=U;exports.getNumberFormatter=dn;exports.getSubdomain=pn;exports.getUploadImageUrl=E;exports.parseStringToKeyValue=_n;exports.prepareColor=gn;exports.prepareLocalMetaData=mn;exports.prepareServerImages=Ti;exports.responseSchema=ji;exports.updateTextByTemplate=S;