@superbright/indexeddb-orm 1.0.43 → 1.0.44
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/api/response-schemas.generated.cjs +2 -0
- package/dist/api/response-schemas.generated.cjs.map +1 -0
- package/dist/api/response-schemas.generated.d.ts +4511 -0
- package/dist/api/response-schemas.generated.mjs +270 -0
- package/dist/api/response-schemas.generated.mjs.map +1 -0
- package/dist/api/schemas.generated.cjs +2 -0
- package/dist/api/schemas.generated.cjs.map +1 -0
- package/dist/api/schemas.generated.d.ts +1818 -0
- package/dist/api/schemas.generated.mjs +287 -0
- package/dist/api/schemas.generated.mjs.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.cjs +1 -1
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.cjs.map +1 -1
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.mjs +104 -103
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.mjs.map +1 -1
- package/dist/response-schemas.cjs +2 -0
- package/dist/response-schemas.cjs.map +1 -0
- package/dist/response-schemas.d.ts +1 -0
- package/dist/response-schemas.mjs +36 -0
- package/dist/response-schemas.mjs.map +1 -0
- package/dist/schemas.cjs +2 -0
- package/dist/schemas.cjs.map +1 -0
- package/dist/schemas.d.ts +1 -0
- package/dist/schemas.mjs +37 -0
- package/dist/schemas.mjs.map +1 -0
- package/dist/types/api.generated.d.ts +8691 -0
- package/dist/types/types.generated.d.ts +8576 -0
- package/package.json +42 -21
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { object as a, enum as n, record as s, string as o, array as e, number as t, lazy as l, boolean as r, unknown as m } from "../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.mjs";
|
|
2
|
+
const U = a({
|
|
3
|
+
Highlights: n(["GOOD_VIEW", "BAD_VIEW"]).optional(),
|
|
4
|
+
highlightsOptMapping: s(o(), e(o())).optional(),
|
|
5
|
+
nearBuilding: n(["GOOD_VIEW", "BAD_VIEW"]).optional(),
|
|
6
|
+
nearNeighbourhood: n(["GOOD_VIEW", "BAD_VIEW"]).optional()
|
|
7
|
+
}), u = a({
|
|
8
|
+
id: t().optional(),
|
|
9
|
+
email: o().optional(),
|
|
10
|
+
first_name: o().optional(),
|
|
11
|
+
last_name: o().optional(),
|
|
12
|
+
role: n(["USER", "ADMIN"]).optional()
|
|
13
|
+
}), i = a({
|
|
14
|
+
id: t().optional(),
|
|
15
|
+
description: o().optional(),
|
|
16
|
+
url: o().optional(),
|
|
17
|
+
mediaType: n(["image", "video"]).optional(),
|
|
18
|
+
signedUrl: o().optional()
|
|
19
|
+
}), c = a({
|
|
20
|
+
id: t().optional(),
|
|
21
|
+
name: o().optional(),
|
|
22
|
+
order: t().optional(),
|
|
23
|
+
cameras: t().optional(),
|
|
24
|
+
floorPlan: l(() => p).optional()
|
|
25
|
+
}), d = a({
|
|
26
|
+
id: t().optional(),
|
|
27
|
+
name: o().optional(),
|
|
28
|
+
description: o().optional(),
|
|
29
|
+
thumbnail: i.optional()
|
|
30
|
+
}), g = a({
|
|
31
|
+
id: t().optional(),
|
|
32
|
+
floorPlanId: t().optional(),
|
|
33
|
+
floorPlan: l(() => p).optional(),
|
|
34
|
+
styleId: t().optional(),
|
|
35
|
+
style: d.optional(),
|
|
36
|
+
status: n(["UN_RENDERED", "RENDERING", "RENDERED", "FAILED"]).optional()
|
|
37
|
+
}), p = a({
|
|
38
|
+
id: t().optional(),
|
|
39
|
+
name: o().optional(),
|
|
40
|
+
description: o().optional(),
|
|
41
|
+
blenderVersion: o().optional(),
|
|
42
|
+
inresiVersion: o().optional(),
|
|
43
|
+
blenderFile: i.optional(),
|
|
44
|
+
properties: e(l(() => y)).optional(),
|
|
45
|
+
customer: u.optional(),
|
|
46
|
+
rooms: e(l(() => c)).optional(),
|
|
47
|
+
styles: e(l(() => g)).optional()
|
|
48
|
+
}), y = a({
|
|
49
|
+
id: t().optional(),
|
|
50
|
+
name: o().optional(),
|
|
51
|
+
description: o().optional(),
|
|
52
|
+
address: o().optional(),
|
|
53
|
+
address_city: o().optional(),
|
|
54
|
+
address_state: o().optional(),
|
|
55
|
+
address_zip: o().optional(),
|
|
56
|
+
address_country: o().optional(),
|
|
57
|
+
latitude: t().optional(),
|
|
58
|
+
longitude: t().optional(),
|
|
59
|
+
thumbnail: i.optional(),
|
|
60
|
+
floorPlanId: t().optional(),
|
|
61
|
+
floorPlan: l(() => p).optional()
|
|
62
|
+
}), b = a({
|
|
63
|
+
id: t().optional(),
|
|
64
|
+
title: o().optional(),
|
|
65
|
+
unitId: t().optional(),
|
|
66
|
+
unit: l(() => S).optional()
|
|
67
|
+
}), h = a({
|
|
68
|
+
id: t().optional(),
|
|
69
|
+
floorPlanData: i.optional(),
|
|
70
|
+
floorPlanExtentsData: i.optional(),
|
|
71
|
+
floorPlanImageData: i.optional(),
|
|
72
|
+
colorfulFloorPlanImage: i.optional(),
|
|
73
|
+
renders: i.optional(),
|
|
74
|
+
unitId: t().optional(),
|
|
75
|
+
floorPlanId: t().optional(),
|
|
76
|
+
floorPlan: p.optional(),
|
|
77
|
+
styleId: t().optional(),
|
|
78
|
+
style: d.optional(),
|
|
79
|
+
visibleOnWebsite: r().optional(),
|
|
80
|
+
stillRenders: e(i).optional()
|
|
81
|
+
}), S = a({
|
|
82
|
+
id: t().optional(),
|
|
83
|
+
name: o().optional(),
|
|
84
|
+
date_availability: o().optional(),
|
|
85
|
+
slug: o().optional(),
|
|
86
|
+
qty_bedrooms: t().optional(),
|
|
87
|
+
qty_bathrooms: t().optional(),
|
|
88
|
+
base_price: t().optional(),
|
|
89
|
+
dim_sq_ft: t().optional(),
|
|
90
|
+
userId: t().optional(),
|
|
91
|
+
user: u.optional(),
|
|
92
|
+
propertyId: t().optional(),
|
|
93
|
+
property: y.optional(),
|
|
94
|
+
amenities: e(l(() => b)).optional(),
|
|
95
|
+
renderedStyle: e(h).optional(),
|
|
96
|
+
video: i.optional(),
|
|
97
|
+
videoThumbnail: i.optional(),
|
|
98
|
+
embedGif: i.optional(),
|
|
99
|
+
thumbnail: i.optional(),
|
|
100
|
+
floorPlanId: t().optional(),
|
|
101
|
+
floorPlan: p.optional()
|
|
102
|
+
}), R = a({
|
|
103
|
+
id: t().optional(),
|
|
104
|
+
unitId: t().optional(),
|
|
105
|
+
visibleOnWebsite: r().optional(),
|
|
106
|
+
unit: S.optional(),
|
|
107
|
+
renderedStyleId: t().optional(),
|
|
108
|
+
renderedStyle: h.optional(),
|
|
109
|
+
stillRenders: e(i).optional()
|
|
110
|
+
}), D = a({
|
|
111
|
+
id: t().optional(),
|
|
112
|
+
floorPlanId: t().optional(),
|
|
113
|
+
floorPlan: p.optional(),
|
|
114
|
+
roomId: t().optional(),
|
|
115
|
+
room: c.optional(),
|
|
116
|
+
furnitureId: t().optional(),
|
|
117
|
+
furniture: c.optional(),
|
|
118
|
+
styleId: t().optional(),
|
|
119
|
+
style: d.optional()
|
|
120
|
+
}), T = a({
|
|
121
|
+
id: t().optional(),
|
|
122
|
+
name: o().optional(),
|
|
123
|
+
category: o().optional(),
|
|
124
|
+
width: o().optional(),
|
|
125
|
+
depth: o().optional(),
|
|
126
|
+
height: o().optional(),
|
|
127
|
+
availability: n(["IN_STOCK", "OUT_OF_STOCK"]).optional(),
|
|
128
|
+
price: o().optional(),
|
|
129
|
+
currency: n(["USD", "EUR"]).optional(),
|
|
130
|
+
brand_name: o().optional(),
|
|
131
|
+
store_name: o().optional(),
|
|
132
|
+
media: i.optional(),
|
|
133
|
+
styles: e(d).optional()
|
|
134
|
+
}), O = a({
|
|
135
|
+
uploadUrl: o().optional(),
|
|
136
|
+
uploadFileKey: o().optional()
|
|
137
|
+
}), E = a({}), f = a({
|
|
138
|
+
id: t(),
|
|
139
|
+
type: n(["Hyly", "GoogleAnalytics", "Mits", "Yardi", "Engrain"]),
|
|
140
|
+
isActive: r(),
|
|
141
|
+
config: E.optional()
|
|
142
|
+
}), F = a({
|
|
143
|
+
externalServices: e(f)
|
|
144
|
+
}), N = a({
|
|
145
|
+
code: t().optional(),
|
|
146
|
+
message: o().optional()
|
|
147
|
+
}), W = a({
|
|
148
|
+
error: a({
|
|
149
|
+
message: o().optional()
|
|
150
|
+
}).optional()
|
|
151
|
+
}), A = a({
|
|
152
|
+
type: n(["contact", "share", "subscribe"]),
|
|
153
|
+
date: o(),
|
|
154
|
+
unitId: t().optional(),
|
|
155
|
+
unitName: o().optional(),
|
|
156
|
+
unitSlug: o().optional()
|
|
157
|
+
}), P = a({
|
|
158
|
+
userId: t(),
|
|
159
|
+
email: o(),
|
|
160
|
+
latestActivity: A,
|
|
161
|
+
visitorFilter: e(o())
|
|
162
|
+
}), I = a({
|
|
163
|
+
totalRecords: t(),
|
|
164
|
+
totalPages: t(),
|
|
165
|
+
currentPage: t(),
|
|
166
|
+
perPage: t()
|
|
167
|
+
}), B = a({
|
|
168
|
+
data: a({
|
|
169
|
+
data: e(P),
|
|
170
|
+
page: I
|
|
171
|
+
})
|
|
172
|
+
}), _ = a({
|
|
173
|
+
type: n(["contact", "share", "subscribe"]),
|
|
174
|
+
date: o(),
|
|
175
|
+
unitId: t().optional(),
|
|
176
|
+
unitName: o().optional(),
|
|
177
|
+
unitSlug: o().optional()
|
|
178
|
+
}), L = a({
|
|
179
|
+
data: a({
|
|
180
|
+
data: e(_),
|
|
181
|
+
page: I
|
|
182
|
+
})
|
|
183
|
+
}), V = a({
|
|
184
|
+
data: a({
|
|
185
|
+
availability: e(o()),
|
|
186
|
+
bedrooms: e(o()),
|
|
187
|
+
budget: e(o()),
|
|
188
|
+
preferences: e(o()),
|
|
189
|
+
mostRecentContact: a({
|
|
190
|
+
date: o()
|
|
191
|
+
}),
|
|
192
|
+
favoriteUnits: e(a({
|
|
193
|
+
id: t(),
|
|
194
|
+
slug: o(),
|
|
195
|
+
name: o()
|
|
196
|
+
}))
|
|
197
|
+
})
|
|
198
|
+
}), x = a({
|
|
199
|
+
id: t(),
|
|
200
|
+
title: o(),
|
|
201
|
+
propertyId: t()
|
|
202
|
+
}), q = a({
|
|
203
|
+
id: t(),
|
|
204
|
+
title: o(),
|
|
205
|
+
propertyId: t()
|
|
206
|
+
}), G = a({
|
|
207
|
+
id: t(),
|
|
208
|
+
type: o(),
|
|
209
|
+
propertyId: t(),
|
|
210
|
+
createdAt: o(),
|
|
211
|
+
isActive: r(),
|
|
212
|
+
parameters: o().optional(),
|
|
213
|
+
config: s(o(), m())
|
|
214
|
+
}), C = a({
|
|
215
|
+
id: t(),
|
|
216
|
+
queueId: t(),
|
|
217
|
+
floorPlanId: t(),
|
|
218
|
+
styleId: t(),
|
|
219
|
+
status: o(),
|
|
220
|
+
startedByUserId: t().optional(),
|
|
221
|
+
startedByUserEmail: o().optional(),
|
|
222
|
+
version: t().optional(),
|
|
223
|
+
createdAt: o(),
|
|
224
|
+
updatedAt: o(),
|
|
225
|
+
startedAt: o().optional(),
|
|
226
|
+
finishedAt: o().optional(),
|
|
227
|
+
data: s(o(), m()),
|
|
228
|
+
logsFileId: t().optional()
|
|
229
|
+
}), M = a({
|
|
230
|
+
id: t(),
|
|
231
|
+
queueId: t(),
|
|
232
|
+
parentId: t(),
|
|
233
|
+
status: o(),
|
|
234
|
+
startedByUserId: t().optional(),
|
|
235
|
+
startedByUserEmail: o().optional(),
|
|
236
|
+
createdAt: o(),
|
|
237
|
+
updatedAt: o(),
|
|
238
|
+
startedAt: o().optional(),
|
|
239
|
+
finishedAt: o().optional(),
|
|
240
|
+
data: s(o(), m()),
|
|
241
|
+
logsFileId: t().optional()
|
|
242
|
+
}), k = a({
|
|
243
|
+
id: t(),
|
|
244
|
+
accountId: t(),
|
|
245
|
+
name: o(),
|
|
246
|
+
url: o(),
|
|
247
|
+
secret: o(),
|
|
248
|
+
isActive: r(),
|
|
249
|
+
createdAt: o(),
|
|
250
|
+
updatedAt: o()
|
|
251
|
+
});
|
|
252
|
+
export {
|
|
253
|
+
U as EmbedEnumsSchema,
|
|
254
|
+
N as ErrorSchema,
|
|
255
|
+
W as ErrorUnprocessableEntitySchema,
|
|
256
|
+
E as ExternalServiceConfigSchema,
|
|
257
|
+
f as ExternalServiceUpdateSchema,
|
|
258
|
+
G as ExternalServicesSchema,
|
|
259
|
+
F as ExternalServicesUpdateRequestSchema,
|
|
260
|
+
p as FloorPlanSchema,
|
|
261
|
+
g as FloorplanStylesSchema,
|
|
262
|
+
D as FurnitureInRoomsSchema,
|
|
263
|
+
T as FurnitureSchema,
|
|
264
|
+
L as LeadActivitiesResponseSchema,
|
|
265
|
+
_ as LeadActivityItemSchema,
|
|
266
|
+
A as LeadActivitySchema,
|
|
267
|
+
V as LeadDetailsResponseSchema,
|
|
268
|
+
P as LeadSchema,
|
|
269
|
+
B as LeadsListResponseSchema,
|
|
270
|
+
i as MediaSchema,
|
|
271
|
+
I as PaginationSchema,
|
|
272
|
+
x as PropertyAmenitySchema,
|
|
273
|
+
q as PropertyHighlightSchema,
|
|
274
|
+
y as PropertySchema,
|
|
275
|
+
M as QueueJobSchema,
|
|
276
|
+
C as RenderJobSchema,
|
|
277
|
+
h as RenderedStyleSchema,
|
|
278
|
+
c as RoomSchema,
|
|
279
|
+
d as StyleSchema,
|
|
280
|
+
b as UnitAmenitySchema,
|
|
281
|
+
R as UnitRenderedStyleSchema,
|
|
282
|
+
S as UnitSchema,
|
|
283
|
+
O as UploadUrlSchema,
|
|
284
|
+
u as UserSchema,
|
|
285
|
+
k as UserWebhookSchema
|
|
286
|
+
};
|
|
287
|
+
//# sourceMappingURL=schemas.generated.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.generated.mjs","sources":["../../src/api/schemas.generated.ts"],"sourcesContent":["/**\n * This file was auto-generated from openapi.json.\n * Do not edit manually — run `pnpm gen:zod` to regenerate.\n */\n\nimport { z } from 'zod';\n\nexport const EmbedEnumsSchema = z.object({\n Highlights: z.enum([\"GOOD_VIEW\", \"BAD_VIEW\"]).optional(),\n highlightsOptMapping: z.record(z.string(), z.array(z.string())).optional(),\n nearBuilding: z.enum([\"GOOD_VIEW\", \"BAD_VIEW\"]).optional(),\n nearNeighbourhood: z.enum([\"GOOD_VIEW\", \"BAD_VIEW\"]).optional(),\n });\nexport type EmbedEnums = z.infer<typeof EmbedEnumsSchema>;\n\nexport const UserSchema = z.object({\n id: z.number().optional(),\n email: z.string().optional(),\n first_name: z.string().optional(),\n last_name: z.string().optional(),\n role: z.enum([\"USER\", \"ADMIN\"]).optional(),\n });\nexport type User = z.infer<typeof UserSchema>;\n\nexport const MediaSchema = z.object({\n id: z.number().optional(),\n description: z.string().optional(),\n url: z.string().optional(),\n mediaType: z.enum([\"image\", \"video\"]).optional(),\n signedUrl: z.string().optional(),\n });\nexport type Media = z.infer<typeof MediaSchema>;\n\nexport const RoomSchema: z.ZodTypeAny = z.object({\n id: z.number().optional(),\n name: z.string().optional(),\n order: z.number().optional(),\n cameras: z.number().optional(),\n floorPlan: z.lazy(() => FloorPlanSchema).optional(),\n });\nexport type Room = z.infer<typeof RoomSchema>;\n\nexport const StyleSchema = z.object({\n id: z.number().optional(),\n name: z.string().optional(),\n description: z.string().optional(),\n thumbnail: MediaSchema.optional(),\n });\nexport type Style = z.infer<typeof StyleSchema>;\n\nexport const FloorplanStylesSchema: z.ZodTypeAny = z.object({\n id: z.number().optional(),\n floorPlanId: z.number().optional(),\n floorPlan: z.lazy(() => FloorPlanSchema).optional(),\n styleId: z.number().optional(),\n style: StyleSchema.optional(),\n status: z.enum([\"UN_RENDERED\", \"RENDERING\", \"RENDERED\", \"FAILED\"]).optional(),\n });\nexport type FloorplanStyles = z.infer<typeof FloorplanStylesSchema>;\n\nexport const FloorPlanSchema: z.ZodTypeAny = z.object({\n id: z.number().optional(),\n name: z.string().optional(),\n description: z.string().optional(),\n blenderVersion: z.string().optional(),\n inresiVersion: z.string().optional(),\n blenderFile: MediaSchema.optional(),\n properties: z.array(z.lazy(() => PropertySchema)).optional(),\n customer: UserSchema.optional(),\n rooms: z.array(z.lazy(() => RoomSchema)).optional(),\n styles: z.array(z.lazy(() => FloorplanStylesSchema)).optional(),\n });\nexport type FloorPlan = z.infer<typeof FloorPlanSchema>;\n\nexport const PropertySchema: z.ZodTypeAny = z.object({\n id: z.number().optional(),\n name: z.string().optional(),\n description: z.string().optional(),\n address: z.string().optional(),\n address_city: z.string().optional(),\n address_state: z.string().optional(),\n address_zip: z.string().optional(),\n address_country: z.string().optional(),\n latitude: z.number().optional(),\n longitude: z.number().optional(),\n thumbnail: MediaSchema.optional(),\n floorPlanId: z.number().optional(),\n floorPlan: z.lazy(() => FloorPlanSchema).optional(),\n });\nexport type Property = z.infer<typeof PropertySchema>;\n\nexport const UnitAmenitySchema: z.ZodTypeAny = z.object({\n id: z.number().optional(),\n title: z.string().optional(),\n unitId: z.number().optional(),\n unit: z.lazy(() => UnitSchema).optional(),\n });\nexport type UnitAmenity = z.infer<typeof UnitAmenitySchema>;\n\nexport const RenderedStyleSchema = z.object({\n id: z.number().optional(),\n floorPlanData: MediaSchema.optional(),\n floorPlanExtentsData: MediaSchema.optional(),\n floorPlanImageData: MediaSchema.optional(),\n colorfulFloorPlanImage: MediaSchema.optional(),\n renders: MediaSchema.optional(),\n unitId: z.number().optional(),\n floorPlanId: z.number().optional(),\n floorPlan: FloorPlanSchema.optional(),\n styleId: z.number().optional(),\n style: StyleSchema.optional(),\n visibleOnWebsite: z.boolean().optional(),\n stillRenders: z.array(MediaSchema).optional(),\n });\nexport type RenderedStyle = z.infer<typeof RenderedStyleSchema>;\n\nexport const UnitSchema: z.ZodTypeAny = z.object({\n id: z.number().optional(),\n name: z.string().optional(),\n date_availability: z.string().optional(),\n slug: z.string().optional(),\n qty_bedrooms: z.number().optional(),\n qty_bathrooms: z.number().optional(),\n base_price: z.number().optional(),\n dim_sq_ft: z.number().optional(),\n userId: z.number().optional(),\n user: UserSchema.optional(),\n propertyId: z.number().optional(),\n property: PropertySchema.optional(),\n amenities: z.array(z.lazy(() => UnitAmenitySchema)).optional(),\n renderedStyle: z.array(RenderedStyleSchema).optional(),\n video: MediaSchema.optional(),\n videoThumbnail: MediaSchema.optional(),\n embedGif: MediaSchema.optional(),\n thumbnail: MediaSchema.optional(),\n floorPlanId: z.number().optional(),\n floorPlan: FloorPlanSchema.optional(),\n });\nexport type Unit = z.infer<typeof UnitSchema>;\n\nexport const UnitRenderedStyleSchema = z.object({\n id: z.number().optional(),\n unitId: z.number().optional(),\n visibleOnWebsite: z.boolean().optional(),\n unit: UnitSchema.optional(),\n renderedStyleId: z.number().optional(),\n renderedStyle: RenderedStyleSchema.optional(),\n stillRenders: z.array(MediaSchema).optional(),\n });\nexport type UnitRenderedStyle = z.infer<typeof UnitRenderedStyleSchema>;\n\nexport const FurnitureInRoomsSchema = z.object({\n id: z.number().optional(),\n floorPlanId: z.number().optional(),\n floorPlan: FloorPlanSchema.optional(),\n roomId: z.number().optional(),\n room: RoomSchema.optional(),\n furnitureId: z.number().optional(),\n furniture: RoomSchema.optional(),\n styleId: z.number().optional(),\n style: StyleSchema.optional(),\n });\nexport type FurnitureInRooms = z.infer<typeof FurnitureInRoomsSchema>;\n\nexport const FurnitureSchema = z.object({\n id: z.number().optional(),\n name: z.string().optional(),\n category: z.string().optional(),\n width: z.string().optional(),\n depth: z.string().optional(),\n height: z.string().optional(),\n availability: z.enum([\"IN_STOCK\", \"OUT_OF_STOCK\"]).optional(),\n price: z.string().optional(),\n currency: z.enum([\"USD\", \"EUR\"]).optional(),\n brand_name: z.string().optional(),\n store_name: z.string().optional(),\n media: MediaSchema.optional(),\n styles: z.array(StyleSchema).optional(),\n });\nexport type Furniture = z.infer<typeof FurnitureSchema>;\n\nexport const UploadUrlSchema = z.object({\n uploadUrl: z.string().optional(),\n uploadFileKey: z.string().optional(),\n });\nexport type UploadUrl = z.infer<typeof UploadUrlSchema>;\n\nexport const ExternalServiceConfigSchema = z.object({});\nexport type ExternalServiceConfig = z.infer<typeof ExternalServiceConfigSchema>;\n\nexport const ExternalServiceUpdateSchema = z.object({\n id: z.number(),\n type: z.enum([\"Hyly\", \"GoogleAnalytics\", \"Mits\", \"Yardi\", \"Engrain\"]),\n isActive: z.boolean(),\n config: ExternalServiceConfigSchema.optional(),\n });\nexport type ExternalServiceUpdate = z.infer<typeof ExternalServiceUpdateSchema>;\n\nexport const ExternalServicesUpdateRequestSchema = z.object({\n externalServices: z.array(ExternalServiceUpdateSchema),\n });\nexport type ExternalServicesUpdateRequest = z.infer<typeof ExternalServicesUpdateRequestSchema>;\n\nexport const ErrorSchema = z.object({\n code: z.number().optional(),\n message: z.string().optional(),\n });\nexport type Error = z.infer<typeof ErrorSchema>;\n\nexport const ErrorUnprocessableEntitySchema = z.object({\n error: z.object({\n message: z.string().optional(),\n }).optional(),\n });\nexport type ErrorUnprocessableEntity = z.infer<typeof ErrorUnprocessableEntitySchema>;\n\nexport const LeadActivitySchema = z.object({\n type: z.enum([\"contact\", \"share\", \"subscribe\"]),\n date: z.string(),\n unitId: z.number().optional(),\n unitName: z.string().optional(),\n unitSlug: z.string().optional(),\n });\nexport type LeadActivity = z.infer<typeof LeadActivitySchema>;\n\nexport const LeadSchema = z.object({\n userId: z.number(),\n email: z.string(),\n latestActivity: LeadActivitySchema,\n visitorFilter: z.array(z.string()),\n });\nexport type Lead = z.infer<typeof LeadSchema>;\n\nexport const PaginationSchema = z.object({\n totalRecords: z.number(),\n totalPages: z.number(),\n currentPage: z.number(),\n perPage: z.number(),\n });\nexport type Pagination = z.infer<typeof PaginationSchema>;\n\nexport const LeadsListResponseSchema = z.object({\n data: z.object({\n data: z.array(LeadSchema),\n page: PaginationSchema,\n }),\n });\nexport type LeadsListResponse = z.infer<typeof LeadsListResponseSchema>;\n\nexport const LeadActivityItemSchema = z.object({\n type: z.enum([\"contact\", \"share\", \"subscribe\"]),\n date: z.string(),\n unitId: z.number().optional(),\n unitName: z.string().optional(),\n unitSlug: z.string().optional(),\n });\nexport type LeadActivityItem = z.infer<typeof LeadActivityItemSchema>;\n\nexport const LeadActivitiesResponseSchema = z.object({\n data: z.object({\n data: z.array(LeadActivityItemSchema),\n page: PaginationSchema,\n }),\n });\nexport type LeadActivitiesResponse = z.infer<typeof LeadActivitiesResponseSchema>;\n\nexport const LeadDetailsResponseSchema = z.object({\n data: z.object({\n availability: z.array(z.string()),\n bedrooms: z.array(z.string()),\n budget: z.array(z.string()),\n preferences: z.array(z.string()),\n mostRecentContact: z.object({\n date: z.string(),\n }),\n favoriteUnits: z.array(z.object({\n id: z.number(),\n slug: z.string(),\n name: z.string(),\n })),\n }),\n });\nexport type LeadDetailsResponse = z.infer<typeof LeadDetailsResponseSchema>;\n\nexport const PropertyAmenitySchema = z.object({\n id: z.number(),\n title: z.string(),\n propertyId: z.number(),\n });\nexport type PropertyAmenity = z.infer<typeof PropertyAmenitySchema>;\n\nexport const PropertyHighlightSchema = z.object({\n id: z.number(),\n title: z.string(),\n propertyId: z.number(),\n });\nexport type PropertyHighlight = z.infer<typeof PropertyHighlightSchema>;\n\nexport const ExternalServicesSchema = z.object({\n id: z.number(),\n type: z.string(),\n propertyId: z.number(),\n createdAt: z.string(),\n isActive: z.boolean(),\n parameters: z.string().optional(),\n config: z.record(z.string(), z.unknown()),\n });\nexport type ExternalServices = z.infer<typeof ExternalServicesSchema>;\n\nexport const RenderJobSchema = z.object({\n id: z.number(),\n queueId: z.number(),\n floorPlanId: z.number(),\n styleId: z.number(),\n status: z.string(),\n startedByUserId: z.number().optional(),\n startedByUserEmail: z.string().optional(),\n version: z.number().optional(),\n createdAt: z.string(),\n updatedAt: z.string(),\n startedAt: z.string().optional(),\n finishedAt: z.string().optional(),\n data: z.record(z.string(), z.unknown()),\n logsFileId: z.number().optional(),\n });\nexport type RenderJob = z.infer<typeof RenderJobSchema>;\n\nexport const QueueJobSchema = z.object({\n id: z.number(),\n queueId: z.number(),\n parentId: z.number(),\n status: z.string(),\n startedByUserId: z.number().optional(),\n startedByUserEmail: z.string().optional(),\n createdAt: z.string(),\n updatedAt: z.string(),\n startedAt: z.string().optional(),\n finishedAt: z.string().optional(),\n data: z.record(z.string(), z.unknown()),\n logsFileId: z.number().optional(),\n });\nexport type QueueJob = z.infer<typeof QueueJobSchema>;\n\nexport const UserWebhookSchema = z.object({\n id: z.number(),\n accountId: z.number(),\n name: z.string(),\n url: z.string(),\n secret: z.string(),\n isActive: z.boolean(),\n createdAt: z.string(),\n updatedAt: z.string(),\n });\nexport type UserWebhook = z.infer<typeof UserWebhookSchema>;\n"],"names":["EmbedEnumsSchema","z.object","z.enum","z.record","z.string","z.array","UserSchema","z.number","MediaSchema","RoomSchema","z.lazy","FloorPlanSchema","StyleSchema","FloorplanStylesSchema","PropertySchema","UnitAmenitySchema","UnitSchema","RenderedStyleSchema","z.boolean","UnitRenderedStyleSchema","FurnitureInRoomsSchema","FurnitureSchema","UploadUrlSchema","ExternalServiceConfigSchema","ExternalServiceUpdateSchema","ExternalServicesUpdateRequestSchema","ErrorSchema","ErrorUnprocessableEntitySchema","LeadActivitySchema","LeadSchema","PaginationSchema","LeadsListResponseSchema","LeadActivityItemSchema","LeadActivitiesResponseSchema","LeadDetailsResponseSchema","PropertyAmenitySchema","PropertyHighlightSchema","ExternalServicesSchema","z.unknown","RenderJobSchema","QueueJobSchema","UserWebhookSchema"],"mappings":";AAOO,MAAMA,IAAmBC,EAAS;AAAA,EACrC,YAAYC,EAAO,CAAC,aAAa,UAAU,CAAC,EAAE,SAAA;AAAA,EAC9C,sBAAsBC,EAASC,EAAE,GAAUC,EAAQD,EAAE,CAAQ,CAAC,EAAE,SAAA;AAAA,EAChE,cAAcF,EAAO,CAAC,aAAa,UAAU,CAAC,EAAE,SAAA;AAAA,EAChD,mBAAmBA,EAAO,CAAC,aAAa,UAAU,CAAC,EAAE,SAAA;AACvD,CAAC,GAGUI,IAAaL,EAAS;AAAA,EAC/B,IAAIM,EAAE,EAAS,SAAA;AAAA,EACf,OAAOH,EAAE,EAAS,SAAA;AAAA,EAClB,YAAYA,EAAE,EAAS,SAAA;AAAA,EACvB,WAAWA,EA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E;AAAA,EACV,iBAAiBG,EAAE,EAAS,SAAA;AAAA,EAC5B,oBAAoBH,EAAE,EAAS,SAAA;AAAA,EAC/B,SAASG,EAAE,EAAS,SAAA;AAAA,EACpB,WAAWH,EAAE;AAAA,EACb,WAAWA,EAAE;AAAA,EACb,WAAWA,EAAE,EAAS,SAAA;AAAA,EACtB,YAAYA,EAAE,EAAS,SAAA;AAAA,EACvB,MAAMD,EAASC,KAAYkC,GAAW;AAAA,EACtC,YAAY/B,EAAE,EAAS,SAAA;AACzB,CAAC,GAGUiC,IAAiBvC,EAAS;AAAA,EACnC,IAAIM,EAAE;AAAA,EACN,SAASA,EAAE;AAAA,EACX,UAAUA,EAAE;AAAA,EACZ,QAAQH,EAAE;AAAA,EACV,iBAAiBG,EAAE,EAAS,SAAA;AAAA,EAC5B,oBAAoBH,EAAE,EAAS,SAAA;AAAA,EAC/B,WAAWA,EAAE;AAAA,EACb,WAAWA,EAAE;AAAA,EACb,WAAWA,EAAE,EAAS,SAAA;AAAA,EACtB,YAAYA,EAAE,EAAS,SAAA;AAAA,EACvB,MAAMD,EAASC,KAAYkC,GAAW;AAAA,EACtC,YAAY/B,EAAE,EAAS,SAAA;AACzB,CAAC,GAGUkC,IAAoBxC,EAAS;AAAA,EACtC,IAAIM,EAAE;AAAA,EACN,WAAWA,EAAE;AAAA,EACb,MAAMH,EAAE;AAAA,EACR,KAAKA,EAAE;AAAA,EACP,QAAQA,EAAE;AAAA,EACV,UAAUc,EAAE;AAAA,EACZ,WAAWd,EAAE;AAAA,EACb,WAAWA,EAAE;AACf,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./ZodError.cjs"),l=require("./helpers/errorUtil.cjs"),i=require("./helpers/parseUtil.cjs"),c=require("./helpers/util.cjs");class x{constructor(e,t,s,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const te=(n,e)=>{if(i.isValid(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new u.ZodError(n.common.issues);return this._error=t,this._error}}};function p(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:r}=n;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(o,d)=>{const{message:h}=n;return o.code==="invalid_enum_value"?{message:h??d.defaultError}:typeof d.data>"u"?{message:h??s??d.defaultError}:o.code!=="invalid_type"?{message:d.defaultError}:{message:h??t??d.defaultError}},description:r}}class y{get description(){return this._def.description}_getType(e){return c.getParsedType(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:c.getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new i.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:c.getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(i.isAsync(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:c.getParsedType(e)},r=this._parseSync({data:e,path:s.path,parent:s});return te(s,r)}"~validate"(e){var s,r;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:c.getParsedType(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return i.isValid(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(r=(s=a==null?void 0:a.message)==null?void 0:s.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>i.isValid(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:c.getParsedType(e)},r=this._parse({data:e,path:s.path,parent:s}),a=await(i.isAsync(r)?r:Promise.resolve(r));return te(s,a)}refine(e,t){const s=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,a)=>{const o=e(r),d=()=>a.addIssue({code:u.ZodIssueCode.custom,...s(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(h=>h?!0:(d(),!1)):o?!0:(d(),!1)})}refinement(e,t){return this._refinement((s,r)=>e(s)?!0:(r.addIssue(typeof t=="function"?t(s,r):t),!1))}_refinement(e){return new w({schema:this,typeName:exports.ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return T.create(this,this._def)}nullable(){return P.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return v.create(this)}promise(){return D.create(this,this._def)}or(e){return V.create([this,e],this._def)}and(e){return L.create(this,e,this._def)}transform(e){return new w({...p(this._def),schema:this,typeName:exports.ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new z({...p(this._def),innerType:this,defaultValue:t,typeName:exports.ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ie({typeName:exports.ZodFirstPartyTypeKind.ZodBranded,type:this,...p(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new M({...p(this._def),innerType:this,catchValue:t,typeName:exports.ZodFirstPartyTypeKind.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return B.create(this,e)}readonly(){return $.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const oe=/^c[^\s-]{8,}$/i,ue=/^[0-9a-z]+$/,ce=/^[0-9A-HJKMNP-TV-Z]{26}$/i,le=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,he=/^[a-z0-9_-]{21}$/i,fe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?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{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,xe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Te=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ze=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,se="((\\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])))",Ie=new RegExp(`^${se}$`);function re(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);const t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ke(n){return new RegExp(`^${re(n)}$`)}function ae(n){let e=`${se}T${re(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ce(n,e){return!!((e==="v4"||!e)&&_e.test(n)||(e==="v6"||!e)&&ve.test(n))}function we(n,e){if(!fe.test(n))return!1;try{const[t]=n.split(".");if(!t)return!1;const s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(s));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function be(n,e){return!!((e==="v4"||!e)&&ge.test(n)||(e==="v6"||!e)&&xe.test(n))}class g extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==c.ZodParsedType.string){const a=this._getOrReturnCtx(e);return i.addIssueToContext(a,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.string,received:a.parsedType}),i.INVALID}const s=new i.ParseStatus;let r;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const o=e.data.length>a.value,d=e.data.length<a.value;(o||d)&&(r=this._getOrReturnCtx(e,r),o?i.addIssueToContext(r,{code:u.ZodIssueCode.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):d&&i.addIssueToContext(r,{code:u.ZodIssueCode.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")ye.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"email",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")W||(W=new RegExp(me,"u")),W.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"emoji",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")le.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"uuid",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")he.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"nanoid",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")oe.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"cuid",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")ue.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"cuid2",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")ce.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"ulid",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"url",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"regex",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?ae(a).test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?Ie.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?ke(a).test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?pe.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"duration",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Ce(e.data,a.version)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"ip",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?we(e.data,a.alg)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"jwt",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?be(e.data,a.version)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"cidr",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?Te.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"base64",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?Ze.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"base64url",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()):c.util.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(r=>e.test(r),{validation:t,code:u.ZodIssueCode.invalid_string,...l.errorUtil.errToObj(s)})}_addCheck(e){return new g({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...l.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...l.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...l.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...l.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...l.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...l.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...l.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...l.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...l.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...l.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...l.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...l.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...l.errorUtil.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...l.errorUtil.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...l.errorUtil.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...l.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...l.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...l.errorUtil.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...l.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...l.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...l.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...l.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...l.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,l.errorUtil.errToObj(e))}trim(){return new g({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new g({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new g({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}g.create=n=>new g({checks:[],typeName:exports.ZodFirstPartyTypeKind.ZodString,coerce:(n==null?void 0:n.coerce)??!1,...p(n)});function Ae(n,e){const t=(n.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,r=t>s?t:s,a=Number.parseInt(n.toFixed(r).replace(".","")),o=Number.parseInt(e.toFixed(r).replace(".",""));return a%o/10**r}class I extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==c.ZodParsedType.number){const a=this._getOrReturnCtx(e);return i.addIssueToContext(a,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.number,received:a.parsedType}),i.INVALID}let s;const r=new i.ParseStatus;for(const a of this._def.checks)a.kind==="int"?c.util.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="multipleOf"?Ae(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.not_finite,message:a.message}),r.dirty()):c.util.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.errorUtil.toString(t))}setLimit(e,t,s,r){return new I({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:l.errorUtil.toString(r)}]})}_addCheck(e){return new I({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:l.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:l.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&c.util.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}I.create=n=>new I({checks:[],typeName:exports.ZodFirstPartyTypeKind.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...p(n)});class k extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==c.ZodParsedType.bigint)return this._getInvalidInput(e);let s;const r=new i.ParseStatus;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):c.util.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return i.addIssueToContext(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.bigint,received:t.parsedType}),i.INVALID}gte(e,t){return this.setLimit("min",e,!0,l.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.errorUtil.toString(t))}setLimit(e,t,s,r){return new k({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:l.errorUtil.toString(r)}]})}_addCheck(e){return new k({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}k.create=n=>new k({checks:[],typeName:exports.ZodFirstPartyTypeKind.ZodBigInt,coerce:(n==null?void 0:n.coerce)??!1,...p(n)});class R extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==c.ZodParsedType.boolean){const s=this._getOrReturnCtx(e);return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.boolean,received:s.parsedType}),i.INVALID}return i.OK(e.data)}}R.create=n=>new R({typeName:exports.ZodFirstPartyTypeKind.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...p(n)});class b extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==c.ZodParsedType.date){const a=this._getOrReturnCtx(e);return i.addIssueToContext(a,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.date,received:a.parsedType}),i.INVALID}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return i.addIssueToContext(a,{code:u.ZodIssueCode.invalid_date}),i.INVALID}const s=new i.ParseStatus;let r;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):c.util.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new b({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:l.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:l.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}b.create=n=>new b({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:exports.ZodFirstPartyTypeKind.ZodDate,...p(n)});class Y extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.symbol){const s=this._getOrReturnCtx(e);return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.symbol,received:s.parsedType}),i.INVALID}return i.OK(e.data)}}Y.create=n=>new Y({typeName:exports.ZodFirstPartyTypeKind.ZodSymbol,...p(n)});class q extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const s=this._getOrReturnCtx(e);return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.undefined,received:s.parsedType}),i.INVALID}return i.OK(e.data)}}q.create=n=>new q({typeName:exports.ZodFirstPartyTypeKind.ZodUndefined,...p(n)});class j extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.null){const s=this._getOrReturnCtx(e);return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.null,received:s.parsedType}),i.INVALID}return i.OK(e.data)}}j.create=n=>new j({typeName:exports.ZodFirstPartyTypeKind.ZodNull,...p(n)});class E extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return i.OK(e.data)}}E.create=n=>new E({typeName:exports.ZodFirstPartyTypeKind.ZodAny,...p(n)});class F extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return i.OK(e.data)}}F.create=n=>new F({typeName:exports.ZodFirstPartyTypeKind.ZodUnknown,...p(n)});class Z extends y{_parse(e){const t=this._getOrReturnCtx(e);return i.addIssueToContext(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.never,received:t.parsedType}),i.INVALID}}Z.create=n=>new Z({typeName:exports.ZodFirstPartyTypeKind.ZodNever,...p(n)});class J extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const s=this._getOrReturnCtx(e);return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.void,received:s.parsedType}),i.INVALID}return i.OK(e.data)}}J.create=n=>new J({typeName:exports.ZodFirstPartyTypeKind.ZodVoid,...p(n)});class v extends y{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==c.ZodParsedType.array)return i.addIssueToContext(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:t.parsedType}),i.INVALID;if(r.exactLength!==null){const o=t.data.length>r.exactLength.value,d=t.data.length<r.exactLength.value;(o||d)&&(i.addIssueToContext(t,{code:o?u.ZodIssueCode.too_big:u.ZodIssueCode.too_small,minimum:d?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(i.addIssueToContext(t,{code:u.ZodIssueCode.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(i.addIssueToContext(t,{code:u.ZodIssueCode.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((o,d)=>r.type._parseAsync(new x(t,o,t.path,d)))).then(o=>i.ParseStatus.mergeArray(s,o));const a=[...t.data].map((o,d)=>r.type._parseSync(new x(t,o,t.path,d)));return i.ParseStatus.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new v({...this._def,minLength:{value:e,message:l.errorUtil.toString(t)}})}max(e,t){return new v({...this._def,maxLength:{value:e,message:l.errorUtil.toString(t)}})}length(e,t){return new v({...this._def,exactLength:{value:e,message:l.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}v.create=(n,e)=>new v({type:n,minLength:null,maxLength:null,exactLength:null,typeName:exports.ZodFirstPartyTypeKind.ZodArray,...p(e)});function N(n){if(n instanceof _){const e={};for(const t in n.shape){const s=n.shape[t];e[t]=T.create(N(s))}return new _({...n._def,shape:()=>e})}else return n instanceof v?new v({...n._def,type:N(n.element)}):n instanceof T?T.create(N(n.unwrap())):n instanceof P?P.create(N(n.unwrap())):n instanceof C?C.create(n.items.map(e=>N(e))):n}class _ extends y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=c.util.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==c.ZodParsedType.object){const f=this._getOrReturnCtx(e);return i.addIssueToContext(f,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:f.parsedType}),i.INVALID}const{status:s,ctx:r}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),d=[];if(!(this._def.catchall instanceof Z&&this._def.unknownKeys==="strip"))for(const f in r.data)o.includes(f)||d.push(f);const h=[];for(const f of o){const m=a[f],O=r.data[f];h.push({key:{status:"valid",value:f},value:m._parse(new x(r,O,r.path,f)),alwaysSet:f in r.data})}if(this._def.catchall instanceof Z){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of d)h.push({key:{status:"valid",value:m},value:{status:"valid",value:r.data[m]}});else if(f==="strict")d.length>0&&(i.addIssueToContext(r,{code:u.ZodIssueCode.unrecognized_keys,keys:d}),s.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of d){const O=r.data[m];h.push({key:{status:"valid",value:m},value:f._parse(new x(r,O,r.path,m)),alwaysSet:m in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of h){const O=await m.key,de=await m.value;f.push({key:O,value:de,alwaysSet:m.alwaysSet})}return f}).then(f=>i.ParseStatus.mergeObjectSync(s,f)):i.ParseStatus.mergeObjectSync(s,h)}get shape(){return this._def.shape()}strict(e){return l.errorUtil.errToObj,new _({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var a,o;const r=((o=(a=this._def).errorMap)==null?void 0:o.call(a,t,s).message)??s.defaultError;return t.code==="unrecognized_keys"?{message:l.errorUtil.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new _({...this._def,unknownKeys:"strip"})}passthrough(){return new _({...this._def,unknownKeys:"passthrough"})}extend(e){return new _({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new _({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:exports.ZodFirstPartyTypeKind.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new _({...this._def,catchall:e})}pick(e){const t={};for(const s of c.util.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new _({...this._def,shape:()=>t})}omit(e){const t={};for(const s of c.util.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new _({...this._def,shape:()=>t})}deepPartial(){return N(this)}partial(e){const t={};for(const s of c.util.objectKeys(this.shape)){const r=this.shape[s];e&&!e[s]?t[s]=r:t[s]=r.optional()}return new _({...this._def,shape:()=>t})}required(e){const t={};for(const s of c.util.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof T;)a=a._def.innerType;t[s]=a}return new _({...this._def,shape:()=>t})}keyof(){return ne(c.util.objectKeys(this.shape))}}_.create=(n,e)=>new _({shape:()=>n,unknownKeys:"strip",catchall:Z.create(),typeName:exports.ZodFirstPartyTypeKind.ZodObject,...p(e)});_.strictCreate=(n,e)=>new _({shape:()=>n,unknownKeys:"strict",catchall:Z.create(),typeName:exports.ZodFirstPartyTypeKind.ZodObject,...p(e)});_.lazycreate=(n,e)=>new _({shape:n,unknownKeys:"strip",catchall:Z.create(),typeName:exports.ZodFirstPartyTypeKind.ZodObject,...p(e)});class V extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function r(a){for(const d of a)if(d.result.status==="valid")return d.result;for(const d of a)if(d.result.status==="dirty")return t.common.issues.push(...d.ctx.common.issues),d.result;const o=a.map(d=>new u.ZodError(d.ctx.common.issues));return i.addIssueToContext(t,{code:u.ZodIssueCode.invalid_union,unionErrors:o}),i.INVALID}if(t.common.async)return Promise.all(s.map(async a=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(r);{let a;const o=[];for(const h of s){const f={...t,common:{...t.common,issues:[]},parent:null},m=h._parseSync({data:t.data,path:t.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!a&&(a={result:m,ctx:f}),f.common.issues.length&&o.push(f.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const d=o.map(h=>new u.ZodError(h));return i.addIssueToContext(t,{code:u.ZodIssueCode.invalid_union,unionErrors:d}),i.INVALID}}get options(){return this._def.options}}V.create=(n,e)=>new V({options:n,typeName:exports.ZodFirstPartyTypeKind.ZodUnion,...p(e)});function H(n,e){const t=c.getParsedType(n),s=c.getParsedType(e);if(n===e)return{valid:!0,data:n};if(t===c.ZodParsedType.object&&s===c.ZodParsedType.object){const r=c.util.objectKeys(e),a=c.util.objectKeys(n).filter(d=>r.indexOf(d)!==-1),o={...n,...e};for(const d of a){const h=H(n[d],e[d]);if(!h.valid)return{valid:!1};o[d]=h.data}return{valid:!0,data:o}}else if(t===c.ZodParsedType.array&&s===c.ZodParsedType.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let a=0;a<n.length;a++){const o=n[a],d=e[a],h=H(o,d);if(!h.valid)return{valid:!1};r.push(h.data)}return{valid:!0,data:r}}else return t===c.ZodParsedType.date&&s===c.ZodParsedType.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class L extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=(a,o)=>{if(i.isAborted(a)||i.isAborted(o))return i.INVALID;const d=H(a.value,o.value);return d.valid?((i.isDirty(a)||i.isDirty(o))&&t.dirty(),{status:t.value,value:d.data}):(i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_intersection_types}),i.INVALID)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,o])=>r(a,o)):r(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}L.create=(n,e,t)=>new L({left:n,right:e,typeName:exports.ZodFirstPartyTypeKind.ZodIntersection,...p(t)});class C extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==c.ZodParsedType.array)return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:s.parsedType}),i.INVALID;if(s.data.length<this._def.items.length)return i.addIssueToContext(s,{code:u.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.INVALID;!this._def.rest&&s.data.length>this._def.items.length&&(i.addIssueToContext(s,{code:u.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((o,d)=>{const h=this._def.items[d]||this._def.rest;return h?h._parse(new x(s,o,s.path,d)):null}).filter(o=>!!o);return s.common.async?Promise.all(a).then(o=>i.ParseStatus.mergeArray(t,o)):i.ParseStatus.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new C({...this._def,rest:e})}}C.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new C({items:n,typeName:exports.ZodFirstPartyTypeKind.ZodTuple,rest:null,...p(e)})};class U extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==c.ZodParsedType.object)return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:s.parsedType}),i.INVALID;const r=[],a=this._def.keyType,o=this._def.valueType;for(const d in s.data)r.push({key:a._parse(new x(s,d,s.path,d)),value:o._parse(new x(s,s.data[d],s.path,d)),alwaysSet:d in s.data});return s.common.async?i.ParseStatus.mergeObjectAsync(t,r):i.ParseStatus.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof y?new U({keyType:e,valueType:t,typeName:exports.ZodFirstPartyTypeKind.ZodRecord,...p(s)}):new U({keyType:g.create(),valueType:e,typeName:exports.ZodFirstPartyTypeKind.ZodRecord,...p(t)})}}class G extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==c.ZodParsedType.map)return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.map,received:s.parsedType}),i.INVALID;const r=this._def.keyType,a=this._def.valueType,o=[...s.data.entries()].map(([d,h],f)=>({key:r._parse(new x(s,d,s.path,[f,"key"])),value:a._parse(new x(s,h,s.path,[f,"value"]))}));if(s.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const h of o){const f=await h.key,m=await h.value;if(f.status==="aborted"||m.status==="aborted")return i.INVALID;(f.status==="dirty"||m.status==="dirty")&&t.dirty(),d.set(f.value,m.value)}return{status:t.value,value:d}})}else{const d=new Map;for(const h of o){const f=h.key,m=h.value;if(f.status==="aborted"||m.status==="aborted")return i.INVALID;(f.status==="dirty"||m.status==="dirty")&&t.dirty(),d.set(f.value,m.value)}return{status:t.value,value:d}}}}G.create=(n,e,t)=>new G({valueType:e,keyType:n,typeName:exports.ZodFirstPartyTypeKind.ZodMap,...p(t)});class S extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==c.ZodParsedType.set)return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.set,received:s.parsedType}),i.INVALID;const r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(i.addIssueToContext(s,{code:u.ZodIssueCode.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&s.data.size>r.maxSize.value&&(i.addIssueToContext(s,{code:u.ZodIssueCode.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const a=this._def.valueType;function o(h){const f=new Set;for(const m of h){if(m.status==="aborted")return i.INVALID;m.status==="dirty"&&t.dirty(),f.add(m.value)}return{status:t.value,value:f}}const d=[...s.data.values()].map((h,f)=>a._parse(new x(s,h,s.path,f)));return s.common.async?Promise.all(d).then(h=>o(h)):o(d)}min(e,t){return new S({...this._def,minSize:{value:e,message:l.errorUtil.toString(t)}})}max(e,t){return new S({...this._def,maxSize:{value:e,message:l.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}S.create=(n,e)=>new S({valueType:n,minSize:null,maxSize:null,typeName:exports.ZodFirstPartyTypeKind.ZodSet,...p(e)});class Q extends y{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Q.create=(n,e)=>new Q({getter:n,typeName:exports.ZodFirstPartyTypeKind.ZodLazy,...p(e)});class X extends y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return i.addIssueToContext(t,{received:t.data,code:u.ZodIssueCode.invalid_literal,expected:this._def.value}),i.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}X.create=(n,e)=>new X({value:n,typeName:exports.ZodFirstPartyTypeKind.ZodLiteral,...p(e)});function ne(n,e){return new A({values:n,typeName:exports.ZodFirstPartyTypeKind.ZodEnum,...p(e)})}class A extends y{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return i.addIssueToContext(t,{expected:c.util.joinValues(s),received:t.parsedType,code:u.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return i.addIssueToContext(t,{received:t.data,code:u.ZodIssueCode.invalid_enum_value,options:s}),i.INVALID}return i.OK(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return A.create(e,{...this._def,...t})}exclude(e,t=this._def){return A.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}A.create=ne;class K extends y{_parse(e){const t=c.util.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==c.ZodParsedType.string&&s.parsedType!==c.ZodParsedType.number){const r=c.util.objectValues(t);return i.addIssueToContext(s,{expected:c.util.joinValues(r),received:s.parsedType,code:u.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||(this._cache=new Set(c.util.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=c.util.objectValues(t);return i.addIssueToContext(s,{received:s.data,code:u.ZodIssueCode.invalid_enum_value,options:r}),i.INVALID}return i.OK(e.data)}get enum(){return this._def.values}}K.create=(n,e)=>new K({values:n,typeName:exports.ZodFirstPartyTypeKind.ZodNativeEnum,...p(e)});class D extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.promise&&t.common.async===!1)return i.addIssueToContext(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.promise,received:t.parsedType}),i.INVALID;const s=t.parsedType===c.ZodParsedType.promise?t.data:Promise.resolve(t.data);return i.OK(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}D.create=(n,e)=>new D({type:n,typeName:exports.ZodFirstPartyTypeKind.ZodPromise,...p(e)});class w extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===exports.ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:o=>{i.addIssueToContext(s,o),o.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),r.type==="preprocess"){const o=r.transform(s.data,a);if(s.common.async)return Promise.resolve(o).then(async d=>{if(t.value==="aborted")return i.INVALID;const h=await this._def.schema._parseAsync({data:d,path:s.path,parent:s});return h.status==="aborted"?i.INVALID:h.status==="dirty"||t.value==="dirty"?i.DIRTY(h.value):h});{if(t.value==="aborted")return i.INVALID;const d=this._def.schema._parseSync({data:o,path:s.path,parent:s});return d.status==="aborted"?i.INVALID:d.status==="dirty"||t.value==="dirty"?i.DIRTY(d.value):d}}if(r.type==="refinement"){const o=d=>{const h=r.refinement(d,a);if(s.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(s.common.async===!1){const d=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return d.status==="aborted"?i.INVALID:(d.status==="dirty"&&t.dirty(),o(d.value),{status:t.value,value:d.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(d=>d.status==="aborted"?i.INVALID:(d.status==="dirty"&&t.dirty(),o(d.value).then(()=>({status:t.value,value:d.value}))))}if(r.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!i.isValid(o))return i.INVALID;const d=r.transform(o.value,a);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:d}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>i.isValid(o)?Promise.resolve(r.transform(o.value,a)).then(d=>({status:t.value,value:d})):i.INVALID);c.util.assertNever(r)}}w.create=(n,e,t)=>new w({schema:n,typeName:exports.ZodFirstPartyTypeKind.ZodEffects,effect:e,...p(t)});w.createWithPreprocess=(n,e,t)=>new w({schema:e,effect:{type:"preprocess",transform:n},typeName:exports.ZodFirstPartyTypeKind.ZodEffects,...p(t)});class T extends y{_parse(e){return this._getType(e)===c.ZodParsedType.undefined?i.OK(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}T.create=(n,e)=>new T({innerType:n,typeName:exports.ZodFirstPartyTypeKind.ZodOptional,...p(e)});class P extends y{_parse(e){return this._getType(e)===c.ZodParsedType.null?i.OK(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}P.create=(n,e)=>new P({innerType:n,typeName:exports.ZodFirstPartyTypeKind.ZodNullable,...p(e)});class z extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===c.ZodParsedType.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}z.create=(n,e)=>new z({innerType:n,typeName:exports.ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...p(e)});class M extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return i.isAsync(r)?r.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new u.ZodError(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new u.ZodError(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}M.create=(n,e)=>new M({innerType:n,typeName:exports.ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...p(e)});class ee extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.nan){const s=this._getOrReturnCtx(e);return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.nan,received:s.parsedType}),i.INVALID}return{status:"valid",value:e.data}}}ee.create=n=>new ee({typeName:exports.ZodFirstPartyTypeKind.ZodNaN,...p(n)});class ie extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class B extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?i.INVALID:a.status==="dirty"?(t.dirty(),i.DIRTY(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const r=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?i.INVALID:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:s.path,parent:s})}}static create(e,t){return new B({in:e,out:t,typeName:exports.ZodFirstPartyTypeKind.ZodPipeline})}}class $ extends y{_parse(e){const t=this._def.innerType._parse(e),s=r=>(i.isValid(r)&&(r.value=Object.freeze(r.value)),r);return i.isAsync(t)?t.then(r=>s(r)):s(t)}unwrap(){return this._def.innerType}}$.create=(n,e)=>new $({innerType:n,typeName:exports.ZodFirstPartyTypeKind.ZodReadonly,...p(e)});exports.ZodFirstPartyTypeKind=void 0;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(exports.ZodFirstPartyTypeKind||(exports.ZodFirstPartyTypeKind={}));const Pe=g.create,Ne=I.create;k.create;const Se=R.create,Oe=b.create,Re=j.create,Ve=E.create,Le=F.create;Z.create;const Ue=v.create,De=_.create,je=V.create;L.create;C.create;const Ee=U.create,Fe=A.create,Ke=K.create;D.create;T.create;P.create;const ze={string:n=>g.create({...n,coerce:!0}),number:n=>I.create({...n,coerce:!0}),boolean:n=>R.create({...n,coerce:!0}),bigint:n=>k.create({...n,coerce:!0}),date:n=>b.create({...n,coerce:!0})};exports.Schema=y;exports.ZodAny=E;exports.ZodArray=v;exports.ZodBigInt=k;exports.ZodBoolean=R;exports.ZodBranded=ie;exports.ZodCatch=M;exports.ZodDate=b;exports.ZodDefault=z;exports.ZodEffects=w;exports.ZodEnum=A;exports.ZodIntersection=L;exports.ZodLazy=Q;exports.ZodLiteral=X;exports.ZodMap=G;exports.ZodNaN=ee;exports.ZodNativeEnum=K;exports.ZodNever=Z;exports.ZodNull=j;exports.ZodNullable=P;exports.ZodNumber=I;exports.ZodObject=_;exports.ZodOptional=T;exports.ZodPipeline=B;exports.ZodPromise=D;exports.ZodReadonly=$;exports.ZodRecord=U;exports.ZodSchema=y;exports.ZodSet=S;exports.ZodString=g;exports.ZodSymbol=Y;exports.ZodTransformer=w;exports.ZodTuple=C;exports.ZodType=y;exports.ZodUndefined=q;exports.ZodUnion=V;exports.ZodUnknown=F;exports.ZodVoid=J;exports.any=Ve;exports.array=Ue;exports.boolean=Se;exports.coerce=ze;exports.date=Oe;exports.datetimeRegex=ae;exports.enum=Fe;exports.nativeEnum=Ke;exports.null=Re;exports.number=Ne;exports.object=De;exports.record=Ee;exports.string=Pe;exports.union=je;exports.unknown=Le;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./ZodError.cjs"),l=require("./helpers/errorUtil.cjs"),i=require("./helpers/parseUtil.cjs"),c=require("./helpers/util.cjs");class x{constructor(e,t,s,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const te=(n,e)=>{if(i.isValid(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new u.ZodError(n.common.issues);return this._error=t,this._error}}};function p(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:r}=n;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(o,d)=>{const{message:h}=n;return o.code==="invalid_enum_value"?{message:h??d.defaultError}:typeof d.data>"u"?{message:h??s??d.defaultError}:o.code!=="invalid_type"?{message:d.defaultError}:{message:h??t??d.defaultError}},description:r}}class y{get description(){return this._def.description}_getType(e){return c.getParsedType(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:c.getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new i.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:c.getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(i.isAsync(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:c.getParsedType(e)},r=this._parseSync({data:e,path:s.path,parent:s});return te(s,r)}"~validate"(e){var s,r;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:c.getParsedType(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return i.isValid(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(r=(s=a==null?void 0:a.message)==null?void 0:s.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>i.isValid(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:c.getParsedType(e)},r=this._parse({data:e,path:s.path,parent:s}),a=await(i.isAsync(r)?r:Promise.resolve(r));return te(s,a)}refine(e,t){const s=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,a)=>{const o=e(r),d=()=>a.addIssue({code:u.ZodIssueCode.custom,...s(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(h=>h?!0:(d(),!1)):o?!0:(d(),!1)})}refinement(e,t){return this._refinement((s,r)=>e(s)?!0:(r.addIssue(typeof t=="function"?t(s,r):t),!1))}_refinement(e){return new w({schema:this,typeName:exports.ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return T.create(this,this._def)}nullable(){return P.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return v.create(this)}promise(){return D.create(this,this._def)}or(e){return V.create([this,e],this._def)}and(e){return L.create(this,e,this._def)}transform(e){return new w({...p(this._def),schema:this,typeName:exports.ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new M({...p(this._def),innerType:this,defaultValue:t,typeName:exports.ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ie({typeName:exports.ZodFirstPartyTypeKind.ZodBranded,type:this,...p(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new $({...p(this._def),innerType:this,catchValue:t,typeName:exports.ZodFirstPartyTypeKind.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return W.create(this,e)}readonly(){return B.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const oe=/^c[^\s-]{8,}$/i,ue=/^[0-9a-z]+$/,ce=/^[0-9A-HJKMNP-TV-Z]{26}$/i,le=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,he=/^[a-z0-9_-]{21}$/i,fe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ye=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,me="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Y;const _e=/^(?:(?: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])$/,ge=/^(?:(?:25[0-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,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Te=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ze=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,se="((\\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])))",Ie=new RegExp(`^${se}$`);function re(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);const t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ke(n){return new RegExp(`^${re(n)}$`)}function ae(n){let e=`${se}T${re(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ce(n,e){return!!((e==="v4"||!e)&&_e.test(n)||(e==="v6"||!e)&&ve.test(n))}function we(n,e){if(!fe.test(n))return!1;try{const[t]=n.split(".");if(!t)return!1;const s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(s));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function be(n,e){return!!((e==="v4"||!e)&&ge.test(n)||(e==="v6"||!e)&&xe.test(n))}class g extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==c.ZodParsedType.string){const a=this._getOrReturnCtx(e);return i.addIssueToContext(a,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.string,received:a.parsedType}),i.INVALID}const s=new i.ParseStatus;let r;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const o=e.data.length>a.value,d=e.data.length<a.value;(o||d)&&(r=this._getOrReturnCtx(e,r),o?i.addIssueToContext(r,{code:u.ZodIssueCode.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):d&&i.addIssueToContext(r,{code:u.ZodIssueCode.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")ye.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"email",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Y||(Y=new RegExp(me,"u")),Y.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"emoji",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")le.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"uuid",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")he.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"nanoid",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")oe.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"cuid",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")ue.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"cuid2",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")ce.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"ulid",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"url",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"regex",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?ae(a).test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?Ie.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?ke(a).test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?pe.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"duration",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Ce(e.data,a.version)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"ip",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?we(e.data,a.alg)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"jwt",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?be(e.data,a.version)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"cidr",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?Te.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"base64",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?Ze.test(e.data)||(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{validation:"base64url",code:u.ZodIssueCode.invalid_string,message:a.message}),s.dirty()):c.util.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(r=>e.test(r),{validation:t,code:u.ZodIssueCode.invalid_string,...l.errorUtil.errToObj(s)})}_addCheck(e){return new g({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...l.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...l.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...l.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...l.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...l.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...l.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...l.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...l.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...l.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...l.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...l.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...l.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...l.errorUtil.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...l.errorUtil.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...l.errorUtil.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...l.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...l.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...l.errorUtil.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...l.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...l.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...l.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...l.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...l.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,l.errorUtil.errToObj(e))}trim(){return new g({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new g({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new g({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}g.create=n=>new g({checks:[],typeName:exports.ZodFirstPartyTypeKind.ZodString,coerce:(n==null?void 0:n.coerce)??!1,...p(n)});function Ae(n,e){const t=(n.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,r=t>s?t:s,a=Number.parseInt(n.toFixed(r).replace(".","")),o=Number.parseInt(e.toFixed(r).replace(".",""));return a%o/10**r}class I extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==c.ZodParsedType.number){const a=this._getOrReturnCtx(e);return i.addIssueToContext(a,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.number,received:a.parsedType}),i.INVALID}let s;const r=new i.ParseStatus;for(const a of this._def.checks)a.kind==="int"?c.util.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="multipleOf"?Ae(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.not_finite,message:a.message}),r.dirty()):c.util.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.errorUtil.toString(t))}setLimit(e,t,s,r){return new I({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:l.errorUtil.toString(r)}]})}_addCheck(e){return new I({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:l.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:l.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&c.util.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}I.create=n=>new I({checks:[],typeName:exports.ZodFirstPartyTypeKind.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...p(n)});class k extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==c.ZodParsedType.bigint)return this._getInvalidInput(e);let s;const r=new i.ParseStatus;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),i.addIssueToContext(s,{code:u.ZodIssueCode.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):c.util.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return i.addIssueToContext(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.bigint,received:t.parsedType}),i.INVALID}gte(e,t){return this.setLimit("min",e,!0,l.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.errorUtil.toString(t))}setLimit(e,t,s,r){return new k({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:l.errorUtil.toString(r)}]})}_addCheck(e){return new k({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}k.create=n=>new k({checks:[],typeName:exports.ZodFirstPartyTypeKind.ZodBigInt,coerce:(n==null?void 0:n.coerce)??!1,...p(n)});class R extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==c.ZodParsedType.boolean){const s=this._getOrReturnCtx(e);return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.boolean,received:s.parsedType}),i.INVALID}return i.OK(e.data)}}R.create=n=>new R({typeName:exports.ZodFirstPartyTypeKind.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...p(n)});class b extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==c.ZodParsedType.date){const a=this._getOrReturnCtx(e);return i.addIssueToContext(a,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.date,received:a.parsedType}),i.INVALID}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return i.addIssueToContext(a,{code:u.ZodIssueCode.invalid_date}),i.INVALID}const s=new i.ParseStatus;let r;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),i.addIssueToContext(r,{code:u.ZodIssueCode.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):c.util.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new b({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:l.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:l.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}b.create=n=>new b({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:exports.ZodFirstPartyTypeKind.ZodDate,...p(n)});class q extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.symbol){const s=this._getOrReturnCtx(e);return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.symbol,received:s.parsedType}),i.INVALID}return i.OK(e.data)}}q.create=n=>new q({typeName:exports.ZodFirstPartyTypeKind.ZodSymbol,...p(n)});class J extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const s=this._getOrReturnCtx(e);return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.undefined,received:s.parsedType}),i.INVALID}return i.OK(e.data)}}J.create=n=>new J({typeName:exports.ZodFirstPartyTypeKind.ZodUndefined,...p(n)});class j extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.null){const s=this._getOrReturnCtx(e);return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.null,received:s.parsedType}),i.INVALID}return i.OK(e.data)}}j.create=n=>new j({typeName:exports.ZodFirstPartyTypeKind.ZodNull,...p(n)});class E extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return i.OK(e.data)}}E.create=n=>new E({typeName:exports.ZodFirstPartyTypeKind.ZodAny,...p(n)});class F extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return i.OK(e.data)}}F.create=n=>new F({typeName:exports.ZodFirstPartyTypeKind.ZodUnknown,...p(n)});class Z extends y{_parse(e){const t=this._getOrReturnCtx(e);return i.addIssueToContext(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.never,received:t.parsedType}),i.INVALID}}Z.create=n=>new Z({typeName:exports.ZodFirstPartyTypeKind.ZodNever,...p(n)});class H extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const s=this._getOrReturnCtx(e);return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.void,received:s.parsedType}),i.INVALID}return i.OK(e.data)}}H.create=n=>new H({typeName:exports.ZodFirstPartyTypeKind.ZodVoid,...p(n)});class v extends y{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==c.ZodParsedType.array)return i.addIssueToContext(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:t.parsedType}),i.INVALID;if(r.exactLength!==null){const o=t.data.length>r.exactLength.value,d=t.data.length<r.exactLength.value;(o||d)&&(i.addIssueToContext(t,{code:o?u.ZodIssueCode.too_big:u.ZodIssueCode.too_small,minimum:d?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(i.addIssueToContext(t,{code:u.ZodIssueCode.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(i.addIssueToContext(t,{code:u.ZodIssueCode.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((o,d)=>r.type._parseAsync(new x(t,o,t.path,d)))).then(o=>i.ParseStatus.mergeArray(s,o));const a=[...t.data].map((o,d)=>r.type._parseSync(new x(t,o,t.path,d)));return i.ParseStatus.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new v({...this._def,minLength:{value:e,message:l.errorUtil.toString(t)}})}max(e,t){return new v({...this._def,maxLength:{value:e,message:l.errorUtil.toString(t)}})}length(e,t){return new v({...this._def,exactLength:{value:e,message:l.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}v.create=(n,e)=>new v({type:n,minLength:null,maxLength:null,exactLength:null,typeName:exports.ZodFirstPartyTypeKind.ZodArray,...p(e)});function N(n){if(n instanceof _){const e={};for(const t in n.shape){const s=n.shape[t];e[t]=T.create(N(s))}return new _({...n._def,shape:()=>e})}else return n instanceof v?new v({...n._def,type:N(n.element)}):n instanceof T?T.create(N(n.unwrap())):n instanceof P?P.create(N(n.unwrap())):n instanceof C?C.create(n.items.map(e=>N(e))):n}class _ extends y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=c.util.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==c.ZodParsedType.object){const f=this._getOrReturnCtx(e);return i.addIssueToContext(f,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:f.parsedType}),i.INVALID}const{status:s,ctx:r}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),d=[];if(!(this._def.catchall instanceof Z&&this._def.unknownKeys==="strip"))for(const f in r.data)o.includes(f)||d.push(f);const h=[];for(const f of o){const m=a[f],O=r.data[f];h.push({key:{status:"valid",value:f},value:m._parse(new x(r,O,r.path,f)),alwaysSet:f in r.data})}if(this._def.catchall instanceof Z){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of d)h.push({key:{status:"valid",value:m},value:{status:"valid",value:r.data[m]}});else if(f==="strict")d.length>0&&(i.addIssueToContext(r,{code:u.ZodIssueCode.unrecognized_keys,keys:d}),s.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of d){const O=r.data[m];h.push({key:{status:"valid",value:m},value:f._parse(new x(r,O,r.path,m)),alwaysSet:m in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of h){const O=await m.key,de=await m.value;f.push({key:O,value:de,alwaysSet:m.alwaysSet})}return f}).then(f=>i.ParseStatus.mergeObjectSync(s,f)):i.ParseStatus.mergeObjectSync(s,h)}get shape(){return this._def.shape()}strict(e){return l.errorUtil.errToObj,new _({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var a,o;const r=((o=(a=this._def).errorMap)==null?void 0:o.call(a,t,s).message)??s.defaultError;return t.code==="unrecognized_keys"?{message:l.errorUtil.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new _({...this._def,unknownKeys:"strip"})}passthrough(){return new _({...this._def,unknownKeys:"passthrough"})}extend(e){return new _({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new _({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:exports.ZodFirstPartyTypeKind.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new _({...this._def,catchall:e})}pick(e){const t={};for(const s of c.util.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new _({...this._def,shape:()=>t})}omit(e){const t={};for(const s of c.util.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new _({...this._def,shape:()=>t})}deepPartial(){return N(this)}partial(e){const t={};for(const s of c.util.objectKeys(this.shape)){const r=this.shape[s];e&&!e[s]?t[s]=r:t[s]=r.optional()}return new _({...this._def,shape:()=>t})}required(e){const t={};for(const s of c.util.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof T;)a=a._def.innerType;t[s]=a}return new _({...this._def,shape:()=>t})}keyof(){return ne(c.util.objectKeys(this.shape))}}_.create=(n,e)=>new _({shape:()=>n,unknownKeys:"strip",catchall:Z.create(),typeName:exports.ZodFirstPartyTypeKind.ZodObject,...p(e)});_.strictCreate=(n,e)=>new _({shape:()=>n,unknownKeys:"strict",catchall:Z.create(),typeName:exports.ZodFirstPartyTypeKind.ZodObject,...p(e)});_.lazycreate=(n,e)=>new _({shape:n,unknownKeys:"strip",catchall:Z.create(),typeName:exports.ZodFirstPartyTypeKind.ZodObject,...p(e)});class V extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function r(a){for(const d of a)if(d.result.status==="valid")return d.result;for(const d of a)if(d.result.status==="dirty")return t.common.issues.push(...d.ctx.common.issues),d.result;const o=a.map(d=>new u.ZodError(d.ctx.common.issues));return i.addIssueToContext(t,{code:u.ZodIssueCode.invalid_union,unionErrors:o}),i.INVALID}if(t.common.async)return Promise.all(s.map(async a=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(r);{let a;const o=[];for(const h of s){const f={...t,common:{...t.common,issues:[]},parent:null},m=h._parseSync({data:t.data,path:t.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!a&&(a={result:m,ctx:f}),f.common.issues.length&&o.push(f.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const d=o.map(h=>new u.ZodError(h));return i.addIssueToContext(t,{code:u.ZodIssueCode.invalid_union,unionErrors:d}),i.INVALID}}get options(){return this._def.options}}V.create=(n,e)=>new V({options:n,typeName:exports.ZodFirstPartyTypeKind.ZodUnion,...p(e)});function G(n,e){const t=c.getParsedType(n),s=c.getParsedType(e);if(n===e)return{valid:!0,data:n};if(t===c.ZodParsedType.object&&s===c.ZodParsedType.object){const r=c.util.objectKeys(e),a=c.util.objectKeys(n).filter(d=>r.indexOf(d)!==-1),o={...n,...e};for(const d of a){const h=G(n[d],e[d]);if(!h.valid)return{valid:!1};o[d]=h.data}return{valid:!0,data:o}}else if(t===c.ZodParsedType.array&&s===c.ZodParsedType.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let a=0;a<n.length;a++){const o=n[a],d=e[a],h=G(o,d);if(!h.valid)return{valid:!1};r.push(h.data)}return{valid:!0,data:r}}else return t===c.ZodParsedType.date&&s===c.ZodParsedType.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class L extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=(a,o)=>{if(i.isAborted(a)||i.isAborted(o))return i.INVALID;const d=G(a.value,o.value);return d.valid?((i.isDirty(a)||i.isDirty(o))&&t.dirty(),{status:t.value,value:d.data}):(i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_intersection_types}),i.INVALID)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,o])=>r(a,o)):r(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}L.create=(n,e,t)=>new L({left:n,right:e,typeName:exports.ZodFirstPartyTypeKind.ZodIntersection,...p(t)});class C extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==c.ZodParsedType.array)return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:s.parsedType}),i.INVALID;if(s.data.length<this._def.items.length)return i.addIssueToContext(s,{code:u.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.INVALID;!this._def.rest&&s.data.length>this._def.items.length&&(i.addIssueToContext(s,{code:u.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((o,d)=>{const h=this._def.items[d]||this._def.rest;return h?h._parse(new x(s,o,s.path,d)):null}).filter(o=>!!o);return s.common.async?Promise.all(a).then(o=>i.ParseStatus.mergeArray(t,o)):i.ParseStatus.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new C({...this._def,rest:e})}}C.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new C({items:n,typeName:exports.ZodFirstPartyTypeKind.ZodTuple,rest:null,...p(e)})};class U extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==c.ZodParsedType.object)return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:s.parsedType}),i.INVALID;const r=[],a=this._def.keyType,o=this._def.valueType;for(const d in s.data)r.push({key:a._parse(new x(s,d,s.path,d)),value:o._parse(new x(s,s.data[d],s.path,d)),alwaysSet:d in s.data});return s.common.async?i.ParseStatus.mergeObjectAsync(t,r):i.ParseStatus.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof y?new U({keyType:e,valueType:t,typeName:exports.ZodFirstPartyTypeKind.ZodRecord,...p(s)}):new U({keyType:g.create(),valueType:e,typeName:exports.ZodFirstPartyTypeKind.ZodRecord,...p(t)})}}class Q extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==c.ZodParsedType.map)return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.map,received:s.parsedType}),i.INVALID;const r=this._def.keyType,a=this._def.valueType,o=[...s.data.entries()].map(([d,h],f)=>({key:r._parse(new x(s,d,s.path,[f,"key"])),value:a._parse(new x(s,h,s.path,[f,"value"]))}));if(s.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const h of o){const f=await h.key,m=await h.value;if(f.status==="aborted"||m.status==="aborted")return i.INVALID;(f.status==="dirty"||m.status==="dirty")&&t.dirty(),d.set(f.value,m.value)}return{status:t.value,value:d}})}else{const d=new Map;for(const h of o){const f=h.key,m=h.value;if(f.status==="aborted"||m.status==="aborted")return i.INVALID;(f.status==="dirty"||m.status==="dirty")&&t.dirty(),d.set(f.value,m.value)}return{status:t.value,value:d}}}}Q.create=(n,e,t)=>new Q({valueType:e,keyType:n,typeName:exports.ZodFirstPartyTypeKind.ZodMap,...p(t)});class S extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==c.ZodParsedType.set)return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.set,received:s.parsedType}),i.INVALID;const r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(i.addIssueToContext(s,{code:u.ZodIssueCode.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&s.data.size>r.maxSize.value&&(i.addIssueToContext(s,{code:u.ZodIssueCode.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const a=this._def.valueType;function o(h){const f=new Set;for(const m of h){if(m.status==="aborted")return i.INVALID;m.status==="dirty"&&t.dirty(),f.add(m.value)}return{status:t.value,value:f}}const d=[...s.data.values()].map((h,f)=>a._parse(new x(s,h,s.path,f)));return s.common.async?Promise.all(d).then(h=>o(h)):o(d)}min(e,t){return new S({...this._def,minSize:{value:e,message:l.errorUtil.toString(t)}})}max(e,t){return new S({...this._def,maxSize:{value:e,message:l.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}S.create=(n,e)=>new S({valueType:n,minSize:null,maxSize:null,typeName:exports.ZodFirstPartyTypeKind.ZodSet,...p(e)});class K extends y{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}K.create=(n,e)=>new K({getter:n,typeName:exports.ZodFirstPartyTypeKind.ZodLazy,...p(e)});class X extends y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return i.addIssueToContext(t,{received:t.data,code:u.ZodIssueCode.invalid_literal,expected:this._def.value}),i.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}X.create=(n,e)=>new X({value:n,typeName:exports.ZodFirstPartyTypeKind.ZodLiteral,...p(e)});function ne(n,e){return new A({values:n,typeName:exports.ZodFirstPartyTypeKind.ZodEnum,...p(e)})}class A extends y{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return i.addIssueToContext(t,{expected:c.util.joinValues(s),received:t.parsedType,code:u.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return i.addIssueToContext(t,{received:t.data,code:u.ZodIssueCode.invalid_enum_value,options:s}),i.INVALID}return i.OK(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return A.create(e,{...this._def,...t})}exclude(e,t=this._def){return A.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}A.create=ne;class z extends y{_parse(e){const t=c.util.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==c.ZodParsedType.string&&s.parsedType!==c.ZodParsedType.number){const r=c.util.objectValues(t);return i.addIssueToContext(s,{expected:c.util.joinValues(r),received:s.parsedType,code:u.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||(this._cache=new Set(c.util.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=c.util.objectValues(t);return i.addIssueToContext(s,{received:s.data,code:u.ZodIssueCode.invalid_enum_value,options:r}),i.INVALID}return i.OK(e.data)}get enum(){return this._def.values}}z.create=(n,e)=>new z({values:n,typeName:exports.ZodFirstPartyTypeKind.ZodNativeEnum,...p(e)});class D extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.promise&&t.common.async===!1)return i.addIssueToContext(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.promise,received:t.parsedType}),i.INVALID;const s=t.parsedType===c.ZodParsedType.promise?t.data:Promise.resolve(t.data);return i.OK(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}D.create=(n,e)=>new D({type:n,typeName:exports.ZodFirstPartyTypeKind.ZodPromise,...p(e)});class w extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===exports.ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:o=>{i.addIssueToContext(s,o),o.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),r.type==="preprocess"){const o=r.transform(s.data,a);if(s.common.async)return Promise.resolve(o).then(async d=>{if(t.value==="aborted")return i.INVALID;const h=await this._def.schema._parseAsync({data:d,path:s.path,parent:s});return h.status==="aborted"?i.INVALID:h.status==="dirty"||t.value==="dirty"?i.DIRTY(h.value):h});{if(t.value==="aborted")return i.INVALID;const d=this._def.schema._parseSync({data:o,path:s.path,parent:s});return d.status==="aborted"?i.INVALID:d.status==="dirty"||t.value==="dirty"?i.DIRTY(d.value):d}}if(r.type==="refinement"){const o=d=>{const h=r.refinement(d,a);if(s.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(s.common.async===!1){const d=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return d.status==="aborted"?i.INVALID:(d.status==="dirty"&&t.dirty(),o(d.value),{status:t.value,value:d.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(d=>d.status==="aborted"?i.INVALID:(d.status==="dirty"&&t.dirty(),o(d.value).then(()=>({status:t.value,value:d.value}))))}if(r.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!i.isValid(o))return i.INVALID;const d=r.transform(o.value,a);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:d}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>i.isValid(o)?Promise.resolve(r.transform(o.value,a)).then(d=>({status:t.value,value:d})):i.INVALID);c.util.assertNever(r)}}w.create=(n,e,t)=>new w({schema:n,typeName:exports.ZodFirstPartyTypeKind.ZodEffects,effect:e,...p(t)});w.createWithPreprocess=(n,e,t)=>new w({schema:e,effect:{type:"preprocess",transform:n},typeName:exports.ZodFirstPartyTypeKind.ZodEffects,...p(t)});class T extends y{_parse(e){return this._getType(e)===c.ZodParsedType.undefined?i.OK(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}T.create=(n,e)=>new T({innerType:n,typeName:exports.ZodFirstPartyTypeKind.ZodOptional,...p(e)});class P extends y{_parse(e){return this._getType(e)===c.ZodParsedType.null?i.OK(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}P.create=(n,e)=>new P({innerType:n,typeName:exports.ZodFirstPartyTypeKind.ZodNullable,...p(e)});class M extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===c.ZodParsedType.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}M.create=(n,e)=>new M({innerType:n,typeName:exports.ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...p(e)});class $ extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return i.isAsync(r)?r.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new u.ZodError(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new u.ZodError(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}$.create=(n,e)=>new $({innerType:n,typeName:exports.ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...p(e)});class ee extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.nan){const s=this._getOrReturnCtx(e);return i.addIssueToContext(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.nan,received:s.parsedType}),i.INVALID}return{status:"valid",value:e.data}}}ee.create=n=>new ee({typeName:exports.ZodFirstPartyTypeKind.ZodNaN,...p(n)});class ie extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class W extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?i.INVALID:a.status==="dirty"?(t.dirty(),i.DIRTY(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const r=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?i.INVALID:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:s.path,parent:s})}}static create(e,t){return new W({in:e,out:t,typeName:exports.ZodFirstPartyTypeKind.ZodPipeline})}}class B extends y{_parse(e){const t=this._def.innerType._parse(e),s=r=>(i.isValid(r)&&(r.value=Object.freeze(r.value)),r);return i.isAsync(t)?t.then(r=>s(r)):s(t)}unwrap(){return this._def.innerType}}B.create=(n,e)=>new B({innerType:n,typeName:exports.ZodFirstPartyTypeKind.ZodReadonly,...p(e)});exports.ZodFirstPartyTypeKind=void 0;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(exports.ZodFirstPartyTypeKind||(exports.ZodFirstPartyTypeKind={}));const Pe=g.create,Ne=I.create;k.create;const Se=R.create,Oe=b.create,Re=j.create,Ve=E.create,Le=F.create;Z.create;const Ue=v.create,De=_.create,je=V.create;L.create;C.create;const Ee=U.create,Fe=K.create,Ke=A.create,ze=z.create;D.create;T.create;P.create;const Me={string:n=>g.create({...n,coerce:!0}),number:n=>I.create({...n,coerce:!0}),boolean:n=>R.create({...n,coerce:!0}),bigint:n=>k.create({...n,coerce:!0}),date:n=>b.create({...n,coerce:!0})};exports.Schema=y;exports.ZodAny=E;exports.ZodArray=v;exports.ZodBigInt=k;exports.ZodBoolean=R;exports.ZodBranded=ie;exports.ZodCatch=$;exports.ZodDate=b;exports.ZodDefault=M;exports.ZodEffects=w;exports.ZodEnum=A;exports.ZodIntersection=L;exports.ZodLazy=K;exports.ZodLiteral=X;exports.ZodMap=Q;exports.ZodNaN=ee;exports.ZodNativeEnum=z;exports.ZodNever=Z;exports.ZodNull=j;exports.ZodNullable=P;exports.ZodNumber=I;exports.ZodObject=_;exports.ZodOptional=T;exports.ZodPipeline=W;exports.ZodPromise=D;exports.ZodReadonly=B;exports.ZodRecord=U;exports.ZodSchema=y;exports.ZodSet=S;exports.ZodString=g;exports.ZodSymbol=q;exports.ZodTransformer=w;exports.ZodTuple=C;exports.ZodType=y;exports.ZodUndefined=J;exports.ZodUnion=V;exports.ZodUnknown=F;exports.ZodVoid=H;exports.any=Ve;exports.array=Ue;exports.boolean=Se;exports.coerce=Me;exports.date=Oe;exports.datetimeRegex=ae;exports.enum=Ke;exports.lazy=Fe;exports.nativeEnum=ze;exports.null=Re;exports.number=Ne;exports.object=De;exports.record=Ee;exports.string=Pe;exports.union=je;exports.unknown=Le;
|
|
2
2
|
//# sourceMappingURL=types.cjs.map
|