@logto/connector-apple 1.0.0-beta.12 → 1.0.0-beta.15

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/lib/index.js CHANGED
@@ -2,411 +2,87 @@
2
2
  /******/ "use strict";
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
5
- /***/ 375:
6
- /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
7
-
8
-
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
22
- };
23
- Object.defineProperty(exports, "__esModule", ({ value: true }));
24
- exports.parseJson = exports.validateConfig = void 0;
25
- const types_js_1 = __nccwpck_require__(6309);
26
- __exportStar(__nccwpck_require__(6309), exports);
27
- function validateConfig(config, guard) {
28
- const result = guard.safeParse(config);
29
- if (!result.success) {
30
- throw new types_js_1.ConnectorError(types_js_1.ConnectorErrorCodes.InvalidConfig, result.error);
31
- }
32
- }
33
- exports.validateConfig = validateConfig;
34
- const parseJson = (jsonString, errorCode = types_js_1.ConnectorErrorCodes.InvalidResponse, errorPayload) => {
35
- try {
36
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
37
- return JSON.parse(jsonString);
38
- }
39
- catch {
40
- throw new types_js_1.ConnectorError(errorCode, errorPayload ?? jsonString);
41
- }
42
- };
43
- exports.parseJson = parseJson;
44
-
45
-
46
- /***/ }),
47
-
48
- /***/ 6309:
49
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
50
-
51
-
52
- Object.defineProperty(exports, "__esModule", ({ value: true }));
53
- exports.configurableConnectorMetadataGuard = exports.messageTypesGuard = exports.MessageTypes = exports.ConnectorError = exports.ConnectorErrorCodes = exports.i18nPhrasesGuard = exports.ConnectorPlatform = exports.ConnectorType = void 0;
54
- const language_kit_1 = __nccwpck_require__(7266);
55
- const zod_1 = __nccwpck_require__(8062);
56
- // MARK: Foundation
57
- var ConnectorType;
58
- (function (ConnectorType) {
59
- ConnectorType["Email"] = "Email";
60
- ConnectorType["Sms"] = "Sms";
61
- ConnectorType["Social"] = "Social";
62
- })(ConnectorType = exports.ConnectorType || (exports.ConnectorType = {}));
63
- var ConnectorPlatform;
64
- (function (ConnectorPlatform) {
65
- ConnectorPlatform["Native"] = "Native";
66
- ConnectorPlatform["Universal"] = "Universal";
67
- ConnectorPlatform["Web"] = "Web";
68
- })(ConnectorPlatform = exports.ConnectorPlatform || (exports.ConnectorPlatform = {}));
69
- exports.i18nPhrasesGuard = zod_1.z
70
- .object({ en: zod_1.z.string() })
71
- .and(zod_1.z.record(zod_1.z.string()))
72
- .refine((i18nObject) => {
73
- const keys = Object.keys(i18nObject);
74
- if (!keys.includes('en')) {
75
- return false;
76
- }
77
- for (const value of keys) {
78
- if (!(0, language_kit_1.isLanguageTag)(value)) {
79
- return false;
80
- }
81
- }
82
- return true;
83
- });
84
- var ConnectorErrorCodes;
85
- (function (ConnectorErrorCodes) {
86
- ConnectorErrorCodes["General"] = "general";
87
- ConnectorErrorCodes["InvalidMetadata"] = "invalid_metadata";
88
- ConnectorErrorCodes["UnexpectedType"] = "unexpected_type";
89
- ConnectorErrorCodes["InvalidConfigGuard"] = "invalid_config_guard";
90
- ConnectorErrorCodes["InvalidRequestParameters"] = "invalid_request_parameters";
91
- ConnectorErrorCodes["InsufficientRequestParameters"] = "insufficient_request_parameters";
92
- ConnectorErrorCodes["InvalidConfig"] = "invalid_config";
93
- ConnectorErrorCodes["InvalidResponse"] = "invalid_response";
94
- ConnectorErrorCodes["TemplateNotFound"] = "template_not_found";
95
- ConnectorErrorCodes["NotImplemented"] = "not_implemented";
96
- ConnectorErrorCodes["SocialAuthCodeInvalid"] = "social_auth_code_invalid";
97
- ConnectorErrorCodes["SocialAccessTokenInvalid"] = "social_invalid_access_token";
98
- ConnectorErrorCodes["SocialIdTokenInvalid"] = "social_invalid_id_token";
99
- ConnectorErrorCodes["AuthorizationFailed"] = "authorization_failed";
100
- })(ConnectorErrorCodes = exports.ConnectorErrorCodes || (exports.ConnectorErrorCodes = {}));
101
- class ConnectorError extends Error {
102
- constructor(code, data) {
103
- const message = typeof data === 'string' ? data : 'Connector error occurred.';
104
- super(message);
105
- this.code = code;
106
- this.data = typeof data === 'string' ? { message: data } : data;
107
- }
108
- }
109
- exports.ConnectorError = ConnectorError;
110
- var MessageTypes;
111
- (function (MessageTypes) {
112
- MessageTypes["SignIn"] = "SignIn";
113
- MessageTypes["Register"] = "Register";
114
- MessageTypes["ForgotPassword"] = "ForgotPassword";
115
- MessageTypes["Test"] = "Test";
116
- })(MessageTypes = exports.MessageTypes || (exports.MessageTypes = {}));
117
- exports.messageTypesGuard = zod_1.z.nativeEnum(MessageTypes);
118
- const connectorMetadataGuard = zod_1.z.object({
119
- id: zod_1.z.string(),
120
- target: zod_1.z.string(),
121
- platform: zod_1.z.nativeEnum(ConnectorPlatform).nullable(),
122
- name: exports.i18nPhrasesGuard,
123
- logo: zod_1.z.string(),
124
- logoDark: zod_1.z.string().nullable(),
125
- description: exports.i18nPhrasesGuard,
126
- isStandard: zod_1.z.boolean().optional(),
127
- readme: zod_1.z.string(),
128
- configTemplate: zod_1.z.string(),
129
- });
130
- exports.configurableConnectorMetadataGuard = connectorMetadataGuard
131
- .pick({
132
- target: true,
133
- name: true,
134
- logo: true,
135
- logoDark: true,
136
- })
137
- .partial();
138
-
139
-
140
- /***/ }),
141
-
142
- /***/ 6921:
143
- /***/ ((__unused_webpack_module, exports) => {
144
-
145
-
146
- Object.defineProperty(exports, "__esModule", ({ value: true }));
147
- exports.languages = void 0;
148
- exports.languages = Object.freeze({
149
- 'af-ZA': 'Afrikaans',
150
- 'am-ET': 'አማርኛ',
151
- 'ar-AR': 'العربية',
152
- 'as-IN': 'অসমীয়া',
153
- 'az-AZ': 'Azərbaycan dili',
154
- 'be-BY': 'Беларуская',
155
- 'bg-BG': 'Български',
156
- 'bn-IN': 'বাংলা',
157
- 'br-FR': 'Brezhoneg',
158
- 'bs-BA': 'Bosanski',
159
- 'ca-ES': 'Català',
160
- 'cb-IQ': 'کوردیی ناوەندی',
161
- 'co-FR': 'Corsu',
162
- 'cs-CZ': 'Čeština',
163
- 'cx-PH': 'Bisaya',
164
- 'cy-GB': 'Cymraeg',
165
- 'da-DK': 'Dansk',
166
- de: 'Deutsch',
167
- 'de-DE': 'Deutsch (Deutschland)',
168
- 'el-GR': 'Ελληνικά',
169
- en: 'English',
170
- 'en-GB': 'English (UK)',
171
- 'en-US': 'English (US)',
172
- 'eo-EO': 'Esperanto',
173
- es: 'Español',
174
- 'es-ES': 'Español (España)',
175
- 'es-419': 'Español (Latinoamérica)',
176
- 'et-EE': 'Eesti',
177
- 'eu-ES': 'Euskara',
178
- 'fa-IR': 'فارسی',
179
- 'ff-NG': 'Fula',
180
- 'fi-FI': 'Suomi',
181
- 'fo-FO': 'Føroyskt',
182
- fr: 'Français',
183
- 'fr-CA': 'Français (Canada)',
184
- 'fr-FR': 'Français (France)',
185
- 'fy-NL': 'Frysk',
186
- 'ga-IE': 'Gaeilge',
187
- 'gl-ES': 'Galego',
188
- 'gn-PY': 'Guarani',
189
- 'gu-IN': 'ગુજરાતી',
190
- 'ha-NG': 'Hausa',
191
- 'he-IL': 'עברית',
192
- 'hi-IN': 'हिन्दी',
193
- 'hr-HR': 'Hrvatski',
194
- 'ht-HT': 'Kreyòl Ayisyen',
195
- 'hu-HU': 'Magyar',
196
- 'hy-AM': 'Հայերեն',
197
- 'id-ID': 'Bahasa Indonesia',
198
- 'ik-US': 'Iñupiatun',
199
- 'is-IS': 'Íslenska',
200
- it: 'Italiano',
201
- 'it-IT': 'italiano (Italia)',
202
- 'iu-CA': 'Inuktitut',
203
- ja: '日本語',
204
- 'ja-JP': '日本語',
205
- 'ja-KS': '日本語(関西)',
206
- 'jv-ID': 'Basa Jawa',
207
- 'ka-GE': 'ქართული',
208
- 'kk-KZ': 'Қазақша',
209
- 'km-KH': 'ភាសាខ្មែរ',
210
- 'kn-IN': 'ಕನ್ನಡ',
211
- ko: '한국어',
212
- 'ko-KR': '한국어',
213
- 'ku-TR': 'Kurdî (Kurmancî)',
214
- 'ky-KG': 'кыргызча',
215
- 'lo-LA': 'ພາສາລາວ',
216
- 'lt-LT': 'Lietuvių',
217
- 'lv-LV': 'Latviešu',
218
- 'mg-MG': 'Malagasy',
219
- 'mk-MK': 'Македонски',
220
- 'ml-IN': 'മലയാളം',
221
- 'mn-MN': 'Монгол',
222
- 'mr-IN': 'मराठी',
223
- 'ms-MY': 'Bahasa Melayu',
224
- 'mt-MT': 'Malti',
225
- 'my-MM': 'မြန်မာဘာသာ',
226
- 'nb-NO': 'Norsk (bokmål)',
227
- 'ne-NP': 'नेपाली',
228
- 'nl-BE': 'Vlaams',
229
- 'nl-NL': 'Nederlands',
230
- 'nn-NO': 'Norsk (nynorsk)',
231
- 'or-IN': 'ଓଡ଼ିଆ',
232
- 'pa-IN': 'ਪੰਜਾਬੀ',
233
- 'pl-PL': 'Polski',
234
- 'ps-AF': 'پښتو',
235
- pt: 'português',
236
- 'pt-BR': 'Português (Brasil)',
237
- 'pt-PT': 'português (Portugal)',
238
- 'ro-RO': 'Română',
239
- ru: 'Русский',
240
- 'ru-RU': 'Русский',
241
- 'rw-RW': 'Ikinyarwanda',
242
- 'sc-IT': 'Sardu',
243
- 'si-LK': 'සිංහල',
244
- 'sk-SK': 'Slovenčina',
245
- 'sl-SI': 'Slovenščina',
246
- 'sn-ZW': 'Shona',
247
- 'sq-AL': 'Shqip',
248
- 'sr-RS': 'Српски',
249
- 'sv-SE': 'Svenska',
250
- 'sw-KE': 'Kiswahili',
251
- 'sy-SY': 'ܣܘܪܝܝܐ',
252
- 'sz-PL': 'ślōnskŏ gŏdka',
253
- 'ta-IN': 'தமிழ்',
254
- 'te-IN': 'తెలుగు',
255
- 'tg-TJ': 'Тоҷикӣ',
256
- 'th-TH': 'ภาษาไทย',
257
- 'tl-PH': 'Filipino',
258
- tr: 'Türkçe',
259
- 'tr-TR': 'Türkçe',
260
- 'tt-RU': 'Татарча',
261
- 'tz-MA': 'ⵜⴰⵎⴰⵣⵉⵖⵜ',
262
- 'uk-UA': 'Українська',
263
- 'ur-PK': 'اردو',
264
- 'uz-UZ': "O'zbek",
265
- 'vi-VN': 'Tiếng Việt',
266
- zh: '中文',
267
- 'zh-CN': '简体中文',
268
- 'zh-HK': '繁體中文(香港)',
269
- 'zh-MO': '繁體中文(澳門)',
270
- 'zh-TW': '繁體中文(台灣)',
271
- 'zz-TR': 'Zaza',
272
- });
273
-
274
-
275
- /***/ }),
276
-
277
- /***/ 7266:
278
- /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
279
-
280
-
281
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
282
- if (k2 === undefined) k2 = k;
283
- var desc = Object.getOwnPropertyDescriptor(m, k);
284
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
285
- desc = { enumerable: true, get: function() { return m[k]; } };
286
- }
287
- Object.defineProperty(o, k2, desc);
288
- }) : (function(o, m, k, k2) {
289
- if (k2 === undefined) k2 = k;
290
- o[k2] = m[k];
291
- }));
292
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
293
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
294
- };
295
- Object.defineProperty(exports, "__esModule", ({ value: true }));
296
- __exportStar(__nccwpck_require__(6921), exports);
297
- __exportStar(__nccwpck_require__(9962), exports);
298
- __exportStar(__nccwpck_require__(9715), exports);
299
-
300
-
301
- /***/ }),
302
-
303
- /***/ 9962:
304
- /***/ ((__unused_webpack_module, exports) => {
305
-
306
-
307
- Object.defineProperty(exports, "__esModule", ({ value: true }));
308
-
309
-
310
- /***/ }),
311
-
312
- /***/ 9715:
313
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
314
-
315
-
316
- Object.defineProperty(exports, "__esModule", ({ value: true }));
317
- exports.languageTagGuard = exports.isLanguageTag = void 0;
318
- const zod_1 = __nccwpck_require__(8062);
319
- const const_1 = __nccwpck_require__(6921);
320
- const isLanguageTag = (value) => typeof value === 'string' && value in const_1.languages;
321
- exports.isLanguageTag = isLanguageTag;
322
- exports.languageTagGuard = zod_1.z
323
- .any()
324
- .refine((value) => (0, exports.isLanguageTag)(value));
325
-
326
-
327
- /***/ }),
328
-
329
- /***/ 4974:
5
+ /***/ 9179:
330
6
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
331
7
 
332
8
 
333
9
  Object.defineProperty(exports, "__esModule", ({ value: true }));
334
10
  exports.base64url = exports.generateSecret = exports.generateKeyPair = exports.errors = exports.decodeJwt = exports.decodeProtectedHeader = exports.importJWK = exports.importX509 = exports.importPKCS8 = exports.importSPKI = exports.exportJWK = exports.exportSPKI = exports.exportPKCS8 = exports.UnsecuredJWT = exports.createRemoteJWKSet = exports.createLocalJWKSet = exports.EmbeddedJWK = exports.calculateJwkThumbprintUri = exports.calculateJwkThumbprint = exports.EncryptJWT = exports.SignJWT = exports.GeneralSign = exports.FlattenedSign = exports.CompactSign = exports.FlattenedEncrypt = exports.CompactEncrypt = exports.jwtDecrypt = exports.jwtVerify = exports.generalVerify = exports.flattenedVerify = exports.compactVerify = exports.GeneralEncrypt = exports.generalDecrypt = exports.flattenedDecrypt = exports.compactDecrypt = void 0;
335
- var decrypt_js_1 = __nccwpck_require__(1698);
11
+ var decrypt_js_1 = __nccwpck_require__(9293);
336
12
  Object.defineProperty(exports, "compactDecrypt", ({ enumerable: true, get: function () { return decrypt_js_1.compactDecrypt; } }));
337
- var decrypt_js_2 = __nccwpck_require__(827);
13
+ var decrypt_js_2 = __nccwpck_require__(9836);
338
14
  Object.defineProperty(exports, "flattenedDecrypt", ({ enumerable: true, get: function () { return decrypt_js_2.flattenedDecrypt; } }));
339
- var decrypt_js_3 = __nccwpck_require__(7978);
15
+ var decrypt_js_3 = __nccwpck_require__(1807);
340
16
  Object.defineProperty(exports, "generalDecrypt", ({ enumerable: true, get: function () { return decrypt_js_3.generalDecrypt; } }));
341
- var encrypt_js_1 = __nccwpck_require__(3170);
17
+ var encrypt_js_1 = __nccwpck_require__(4086);
342
18
  Object.defineProperty(exports, "GeneralEncrypt", ({ enumerable: true, get: function () { return encrypt_js_1.GeneralEncrypt; } }));
343
- var verify_js_1 = __nccwpck_require__(3757);
19
+ var verify_js_1 = __nccwpck_require__(214);
344
20
  Object.defineProperty(exports, "compactVerify", ({ enumerable: true, get: function () { return verify_js_1.compactVerify; } }));
345
- var verify_js_2 = __nccwpck_require__(1071);
21
+ var verify_js_2 = __nccwpck_require__(5763);
346
22
  Object.defineProperty(exports, "flattenedVerify", ({ enumerable: true, get: function () { return verify_js_2.flattenedVerify; } }));
347
- var verify_js_3 = __nccwpck_require__(8913);
23
+ var verify_js_3 = __nccwpck_require__(6984);
348
24
  Object.defineProperty(exports, "generalVerify", ({ enumerable: true, get: function () { return verify_js_3.generalVerify; } }));
349
- var verify_js_4 = __nccwpck_require__(958);
25
+ var verify_js_4 = __nccwpck_require__(2005);
350
26
  Object.defineProperty(exports, "jwtVerify", ({ enumerable: true, get: function () { return verify_js_4.jwtVerify; } }));
351
- var decrypt_js_4 = __nccwpck_require__(9486);
27
+ var decrypt_js_4 = __nccwpck_require__(3632);
352
28
  Object.defineProperty(exports, "jwtDecrypt", ({ enumerable: true, get: function () { return decrypt_js_4.jwtDecrypt; } }));
353
- var encrypt_js_2 = __nccwpck_require__(9325);
29
+ var encrypt_js_2 = __nccwpck_require__(7623);
354
30
  Object.defineProperty(exports, "CompactEncrypt", ({ enumerable: true, get: function () { return encrypt_js_2.CompactEncrypt; } }));
355
- var encrypt_js_3 = __nccwpck_require__(2878);
31
+ var encrypt_js_3 = __nccwpck_require__(2079);
356
32
  Object.defineProperty(exports, "FlattenedEncrypt", ({ enumerable: true, get: function () { return encrypt_js_3.FlattenedEncrypt; } }));
357
- var sign_js_1 = __nccwpck_require__(670);
33
+ var sign_js_1 = __nccwpck_require__(9630);
358
34
  Object.defineProperty(exports, "CompactSign", ({ enumerable: true, get: function () { return sign_js_1.CompactSign; } }));
359
- var sign_js_2 = __nccwpck_require__(657);
35
+ var sign_js_2 = __nccwpck_require__(7347);
360
36
  Object.defineProperty(exports, "FlattenedSign", ({ enumerable: true, get: function () { return sign_js_2.FlattenedSign; } }));
361
- var sign_js_3 = __nccwpck_require__(8473);
37
+ var sign_js_3 = __nccwpck_require__(7687);
362
38
  Object.defineProperty(exports, "GeneralSign", ({ enumerable: true, get: function () { return sign_js_3.GeneralSign; } }));
363
- var sign_js_4 = __nccwpck_require__(3744);
39
+ var sign_js_4 = __nccwpck_require__(7561);
364
40
  Object.defineProperty(exports, "SignJWT", ({ enumerable: true, get: function () { return sign_js_4.SignJWT; } }));
365
- var encrypt_js_4 = __nccwpck_require__(242);
41
+ var encrypt_js_4 = __nccwpck_require__(8332);
366
42
  Object.defineProperty(exports, "EncryptJWT", ({ enumerable: true, get: function () { return encrypt_js_4.EncryptJWT; } }));
367
- var thumbprint_js_1 = __nccwpck_require__(8166);
43
+ var thumbprint_js_1 = __nccwpck_require__(7093);
368
44
  Object.defineProperty(exports, "calculateJwkThumbprint", ({ enumerable: true, get: function () { return thumbprint_js_1.calculateJwkThumbprint; } }));
369
45
  Object.defineProperty(exports, "calculateJwkThumbprintUri", ({ enumerable: true, get: function () { return thumbprint_js_1.calculateJwkThumbprintUri; } }));
370
- var embedded_js_1 = __nccwpck_require__(9483);
46
+ var embedded_js_1 = __nccwpck_require__(8433);
371
47
  Object.defineProperty(exports, "EmbeddedJWK", ({ enumerable: true, get: function () { return embedded_js_1.EmbeddedJWK; } }));
372
- var local_js_1 = __nccwpck_require__(8560);
48
+ var local_js_1 = __nccwpck_require__(1588);
373
49
  Object.defineProperty(exports, "createLocalJWKSet", ({ enumerable: true, get: function () { return local_js_1.createLocalJWKSet; } }));
374
- var remote_js_1 = __nccwpck_require__(7351);
50
+ var remote_js_1 = __nccwpck_require__(9143);
375
51
  Object.defineProperty(exports, "createRemoteJWKSet", ({ enumerable: true, get: function () { return remote_js_1.createRemoteJWKSet; } }));
376
- var unsecured_js_1 = __nccwpck_require__(9701);
52
+ var unsecured_js_1 = __nccwpck_require__(7986);
377
53
  Object.defineProperty(exports, "UnsecuredJWT", ({ enumerable: true, get: function () { return unsecured_js_1.UnsecuredJWT; } }));
378
- var export_js_1 = __nccwpck_require__(8771);
54
+ var export_js_1 = __nccwpck_require__(8239);
379
55
  Object.defineProperty(exports, "exportPKCS8", ({ enumerable: true, get: function () { return export_js_1.exportPKCS8; } }));
380
56
  Object.defineProperty(exports, "exportSPKI", ({ enumerable: true, get: function () { return export_js_1.exportSPKI; } }));
381
57
  Object.defineProperty(exports, "exportJWK", ({ enumerable: true, get: function () { return export_js_1.exportJWK; } }));
382
- var import_js_1 = __nccwpck_require__(3287);
58
+ var import_js_1 = __nccwpck_require__(1010);
383
59
  Object.defineProperty(exports, "importSPKI", ({ enumerable: true, get: function () { return import_js_1.importSPKI; } }));
384
60
  Object.defineProperty(exports, "importPKCS8", ({ enumerable: true, get: function () { return import_js_1.importPKCS8; } }));
385
61
  Object.defineProperty(exports, "importX509", ({ enumerable: true, get: function () { return import_js_1.importX509; } }));
386
62
  Object.defineProperty(exports, "importJWK", ({ enumerable: true, get: function () { return import_js_1.importJWK; } }));
387
- var decode_protected_header_js_1 = __nccwpck_require__(1158);
63
+ var decode_protected_header_js_1 = __nccwpck_require__(1533);
388
64
  Object.defineProperty(exports, "decodeProtectedHeader", ({ enumerable: true, get: function () { return decode_protected_header_js_1.decodeProtectedHeader; } }));
389
- var decode_jwt_js_1 = __nccwpck_require__(6537);
65
+ var decode_jwt_js_1 = __nccwpck_require__(2467);
390
66
  Object.defineProperty(exports, "decodeJwt", ({ enumerable: true, get: function () { return decode_jwt_js_1.decodeJwt; } }));
391
- exports.errors = __nccwpck_require__(6891);
392
- var generate_key_pair_js_1 = __nccwpck_require__(8959);
67
+ exports.errors = __nccwpck_require__(2745);
68
+ var generate_key_pair_js_1 = __nccwpck_require__(5449);
393
69
  Object.defineProperty(exports, "generateKeyPair", ({ enumerable: true, get: function () { return generate_key_pair_js_1.generateKeyPair; } }));
394
- var generate_secret_js_1 = __nccwpck_require__(9896);
70
+ var generate_secret_js_1 = __nccwpck_require__(6096);
395
71
  Object.defineProperty(exports, "generateSecret", ({ enumerable: true, get: function () { return generate_secret_js_1.generateSecret; } }));
396
- exports.base64url = __nccwpck_require__(5831);
72
+ exports.base64url = __nccwpck_require__(2443);
397
73
 
398
74
 
399
75
  /***/ }),
400
76
 
401
- /***/ 1698:
77
+ /***/ 9293:
402
78
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
403
79
 
404
80
 
405
81
  Object.defineProperty(exports, "__esModule", ({ value: true }));
406
82
  exports.compactDecrypt = void 0;
407
- const decrypt_js_1 = __nccwpck_require__(827);
408
- const errors_js_1 = __nccwpck_require__(6891);
409
- const buffer_utils_js_1 = __nccwpck_require__(3605);
83
+ const decrypt_js_1 = __nccwpck_require__(9836);
84
+ const errors_js_1 = __nccwpck_require__(2745);
85
+ const buffer_utils_js_1 = __nccwpck_require__(614);
410
86
  async function compactDecrypt(jwe, key, options) {
411
87
  if (jwe instanceof Uint8Array) {
412
88
  jwe = buffer_utils_js_1.decoder.decode(jwe);
@@ -436,13 +112,13 @@ exports.compactDecrypt = compactDecrypt;
436
112
 
437
113
  /***/ }),
438
114
 
439
- /***/ 9325:
115
+ /***/ 7623:
440
116
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
441
117
 
442
118
 
443
119
  Object.defineProperty(exports, "__esModule", ({ value: true }));
444
120
  exports.CompactEncrypt = void 0;
445
- const encrypt_js_1 = __nccwpck_require__(2878);
121
+ const encrypt_js_1 = __nccwpck_require__(2079);
446
122
  class CompactEncrypt {
447
123
  constructor(plaintext) {
448
124
  this._flattened = new encrypt_js_1.FlattenedEncrypt(plaintext);
@@ -473,23 +149,23 @@ exports.CompactEncrypt = CompactEncrypt;
473
149
 
474
150
  /***/ }),
475
151
 
476
- /***/ 827:
152
+ /***/ 9836:
477
153
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
478
154
 
479
155
 
480
156
  Object.defineProperty(exports, "__esModule", ({ value: true }));
481
157
  exports.flattenedDecrypt = void 0;
482
- const base64url_js_1 = __nccwpck_require__(5091);
483
- const decrypt_js_1 = __nccwpck_require__(1788);
484
- const zlib_js_1 = __nccwpck_require__(3239);
485
- const errors_js_1 = __nccwpck_require__(6891);
486
- const is_disjoint_js_1 = __nccwpck_require__(3710);
487
- const is_object_js_1 = __nccwpck_require__(7787);
488
- const decrypt_key_management_js_1 = __nccwpck_require__(3635);
489
- const buffer_utils_js_1 = __nccwpck_require__(3605);
490
- const cek_js_1 = __nccwpck_require__(9942);
491
- const validate_crit_js_1 = __nccwpck_require__(1516);
492
- const validate_algorithms_js_1 = __nccwpck_require__(7946);
158
+ const base64url_js_1 = __nccwpck_require__(7395);
159
+ const decrypt_js_1 = __nccwpck_require__(4888);
160
+ const zlib_js_1 = __nccwpck_require__(4486);
161
+ const errors_js_1 = __nccwpck_require__(2745);
162
+ const is_disjoint_js_1 = __nccwpck_require__(7577);
163
+ const is_object_js_1 = __nccwpck_require__(6643);
164
+ const decrypt_key_management_js_1 = __nccwpck_require__(5044);
165
+ const buffer_utils_js_1 = __nccwpck_require__(614);
166
+ const cek_js_1 = __nccwpck_require__(284);
167
+ const validate_crit_js_1 = __nccwpck_require__(6203);
168
+ const validate_algorithms_js_1 = __nccwpck_require__(3290);
493
169
  async function flattenedDecrypt(jwe, key, options) {
494
170
  var _a;
495
171
  if (!(0, is_object_js_1.default)(jwe)) {
@@ -621,21 +297,21 @@ exports.flattenedDecrypt = flattenedDecrypt;
621
297
 
622
298
  /***/ }),
623
299
 
624
- /***/ 2878:
300
+ /***/ 2079:
625
301
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
626
302
 
627
303
 
628
304
  Object.defineProperty(exports, "__esModule", ({ value: true }));
629
305
  exports.FlattenedEncrypt = exports.unprotected = void 0;
630
- const base64url_js_1 = __nccwpck_require__(5091);
631
- const encrypt_js_1 = __nccwpck_require__(5613);
632
- const zlib_js_1 = __nccwpck_require__(3239);
633
- const iv_js_1 = __nccwpck_require__(8379);
634
- const encrypt_key_management_js_1 = __nccwpck_require__(6053);
635
- const errors_js_1 = __nccwpck_require__(6891);
636
- const is_disjoint_js_1 = __nccwpck_require__(3710);
637
- const buffer_utils_js_1 = __nccwpck_require__(3605);
638
- const validate_crit_js_1 = __nccwpck_require__(1516);
306
+ const base64url_js_1 = __nccwpck_require__(7395);
307
+ const encrypt_js_1 = __nccwpck_require__(277);
308
+ const zlib_js_1 = __nccwpck_require__(4486);
309
+ const iv_js_1 = __nccwpck_require__(7751);
310
+ const encrypt_key_management_js_1 = __nccwpck_require__(1050);
311
+ const errors_js_1 = __nccwpck_require__(2745);
312
+ const is_disjoint_js_1 = __nccwpck_require__(7577);
313
+ const buffer_utils_js_1 = __nccwpck_require__(614);
314
+ const validate_crit_js_1 = __nccwpck_require__(6203);
639
315
  exports.unprotected = Symbol();
640
316
  class FlattenedEncrypt {
641
317
  constructor(plaintext) {
@@ -807,15 +483,15 @@ exports.FlattenedEncrypt = FlattenedEncrypt;
807
483
 
808
484
  /***/ }),
809
485
 
810
- /***/ 7978:
486
+ /***/ 1807:
811
487
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
812
488
 
813
489
 
814
490
  Object.defineProperty(exports, "__esModule", ({ value: true }));
815
491
  exports.generalDecrypt = void 0;
816
- const decrypt_js_1 = __nccwpck_require__(827);
817
- const errors_js_1 = __nccwpck_require__(6891);
818
- const is_object_js_1 = __nccwpck_require__(7787);
492
+ const decrypt_js_1 = __nccwpck_require__(9836);
493
+ const errors_js_1 = __nccwpck_require__(2745);
494
+ const is_object_js_1 = __nccwpck_require__(6643);
819
495
  async function generalDecrypt(jwe, key, options) {
820
496
  if (!(0, is_object_js_1.default)(jwe)) {
821
497
  throw new errors_js_1.JWEInvalid('General JWE must be an object');
@@ -849,19 +525,19 @@ exports.generalDecrypt = generalDecrypt;
849
525
 
850
526
  /***/ }),
851
527
 
852
- /***/ 3170:
528
+ /***/ 4086:
853
529
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
854
530
 
855
531
 
856
532
  Object.defineProperty(exports, "__esModule", ({ value: true }));
857
533
  exports.GeneralEncrypt = void 0;
858
- const encrypt_js_1 = __nccwpck_require__(2878);
859
- const errors_js_1 = __nccwpck_require__(6891);
860
- const cek_js_1 = __nccwpck_require__(9942);
861
- const is_disjoint_js_1 = __nccwpck_require__(3710);
862
- const encrypt_key_management_js_1 = __nccwpck_require__(6053);
863
- const base64url_js_1 = __nccwpck_require__(5091);
864
- const validate_crit_js_1 = __nccwpck_require__(1516);
534
+ const encrypt_js_1 = __nccwpck_require__(2079);
535
+ const errors_js_1 = __nccwpck_require__(2745);
536
+ const cek_js_1 = __nccwpck_require__(284);
537
+ const is_disjoint_js_1 = __nccwpck_require__(7577);
538
+ const encrypt_key_management_js_1 = __nccwpck_require__(1050);
539
+ const base64url_js_1 = __nccwpck_require__(7395);
540
+ const validate_crit_js_1 = __nccwpck_require__(6203);
865
541
  class IndividualRecipient {
866
542
  constructor(enc, key, options) {
867
543
  this.parent = enc;
@@ -1038,15 +714,15 @@ exports.GeneralEncrypt = GeneralEncrypt;
1038
714
 
1039
715
  /***/ }),
1040
716
 
1041
- /***/ 9483:
717
+ /***/ 8433:
1042
718
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1043
719
 
1044
720
 
1045
721
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1046
722
  exports.EmbeddedJWK = void 0;
1047
- const import_js_1 = __nccwpck_require__(3287);
1048
- const is_object_js_1 = __nccwpck_require__(7787);
1049
- const errors_js_1 = __nccwpck_require__(6891);
723
+ const import_js_1 = __nccwpck_require__(1010);
724
+ const is_object_js_1 = __nccwpck_require__(6643);
725
+ const errors_js_1 = __nccwpck_require__(2745);
1050
726
  async function EmbeddedJWK(protectedHeader, token) {
1051
727
  const joseHeader = {
1052
728
  ...protectedHeader,
@@ -1066,17 +742,17 @@ exports.EmbeddedJWK = EmbeddedJWK;
1066
742
 
1067
743
  /***/ }),
1068
744
 
1069
- /***/ 8166:
745
+ /***/ 7093:
1070
746
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1071
747
 
1072
748
 
1073
749
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1074
750
  exports.calculateJwkThumbprintUri = exports.calculateJwkThumbprint = void 0;
1075
- const digest_js_1 = __nccwpck_require__(7638);
1076
- const base64url_js_1 = __nccwpck_require__(5091);
1077
- const errors_js_1 = __nccwpck_require__(6891);
1078
- const buffer_utils_js_1 = __nccwpck_require__(3605);
1079
- const is_object_js_1 = __nccwpck_require__(7787);
751
+ const digest_js_1 = __nccwpck_require__(1011);
752
+ const base64url_js_1 = __nccwpck_require__(7395);
753
+ const errors_js_1 = __nccwpck_require__(2745);
754
+ const buffer_utils_js_1 = __nccwpck_require__(614);
755
+ const is_object_js_1 = __nccwpck_require__(6643);
1080
756
  const check = (value, description) => {
1081
757
  if (typeof value !== 'string' || !value) {
1082
758
  throw new errors_js_1.JWKInvalid(`${description} missing or invalid`);
@@ -1131,15 +807,15 @@ exports.calculateJwkThumbprintUri = calculateJwkThumbprintUri;
1131
807
 
1132
808
  /***/ }),
1133
809
 
1134
- /***/ 8560:
810
+ /***/ 1588:
1135
811
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1136
812
 
1137
813
 
1138
814
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1139
815
  exports.createLocalJWKSet = exports.LocalJWKSet = exports.isJWKSLike = void 0;
1140
- const import_js_1 = __nccwpck_require__(3287);
1141
- const errors_js_1 = __nccwpck_require__(6891);
1142
- const is_object_js_1 = __nccwpck_require__(7787);
816
+ const import_js_1 = __nccwpck_require__(1010);
817
+ const errors_js_1 = __nccwpck_require__(2745);
818
+ const is_object_js_1 = __nccwpck_require__(6643);
1143
819
  function getKtyFromAlg(alg) {
1144
820
  switch (typeof alg === 'string' && alg.slice(0, 2)) {
1145
821
  case 'RS':
@@ -1242,16 +918,16 @@ exports.createLocalJWKSet = createLocalJWKSet;
1242
918
 
1243
919
  /***/ }),
1244
920
 
1245
- /***/ 7351:
921
+ /***/ 9143:
1246
922
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1247
923
 
1248
924
 
1249
925
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1250
926
  exports.createRemoteJWKSet = void 0;
1251
- const fetch_jwks_js_1 = __nccwpck_require__(7584);
1252
- const env_js_1 = __nccwpck_require__(3354);
1253
- const errors_js_1 = __nccwpck_require__(6891);
1254
- const local_js_1 = __nccwpck_require__(8560);
927
+ const fetch_jwks_js_1 = __nccwpck_require__(7409);
928
+ const env_js_1 = __nccwpck_require__(9884);
929
+ const errors_js_1 = __nccwpck_require__(2745);
930
+ const local_js_1 = __nccwpck_require__(1588);
1255
931
  class RemoteJWKSet extends local_js_1.LocalJWKSet {
1256
932
  constructor(url, options) {
1257
933
  super({ keys: [] });
@@ -1334,13 +1010,13 @@ exports.createRemoteJWKSet = createRemoteJWKSet;
1334
1010
 
1335
1011
  /***/ }),
1336
1012
 
1337
- /***/ 670:
1013
+ /***/ 9630:
1338
1014
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1339
1015
 
1340
1016
 
1341
1017
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1342
1018
  exports.CompactSign = void 0;
1343
- const sign_js_1 = __nccwpck_require__(657);
1019
+ const sign_js_1 = __nccwpck_require__(7347);
1344
1020
  class CompactSign {
1345
1021
  constructor(payload) {
1346
1022
  this._flattened = new sign_js_1.FlattenedSign(payload);
@@ -1362,15 +1038,15 @@ exports.CompactSign = CompactSign;
1362
1038
 
1363
1039
  /***/ }),
1364
1040
 
1365
- /***/ 3757:
1041
+ /***/ 214:
1366
1042
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1367
1043
 
1368
1044
 
1369
1045
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1370
1046
  exports.compactVerify = void 0;
1371
- const verify_js_1 = __nccwpck_require__(1071);
1372
- const errors_js_1 = __nccwpck_require__(6891);
1373
- const buffer_utils_js_1 = __nccwpck_require__(3605);
1047
+ const verify_js_1 = __nccwpck_require__(5763);
1048
+ const errors_js_1 = __nccwpck_require__(2745);
1049
+ const buffer_utils_js_1 = __nccwpck_require__(614);
1374
1050
  async function compactVerify(jws, key, options) {
1375
1051
  if (jws instanceof Uint8Array) {
1376
1052
  jws = buffer_utils_js_1.decoder.decode(jws);
@@ -1394,19 +1070,19 @@ exports.compactVerify = compactVerify;
1394
1070
 
1395
1071
  /***/ }),
1396
1072
 
1397
- /***/ 657:
1073
+ /***/ 7347:
1398
1074
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1399
1075
 
1400
1076
 
1401
1077
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1402
1078
  exports.FlattenedSign = void 0;
1403
- const base64url_js_1 = __nccwpck_require__(5091);
1404
- const sign_js_1 = __nccwpck_require__(8979);
1405
- const is_disjoint_js_1 = __nccwpck_require__(3710);
1406
- const errors_js_1 = __nccwpck_require__(6891);
1407
- const buffer_utils_js_1 = __nccwpck_require__(3605);
1408
- const check_key_type_js_1 = __nccwpck_require__(3067);
1409
- const validate_crit_js_1 = __nccwpck_require__(1516);
1079
+ const base64url_js_1 = __nccwpck_require__(7395);
1080
+ const sign_js_1 = __nccwpck_require__(6193);
1081
+ const is_disjoint_js_1 = __nccwpck_require__(7577);
1082
+ const errors_js_1 = __nccwpck_require__(2745);
1083
+ const buffer_utils_js_1 = __nccwpck_require__(614);
1084
+ const check_key_type_js_1 = __nccwpck_require__(7898);
1085
+ const validate_crit_js_1 = __nccwpck_require__(6203);
1410
1086
  class FlattenedSign {
1411
1087
  constructor(payload) {
1412
1088
  if (!(payload instanceof Uint8Array)) {
@@ -1486,21 +1162,21 @@ exports.FlattenedSign = FlattenedSign;
1486
1162
 
1487
1163
  /***/ }),
1488
1164
 
1489
- /***/ 1071:
1165
+ /***/ 5763:
1490
1166
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1491
1167
 
1492
1168
 
1493
1169
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1494
1170
  exports.flattenedVerify = void 0;
1495
- const base64url_js_1 = __nccwpck_require__(5091);
1496
- const verify_js_1 = __nccwpck_require__(7190);
1497
- const errors_js_1 = __nccwpck_require__(6891);
1498
- const buffer_utils_js_1 = __nccwpck_require__(3605);
1499
- const is_disjoint_js_1 = __nccwpck_require__(3710);
1500
- const is_object_js_1 = __nccwpck_require__(7787);
1501
- const check_key_type_js_1 = __nccwpck_require__(3067);
1502
- const validate_crit_js_1 = __nccwpck_require__(1516);
1503
- const validate_algorithms_js_1 = __nccwpck_require__(7946);
1171
+ const base64url_js_1 = __nccwpck_require__(7395);
1172
+ const verify_js_1 = __nccwpck_require__(4476);
1173
+ const errors_js_1 = __nccwpck_require__(2745);
1174
+ const buffer_utils_js_1 = __nccwpck_require__(614);
1175
+ const is_disjoint_js_1 = __nccwpck_require__(7577);
1176
+ const is_object_js_1 = __nccwpck_require__(6643);
1177
+ const check_key_type_js_1 = __nccwpck_require__(7898);
1178
+ const validate_crit_js_1 = __nccwpck_require__(6203);
1179
+ const validate_algorithms_js_1 = __nccwpck_require__(3290);
1504
1180
  async function flattenedVerify(jws, key, options) {
1505
1181
  var _a;
1506
1182
  if (!(0, is_object_js_1.default)(jws)) {
@@ -1601,14 +1277,14 @@ exports.flattenedVerify = flattenedVerify;
1601
1277
 
1602
1278
  /***/ }),
1603
1279
 
1604
- /***/ 8473:
1280
+ /***/ 7687:
1605
1281
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1606
1282
 
1607
1283
 
1608
1284
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1609
1285
  exports.GeneralSign = void 0;
1610
- const sign_js_1 = __nccwpck_require__(657);
1611
- const errors_js_1 = __nccwpck_require__(6891);
1286
+ const sign_js_1 = __nccwpck_require__(7347);
1287
+ const errors_js_1 = __nccwpck_require__(2745);
1612
1288
  class IndividualSignature {
1613
1289
  constructor(sig, key, options) {
1614
1290
  this.parent = sig;
@@ -1679,15 +1355,15 @@ exports.GeneralSign = GeneralSign;
1679
1355
 
1680
1356
  /***/ }),
1681
1357
 
1682
- /***/ 8913:
1358
+ /***/ 6984:
1683
1359
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1684
1360
 
1685
1361
 
1686
1362
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1687
1363
  exports.generalVerify = void 0;
1688
- const verify_js_1 = __nccwpck_require__(1071);
1689
- const errors_js_1 = __nccwpck_require__(6891);
1690
- const is_object_js_1 = __nccwpck_require__(7787);
1364
+ const verify_js_1 = __nccwpck_require__(5763);
1365
+ const errors_js_1 = __nccwpck_require__(2745);
1366
+ const is_object_js_1 = __nccwpck_require__(6643);
1691
1367
  async function generalVerify(jws, key, options) {
1692
1368
  if (!(0, is_object_js_1.default)(jws)) {
1693
1369
  throw new errors_js_1.JWSInvalid('General JWS must be an object');
@@ -1714,15 +1390,15 @@ exports.generalVerify = generalVerify;
1714
1390
 
1715
1391
  /***/ }),
1716
1392
 
1717
- /***/ 9486:
1393
+ /***/ 3632:
1718
1394
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1719
1395
 
1720
1396
 
1721
1397
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1722
1398
  exports.jwtDecrypt = void 0;
1723
- const decrypt_js_1 = __nccwpck_require__(1698);
1724
- const jwt_claims_set_js_1 = __nccwpck_require__(8350);
1725
- const errors_js_1 = __nccwpck_require__(6891);
1399
+ const decrypt_js_1 = __nccwpck_require__(9293);
1400
+ const jwt_claims_set_js_1 = __nccwpck_require__(4737);
1401
+ const errors_js_1 = __nccwpck_require__(2745);
1726
1402
  async function jwtDecrypt(jwt, key, options) {
1727
1403
  const decrypted = await (0, decrypt_js_1.compactDecrypt)(jwt, key, options);
1728
1404
  const payload = (0, jwt_claims_set_js_1.default)(decrypted.protectedHeader, decrypted.plaintext, options);
@@ -1748,15 +1424,15 @@ exports.jwtDecrypt = jwtDecrypt;
1748
1424
 
1749
1425
  /***/ }),
1750
1426
 
1751
- /***/ 242:
1427
+ /***/ 8332:
1752
1428
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1753
1429
 
1754
1430
 
1755
1431
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1756
1432
  exports.EncryptJWT = void 0;
1757
- const encrypt_js_1 = __nccwpck_require__(9325);
1758
- const buffer_utils_js_1 = __nccwpck_require__(3605);
1759
- const produce_js_1 = __nccwpck_require__(395);
1433
+ const encrypt_js_1 = __nccwpck_require__(7623);
1434
+ const buffer_utils_js_1 = __nccwpck_require__(614);
1435
+ const produce_js_1 = __nccwpck_require__(7969);
1760
1436
  class EncryptJWT extends produce_js_1.ProduceJWT {
1761
1437
  setProtectedHeader(protectedHeader) {
1762
1438
  if (this._protectedHeader) {
@@ -1827,15 +1503,15 @@ exports.EncryptJWT = EncryptJWT;
1827
1503
 
1828
1504
  /***/ }),
1829
1505
 
1830
- /***/ 395:
1506
+ /***/ 7969:
1831
1507
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1832
1508
 
1833
1509
 
1834
1510
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1835
1511
  exports.ProduceJWT = void 0;
1836
- const epoch_js_1 = __nccwpck_require__(1185);
1837
- const is_object_js_1 = __nccwpck_require__(7787);
1838
- const secs_js_1 = __nccwpck_require__(3393);
1512
+ const epoch_js_1 = __nccwpck_require__(7722);
1513
+ const is_object_js_1 = __nccwpck_require__(6643);
1514
+ const secs_js_1 = __nccwpck_require__(6293);
1839
1515
  class ProduceJWT {
1840
1516
  constructor(payload) {
1841
1517
  if (!(0, is_object_js_1.default)(payload)) {
@@ -1892,16 +1568,16 @@ exports.ProduceJWT = ProduceJWT;
1892
1568
 
1893
1569
  /***/ }),
1894
1570
 
1895
- /***/ 3744:
1571
+ /***/ 7561:
1896
1572
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1897
1573
 
1898
1574
 
1899
1575
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1900
1576
  exports.SignJWT = void 0;
1901
- const sign_js_1 = __nccwpck_require__(670);
1902
- const errors_js_1 = __nccwpck_require__(6891);
1903
- const buffer_utils_js_1 = __nccwpck_require__(3605);
1904
- const produce_js_1 = __nccwpck_require__(395);
1577
+ const sign_js_1 = __nccwpck_require__(9630);
1578
+ const errors_js_1 = __nccwpck_require__(2745);
1579
+ const buffer_utils_js_1 = __nccwpck_require__(614);
1580
+ const produce_js_1 = __nccwpck_require__(7969);
1905
1581
  class SignJWT extends produce_js_1.ProduceJWT {
1906
1582
  setProtectedHeader(protectedHeader) {
1907
1583
  this._protectedHeader = protectedHeader;
@@ -1924,17 +1600,17 @@ exports.SignJWT = SignJWT;
1924
1600
 
1925
1601
  /***/ }),
1926
1602
 
1927
- /***/ 9701:
1603
+ /***/ 7986:
1928
1604
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1929
1605
 
1930
1606
 
1931
1607
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1932
1608
  exports.UnsecuredJWT = void 0;
1933
- const base64url = __nccwpck_require__(5091);
1934
- const buffer_utils_js_1 = __nccwpck_require__(3605);
1935
- const errors_js_1 = __nccwpck_require__(6891);
1936
- const jwt_claims_set_js_1 = __nccwpck_require__(8350);
1937
- const produce_js_1 = __nccwpck_require__(395);
1609
+ const base64url = __nccwpck_require__(7395);
1610
+ const buffer_utils_js_1 = __nccwpck_require__(614);
1611
+ const errors_js_1 = __nccwpck_require__(2745);
1612
+ const jwt_claims_set_js_1 = __nccwpck_require__(4737);
1613
+ const produce_js_1 = __nccwpck_require__(7969);
1938
1614
  class UnsecuredJWT extends produce_js_1.ProduceJWT {
1939
1615
  encode() {
1940
1616
  const header = base64url.encode(JSON.stringify({ alg: 'none' }));
@@ -1967,15 +1643,15 @@ exports.UnsecuredJWT = UnsecuredJWT;
1967
1643
 
1968
1644
  /***/ }),
1969
1645
 
1970
- /***/ 958:
1646
+ /***/ 2005:
1971
1647
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1972
1648
 
1973
1649
 
1974
1650
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1975
1651
  exports.jwtVerify = void 0;
1976
- const verify_js_1 = __nccwpck_require__(3757);
1977
- const jwt_claims_set_js_1 = __nccwpck_require__(8350);
1978
- const errors_js_1 = __nccwpck_require__(6891);
1652
+ const verify_js_1 = __nccwpck_require__(214);
1653
+ const jwt_claims_set_js_1 = __nccwpck_require__(4737);
1654
+ const errors_js_1 = __nccwpck_require__(2745);
1979
1655
  async function jwtVerify(jwt, key, options) {
1980
1656
  var _a;
1981
1657
  const verified = await (0, verify_js_1.compactVerify)(jwt, key, options);
@@ -1994,15 +1670,15 @@ exports.jwtVerify = jwtVerify;
1994
1670
 
1995
1671
  /***/ }),
1996
1672
 
1997
- /***/ 8771:
1673
+ /***/ 8239:
1998
1674
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1999
1675
 
2000
1676
 
2001
1677
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2002
1678
  exports.exportJWK = exports.exportPKCS8 = exports.exportSPKI = void 0;
2003
- const asn1_js_1 = __nccwpck_require__(3029);
2004
- const asn1_js_2 = __nccwpck_require__(3029);
2005
- const key_to_jwk_js_1 = __nccwpck_require__(1297);
1679
+ const asn1_js_1 = __nccwpck_require__(1662);
1680
+ const asn1_js_2 = __nccwpck_require__(1662);
1681
+ const key_to_jwk_js_1 = __nccwpck_require__(4135);
2006
1682
  async function exportSPKI(key) {
2007
1683
  return (0, asn1_js_1.toSPKI)(key);
2008
1684
  }
@@ -2019,13 +1695,13 @@ exports.exportJWK = exportJWK;
2019
1695
 
2020
1696
  /***/ }),
2021
1697
 
2022
- /***/ 8959:
1698
+ /***/ 5449:
2023
1699
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2024
1700
 
2025
1701
 
2026
1702
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2027
1703
  exports.generateKeyPair = void 0;
2028
- const generate_js_1 = __nccwpck_require__(8737);
1704
+ const generate_js_1 = __nccwpck_require__(3583);
2029
1705
  async function generateKeyPair(alg, options) {
2030
1706
  return (0, generate_js_1.generateKeyPair)(alg, options);
2031
1707
  }
@@ -2034,13 +1710,13 @@ exports.generateKeyPair = generateKeyPair;
2034
1710
 
2035
1711
  /***/ }),
2036
1712
 
2037
- /***/ 9896:
1713
+ /***/ 6096:
2038
1714
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2039
1715
 
2040
1716
 
2041
1717
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2042
1718
  exports.generateSecret = void 0;
2043
- const generate_js_1 = __nccwpck_require__(8737);
1719
+ const generate_js_1 = __nccwpck_require__(3583);
2044
1720
  async function generateSecret(alg, options) {
2045
1721
  return (0, generate_js_1.generateSecret)(alg, options);
2046
1722
  }
@@ -2049,19 +1725,19 @@ exports.generateSecret = generateSecret;
2049
1725
 
2050
1726
  /***/ }),
2051
1727
 
2052
- /***/ 3287:
1728
+ /***/ 1010:
2053
1729
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2054
1730
 
2055
1731
 
2056
1732
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2057
1733
  exports.importJWK = exports.importPKCS8 = exports.importX509 = exports.importSPKI = void 0;
2058
- const base64url_js_1 = __nccwpck_require__(5091);
2059
- const asn1_js_1 = __nccwpck_require__(3029);
2060
- const asn1_js_2 = __nccwpck_require__(3029);
2061
- const jwk_to_key_js_1 = __nccwpck_require__(2251);
2062
- const errors_js_1 = __nccwpck_require__(6891);
2063
- const format_pem_js_1 = __nccwpck_require__(7283);
2064
- const is_object_js_1 = __nccwpck_require__(7787);
1734
+ const base64url_js_1 = __nccwpck_require__(7395);
1735
+ const asn1_js_1 = __nccwpck_require__(1662);
1736
+ const asn1_js_2 = __nccwpck_require__(1662);
1737
+ const jwk_to_key_js_1 = __nccwpck_require__(3810);
1738
+ const errors_js_1 = __nccwpck_require__(2745);
1739
+ const format_pem_js_1 = __nccwpck_require__(3257);
1740
+ const is_object_js_1 = __nccwpck_require__(6643);
2065
1741
  function getElement(seq) {
2066
1742
  let result = [];
2067
1743
  let next = 0;
@@ -2183,16 +1859,16 @@ exports.importJWK = importJWK;
2183
1859
 
2184
1860
  /***/ }),
2185
1861
 
2186
- /***/ 7081:
1862
+ /***/ 3049:
2187
1863
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2188
1864
 
2189
1865
 
2190
1866
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2191
1867
  exports.unwrap = exports.wrap = void 0;
2192
- const encrypt_js_1 = __nccwpck_require__(5613);
2193
- const decrypt_js_1 = __nccwpck_require__(1788);
2194
- const iv_js_1 = __nccwpck_require__(8379);
2195
- const base64url_js_1 = __nccwpck_require__(5091);
1868
+ const encrypt_js_1 = __nccwpck_require__(277);
1869
+ const decrypt_js_1 = __nccwpck_require__(4888);
1870
+ const iv_js_1 = __nccwpck_require__(7751);
1871
+ const base64url_js_1 = __nccwpck_require__(7395);
2196
1872
  async function wrap(alg, key, cek, iv) {
2197
1873
  const jweAlgorithm = alg.slice(0, 7);
2198
1874
  iv || (iv = (0, iv_js_1.default)(jweAlgorithm));
@@ -2209,13 +1885,13 @@ exports.unwrap = unwrap;
2209
1885
 
2210
1886
  /***/ }),
2211
1887
 
2212
- /***/ 3605:
1888
+ /***/ 614:
2213
1889
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2214
1890
 
2215
1891
 
2216
1892
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2217
1893
  exports.concatKdf = exports.lengthAndInput = exports.uint32be = exports.uint64be = exports.p2s = exports.concat = exports.decoder = exports.encoder = void 0;
2218
- const digest_js_1 = __nccwpck_require__(7638);
1894
+ const digest_js_1 = __nccwpck_require__(1011);
2219
1895
  exports.encoder = new TextEncoder();
2220
1896
  exports.decoder = new TextDecoder();
2221
1897
  const MAX_INT32 = 2 ** 32;
@@ -2276,14 +1952,14 @@ exports.concatKdf = concatKdf;
2276
1952
 
2277
1953
  /***/ }),
2278
1954
 
2279
- /***/ 9942:
1955
+ /***/ 284:
2280
1956
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2281
1957
 
2282
1958
 
2283
1959
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2284
1960
  exports.bitLength = void 0;
2285
- const errors_js_1 = __nccwpck_require__(6891);
2286
- const random_js_1 = __nccwpck_require__(3609);
1961
+ const errors_js_1 = __nccwpck_require__(2745);
1962
+ const random_js_1 = __nccwpck_require__(2368);
2287
1963
  function bitLength(alg) {
2288
1964
  switch (alg) {
2289
1965
  case 'A128GCM':
@@ -2307,13 +1983,13 @@ exports["default"] = (alg) => (0, random_js_1.default)(new Uint8Array(bitLength(
2307
1983
 
2308
1984
  /***/ }),
2309
1985
 
2310
- /***/ 962:
1986
+ /***/ 2225:
2311
1987
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2312
1988
 
2313
1989
 
2314
1990
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2315
- const errors_js_1 = __nccwpck_require__(6891);
2316
- const iv_js_1 = __nccwpck_require__(8379);
1991
+ const errors_js_1 = __nccwpck_require__(2745);
1992
+ const iv_js_1 = __nccwpck_require__(7751);
2317
1993
  const checkIvLength = (enc, iv) => {
2318
1994
  if (iv.length << 3 !== (0, iv_js_1.bitLength)(enc)) {
2319
1995
  throw new errors_js_1.JWEInvalid('Invalid Initialization Vector length');
@@ -2324,13 +2000,13 @@ exports["default"] = checkIvLength;
2324
2000
 
2325
2001
  /***/ }),
2326
2002
 
2327
- /***/ 3067:
2003
+ /***/ 7898:
2328
2004
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2329
2005
 
2330
2006
 
2331
2007
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2332
- const invalid_key_input_js_1 = __nccwpck_require__(9548);
2333
- const is_key_like_js_1 = __nccwpck_require__(938);
2008
+ const invalid_key_input_js_1 = __nccwpck_require__(5547);
2009
+ const is_key_like_js_1 = __nccwpck_require__(4871);
2334
2010
  const symmetricTypeCheck = (key) => {
2335
2011
  if (key instanceof Uint8Array)
2336
2012
  return;
@@ -2378,12 +2054,12 @@ exports["default"] = checkKeyType;
2378
2054
 
2379
2055
  /***/ }),
2380
2056
 
2381
- /***/ 2469:
2057
+ /***/ 5025:
2382
2058
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2383
2059
 
2384
2060
 
2385
2061
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2386
- const errors_js_1 = __nccwpck_require__(6891);
2062
+ const errors_js_1 = __nccwpck_require__(2745);
2387
2063
  function checkP2s(p2s) {
2388
2064
  if (!(p2s instanceof Uint8Array) || p2s.length < 8) {
2389
2065
  throw new errors_js_1.JWEInvalid('PBES2 Salt Input must be 8 or more octets');
@@ -2394,13 +2070,13 @@ exports["default"] = checkP2s;
2394
2070
 
2395
2071
  /***/ }),
2396
2072
 
2397
- /***/ 7849:
2073
+ /***/ 5985:
2398
2074
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2399
2075
 
2400
2076
 
2401
2077
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2402
2078
  exports.checkEncCryptoKey = exports.checkSigCryptoKey = void 0;
2403
- const env_js_1 = __nccwpck_require__(3354);
2079
+ const env_js_1 = __nccwpck_require__(9884);
2404
2080
  function unusable(name, prop = 'algorithm.name') {
2405
2081
  return new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);
2406
2082
  }
@@ -2551,22 +2227,22 @@ exports.checkEncCryptoKey = checkEncCryptoKey;
2551
2227
 
2552
2228
  /***/ }),
2553
2229
 
2554
- /***/ 3635:
2230
+ /***/ 5044:
2555
2231
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2556
2232
 
2557
2233
 
2558
2234
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2559
- const aeskw_js_1 = __nccwpck_require__(7052);
2560
- const ECDH = __nccwpck_require__(2772);
2561
- const pbes2kw_js_1 = __nccwpck_require__(5151);
2562
- const rsaes_js_1 = __nccwpck_require__(8550);
2563
- const base64url_js_1 = __nccwpck_require__(5091);
2564
- const errors_js_1 = __nccwpck_require__(6891);
2565
- const cek_js_1 = __nccwpck_require__(9942);
2566
- const import_js_1 = __nccwpck_require__(3287);
2567
- const check_key_type_js_1 = __nccwpck_require__(3067);
2568
- const is_object_js_1 = __nccwpck_require__(7787);
2569
- const aesgcmkw_js_1 = __nccwpck_require__(7081);
2235
+ const aeskw_js_1 = __nccwpck_require__(4357);
2236
+ const ECDH = __nccwpck_require__(9356);
2237
+ const pbes2kw_js_1 = __nccwpck_require__(9295);
2238
+ const rsaes_js_1 = __nccwpck_require__(211);
2239
+ const base64url_js_1 = __nccwpck_require__(7395);
2240
+ const errors_js_1 = __nccwpck_require__(2745);
2241
+ const cek_js_1 = __nccwpck_require__(284);
2242
+ const import_js_1 = __nccwpck_require__(1010);
2243
+ const check_key_type_js_1 = __nccwpck_require__(7898);
2244
+ const is_object_js_1 = __nccwpck_require__(6643);
2245
+ const aesgcmkw_js_1 = __nccwpck_require__(3049);
2570
2246
  async function decryptKeyManagement(alg, key, encryptedKey, joseHeader, options) {
2571
2247
  (0, check_key_type_js_1.default)(alg, key, 'decrypt');
2572
2248
  switch (alg) {
@@ -2658,21 +2334,21 @@ exports["default"] = decryptKeyManagement;
2658
2334
 
2659
2335
  /***/ }),
2660
2336
 
2661
- /***/ 6053:
2337
+ /***/ 1050:
2662
2338
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2663
2339
 
2664
2340
 
2665
2341
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2666
- const aeskw_js_1 = __nccwpck_require__(7052);
2667
- const ECDH = __nccwpck_require__(2772);
2668
- const pbes2kw_js_1 = __nccwpck_require__(5151);
2669
- const rsaes_js_1 = __nccwpck_require__(8550);
2670
- const base64url_js_1 = __nccwpck_require__(5091);
2671
- const cek_js_1 = __nccwpck_require__(9942);
2672
- const errors_js_1 = __nccwpck_require__(6891);
2673
- const export_js_1 = __nccwpck_require__(8771);
2674
- const check_key_type_js_1 = __nccwpck_require__(3067);
2675
- const aesgcmkw_js_1 = __nccwpck_require__(7081);
2342
+ const aeskw_js_1 = __nccwpck_require__(4357);
2343
+ const ECDH = __nccwpck_require__(9356);
2344
+ const pbes2kw_js_1 = __nccwpck_require__(9295);
2345
+ const rsaes_js_1 = __nccwpck_require__(211);
2346
+ const base64url_js_1 = __nccwpck_require__(7395);
2347
+ const cek_js_1 = __nccwpck_require__(284);
2348
+ const errors_js_1 = __nccwpck_require__(2745);
2349
+ const export_js_1 = __nccwpck_require__(8239);
2350
+ const check_key_type_js_1 = __nccwpck_require__(7898);
2351
+ const aesgcmkw_js_1 = __nccwpck_require__(3049);
2676
2352
  async function encryptKeyManagement(alg, enc, key, providedCek, providedParameters = {}) {
2677
2353
  let encryptedKey;
2678
2354
  let parameters;
@@ -2754,7 +2430,7 @@ exports["default"] = encryptKeyManagement;
2754
2430
 
2755
2431
  /***/ }),
2756
2432
 
2757
- /***/ 1185:
2433
+ /***/ 7722:
2758
2434
  /***/ ((__unused_webpack_module, exports) => {
2759
2435
 
2760
2436
 
@@ -2764,7 +2440,7 @@ exports["default"] = (date) => Math.floor(date.getTime() / 1000);
2764
2440
 
2765
2441
  /***/ }),
2766
2442
 
2767
- /***/ 7283:
2443
+ /***/ 3257:
2768
2444
  /***/ ((__unused_webpack_module, exports) => {
2769
2445
 
2770
2446
 
@@ -2777,7 +2453,7 @@ exports["default"] = (b64, descriptor) => {
2777
2453
 
2778
2454
  /***/ }),
2779
2455
 
2780
- /***/ 9548:
2456
+ /***/ 5547:
2781
2457
  /***/ ((__unused_webpack_module, exports) => {
2782
2458
 
2783
2459
 
@@ -2811,7 +2487,7 @@ exports["default"] = (actual, ...types) => {
2811
2487
 
2812
2488
  /***/ }),
2813
2489
 
2814
- /***/ 3710:
2490
+ /***/ 7577:
2815
2491
  /***/ ((__unused_webpack_module, exports) => {
2816
2492
 
2817
2493
 
@@ -2842,7 +2518,7 @@ exports["default"] = isDisjoint;
2842
2518
 
2843
2519
  /***/ }),
2844
2520
 
2845
- /***/ 7787:
2521
+ /***/ 6643:
2846
2522
  /***/ ((__unused_webpack_module, exports) => {
2847
2523
 
2848
2524
 
@@ -2868,14 +2544,14 @@ exports["default"] = isObject;
2868
2544
 
2869
2545
  /***/ }),
2870
2546
 
2871
- /***/ 8379:
2547
+ /***/ 7751:
2872
2548
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2873
2549
 
2874
2550
 
2875
2551
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2876
2552
  exports.bitLength = void 0;
2877
- const errors_js_1 = __nccwpck_require__(6891);
2878
- const random_js_1 = __nccwpck_require__(3609);
2553
+ const errors_js_1 = __nccwpck_require__(2745);
2554
+ const random_js_1 = __nccwpck_require__(2368);
2879
2555
  function bitLength(alg) {
2880
2556
  switch (alg) {
2881
2557
  case 'A128GCM':
@@ -2899,16 +2575,16 @@ exports["default"] = (alg) => (0, random_js_1.default)(new Uint8Array(bitLength(
2899
2575
 
2900
2576
  /***/ }),
2901
2577
 
2902
- /***/ 8350:
2578
+ /***/ 4737:
2903
2579
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2904
2580
 
2905
2581
 
2906
2582
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2907
- const errors_js_1 = __nccwpck_require__(6891);
2908
- const buffer_utils_js_1 = __nccwpck_require__(3605);
2909
- const epoch_js_1 = __nccwpck_require__(1185);
2910
- const secs_js_1 = __nccwpck_require__(3393);
2911
- const is_object_js_1 = __nccwpck_require__(7787);
2583
+ const errors_js_1 = __nccwpck_require__(2745);
2584
+ const buffer_utils_js_1 = __nccwpck_require__(614);
2585
+ const epoch_js_1 = __nccwpck_require__(7722);
2586
+ const secs_js_1 = __nccwpck_require__(6293);
2587
+ const is_object_js_1 = __nccwpck_require__(6643);
2912
2588
  const normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, '');
2913
2589
  const checkAudiencePresence = (audPayload, audOption) => {
2914
2590
  if (typeof audPayload === 'string') {
@@ -2999,7 +2675,7 @@ exports["default"] = (protectedHeader, encodedPayload, options = {}) => {
2999
2675
 
3000
2676
  /***/ }),
3001
2677
 
3002
- /***/ 3393:
2678
+ /***/ 6293:
3003
2679
  /***/ ((__unused_webpack_module, exports) => {
3004
2680
 
3005
2681
 
@@ -3052,7 +2728,7 @@ exports["default"] = (str) => {
3052
2728
 
3053
2729
  /***/ }),
3054
2730
 
3055
- /***/ 7946:
2731
+ /***/ 3290:
3056
2732
  /***/ ((__unused_webpack_module, exports) => {
3057
2733
 
3058
2734
 
@@ -3072,12 +2748,12 @@ exports["default"] = validateAlgorithms;
3072
2748
 
3073
2749
  /***/ }),
3074
2750
 
3075
- /***/ 1516:
2751
+ /***/ 6203:
3076
2752
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3077
2753
 
3078
2754
 
3079
2755
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3080
- const errors_js_1 = __nccwpck_require__(6891);
2756
+ const errors_js_1 = __nccwpck_require__(2745);
3081
2757
  function validateCrit(Err, recognizedDefault, recognizedOption, protectedHeader, joseHeader) {
3082
2758
  if (joseHeader.crit !== undefined && protectedHeader.crit === undefined) {
3083
2759
  throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected');
@@ -3115,7 +2791,7 @@ exports["default"] = validateCrit;
3115
2791
 
3116
2792
  /***/ }),
3117
2793
 
3118
- /***/ 7052:
2794
+ /***/ 4357:
3119
2795
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3120
2796
 
3121
2797
 
@@ -3123,14 +2799,14 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
3123
2799
  exports.unwrap = exports.wrap = void 0;
3124
2800
  const buffer_1 = __nccwpck_require__(4300);
3125
2801
  const crypto_1 = __nccwpck_require__(6113);
3126
- const errors_js_1 = __nccwpck_require__(6891);
3127
- const buffer_utils_js_1 = __nccwpck_require__(3605);
3128
- const webcrypto_js_1 = __nccwpck_require__(6474);
3129
- const crypto_key_js_1 = __nccwpck_require__(7849);
3130
- const is_key_object_js_1 = __nccwpck_require__(3758);
3131
- const invalid_key_input_js_1 = __nccwpck_require__(9548);
3132
- const ciphers_js_1 = __nccwpck_require__(3227);
3133
- const is_key_like_js_1 = __nccwpck_require__(938);
2802
+ const errors_js_1 = __nccwpck_require__(2745);
2803
+ const buffer_utils_js_1 = __nccwpck_require__(614);
2804
+ const webcrypto_js_1 = __nccwpck_require__(2259);
2805
+ const crypto_key_js_1 = __nccwpck_require__(5985);
2806
+ const is_key_object_js_1 = __nccwpck_require__(1093);
2807
+ const invalid_key_input_js_1 = __nccwpck_require__(5547);
2808
+ const ciphers_js_1 = __nccwpck_require__(7464);
2809
+ const is_key_like_js_1 = __nccwpck_require__(4871);
3134
2810
  function checkKeySize(key, alg) {
3135
2811
  if (key.symmetricKeySize << 3 !== parseInt(alg.slice(1, 4), 10)) {
3136
2812
  throw new TypeError(`Invalid key size for alg: ${alg}`);
@@ -3177,7 +2853,7 @@ exports.unwrap = unwrap;
3177
2853
 
3178
2854
  /***/ }),
3179
2855
 
3180
- /***/ 3029:
2856
+ /***/ 1662:
3181
2857
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3182
2858
 
3183
2859
 
@@ -3185,10 +2861,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
3185
2861
  exports.fromSPKI = exports.fromPKCS8 = exports.toPKCS8 = exports.toSPKI = void 0;
3186
2862
  const crypto_1 = __nccwpck_require__(6113);
3187
2863
  const buffer_1 = __nccwpck_require__(4300);
3188
- const webcrypto_js_1 = __nccwpck_require__(6474);
3189
- const is_key_object_js_1 = __nccwpck_require__(3758);
3190
- const invalid_key_input_js_1 = __nccwpck_require__(9548);
3191
- const is_key_like_js_1 = __nccwpck_require__(938);
2864
+ const webcrypto_js_1 = __nccwpck_require__(2259);
2865
+ const is_key_object_js_1 = __nccwpck_require__(1093);
2866
+ const invalid_key_input_js_1 = __nccwpck_require__(5547);
2867
+ const is_key_like_js_1 = __nccwpck_require__(4871);
3192
2868
  const genericExport = (keyType, keyFormat, key) => {
3193
2869
  let keyObject;
3194
2870
  if ((0, webcrypto_js_1.isCryptoKey)(key)) {
@@ -3232,7 +2908,7 @@ exports.fromSPKI = fromSPKI;
3232
2908
 
3233
2909
  /***/ }),
3234
2910
 
3235
- /***/ 9301:
2911
+ /***/ 5554:
3236
2912
  /***/ ((__unused_webpack_module, exports) => {
3237
2913
 
3238
2914
 
@@ -3286,13 +2962,13 @@ exports["default"] = Asn1SequenceDecoder;
3286
2962
 
3287
2963
  /***/ }),
3288
2964
 
3289
- /***/ 7326:
2965
+ /***/ 7390:
3290
2966
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3291
2967
 
3292
2968
 
3293
2969
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3294
2970
  const buffer_1 = __nccwpck_require__(4300);
3295
- const errors_js_1 = __nccwpck_require__(6891);
2971
+ const errors_js_1 = __nccwpck_require__(2745);
3296
2972
  const tagInteger = 0x02;
3297
2973
  const tagBitStr = 0x03;
3298
2974
  const tagOctStr = 0x04;
@@ -3384,14 +3060,14 @@ exports["default"] = DumbAsn1Encoder;
3384
3060
 
3385
3061
  /***/ }),
3386
3062
 
3387
- /***/ 5091:
3063
+ /***/ 7395:
3388
3064
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3389
3065
 
3390
3066
 
3391
3067
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3392
3068
  exports.decode = exports.encode = exports.encodeBase64 = exports.decodeBase64 = void 0;
3393
3069
  const buffer_1 = __nccwpck_require__(4300);
3394
- const buffer_utils_js_1 = __nccwpck_require__(3605);
3070
+ const buffer_utils_js_1 = __nccwpck_require__(614);
3395
3071
  let encode;
3396
3072
  exports.encode = encode;
3397
3073
  function normalize(input) {
@@ -3417,13 +3093,13 @@ exports.decode = decode;
3417
3093
 
3418
3094
  /***/ }),
3419
3095
 
3420
- /***/ 261:
3096
+ /***/ 3680:
3421
3097
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3422
3098
 
3423
3099
 
3424
3100
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3425
3101
  const crypto_1 = __nccwpck_require__(6113);
3426
- const buffer_utils_js_1 = __nccwpck_require__(3605);
3102
+ const buffer_utils_js_1 = __nccwpck_require__(614);
3427
3103
  function cbcTag(aad, iv, ciphertext, macSize, macKey, keySize) {
3428
3104
  const macData = (0, buffer_utils_js_1.concat)(aad, iv, ciphertext, (0, buffer_utils_js_1.uint64be)(aad.length << 3));
3429
3105
  const hmac = (0, crypto_1.createHmac)(`sha${macSize}`, macKey);
@@ -3435,13 +3111,13 @@ exports["default"] = cbcTag;
3435
3111
 
3436
3112
  /***/ }),
3437
3113
 
3438
- /***/ 1529:
3114
+ /***/ 4507:
3439
3115
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3440
3116
 
3441
3117
 
3442
3118
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3443
- const errors_js_1 = __nccwpck_require__(6891);
3444
- const is_key_object_js_1 = __nccwpck_require__(3758);
3119
+ const errors_js_1 = __nccwpck_require__(2745);
3120
+ const is_key_object_js_1 = __nccwpck_require__(1093);
3445
3121
  const checkCekLength = (enc, cek) => {
3446
3122
  let expected;
3447
3123
  switch (enc) {
@@ -3477,7 +3153,7 @@ exports["default"] = checkCekLength;
3477
3153
 
3478
3154
  /***/ }),
3479
3155
 
3480
- /***/ 1862:
3156
+ /***/ 3995:
3481
3157
  /***/ ((__unused_webpack_module, exports) => {
3482
3158
 
3483
3159
 
@@ -3536,7 +3212,7 @@ exports["default"] = (key, alg) => {
3536
3212
 
3537
3213
  /***/ }),
3538
3214
 
3539
- /***/ 3227:
3215
+ /***/ 7464:
3540
3216
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3541
3217
 
3542
3218
 
@@ -3551,24 +3227,24 @@ exports["default"] = (algorithm) => {
3551
3227
 
3552
3228
  /***/ }),
3553
3229
 
3554
- /***/ 1788:
3230
+ /***/ 4888:
3555
3231
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3556
3232
 
3557
3233
 
3558
3234
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3559
3235
  const crypto_1 = __nccwpck_require__(6113);
3560
- const check_iv_length_js_1 = __nccwpck_require__(962);
3561
- const check_cek_length_js_1 = __nccwpck_require__(1529);
3562
- const buffer_utils_js_1 = __nccwpck_require__(3605);
3563
- const errors_js_1 = __nccwpck_require__(6891);
3564
- const timing_safe_equal_js_1 = __nccwpck_require__(4568);
3565
- const cbc_tag_js_1 = __nccwpck_require__(261);
3566
- const webcrypto_js_1 = __nccwpck_require__(6474);
3567
- const crypto_key_js_1 = __nccwpck_require__(7849);
3568
- const is_key_object_js_1 = __nccwpck_require__(3758);
3569
- const invalid_key_input_js_1 = __nccwpck_require__(9548);
3570
- const ciphers_js_1 = __nccwpck_require__(3227);
3571
- const is_key_like_js_1 = __nccwpck_require__(938);
3236
+ const check_iv_length_js_1 = __nccwpck_require__(2225);
3237
+ const check_cek_length_js_1 = __nccwpck_require__(4507);
3238
+ const buffer_utils_js_1 = __nccwpck_require__(614);
3239
+ const errors_js_1 = __nccwpck_require__(2745);
3240
+ const timing_safe_equal_js_1 = __nccwpck_require__(1517);
3241
+ const cbc_tag_js_1 = __nccwpck_require__(3680);
3242
+ const webcrypto_js_1 = __nccwpck_require__(2259);
3243
+ const crypto_key_js_1 = __nccwpck_require__(5985);
3244
+ const is_key_object_js_1 = __nccwpck_require__(1093);
3245
+ const invalid_key_input_js_1 = __nccwpck_require__(5547);
3246
+ const ciphers_js_1 = __nccwpck_require__(7464);
3247
+ const is_key_like_js_1 = __nccwpck_require__(4871);
3572
3248
  function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
3573
3249
  const keySize = parseInt(enc.slice(1, 4), 10);
3574
3250
  if ((0, is_key_object_js_1.default)(cek)) {
@@ -3655,7 +3331,7 @@ exports["default"] = decrypt;
3655
3331
 
3656
3332
  /***/ }),
3657
3333
 
3658
- /***/ 7638:
3334
+ /***/ 1011:
3659
3335
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3660
3336
 
3661
3337
 
@@ -3667,12 +3343,12 @@ exports["default"] = digest;
3667
3343
 
3668
3344
  /***/ }),
3669
3345
 
3670
- /***/ 1312:
3346
+ /***/ 8704:
3671
3347
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3672
3348
 
3673
3349
 
3674
3350
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3675
- const errors_js_1 = __nccwpck_require__(6891);
3351
+ const errors_js_1 = __nccwpck_require__(2745);
3676
3352
  function dsaDigest(alg) {
3677
3353
  switch (alg) {
3678
3354
  case 'PS256':
@@ -3699,7 +3375,7 @@ exports["default"] = dsaDigest;
3699
3375
 
3700
3376
  /***/ }),
3701
3377
 
3702
- /***/ 2772:
3378
+ /***/ 9356:
3703
3379
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3704
3380
 
3705
3381
 
@@ -3707,14 +3383,14 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
3707
3383
  exports.ecdhAllowed = exports.generateEpk = exports.deriveKey = void 0;
3708
3384
  const crypto_1 = __nccwpck_require__(6113);
3709
3385
  const util_1 = __nccwpck_require__(3837);
3710
- const get_named_curve_js_1 = __nccwpck_require__(3607);
3711
- const buffer_utils_js_1 = __nccwpck_require__(3605);
3712
- const errors_js_1 = __nccwpck_require__(6891);
3713
- const webcrypto_js_1 = __nccwpck_require__(6474);
3714
- const crypto_key_js_1 = __nccwpck_require__(7849);
3715
- const is_key_object_js_1 = __nccwpck_require__(3758);
3716
- const invalid_key_input_js_1 = __nccwpck_require__(9548);
3717
- const is_key_like_js_1 = __nccwpck_require__(938);
3386
+ const get_named_curve_js_1 = __nccwpck_require__(6572);
3387
+ const buffer_utils_js_1 = __nccwpck_require__(614);
3388
+ const errors_js_1 = __nccwpck_require__(2745);
3389
+ const webcrypto_js_1 = __nccwpck_require__(2259);
3390
+ const crypto_key_js_1 = __nccwpck_require__(5985);
3391
+ const is_key_object_js_1 = __nccwpck_require__(1093);
3392
+ const invalid_key_input_js_1 = __nccwpck_require__(5547);
3393
+ const is_key_like_js_1 = __nccwpck_require__(4871);
3718
3394
  const generateKeyPair = (0, util_1.promisify)(crypto_1.generateKeyPair);
3719
3395
  async function deriveKey(publicKee, privateKee, algorithm, keyLength, apu = new Uint8Array(0), apv = new Uint8Array(0)) {
3720
3396
  let publicKey;
@@ -3776,23 +3452,23 @@ exports.ecdhAllowed = ecdhAllowed;
3776
3452
 
3777
3453
  /***/ }),
3778
3454
 
3779
- /***/ 5613:
3455
+ /***/ 277:
3780
3456
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3781
3457
 
3782
3458
 
3783
3459
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3784
3460
  const crypto_1 = __nccwpck_require__(6113);
3785
- const check_iv_length_js_1 = __nccwpck_require__(962);
3786
- const check_cek_length_js_1 = __nccwpck_require__(1529);
3787
- const buffer_utils_js_1 = __nccwpck_require__(3605);
3788
- const cbc_tag_js_1 = __nccwpck_require__(261);
3789
- const webcrypto_js_1 = __nccwpck_require__(6474);
3790
- const crypto_key_js_1 = __nccwpck_require__(7849);
3791
- const is_key_object_js_1 = __nccwpck_require__(3758);
3792
- const invalid_key_input_js_1 = __nccwpck_require__(9548);
3793
- const errors_js_1 = __nccwpck_require__(6891);
3794
- const ciphers_js_1 = __nccwpck_require__(3227);
3795
- const is_key_like_js_1 = __nccwpck_require__(938);
3461
+ const check_iv_length_js_1 = __nccwpck_require__(2225);
3462
+ const check_cek_length_js_1 = __nccwpck_require__(4507);
3463
+ const buffer_utils_js_1 = __nccwpck_require__(614);
3464
+ const cbc_tag_js_1 = __nccwpck_require__(3680);
3465
+ const webcrypto_js_1 = __nccwpck_require__(2259);
3466
+ const crypto_key_js_1 = __nccwpck_require__(5985);
3467
+ const is_key_object_js_1 = __nccwpck_require__(1093);
3468
+ const invalid_key_input_js_1 = __nccwpck_require__(5547);
3469
+ const errors_js_1 = __nccwpck_require__(2745);
3470
+ const ciphers_js_1 = __nccwpck_require__(7464);
3471
+ const is_key_like_js_1 = __nccwpck_require__(4871);
3796
3472
  function cbcEncrypt(enc, plaintext, cek, iv, aad) {
3797
3473
  const keySize = parseInt(enc.slice(1, 4), 10);
3798
3474
  if ((0, is_key_object_js_1.default)(cek)) {
@@ -3857,7 +3533,7 @@ exports["default"] = encrypt;
3857
3533
 
3858
3534
  /***/ }),
3859
3535
 
3860
- /***/ 3354:
3536
+ /***/ 9884:
3861
3537
  /***/ ((__unused_webpack_module, exports) => {
3862
3538
 
3863
3539
 
@@ -3871,7 +3547,7 @@ exports.isCloudflareWorkers = isCloudflareWorkers;
3871
3547
 
3872
3548
  /***/ }),
3873
3549
 
3874
- /***/ 7584:
3550
+ /***/ 7409:
3875
3551
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3876
3552
 
3877
3553
 
@@ -3879,8 +3555,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
3879
3555
  const http = __nccwpck_require__(3685);
3880
3556
  const https = __nccwpck_require__(5687);
3881
3557
  const events_1 = __nccwpck_require__(2361);
3882
- const errors_js_1 = __nccwpck_require__(6891);
3883
- const buffer_utils_js_1 = __nccwpck_require__(3605);
3558
+ const errors_js_1 = __nccwpck_require__(2745);
3559
+ const buffer_utils_js_1 = __nccwpck_require__(614);
3884
3560
  const fetchJwks = async (url, timeout, options) => {
3885
3561
  let get;
3886
3562
  switch (url.protocol) {
@@ -3923,7 +3599,7 @@ exports["default"] = fetchJwks;
3923
3599
 
3924
3600
  /***/ }),
3925
3601
 
3926
- /***/ 8737:
3602
+ /***/ 3583:
3927
3603
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3928
3604
 
3929
3605
 
@@ -3931,9 +3607,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
3931
3607
  exports.generateKeyPair = exports.generateSecret = void 0;
3932
3608
  const crypto_1 = __nccwpck_require__(6113);
3933
3609
  const util_1 = __nccwpck_require__(3837);
3934
- const random_js_1 = __nccwpck_require__(3609);
3935
- const check_modulus_length_js_1 = __nccwpck_require__(1862);
3936
- const errors_js_1 = __nccwpck_require__(6891);
3610
+ const random_js_1 = __nccwpck_require__(2368);
3611
+ const check_modulus_length_js_1 = __nccwpck_require__(3995);
3612
+ const errors_js_1 = __nccwpck_require__(2745);
3937
3613
  const generate = (0, util_1.promisify)(crypto_1.generateKeyPair);
3938
3614
  async function generateSecret(alg, options) {
3939
3615
  let length;
@@ -4035,7 +3711,7 @@ exports.generateKeyPair = generateKeyPair;
4035
3711
 
4036
3712
  /***/ }),
4037
3713
 
4038
- /***/ 3607:
3714
+ /***/ 6572:
4039
3715
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4040
3716
 
4041
3717
 
@@ -4043,11 +3719,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
4043
3719
  exports.setCurve = exports.weakMap = void 0;
4044
3720
  const buffer_1 = __nccwpck_require__(4300);
4045
3721
  const crypto_1 = __nccwpck_require__(6113);
4046
- const errors_js_1 = __nccwpck_require__(6891);
4047
- const webcrypto_js_1 = __nccwpck_require__(6474);
4048
- const is_key_object_js_1 = __nccwpck_require__(3758);
4049
- const invalid_key_input_js_1 = __nccwpck_require__(9548);
4050
- const is_key_like_js_1 = __nccwpck_require__(938);
3722
+ const errors_js_1 = __nccwpck_require__(2745);
3723
+ const webcrypto_js_1 = __nccwpck_require__(2259);
3724
+ const is_key_object_js_1 = __nccwpck_require__(1093);
3725
+ const invalid_key_input_js_1 = __nccwpck_require__(5547);
3726
+ const is_key_like_js_1 = __nccwpck_require__(4871);
4051
3727
  const p256 = buffer_1.Buffer.from([42, 134, 72, 206, 61, 3, 1, 7]);
4052
3728
  const p384 = buffer_1.Buffer.from([43, 129, 4, 0, 34]);
4053
3729
  const p521 = buffer_1.Buffer.from([43, 129, 4, 0, 35]);
@@ -4137,16 +3813,16 @@ exports["default"] = getNamedCurve;
4137
3813
 
4138
3814
  /***/ }),
4139
3815
 
4140
- /***/ 9579:
3816
+ /***/ 2450:
4141
3817
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4142
3818
 
4143
3819
 
4144
3820
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4145
3821
  const crypto_1 = __nccwpck_require__(6113);
4146
- const webcrypto_js_1 = __nccwpck_require__(6474);
4147
- const crypto_key_js_1 = __nccwpck_require__(7849);
4148
- const invalid_key_input_js_1 = __nccwpck_require__(9548);
4149
- const is_key_like_js_1 = __nccwpck_require__(938);
3822
+ const webcrypto_js_1 = __nccwpck_require__(2259);
3823
+ const crypto_key_js_1 = __nccwpck_require__(5985);
3824
+ const invalid_key_input_js_1 = __nccwpck_require__(5547);
3825
+ const is_key_like_js_1 = __nccwpck_require__(4871);
4150
3826
  function getSignVerifyKey(alg, key, usage) {
4151
3827
  if (key instanceof Uint8Array) {
4152
3828
  if (!alg.startsWith('HS')) {
@@ -4168,12 +3844,12 @@ exports["default"] = getSignVerifyKey;
4168
3844
 
4169
3845
  /***/ }),
4170
3846
 
4171
- /***/ 3199:
3847
+ /***/ 1273:
4172
3848
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4173
3849
 
4174
3850
 
4175
3851
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4176
- const errors_js_1 = __nccwpck_require__(6891);
3852
+ const errors_js_1 = __nccwpck_require__(2745);
4177
3853
  function hmacDigest(alg) {
4178
3854
  switch (alg) {
4179
3855
  case 'HS256':
@@ -4191,14 +3867,14 @@ exports["default"] = hmacDigest;
4191
3867
 
4192
3868
  /***/ }),
4193
3869
 
4194
- /***/ 938:
3870
+ /***/ 4871:
4195
3871
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4196
3872
 
4197
3873
 
4198
3874
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4199
3875
  exports.types = void 0;
4200
- const webcrypto_js_1 = __nccwpck_require__(6474);
4201
- const is_key_object_js_1 = __nccwpck_require__(3758);
3876
+ const webcrypto_js_1 = __nccwpck_require__(2259);
3877
+ const is_key_object_js_1 = __nccwpck_require__(1093);
4202
3878
  exports["default"] = (key) => (0, is_key_object_js_1.default)(key) || (0, webcrypto_js_1.isCryptoKey)(key);
4203
3879
  const types = ['KeyObject'];
4204
3880
  exports.types = types;
@@ -4209,7 +3885,7 @@ if (parseInt(process.versions.node) >= 16) {
4209
3885
 
4210
3886
  /***/ }),
4211
3887
 
4212
- /***/ 3758:
3888
+ /***/ 1093:
4213
3889
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4214
3890
 
4215
3891
 
@@ -4223,18 +3899,18 @@ exports["default"] = util.types.isKeyObject
4223
3899
 
4224
3900
  /***/ }),
4225
3901
 
4226
- /***/ 2251:
3902
+ /***/ 3810:
4227
3903
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4228
3904
 
4229
3905
 
4230
3906
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4231
3907
  const buffer_1 = __nccwpck_require__(4300);
4232
3908
  const crypto_1 = __nccwpck_require__(6113);
4233
- const base64url_js_1 = __nccwpck_require__(5091);
4234
- const errors_js_1 = __nccwpck_require__(6891);
4235
- const get_named_curve_js_1 = __nccwpck_require__(3607);
4236
- const check_modulus_length_js_1 = __nccwpck_require__(1862);
4237
- const asn1_sequence_encoder_js_1 = __nccwpck_require__(7326);
3909
+ const base64url_js_1 = __nccwpck_require__(7395);
3910
+ const errors_js_1 = __nccwpck_require__(2745);
3911
+ const get_named_curve_js_1 = __nccwpck_require__(6572);
3912
+ const check_modulus_length_js_1 = __nccwpck_require__(3995);
3913
+ const asn1_sequence_encoder_js_1 = __nccwpck_require__(7390);
4238
3914
  const [major, minor] = process.version
4239
3915
  .slice(1)
4240
3916
  .split('.')
@@ -4352,20 +4028,20 @@ exports["default"] = parse;
4352
4028
 
4353
4029
  /***/ }),
4354
4030
 
4355
- /***/ 1297:
4031
+ /***/ 4135:
4356
4032
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4357
4033
 
4358
4034
 
4359
4035
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4360
4036
  const crypto_1 = __nccwpck_require__(6113);
4361
- const base64url_js_1 = __nccwpck_require__(5091);
4362
- const asn1_sequence_decoder_js_1 = __nccwpck_require__(9301);
4363
- const errors_js_1 = __nccwpck_require__(6891);
4364
- const get_named_curve_js_1 = __nccwpck_require__(3607);
4365
- const webcrypto_js_1 = __nccwpck_require__(6474);
4366
- const is_key_object_js_1 = __nccwpck_require__(3758);
4367
- const invalid_key_input_js_1 = __nccwpck_require__(9548);
4368
- const is_key_like_js_1 = __nccwpck_require__(938);
4037
+ const base64url_js_1 = __nccwpck_require__(7395);
4038
+ const asn1_sequence_decoder_js_1 = __nccwpck_require__(5554);
4039
+ const errors_js_1 = __nccwpck_require__(2745);
4040
+ const get_named_curve_js_1 = __nccwpck_require__(6572);
4041
+ const webcrypto_js_1 = __nccwpck_require__(2259);
4042
+ const is_key_object_js_1 = __nccwpck_require__(1093);
4043
+ const invalid_key_input_js_1 = __nccwpck_require__(5547);
4044
+ const is_key_like_js_1 = __nccwpck_require__(4871);
4369
4045
  const [major, minor] = process.version
4370
4046
  .slice(1)
4371
4047
  .split('.')
@@ -4523,15 +4199,15 @@ exports["default"] = keyToJWK;
4523
4199
 
4524
4200
  /***/ }),
4525
4201
 
4526
- /***/ 7402:
4202
+ /***/ 9072:
4527
4203
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4528
4204
 
4529
4205
 
4530
4206
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4531
4207
  const crypto_1 = __nccwpck_require__(6113);
4532
- const get_named_curve_js_1 = __nccwpck_require__(3607);
4533
- const errors_js_1 = __nccwpck_require__(6891);
4534
- const check_modulus_length_js_1 = __nccwpck_require__(1862);
4208
+ const get_named_curve_js_1 = __nccwpck_require__(6572);
4209
+ const errors_js_1 = __nccwpck_require__(2745);
4210
+ const check_modulus_length_js_1 = __nccwpck_require__(3995);
4535
4211
  const [major, minor] = process.version
4536
4212
  .slice(1)
4537
4213
  .split('.')
@@ -4613,7 +4289,7 @@ exports["default"] = keyForCrypto;
4613
4289
 
4614
4290
  /***/ }),
4615
4291
 
4616
- /***/ 5151:
4292
+ /***/ 9295:
4617
4293
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4618
4294
 
4619
4295
 
@@ -4621,16 +4297,16 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
4621
4297
  exports.decrypt = exports.encrypt = void 0;
4622
4298
  const util_1 = __nccwpck_require__(3837);
4623
4299
  const crypto_1 = __nccwpck_require__(6113);
4624
- const random_js_1 = __nccwpck_require__(3609);
4625
- const buffer_utils_js_1 = __nccwpck_require__(3605);
4626
- const base64url_js_1 = __nccwpck_require__(5091);
4627
- const aeskw_js_1 = __nccwpck_require__(7052);
4628
- const check_p2s_js_1 = __nccwpck_require__(2469);
4629
- const webcrypto_js_1 = __nccwpck_require__(6474);
4630
- const crypto_key_js_1 = __nccwpck_require__(7849);
4631
- const is_key_object_js_1 = __nccwpck_require__(3758);
4632
- const invalid_key_input_js_1 = __nccwpck_require__(9548);
4633
- const is_key_like_js_1 = __nccwpck_require__(938);
4300
+ const random_js_1 = __nccwpck_require__(2368);
4301
+ const buffer_utils_js_1 = __nccwpck_require__(614);
4302
+ const base64url_js_1 = __nccwpck_require__(7395);
4303
+ const aeskw_js_1 = __nccwpck_require__(4357);
4304
+ const check_p2s_js_1 = __nccwpck_require__(5025);
4305
+ const webcrypto_js_1 = __nccwpck_require__(2259);
4306
+ const crypto_key_js_1 = __nccwpck_require__(5985);
4307
+ const is_key_object_js_1 = __nccwpck_require__(1093);
4308
+ const invalid_key_input_js_1 = __nccwpck_require__(5547);
4309
+ const is_key_like_js_1 = __nccwpck_require__(4871);
4634
4310
  const pbkdf2 = (0, util_1.promisify)(crypto_1.pbkdf2);
4635
4311
  function getPassword(key, alg) {
4636
4312
  if ((0, is_key_object_js_1.default)(key)) {
@@ -4668,7 +4344,7 @@ exports.decrypt = decrypt;
4668
4344
 
4669
4345
  /***/ }),
4670
4346
 
4671
- /***/ 3609:
4347
+ /***/ 2368:
4672
4348
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4673
4349
 
4674
4350
 
@@ -4680,19 +4356,19 @@ Object.defineProperty(exports, "default", ({ enumerable: true, get: function ()
4680
4356
 
4681
4357
  /***/ }),
4682
4358
 
4683
- /***/ 8550:
4359
+ /***/ 211:
4684
4360
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4685
4361
 
4686
4362
 
4687
4363
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4688
4364
  exports.decrypt = exports.encrypt = void 0;
4689
4365
  const crypto_1 = __nccwpck_require__(6113);
4690
- const check_modulus_length_js_1 = __nccwpck_require__(1862);
4691
- const webcrypto_js_1 = __nccwpck_require__(6474);
4692
- const crypto_key_js_1 = __nccwpck_require__(7849);
4693
- const is_key_object_js_1 = __nccwpck_require__(3758);
4694
- const invalid_key_input_js_1 = __nccwpck_require__(9548);
4695
- const is_key_like_js_1 = __nccwpck_require__(938);
4366
+ const check_modulus_length_js_1 = __nccwpck_require__(3995);
4367
+ const webcrypto_js_1 = __nccwpck_require__(2259);
4368
+ const crypto_key_js_1 = __nccwpck_require__(5985);
4369
+ const is_key_object_js_1 = __nccwpck_require__(1093);
4370
+ const invalid_key_input_js_1 = __nccwpck_require__(5547);
4371
+ const is_key_like_js_1 = __nccwpck_require__(4871);
4696
4372
  const checkKey = (key, alg) => {
4697
4373
  if (key.asymmetricKeyType !== 'rsa') {
4698
4374
  throw new TypeError('Invalid key for this operation, its asymmetricKeyType must be rsa');
@@ -4756,17 +4432,17 @@ exports.decrypt = decrypt;
4756
4432
 
4757
4433
  /***/ }),
4758
4434
 
4759
- /***/ 8979:
4435
+ /***/ 6193:
4760
4436
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4761
4437
 
4762
4438
 
4763
4439
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4764
4440
  const crypto = __nccwpck_require__(6113);
4765
4441
  const util_1 = __nccwpck_require__(3837);
4766
- const dsa_digest_js_1 = __nccwpck_require__(1312);
4767
- const hmac_digest_js_1 = __nccwpck_require__(3199);
4768
- const node_key_js_1 = __nccwpck_require__(7402);
4769
- const get_sign_verify_key_js_1 = __nccwpck_require__(9579);
4442
+ const dsa_digest_js_1 = __nccwpck_require__(8704);
4443
+ const hmac_digest_js_1 = __nccwpck_require__(1273);
4444
+ const node_key_js_1 = __nccwpck_require__(9072);
4445
+ const get_sign_verify_key_js_1 = __nccwpck_require__(2450);
4770
4446
  let oneShotSign;
4771
4447
  if (crypto.sign.length > 3) {
4772
4448
  oneShotSign = (0, util_1.promisify)(crypto.sign);
@@ -4788,7 +4464,7 @@ exports["default"] = sign;
4788
4464
 
4789
4465
  /***/ }),
4790
4466
 
4791
- /***/ 4568:
4467
+ /***/ 1517:
4792
4468
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4793
4469
 
4794
4470
 
@@ -4800,17 +4476,17 @@ exports["default"] = timingSafeEqual;
4800
4476
 
4801
4477
  /***/ }),
4802
4478
 
4803
- /***/ 7190:
4479
+ /***/ 4476:
4804
4480
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4805
4481
 
4806
4482
 
4807
4483
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4808
4484
  const crypto = __nccwpck_require__(6113);
4809
4485
  const util_1 = __nccwpck_require__(3837);
4810
- const dsa_digest_js_1 = __nccwpck_require__(1312);
4811
- const node_key_js_1 = __nccwpck_require__(7402);
4812
- const sign_js_1 = __nccwpck_require__(8979);
4813
- const get_sign_verify_key_js_1 = __nccwpck_require__(9579);
4486
+ const dsa_digest_js_1 = __nccwpck_require__(8704);
4487
+ const node_key_js_1 = __nccwpck_require__(9072);
4488
+ const sign_js_1 = __nccwpck_require__(6193);
4489
+ const get_sign_verify_key_js_1 = __nccwpck_require__(2450);
4814
4490
  const [major, minor] = process.version
4815
4491
  .slice(1)
4816
4492
  .split('.')
@@ -4849,7 +4525,7 @@ exports["default"] = verify;
4849
4525
 
4850
4526
  /***/ }),
4851
4527
 
4852
- /***/ 6474:
4528
+ /***/ 2259:
4853
4529
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4854
4530
 
4855
4531
 
@@ -4867,7 +4543,7 @@ exports.isCryptoKey = util.types.isCryptoKey
4867
4543
 
4868
4544
  /***/ }),
4869
4545
 
4870
- /***/ 3239:
4546
+ /***/ 4486:
4871
4547
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4872
4548
 
4873
4549
 
@@ -4885,29 +4561,29 @@ exports.deflate = deflate;
4885
4561
 
4886
4562
  /***/ }),
4887
4563
 
4888
- /***/ 5831:
4564
+ /***/ 2443:
4889
4565
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4890
4566
 
4891
4567
 
4892
4568
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4893
4569
  exports.decode = exports.encode = void 0;
4894
- const base64url = __nccwpck_require__(5091);
4570
+ const base64url = __nccwpck_require__(7395);
4895
4571
  exports.encode = base64url.encode;
4896
4572
  exports.decode = base64url.decode;
4897
4573
 
4898
4574
 
4899
4575
  /***/ }),
4900
4576
 
4901
- /***/ 6537:
4577
+ /***/ 2467:
4902
4578
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4903
4579
 
4904
4580
 
4905
4581
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4906
4582
  exports.decodeJwt = void 0;
4907
- const base64url_js_1 = __nccwpck_require__(5831);
4908
- const buffer_utils_js_1 = __nccwpck_require__(3605);
4909
- const is_object_js_1 = __nccwpck_require__(7787);
4910
- const errors_js_1 = __nccwpck_require__(6891);
4583
+ const base64url_js_1 = __nccwpck_require__(2443);
4584
+ const buffer_utils_js_1 = __nccwpck_require__(614);
4585
+ const is_object_js_1 = __nccwpck_require__(6643);
4586
+ const errors_js_1 = __nccwpck_require__(2745);
4911
4587
  function decodeJwt(jwt) {
4912
4588
  if (typeof jwt !== 'string')
4913
4589
  throw new errors_js_1.JWTInvalid('JWTs must use Compact JWS serialization, JWT must be a string');
@@ -4941,15 +4617,15 @@ exports.decodeJwt = decodeJwt;
4941
4617
 
4942
4618
  /***/ }),
4943
4619
 
4944
- /***/ 1158:
4620
+ /***/ 1533:
4945
4621
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4946
4622
 
4947
4623
 
4948
4624
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4949
4625
  exports.decodeProtectedHeader = void 0;
4950
- const base64url_js_1 = __nccwpck_require__(5831);
4951
- const buffer_utils_js_1 = __nccwpck_require__(3605);
4952
- const is_object_js_1 = __nccwpck_require__(7787);
4626
+ const base64url_js_1 = __nccwpck_require__(2443);
4627
+ const buffer_utils_js_1 = __nccwpck_require__(614);
4628
+ const is_object_js_1 = __nccwpck_require__(6643);
4953
4629
  function decodeProtectedHeader(token) {
4954
4630
  let protectedB64u;
4955
4631
  if (typeof token === 'string') {
@@ -4986,7 +4662,7 @@ exports.decodeProtectedHeader = decodeProtectedHeader;
4986
4662
 
4987
4663
  /***/ }),
4988
4664
 
4989
- /***/ 6891:
4665
+ /***/ 2745:
4990
4666
  /***/ ((__unused_webpack_module, exports) => {
4991
4667
 
4992
4668
 
@@ -5158,14 +4834,13 @@ exports.JWSSignatureVerificationFailed = JWSSignatureVerificationFailed;
5158
4834
 
5159
4835
  /***/ }),
5160
4836
 
5161
- /***/ 6597:
4837
+ /***/ 3933:
5162
4838
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
5163
4839
 
5164
4840
 
5165
4841
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5166
- exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;
5167
- const parseUtil_1 = __nccwpck_require__(7822);
5168
- const util_1 = __nccwpck_require__(809);
4842
+ exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;
4843
+ const util_1 = __nccwpck_require__(9973);
5169
4844
  exports.ZodIssueCode = util_1.util.arrayToEnum([
5170
4845
  "invalid_type",
5171
4846
  "invalid_literal",
@@ -5182,6 +4857,7 @@ exports.ZodIssueCode = util_1.util.arrayToEnum([
5182
4857
  "too_big",
5183
4858
  "invalid_intersection_types",
5184
4859
  "not_multiple_of",
4860
+ "not_finite",
5185
4861
  ]);
5186
4862
  const quotelessJson = (obj) => {
5187
4863
  const json = JSON.stringify(obj, null, 2);
@@ -5265,7 +4941,7 @@ class ZodError extends Error {
5265
4941
  return this.message;
5266
4942
  }
5267
4943
  get message() {
5268
- return JSON.stringify(this.issues, parseUtil_1.jsonStringifyReplacer, 2);
4944
+ return JSON.stringify(this.issues, util_1.util.jsonStringifyReplacer, 2);
5269
4945
  }
5270
4946
  get isEmpty() {
5271
4947
  return this.issues.length === 0;
@@ -5293,101 +4969,22 @@ ZodError.create = (issues) => {
5293
4969
  const error = new ZodError(issues);
5294
4970
  return error;
5295
4971
  };
5296
- const defaultErrorMap = (issue, _ctx) => {
5297
- let message;
5298
- switch (issue.code) {
5299
- case exports.ZodIssueCode.invalid_type:
5300
- if (issue.received === util_1.ZodParsedType.undefined) {
5301
- message = "Required";
5302
- }
5303
- else {
5304
- message = `Expected ${issue.expected}, received ${issue.received}`;
5305
- }
5306
- break;
5307
- case exports.ZodIssueCode.invalid_literal:
5308
- message = `Invalid literal value, expected ${JSON.stringify(issue.expected, parseUtil_1.jsonStringifyReplacer)}`;
5309
- break;
5310
- case exports.ZodIssueCode.unrecognized_keys:
5311
- message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`;
5312
- break;
5313
- case exports.ZodIssueCode.invalid_union:
5314
- message = `Invalid input`;
5315
- break;
5316
- case exports.ZodIssueCode.invalid_union_discriminator:
5317
- message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`;
5318
- break;
5319
- case exports.ZodIssueCode.invalid_enum_value:
5320
- message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`;
5321
- break;
5322
- case exports.ZodIssueCode.invalid_arguments:
5323
- message = `Invalid function arguments`;
5324
- break;
5325
- case exports.ZodIssueCode.invalid_return_type:
5326
- message = `Invalid function return type`;
5327
- break;
5328
- case exports.ZodIssueCode.invalid_date:
5329
- message = `Invalid date`;
5330
- break;
5331
- case exports.ZodIssueCode.invalid_string:
5332
- if (typeof issue.validation === "object") {
5333
- if ("startsWith" in issue.validation) {
5334
- message = `Invalid input: must start with "${issue.validation.startsWith}"`;
5335
- }
5336
- else if ("endsWith" in issue.validation) {
5337
- message = `Invalid input: must end with "${issue.validation.endsWith}"`;
5338
- }
5339
- else {
5340
- util_1.util.assertNever(issue.validation);
5341
- }
5342
- }
5343
- else if (issue.validation !== "regex") {
5344
- message = `Invalid ${issue.validation}`;
5345
- }
5346
- else {
5347
- message = "Invalid";
5348
- }
5349
- break;
5350
- case exports.ZodIssueCode.too_small:
5351
- if (issue.type === "array")
5352
- message = `Array must contain ${issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
5353
- else if (issue.type === "string")
5354
- message = `String must contain ${issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
5355
- else if (issue.type === "number")
5356
- message = `Number must be greater than ${issue.inclusive ? `or equal to ` : ``}${issue.minimum}`;
5357
- else if (issue.type === "date")
5358
- message = `Date must be greater than ${issue.inclusive ? `or equal to ` : ``}${new Date(issue.minimum)}`;
5359
- else
5360
- message = "Invalid input";
5361
- break;
5362
- case exports.ZodIssueCode.too_big:
5363
- if (issue.type === "array")
5364
- message = `Array must contain ${issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
5365
- else if (issue.type === "string")
5366
- message = `String must contain ${issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
5367
- else if (issue.type === "number")
5368
- message = `Number must be less than ${issue.inclusive ? `or equal to ` : ``}${issue.maximum}`;
5369
- else if (issue.type === "date")
5370
- message = `Date must be smaller than ${issue.inclusive ? `or equal to ` : ``}${new Date(issue.maximum)}`;
5371
- else
5372
- message = "Invalid input";
5373
- break;
5374
- case exports.ZodIssueCode.custom:
5375
- message = `Invalid input`;
5376
- break;
5377
- case exports.ZodIssueCode.invalid_intersection_types:
5378
- message = `Intersection results could not be merged`;
5379
- break;
5380
- case exports.ZodIssueCode.not_multiple_of:
5381
- message = `Number must be a multiple of ${issue.multipleOf}`;
5382
- break;
5383
- default:
5384
- message = _ctx.defaultError;
5385
- util_1.util.assertNever(issue);
5386
- }
5387
- return { message };
4972
+
4973
+
4974
+ /***/ }),
4975
+
4976
+ /***/ 5391:
4977
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
4978
+
4979
+
4980
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4981
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5388
4982
  };
5389
- exports.defaultErrorMap = defaultErrorMap;
5390
- let overrideErrorMap = exports.defaultErrorMap;
4983
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
4984
+ exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = void 0;
4985
+ const en_1 = __importDefault(__nccwpck_require__(184));
4986
+ exports.defaultErrorMap = en_1.default;
4987
+ let overrideErrorMap = en_1.default;
5391
4988
  function setErrorMap(map) {
5392
4989
  overrideErrorMap = map;
5393
4990
  }
@@ -5400,7 +4997,7 @@ exports.getErrorMap = getErrorMap;
5400
4997
 
5401
4998
  /***/ }),
5402
4999
 
5403
- /***/ 8857:
5000
+ /***/ 7365:
5404
5001
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
5405
5002
 
5406
5003
 
@@ -5415,19 +5012,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
5415
5012
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
5416
5013
  };
5417
5014
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5418
- exports.ZodParsedType = exports.getParsedType = void 0;
5419
- __exportStar(__nccwpck_require__(7822), exports);
5420
- __exportStar(__nccwpck_require__(6836), exports);
5421
- var util_1 = __nccwpck_require__(809);
5422
- Object.defineProperty(exports, "getParsedType", ({ enumerable: true, get: function () { return util_1.getParsedType; } }));
5423
- Object.defineProperty(exports, "ZodParsedType", ({ enumerable: true, get: function () { return util_1.ZodParsedType; } }));
5424
- __exportStar(__nccwpck_require__(54), exports);
5425
- __exportStar(__nccwpck_require__(6597), exports);
5015
+ __exportStar(__nccwpck_require__(5391), exports);
5016
+ __exportStar(__nccwpck_require__(3636), exports);
5017
+ __exportStar(__nccwpck_require__(9599), exports);
5018
+ __exportStar(__nccwpck_require__(9973), exports);
5019
+ __exportStar(__nccwpck_require__(7889), exports);
5020
+ __exportStar(__nccwpck_require__(3933), exports);
5426
5021
 
5427
5022
 
5428
5023
  /***/ }),
5429
5024
 
5430
- /***/ 3797:
5025
+ /***/ 9849:
5431
5026
  /***/ ((__unused_webpack_module, exports) => {
5432
5027
 
5433
5028
 
@@ -5442,13 +5037,17 @@ var errorUtil;
5442
5037
 
5443
5038
  /***/ }),
5444
5039
 
5445
- /***/ 7822:
5446
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
5040
+ /***/ 3636:
5041
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
5447
5042
 
5448
5043
 
5044
+ var __importDefault = (this && this.__importDefault) || function (mod) {
5045
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5046
+ };
5449
5047
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5450
- exports.jsonStringifyReplacer = exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = void 0;
5451
- const ZodError_1 = __nccwpck_require__(6597);
5048
+ exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = void 0;
5049
+ const errors_1 = __nccwpck_require__(5391);
5050
+ const en_1 = __importDefault(__nccwpck_require__(184));
5452
5051
  const makeIssue = (params) => {
5453
5052
  const { data, path, errorMaps, issueData } = params;
5454
5053
  const fullPath = [...path, ...(issueData.path || [])];
@@ -5473,15 +5072,15 @@ const makeIssue = (params) => {
5473
5072
  exports.makeIssue = makeIssue;
5474
5073
  exports.EMPTY_PATH = [];
5475
5074
  function addIssueToContext(ctx, issueData) {
5476
- const issue = exports.makeIssue({
5075
+ const issue = (0, exports.makeIssue)({
5477
5076
  issueData: issueData,
5478
5077
  data: ctx.data,
5479
5078
  path: ctx.path,
5480
5079
  errorMaps: [
5481
5080
  ctx.common.contextualErrorMap,
5482
5081
  ctx.schemaErrorMap,
5483
- ZodError_1.getErrorMap(),
5484
- ZodError_1.defaultErrorMap,
5082
+ (0, errors_1.getErrorMap)(),
5083
+ en_1.default, // then global default map
5485
5084
  ].filter((x) => !!x),
5486
5085
  });
5487
5086
  ctx.common.issues.push(issue);
@@ -5555,18 +5154,11 @@ const isValid = (x) => x.status === "valid";
5555
5154
  exports.isValid = isValid;
5556
5155
  const isAsync = (x) => typeof Promise !== undefined && x instanceof Promise;
5557
5156
  exports.isAsync = isAsync;
5558
- const jsonStringifyReplacer = (_, value) => {
5559
- if (typeof value === "bigint") {
5560
- return value.toString();
5561
- }
5562
- return value;
5563
- };
5564
- exports.jsonStringifyReplacer = jsonStringifyReplacer;
5565
5157
 
5566
5158
 
5567
5159
  /***/ }),
5568
5160
 
5569
- /***/ 6836:
5161
+ /***/ 9599:
5570
5162
  /***/ ((__unused_webpack_module, exports) => {
5571
5163
 
5572
5164
 
@@ -5575,7 +5167,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
5575
5167
 
5576
5168
  /***/ }),
5577
5169
 
5578
- /***/ 809:
5170
+ /***/ 9973:
5579
5171
  /***/ ((__unused_webpack_module, exports) => {
5580
5172
 
5581
5173
 
@@ -5637,6 +5229,12 @@ var util;
5637
5229
  .join(separator);
5638
5230
  }
5639
5231
  util.joinValues = joinValues;
5232
+ util.jsonStringifyReplacer = (_, value) => {
5233
+ if (typeof value === "bigint") {
5234
+ return value.toString();
5235
+ }
5236
+ return value;
5237
+ };
5640
5238
  })(util = exports.util || (exports.util = {}));
5641
5239
  exports.ZodParsedType = util.arrayToEnum([
5642
5240
  "string",
@@ -5675,6 +5273,8 @@ const getParsedType = (data) => {
5675
5273
  return exports.ZodParsedType.function;
5676
5274
  case "bigint":
5677
5275
  return exports.ZodParsedType.bigint;
5276
+ case "symbol":
5277
+ return exports.ZodParsedType.symbol;
5678
5278
  case "object":
5679
5279
  if (Array.isArray(data)) {
5680
5280
  return exports.ZodParsedType.array;
@@ -5691,69 +5291,194 @@ const getParsedType = (data) => {
5691
5291
  if (typeof Map !== "undefined" && data instanceof Map) {
5692
5292
  return exports.ZodParsedType.map;
5693
5293
  }
5694
- if (typeof Set !== "undefined" && data instanceof Set) {
5695
- return exports.ZodParsedType.set;
5294
+ if (typeof Set !== "undefined" && data instanceof Set) {
5295
+ return exports.ZodParsedType.set;
5296
+ }
5297
+ if (typeof Date !== "undefined" && data instanceof Date) {
5298
+ return exports.ZodParsedType.date;
5299
+ }
5300
+ return exports.ZodParsedType.object;
5301
+ default:
5302
+ return exports.ZodParsedType.unknown;
5303
+ }
5304
+ };
5305
+ exports.getParsedType = getParsedType;
5306
+
5307
+
5308
+ /***/ }),
5309
+
5310
+ /***/ 6319:
5311
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
5312
+
5313
+
5314
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5315
+ if (k2 === undefined) k2 = k;
5316
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5317
+ }) : (function(o, m, k, k2) {
5318
+ if (k2 === undefined) k2 = k;
5319
+ o[k2] = m[k];
5320
+ }));
5321
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
5322
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
5323
+ }) : function(o, v) {
5324
+ o["default"] = v;
5325
+ });
5326
+ var __importStar = (this && this.__importStar) || function (mod) {
5327
+ if (mod && mod.__esModule) return mod;
5328
+ var result = {};
5329
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
5330
+ __setModuleDefault(result, mod);
5331
+ return result;
5332
+ };
5333
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
5334
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
5335
+ };
5336
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
5337
+ exports.z = void 0;
5338
+ const mod = __importStar(__nccwpck_require__(7365));
5339
+ exports.z = mod;
5340
+ __exportStar(__nccwpck_require__(7365), exports);
5341
+ exports["default"] = mod;
5342
+
5343
+
5344
+ /***/ }),
5345
+
5346
+ /***/ 184:
5347
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
5348
+
5349
+
5350
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
5351
+ const util_1 = __nccwpck_require__(9973);
5352
+ const ZodError_1 = __nccwpck_require__(3933);
5353
+ const errorMap = (issue, _ctx) => {
5354
+ let message;
5355
+ switch (issue.code) {
5356
+ case ZodError_1.ZodIssueCode.invalid_type:
5357
+ if (issue.received === util_1.ZodParsedType.undefined) {
5358
+ message = "Required";
5359
+ }
5360
+ else {
5361
+ message = `Expected ${issue.expected}, received ${issue.received}`;
5362
+ }
5363
+ break;
5364
+ case ZodError_1.ZodIssueCode.invalid_literal:
5365
+ message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_1.util.jsonStringifyReplacer)}`;
5366
+ break;
5367
+ case ZodError_1.ZodIssueCode.unrecognized_keys:
5368
+ message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`;
5369
+ break;
5370
+ case ZodError_1.ZodIssueCode.invalid_union:
5371
+ message = `Invalid input`;
5372
+ break;
5373
+ case ZodError_1.ZodIssueCode.invalid_union_discriminator:
5374
+ message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`;
5375
+ break;
5376
+ case ZodError_1.ZodIssueCode.invalid_enum_value:
5377
+ message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`;
5378
+ break;
5379
+ case ZodError_1.ZodIssueCode.invalid_arguments:
5380
+ message = `Invalid function arguments`;
5381
+ break;
5382
+ case ZodError_1.ZodIssueCode.invalid_return_type:
5383
+ message = `Invalid function return type`;
5384
+ break;
5385
+ case ZodError_1.ZodIssueCode.invalid_date:
5386
+ message = `Invalid date`;
5387
+ break;
5388
+ case ZodError_1.ZodIssueCode.invalid_string:
5389
+ if (typeof issue.validation === "object") {
5390
+ if ("startsWith" in issue.validation) {
5391
+ message = `Invalid input: must start with "${issue.validation.startsWith}"`;
5392
+ }
5393
+ else if ("endsWith" in issue.validation) {
5394
+ message = `Invalid input: must end with "${issue.validation.endsWith}"`;
5395
+ }
5396
+ else {
5397
+ util_1.util.assertNever(issue.validation);
5398
+ }
5399
+ }
5400
+ else if (issue.validation !== "regex") {
5401
+ message = `Invalid ${issue.validation}`;
5696
5402
  }
5697
- if (typeof Date !== "undefined" && data instanceof Date) {
5698
- return exports.ZodParsedType.date;
5403
+ else {
5404
+ message = "Invalid";
5699
5405
  }
5700
- return exports.ZodParsedType.object;
5406
+ break;
5407
+ case ZodError_1.ZodIssueCode.too_small:
5408
+ if (issue.type === "array")
5409
+ message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
5410
+ else if (issue.type === "string")
5411
+ message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
5412
+ else if (issue.type === "number")
5413
+ message = `Number must be ${issue.exact
5414
+ ? `exactly equal to `
5415
+ : issue.inclusive
5416
+ ? `greater than or equal to `
5417
+ : `greater than `}${issue.minimum}`;
5418
+ else if (issue.type === "date")
5419
+ message = `Date must be ${issue.exact
5420
+ ? `exactly equal to `
5421
+ : issue.inclusive
5422
+ ? `greater than or equal to `
5423
+ : `greater than `}${new Date(issue.minimum)}`;
5424
+ else
5425
+ message = "Invalid input";
5426
+ break;
5427
+ case ZodError_1.ZodIssueCode.too_big:
5428
+ if (issue.type === "array")
5429
+ message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
5430
+ else if (issue.type === "string")
5431
+ message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
5432
+ else if (issue.type === "number")
5433
+ message = `Number must be ${issue.exact
5434
+ ? `exactly`
5435
+ : issue.inclusive
5436
+ ? `less than or equal to`
5437
+ : `less than`} ${issue.maximum}`;
5438
+ else if (issue.type === "date")
5439
+ message = `Date must be ${issue.exact
5440
+ ? `exactly`
5441
+ : issue.inclusive
5442
+ ? `smaller than or equal to`
5443
+ : `smaller than`} ${new Date(issue.maximum)}`;
5444
+ else
5445
+ message = "Invalid input";
5446
+ break;
5447
+ case ZodError_1.ZodIssueCode.custom:
5448
+ message = `Invalid input`;
5449
+ break;
5450
+ case ZodError_1.ZodIssueCode.invalid_intersection_types:
5451
+ message = `Intersection results could not be merged`;
5452
+ break;
5453
+ case ZodError_1.ZodIssueCode.not_multiple_of:
5454
+ message = `Number must be a multiple of ${issue.multipleOf}`;
5455
+ break;
5456
+ case ZodError_1.ZodIssueCode.not_finite:
5457
+ message = "Number must be finite";
5458
+ break;
5701
5459
  default:
5702
- return exports.ZodParsedType.unknown;
5460
+ message = _ctx.defaultError;
5461
+ util_1.util.assertNever(issue);
5703
5462
  }
5463
+ return { message };
5704
5464
  };
5705
- exports.getParsedType = getParsedType;
5706
-
5707
-
5708
- /***/ }),
5709
-
5710
- /***/ 8062:
5711
- /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
5712
-
5713
-
5714
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5715
- if (k2 === undefined) k2 = k;
5716
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5717
- }) : (function(o, m, k, k2) {
5718
- if (k2 === undefined) k2 = k;
5719
- o[k2] = m[k];
5720
- }));
5721
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
5722
- Object.defineProperty(o, "default", { enumerable: true, value: v });
5723
- }) : function(o, v) {
5724
- o["default"] = v;
5725
- });
5726
- var __importStar = (this && this.__importStar) || function (mod) {
5727
- if (mod && mod.__esModule) return mod;
5728
- var result = {};
5729
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
5730
- __setModuleDefault(result, mod);
5731
- return result;
5732
- };
5733
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
5734
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
5735
- };
5736
- Object.defineProperty(exports, "__esModule", ({ value: true }));
5737
- exports.z = void 0;
5738
- const mod = __importStar(__nccwpck_require__(8857));
5739
- exports.z = mod;
5740
- __exportStar(__nccwpck_require__(8857), exports);
5741
- exports["default"] = mod;
5465
+ exports["default"] = errorMap;
5742
5466
 
5743
5467
 
5744
5468
  /***/ }),
5745
5469
 
5746
- /***/ 54:
5470
+ /***/ 7889:
5747
5471
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
5748
5472
 
5749
5473
 
5750
5474
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5751
- exports["function"] = exports["enum"] = exports.effect = exports.discriminatedUnion = exports.date = exports.boolean = exports.bigint = exports.array = exports.any = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.objectUtil = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.ZodType = void 0;
5752
- exports["void"] = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports["null"] = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports["instanceof"] = void 0;
5753
- const errorUtil_1 = __nccwpck_require__(3797);
5754
- const parseUtil_1 = __nccwpck_require__(7822);
5755
- const util_1 = __nccwpck_require__(809);
5756
- const ZodError_1 = __nccwpck_require__(6597);
5475
+ exports.date = exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.objectUtil = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.ZodType = void 0;
5476
+ exports.NEVER = exports["void"] = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports["null"] = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports["instanceof"] = exports["function"] = exports["enum"] = exports.effect = exports.discriminatedUnion = void 0;
5477
+ const errors_1 = __nccwpck_require__(5391);
5478
+ const errorUtil_1 = __nccwpck_require__(9849);
5479
+ const parseUtil_1 = __nccwpck_require__(3636);
5480
+ const util_1 = __nccwpck_require__(9973);
5481
+ const ZodError_1 = __nccwpck_require__(3933);
5757
5482
  class ParseInputLazyPath {
5758
5483
  constructor(parent, value, path, key) {
5759
5484
  this.parent = parent;
@@ -5766,7 +5491,7 @@ class ParseInputLazyPath {
5766
5491
  }
5767
5492
  }
5768
5493
  const handleResult = (ctx, result) => {
5769
- if (parseUtil_1.isValid(result)) {
5494
+ if ((0, parseUtil_1.isValid)(result)) {
5770
5495
  return { success: true, data: result.value };
5771
5496
  }
5772
5497
  else {
@@ -5782,7 +5507,7 @@ function processCreateParams(params) {
5782
5507
  return {};
5783
5508
  const { errorMap, invalid_type_error, required_error, description } = params;
5784
5509
  if (errorMap && (invalid_type_error || required_error)) {
5785
- throw new Error(`Can't use "invalid" or "required" in conjunction with custom error map.`);
5510
+ throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
5786
5511
  }
5787
5512
  if (errorMap)
5788
5513
  return { errorMap: errorMap, description };
@@ -5800,7 +5525,6 @@ class ZodType {
5800
5525
  constructor(def) {
5801
5526
  /** Alias of safeParseAsync */
5802
5527
  this.spa = this.safeParseAsync;
5803
- this.superRefine = this._refinement;
5804
5528
  this._def = def;
5805
5529
  this.parse = this.parse.bind(this);
5806
5530
  this.safeParse = this.safeParse.bind(this);
@@ -5818,8 +5542,11 @@ class ZodType {
5818
5542
  this.or = this.or.bind(this);
5819
5543
  this.and = this.and.bind(this);
5820
5544
  this.transform = this.transform.bind(this);
5545
+ this.brand = this.brand.bind(this);
5821
5546
  this.default = this.default.bind(this);
5547
+ this.catch = this.catch.bind(this);
5822
5548
  this.describe = this.describe.bind(this);
5549
+ this.pipe = this.pipe.bind(this);
5823
5550
  this.isNullable = this.isNullable.bind(this);
5824
5551
  this.isOptional = this.isOptional.bind(this);
5825
5552
  }
@@ -5827,13 +5554,13 @@ class ZodType {
5827
5554
  return this._def.description;
5828
5555
  }
5829
5556
  _getType(input) {
5830
- return util_1.getParsedType(input.data);
5557
+ return (0, util_1.getParsedType)(input.data);
5831
5558
  }
5832
5559
  _getOrReturnCtx(input, ctx) {
5833
5560
  return (ctx || {
5834
5561
  common: input.parent.common,
5835
5562
  data: input.data,
5836
- parsedType: util_1.getParsedType(input.data),
5563
+ parsedType: (0, util_1.getParsedType)(input.data),
5837
5564
  schemaErrorMap: this._def.errorMap,
5838
5565
  path: input.path,
5839
5566
  parent: input.parent,
@@ -5845,7 +5572,7 @@ class ZodType {
5845
5572
  ctx: {
5846
5573
  common: input.parent.common,
5847
5574
  data: input.data,
5848
- parsedType: util_1.getParsedType(input.data),
5575
+ parsedType: (0, util_1.getParsedType)(input.data),
5849
5576
  schemaErrorMap: this._def.errorMap,
5850
5577
  path: input.path,
5851
5578
  parent: input.parent,
@@ -5854,7 +5581,7 @@ class ZodType {
5854
5581
  }
5855
5582
  _parseSync(input) {
5856
5583
  const result = this._parse(input);
5857
- if (parseUtil_1.isAsync(result)) {
5584
+ if ((0, parseUtil_1.isAsync)(result)) {
5858
5585
  throw new Error("Synchronous parse encountered promise.");
5859
5586
  }
5860
5587
  return result;
@@ -5881,7 +5608,7 @@ class ZodType {
5881
5608
  schemaErrorMap: this._def.errorMap,
5882
5609
  parent: null,
5883
5610
  data,
5884
- parsedType: util_1.getParsedType(data),
5611
+ parsedType: (0, util_1.getParsedType)(data),
5885
5612
  };
5886
5613
  const result = this._parseSync({ data, path: ctx.path, parent: ctx });
5887
5614
  return handleResult(ctx, result);
@@ -5903,10 +5630,10 @@ class ZodType {
5903
5630
  schemaErrorMap: this._def.errorMap,
5904
5631
  parent: null,
5905
5632
  data,
5906
- parsedType: util_1.getParsedType(data),
5633
+ parsedType: (0, util_1.getParsedType)(data),
5907
5634
  };
5908
- const maybeAsyncResult = this._parse({ data, path: [], parent: ctx });
5909
- const result = await (parseUtil_1.isAsync(maybeAsyncResult)
5635
+ const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
5636
+ const result = await ((0, parseUtil_1.isAsync)(maybeAsyncResult)
5910
5637
  ? maybeAsyncResult
5911
5638
  : Promise.resolve(maybeAsyncResult));
5912
5639
  return handleResult(ctx, result);
@@ -5969,6 +5696,9 @@ class ZodType {
5969
5696
  effect: { type: "refinement", refinement },
5970
5697
  });
5971
5698
  }
5699
+ superRefine(refinement) {
5700
+ return this._refinement(refinement);
5701
+ }
5972
5702
  optional() {
5973
5703
  return ZodOptional.create(this);
5974
5704
  }
@@ -6012,6 +5742,14 @@ class ZodType {
6012
5742
  ...processCreateParams(undefined),
6013
5743
  });
6014
5744
  }
5745
+ catch(def) {
5746
+ const defaultValueFunc = typeof def === "function" ? def : () => def;
5747
+ return new ZodCatch({
5748
+ innerType: this,
5749
+ defaultValue: defaultValueFunc,
5750
+ typeName: ZodFirstPartyTypeKind.ZodCatch,
5751
+ });
5752
+ }
6015
5753
  describe(description) {
6016
5754
  const This = this.constructor;
6017
5755
  return new This({
@@ -6019,6 +5757,9 @@ class ZodType {
6019
5757
  description,
6020
5758
  });
6021
5759
  }
5760
+ pipe(target) {
5761
+ return ZodPipeline.create(this, target);
5762
+ }
6022
5763
  isOptional() {
6023
5764
  return this.safeParse(undefined).success;
6024
5765
  }
@@ -6036,6 +5777,39 @@ const uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-
6036
5777
  // const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
6037
5778
  // eslint-disable-next-line
6038
5779
  const emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
5780
+ // interface IsDateStringOptions extends StringDateOptions {
5781
+ /**
5782
+ * Match any configuration
5783
+ */
5784
+ // any?: boolean;
5785
+ // }
5786
+ // Adapted from https://stackoverflow.com/a/3143231
5787
+ const datetimeRegex = (args) => {
5788
+ if (args.precision) {
5789
+ if (args.offset) {
5790
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
5791
+ }
5792
+ else {
5793
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
5794
+ }
5795
+ }
5796
+ else if (args.precision === 0) {
5797
+ if (args.offset) {
5798
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
5799
+ }
5800
+ else {
5801
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
5802
+ }
5803
+ }
5804
+ else {
5805
+ if (args.offset) {
5806
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
5807
+ }
5808
+ else {
5809
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
5810
+ }
5811
+ }
5812
+ };
6039
5813
  class ZodString extends ZodType {
6040
5814
  constructor() {
6041
5815
  super(...arguments);
@@ -6055,10 +5829,13 @@ class ZodString extends ZodType {
6055
5829
  });
6056
5830
  }
6057
5831
  _parse(input) {
5832
+ if (this._def.coerce) {
5833
+ input.data = String(input.data);
5834
+ }
6058
5835
  const parsedType = this._getType(input);
6059
5836
  if (parsedType !== util_1.ZodParsedType.string) {
6060
5837
  const ctx = this._getOrReturnCtx(input);
6061
- parseUtil_1.addIssueToContext(ctx, {
5838
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6062
5839
  code: ZodError_1.ZodIssueCode.invalid_type,
6063
5840
  expected: util_1.ZodParsedType.string,
6064
5841
  received: ctx.parsedType,
@@ -6073,11 +5850,12 @@ class ZodString extends ZodType {
6073
5850
  if (check.kind === "min") {
6074
5851
  if (input.data.length < check.value) {
6075
5852
  ctx = this._getOrReturnCtx(input, ctx);
6076
- parseUtil_1.addIssueToContext(ctx, {
5853
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6077
5854
  code: ZodError_1.ZodIssueCode.too_small,
6078
5855
  minimum: check.value,
6079
5856
  type: "string",
6080
5857
  inclusive: true,
5858
+ exact: false,
6081
5859
  message: check.message,
6082
5860
  });
6083
5861
  status.dirty();
@@ -6086,20 +5864,49 @@ class ZodString extends ZodType {
6086
5864
  else if (check.kind === "max") {
6087
5865
  if (input.data.length > check.value) {
6088
5866
  ctx = this._getOrReturnCtx(input, ctx);
6089
- parseUtil_1.addIssueToContext(ctx, {
5867
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6090
5868
  code: ZodError_1.ZodIssueCode.too_big,
6091
5869
  maximum: check.value,
6092
5870
  type: "string",
6093
5871
  inclusive: true,
5872
+ exact: false,
6094
5873
  message: check.message,
6095
5874
  });
6096
5875
  status.dirty();
6097
5876
  }
6098
5877
  }
5878
+ else if (check.kind === "length") {
5879
+ const tooBig = input.data.length > check.value;
5880
+ const tooSmall = input.data.length < check.value;
5881
+ if (tooBig || tooSmall) {
5882
+ ctx = this._getOrReturnCtx(input, ctx);
5883
+ if (tooBig) {
5884
+ (0, parseUtil_1.addIssueToContext)(ctx, {
5885
+ code: ZodError_1.ZodIssueCode.too_big,
5886
+ maximum: check.value,
5887
+ type: "string",
5888
+ inclusive: true,
5889
+ exact: true,
5890
+ message: check.message,
5891
+ });
5892
+ }
5893
+ else if (tooSmall) {
5894
+ (0, parseUtil_1.addIssueToContext)(ctx, {
5895
+ code: ZodError_1.ZodIssueCode.too_small,
5896
+ minimum: check.value,
5897
+ type: "string",
5898
+ inclusive: true,
5899
+ exact: true,
5900
+ message: check.message,
5901
+ });
5902
+ }
5903
+ status.dirty();
5904
+ }
5905
+ }
6099
5906
  else if (check.kind === "email") {
6100
5907
  if (!emailRegex.test(input.data)) {
6101
5908
  ctx = this._getOrReturnCtx(input, ctx);
6102
- parseUtil_1.addIssueToContext(ctx, {
5909
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6103
5910
  validation: "email",
6104
5911
  code: ZodError_1.ZodIssueCode.invalid_string,
6105
5912
  message: check.message,
@@ -6110,7 +5917,7 @@ class ZodString extends ZodType {
6110
5917
  else if (check.kind === "uuid") {
6111
5918
  if (!uuidRegex.test(input.data)) {
6112
5919
  ctx = this._getOrReturnCtx(input, ctx);
6113
- parseUtil_1.addIssueToContext(ctx, {
5920
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6114
5921
  validation: "uuid",
6115
5922
  code: ZodError_1.ZodIssueCode.invalid_string,
6116
5923
  message: check.message,
@@ -6121,7 +5928,7 @@ class ZodString extends ZodType {
6121
5928
  else if (check.kind === "cuid") {
6122
5929
  if (!cuidRegex.test(input.data)) {
6123
5930
  ctx = this._getOrReturnCtx(input, ctx);
6124
- parseUtil_1.addIssueToContext(ctx, {
5931
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6125
5932
  validation: "cuid",
6126
5933
  code: ZodError_1.ZodIssueCode.invalid_string,
6127
5934
  message: check.message,
@@ -6135,7 +5942,7 @@ class ZodString extends ZodType {
6135
5942
  }
6136
5943
  catch (_a) {
6137
5944
  ctx = this._getOrReturnCtx(input, ctx);
6138
- parseUtil_1.addIssueToContext(ctx, {
5945
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6139
5946
  validation: "url",
6140
5947
  code: ZodError_1.ZodIssueCode.invalid_string,
6141
5948
  message: check.message,
@@ -6148,7 +5955,7 @@ class ZodString extends ZodType {
6148
5955
  const testResult = check.regex.test(input.data);
6149
5956
  if (!testResult) {
6150
5957
  ctx = this._getOrReturnCtx(input, ctx);
6151
- parseUtil_1.addIssueToContext(ctx, {
5958
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6152
5959
  validation: "regex",
6153
5960
  code: ZodError_1.ZodIssueCode.invalid_string,
6154
5961
  message: check.message,
@@ -6162,7 +5969,7 @@ class ZodString extends ZodType {
6162
5969
  else if (check.kind === "startsWith") {
6163
5970
  if (!input.data.startsWith(check.value)) {
6164
5971
  ctx = this._getOrReturnCtx(input, ctx);
6165
- parseUtil_1.addIssueToContext(ctx, {
5972
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6166
5973
  code: ZodError_1.ZodIssueCode.invalid_string,
6167
5974
  validation: { startsWith: check.value },
6168
5975
  message: check.message,
@@ -6173,7 +5980,7 @@ class ZodString extends ZodType {
6173
5980
  else if (check.kind === "endsWith") {
6174
5981
  if (!input.data.endsWith(check.value)) {
6175
5982
  ctx = this._getOrReturnCtx(input, ctx);
6176
- parseUtil_1.addIssueToContext(ctx, {
5983
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6177
5984
  code: ZodError_1.ZodIssueCode.invalid_string,
6178
5985
  validation: { endsWith: check.value },
6179
5986
  message: check.message,
@@ -6181,6 +5988,18 @@ class ZodString extends ZodType {
6181
5988
  status.dirty();
6182
5989
  }
6183
5990
  }
5991
+ else if (check.kind === "datetime") {
5992
+ const regex = datetimeRegex(check);
5993
+ if (!regex.test(input.data)) {
5994
+ ctx = this._getOrReturnCtx(input, ctx);
5995
+ (0, parseUtil_1.addIssueToContext)(ctx, {
5996
+ code: ZodError_1.ZodIssueCode.invalid_string,
5997
+ validation: "datetime",
5998
+ message: check.message,
5999
+ });
6000
+ status.dirty();
6001
+ }
6002
+ }
6184
6003
  else {
6185
6004
  util_1.util.assertNever(check);
6186
6005
  }
@@ -6205,6 +6024,23 @@ class ZodString extends ZodType {
6205
6024
  cuid(message) {
6206
6025
  return this._addCheck({ kind: "cuid", ...errorUtil_1.errorUtil.errToObj(message) });
6207
6026
  }
6027
+ datetime(options) {
6028
+ var _a;
6029
+ if (typeof options === "string") {
6030
+ return this._addCheck({
6031
+ kind: "datetime",
6032
+ precision: null,
6033
+ offset: false,
6034
+ message: options,
6035
+ });
6036
+ }
6037
+ return this._addCheck({
6038
+ kind: "datetime",
6039
+ precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
6040
+ offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
6041
+ ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
6042
+ });
6043
+ }
6208
6044
  regex(regex, message) {
6209
6045
  return this._addCheck({
6210
6046
  kind: "regex",
@@ -6241,7 +6077,14 @@ class ZodString extends ZodType {
6241
6077
  });
6242
6078
  }
6243
6079
  length(len, message) {
6244
- return this.min(len, message).max(len, message);
6080
+ return this._addCheck({
6081
+ kind: "length",
6082
+ value: len,
6083
+ ...errorUtil_1.errorUtil.errToObj(message),
6084
+ });
6085
+ }
6086
+ get isDatetime() {
6087
+ return !!this._def.checks.find((ch) => ch.kind === "datetime");
6245
6088
  }
6246
6089
  get isEmail() {
6247
6090
  return !!this._def.checks.find((ch) => ch.kind === "email");
@@ -6278,9 +6121,11 @@ class ZodString extends ZodType {
6278
6121
  }
6279
6122
  exports.ZodString = ZodString;
6280
6123
  ZodString.create = (params) => {
6124
+ var _a;
6281
6125
  return new ZodString({
6282
6126
  checks: [],
6283
6127
  typeName: ZodFirstPartyTypeKind.ZodString,
6128
+ coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
6284
6129
  ...processCreateParams(params),
6285
6130
  });
6286
6131
  };
@@ -6301,10 +6146,13 @@ class ZodNumber extends ZodType {
6301
6146
  this.step = this.multipleOf;
6302
6147
  }
6303
6148
  _parse(input) {
6149
+ if (this._def.coerce) {
6150
+ input.data = Number(input.data);
6151
+ }
6304
6152
  const parsedType = this._getType(input);
6305
6153
  if (parsedType !== util_1.ZodParsedType.number) {
6306
6154
  const ctx = this._getOrReturnCtx(input);
6307
- parseUtil_1.addIssueToContext(ctx, {
6155
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6308
6156
  code: ZodError_1.ZodIssueCode.invalid_type,
6309
6157
  expected: util_1.ZodParsedType.number,
6310
6158
  received: ctx.parsedType,
@@ -6317,7 +6165,7 @@ class ZodNumber extends ZodType {
6317
6165
  if (check.kind === "int") {
6318
6166
  if (!util_1.util.isInteger(input.data)) {
6319
6167
  ctx = this._getOrReturnCtx(input, ctx);
6320
- parseUtil_1.addIssueToContext(ctx, {
6168
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6321
6169
  code: ZodError_1.ZodIssueCode.invalid_type,
6322
6170
  expected: "integer",
6323
6171
  received: "float",
@@ -6332,11 +6180,12 @@ class ZodNumber extends ZodType {
6332
6180
  : input.data <= check.value;
6333
6181
  if (tooSmall) {
6334
6182
  ctx = this._getOrReturnCtx(input, ctx);
6335
- parseUtil_1.addIssueToContext(ctx, {
6183
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6336
6184
  code: ZodError_1.ZodIssueCode.too_small,
6337
6185
  minimum: check.value,
6338
6186
  type: "number",
6339
6187
  inclusive: check.inclusive,
6188
+ exact: false,
6340
6189
  message: check.message,
6341
6190
  });
6342
6191
  status.dirty();
@@ -6348,11 +6197,12 @@ class ZodNumber extends ZodType {
6348
6197
  : input.data >= check.value;
6349
6198
  if (tooBig) {
6350
6199
  ctx = this._getOrReturnCtx(input, ctx);
6351
- parseUtil_1.addIssueToContext(ctx, {
6200
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6352
6201
  code: ZodError_1.ZodIssueCode.too_big,
6353
6202
  maximum: check.value,
6354
6203
  type: "number",
6355
6204
  inclusive: check.inclusive,
6205
+ exact: false,
6356
6206
  message: check.message,
6357
6207
  });
6358
6208
  status.dirty();
@@ -6361,7 +6211,7 @@ class ZodNumber extends ZodType {
6361
6211
  else if (check.kind === "multipleOf") {
6362
6212
  if (floatSafeRemainder(input.data, check.value) !== 0) {
6363
6213
  ctx = this._getOrReturnCtx(input, ctx);
6364
- parseUtil_1.addIssueToContext(ctx, {
6214
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6365
6215
  code: ZodError_1.ZodIssueCode.not_multiple_of,
6366
6216
  multipleOf: check.value,
6367
6217
  message: check.message,
@@ -6369,6 +6219,16 @@ class ZodNumber extends ZodType {
6369
6219
  status.dirty();
6370
6220
  }
6371
6221
  }
6222
+ else if (check.kind === "finite") {
6223
+ if (!Number.isFinite(input.data)) {
6224
+ ctx = this._getOrReturnCtx(input, ctx);
6225
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6226
+ code: ZodError_1.ZodIssueCode.not_finite,
6227
+ message: check.message,
6228
+ });
6229
+ status.dirty();
6230
+ }
6231
+ }
6372
6232
  else {
6373
6233
  util_1.util.assertNever(check);
6374
6234
  }
@@ -6452,6 +6312,12 @@ class ZodNumber extends ZodType {
6452
6312
  message: errorUtil_1.errorUtil.toString(message),
6453
6313
  });
6454
6314
  }
6315
+ finite(message) {
6316
+ return this._addCheck({
6317
+ kind: "finite",
6318
+ message: errorUtil_1.errorUtil.toString(message),
6319
+ });
6320
+ }
6455
6321
  get minValue() {
6456
6322
  let min = null;
6457
6323
  for (const ch of this._def.checks) {
@@ -6481,59 +6347,72 @@ ZodNumber.create = (params) => {
6481
6347
  return new ZodNumber({
6482
6348
  checks: [],
6483
6349
  typeName: ZodFirstPartyTypeKind.ZodNumber,
6350
+ coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
6484
6351
  ...processCreateParams(params),
6485
6352
  });
6486
6353
  };
6487
6354
  class ZodBigInt extends ZodType {
6488
6355
  _parse(input) {
6356
+ if (this._def.coerce) {
6357
+ input.data = BigInt(input.data);
6358
+ }
6489
6359
  const parsedType = this._getType(input);
6490
6360
  if (parsedType !== util_1.ZodParsedType.bigint) {
6491
6361
  const ctx = this._getOrReturnCtx(input);
6492
- parseUtil_1.addIssueToContext(ctx, {
6362
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6493
6363
  code: ZodError_1.ZodIssueCode.invalid_type,
6494
6364
  expected: util_1.ZodParsedType.bigint,
6495
6365
  received: ctx.parsedType,
6496
6366
  });
6497
6367
  return parseUtil_1.INVALID;
6498
6368
  }
6499
- return parseUtil_1.OK(input.data);
6369
+ return (0, parseUtil_1.OK)(input.data);
6500
6370
  }
6501
6371
  }
6502
6372
  exports.ZodBigInt = ZodBigInt;
6503
6373
  ZodBigInt.create = (params) => {
6374
+ var _a;
6504
6375
  return new ZodBigInt({
6505
6376
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
6377
+ coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
6506
6378
  ...processCreateParams(params),
6507
6379
  });
6508
6380
  };
6509
6381
  class ZodBoolean extends ZodType {
6510
6382
  _parse(input) {
6383
+ if (this._def.coerce) {
6384
+ input.data = Boolean(input.data);
6385
+ }
6511
6386
  const parsedType = this._getType(input);
6512
6387
  if (parsedType !== util_1.ZodParsedType.boolean) {
6513
6388
  const ctx = this._getOrReturnCtx(input);
6514
- parseUtil_1.addIssueToContext(ctx, {
6389
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6515
6390
  code: ZodError_1.ZodIssueCode.invalid_type,
6516
6391
  expected: util_1.ZodParsedType.boolean,
6517
6392
  received: ctx.parsedType,
6518
6393
  });
6519
6394
  return parseUtil_1.INVALID;
6520
6395
  }
6521
- return parseUtil_1.OK(input.data);
6396
+ return (0, parseUtil_1.OK)(input.data);
6522
6397
  }
6523
6398
  }
6524
6399
  exports.ZodBoolean = ZodBoolean;
6525
6400
  ZodBoolean.create = (params) => {
6526
6401
  return new ZodBoolean({
6527
6402
  typeName: ZodFirstPartyTypeKind.ZodBoolean,
6403
+ coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
6528
6404
  ...processCreateParams(params),
6529
6405
  });
6530
6406
  };
6531
6407
  class ZodDate extends ZodType {
6532
6408
  _parse(input) {
6409
+ if (this._def.coerce) {
6410
+ input.data = new Date(input.data);
6411
+ }
6533
6412
  const parsedType = this._getType(input);
6534
6413
  if (parsedType !== util_1.ZodParsedType.date) {
6535
6414
  const ctx = this._getOrReturnCtx(input);
6536
- parseUtil_1.addIssueToContext(ctx, {
6415
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6537
6416
  code: ZodError_1.ZodIssueCode.invalid_type,
6538
6417
  expected: util_1.ZodParsedType.date,
6539
6418
  received: ctx.parsedType,
@@ -6542,7 +6421,7 @@ class ZodDate extends ZodType {
6542
6421
  }
6543
6422
  if (isNaN(input.data.getTime())) {
6544
6423
  const ctx = this._getOrReturnCtx(input);
6545
- parseUtil_1.addIssueToContext(ctx, {
6424
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6546
6425
  code: ZodError_1.ZodIssueCode.invalid_date,
6547
6426
  });
6548
6427
  return parseUtil_1.INVALID;
@@ -6553,10 +6432,11 @@ class ZodDate extends ZodType {
6553
6432
  if (check.kind === "min") {
6554
6433
  if (input.data.getTime() < check.value) {
6555
6434
  ctx = this._getOrReturnCtx(input, ctx);
6556
- parseUtil_1.addIssueToContext(ctx, {
6435
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6557
6436
  code: ZodError_1.ZodIssueCode.too_small,
6558
6437
  message: check.message,
6559
6438
  inclusive: true,
6439
+ exact: false,
6560
6440
  minimum: check.value,
6561
6441
  type: "date",
6562
6442
  });
@@ -6566,10 +6446,11 @@ class ZodDate extends ZodType {
6566
6446
  else if (check.kind === "max") {
6567
6447
  if (input.data.getTime() > check.value) {
6568
6448
  ctx = this._getOrReturnCtx(input, ctx);
6569
- parseUtil_1.addIssueToContext(ctx, {
6449
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6570
6450
  code: ZodError_1.ZodIssueCode.too_big,
6571
6451
  message: check.message,
6572
6452
  inclusive: true,
6453
+ exact: false,
6573
6454
  maximum: check.value,
6574
6455
  type: "date",
6575
6456
  });
@@ -6630,23 +6511,46 @@ exports.ZodDate = ZodDate;
6630
6511
  ZodDate.create = (params) => {
6631
6512
  return new ZodDate({
6632
6513
  checks: [],
6514
+ coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
6633
6515
  typeName: ZodFirstPartyTypeKind.ZodDate,
6634
6516
  ...processCreateParams(params),
6635
6517
  });
6636
6518
  };
6519
+ class ZodSymbol extends ZodType {
6520
+ _parse(input) {
6521
+ const parsedType = this._getType(input);
6522
+ if (parsedType !== util_1.ZodParsedType.symbol) {
6523
+ const ctx = this._getOrReturnCtx(input);
6524
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6525
+ code: ZodError_1.ZodIssueCode.invalid_type,
6526
+ expected: util_1.ZodParsedType.symbol,
6527
+ received: ctx.parsedType,
6528
+ });
6529
+ return parseUtil_1.INVALID;
6530
+ }
6531
+ return (0, parseUtil_1.OK)(input.data);
6532
+ }
6533
+ }
6534
+ exports.ZodSymbol = ZodSymbol;
6535
+ ZodSymbol.create = (params) => {
6536
+ return new ZodSymbol({
6537
+ typeName: ZodFirstPartyTypeKind.ZodSymbol,
6538
+ ...processCreateParams(params),
6539
+ });
6540
+ };
6637
6541
  class ZodUndefined extends ZodType {
6638
6542
  _parse(input) {
6639
6543
  const parsedType = this._getType(input);
6640
6544
  if (parsedType !== util_1.ZodParsedType.undefined) {
6641
6545
  const ctx = this._getOrReturnCtx(input);
6642
- parseUtil_1.addIssueToContext(ctx, {
6546
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6643
6547
  code: ZodError_1.ZodIssueCode.invalid_type,
6644
6548
  expected: util_1.ZodParsedType.undefined,
6645
6549
  received: ctx.parsedType,
6646
6550
  });
6647
6551
  return parseUtil_1.INVALID;
6648
6552
  }
6649
- return parseUtil_1.OK(input.data);
6553
+ return (0, parseUtil_1.OK)(input.data);
6650
6554
  }
6651
6555
  }
6652
6556
  exports.ZodUndefined = ZodUndefined;
@@ -6661,14 +6565,14 @@ class ZodNull extends ZodType {
6661
6565
  const parsedType = this._getType(input);
6662
6566
  if (parsedType !== util_1.ZodParsedType.null) {
6663
6567
  const ctx = this._getOrReturnCtx(input);
6664
- parseUtil_1.addIssueToContext(ctx, {
6568
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6665
6569
  code: ZodError_1.ZodIssueCode.invalid_type,
6666
6570
  expected: util_1.ZodParsedType.null,
6667
6571
  received: ctx.parsedType,
6668
6572
  });
6669
6573
  return parseUtil_1.INVALID;
6670
6574
  }
6671
- return parseUtil_1.OK(input.data);
6575
+ return (0, parseUtil_1.OK)(input.data);
6672
6576
  }
6673
6577
  }
6674
6578
  exports.ZodNull = ZodNull;
@@ -6685,7 +6589,7 @@ class ZodAny extends ZodType {
6685
6589
  this._any = true;
6686
6590
  }
6687
6591
  _parse(input) {
6688
- return parseUtil_1.OK(input.data);
6592
+ return (0, parseUtil_1.OK)(input.data);
6689
6593
  }
6690
6594
  }
6691
6595
  exports.ZodAny = ZodAny;
@@ -6702,7 +6606,7 @@ class ZodUnknown extends ZodType {
6702
6606
  this._unknown = true;
6703
6607
  }
6704
6608
  _parse(input) {
6705
- return parseUtil_1.OK(input.data);
6609
+ return (0, parseUtil_1.OK)(input.data);
6706
6610
  }
6707
6611
  }
6708
6612
  exports.ZodUnknown = ZodUnknown;
@@ -6715,7 +6619,7 @@ ZodUnknown.create = (params) => {
6715
6619
  class ZodNever extends ZodType {
6716
6620
  _parse(input) {
6717
6621
  const ctx = this._getOrReturnCtx(input);
6718
- parseUtil_1.addIssueToContext(ctx, {
6622
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6719
6623
  code: ZodError_1.ZodIssueCode.invalid_type,
6720
6624
  expected: util_1.ZodParsedType.never,
6721
6625
  received: ctx.parsedType,
@@ -6735,14 +6639,14 @@ class ZodVoid extends ZodType {
6735
6639
  const parsedType = this._getType(input);
6736
6640
  if (parsedType !== util_1.ZodParsedType.undefined) {
6737
6641
  const ctx = this._getOrReturnCtx(input);
6738
- parseUtil_1.addIssueToContext(ctx, {
6642
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6739
6643
  code: ZodError_1.ZodIssueCode.invalid_type,
6740
6644
  expected: util_1.ZodParsedType.void,
6741
6645
  received: ctx.parsedType,
6742
6646
  });
6743
6647
  return parseUtil_1.INVALID;
6744
6648
  }
6745
- return parseUtil_1.OK(input.data);
6649
+ return (0, parseUtil_1.OK)(input.data);
6746
6650
  }
6747
6651
  }
6748
6652
  exports.ZodVoid = ZodVoid;
@@ -6757,20 +6661,37 @@ class ZodArray extends ZodType {
6757
6661
  const { ctx, status } = this._processInputParams(input);
6758
6662
  const def = this._def;
6759
6663
  if (ctx.parsedType !== util_1.ZodParsedType.array) {
6760
- parseUtil_1.addIssueToContext(ctx, {
6664
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6761
6665
  code: ZodError_1.ZodIssueCode.invalid_type,
6762
6666
  expected: util_1.ZodParsedType.array,
6763
6667
  received: ctx.parsedType,
6764
6668
  });
6765
6669
  return parseUtil_1.INVALID;
6766
6670
  }
6671
+ if (def.exactLength !== null) {
6672
+ const tooBig = ctx.data.length > def.exactLength.value;
6673
+ const tooSmall = ctx.data.length < def.exactLength.value;
6674
+ if (tooBig || tooSmall) {
6675
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6676
+ code: tooBig ? ZodError_1.ZodIssueCode.too_big : ZodError_1.ZodIssueCode.too_small,
6677
+ minimum: (tooSmall ? def.exactLength.value : undefined),
6678
+ maximum: (tooBig ? def.exactLength.value : undefined),
6679
+ type: "array",
6680
+ inclusive: true,
6681
+ exact: true,
6682
+ message: def.exactLength.message,
6683
+ });
6684
+ status.dirty();
6685
+ }
6686
+ }
6767
6687
  if (def.minLength !== null) {
6768
6688
  if (ctx.data.length < def.minLength.value) {
6769
- parseUtil_1.addIssueToContext(ctx, {
6689
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6770
6690
  code: ZodError_1.ZodIssueCode.too_small,
6771
6691
  minimum: def.minLength.value,
6772
6692
  type: "array",
6773
6693
  inclusive: true,
6694
+ exact: false,
6774
6695
  message: def.minLength.message,
6775
6696
  });
6776
6697
  status.dirty();
@@ -6778,11 +6699,12 @@ class ZodArray extends ZodType {
6778
6699
  }
6779
6700
  if (def.maxLength !== null) {
6780
6701
  if (ctx.data.length > def.maxLength.value) {
6781
- parseUtil_1.addIssueToContext(ctx, {
6702
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6782
6703
  code: ZodError_1.ZodIssueCode.too_big,
6783
6704
  maximum: def.maxLength.value,
6784
6705
  type: "array",
6785
6706
  inclusive: true,
6707
+ exact: false,
6786
6708
  message: def.maxLength.message,
6787
6709
  });
6788
6710
  status.dirty();
@@ -6816,7 +6738,10 @@ class ZodArray extends ZodType {
6816
6738
  });
6817
6739
  }
6818
6740
  length(len, message) {
6819
- return this.min(len, message).max(len, message);
6741
+ return new ZodArray({
6742
+ ...this._def,
6743
+ exactLength: { value: len, message: errorUtil_1.errorUtil.toString(message) },
6744
+ });
6820
6745
  }
6821
6746
  nonempty(message) {
6822
6747
  return this.min(1, message);
@@ -6828,6 +6753,7 @@ ZodArray.create = (schema, params) => {
6828
6753
  type: schema,
6829
6754
  minLength: null,
6830
6755
  maxLength: null,
6756
+ exactLength: null,
6831
6757
  typeName: ZodFirstPartyTypeKind.ZodArray,
6832
6758
  ...processCreateParams(params),
6833
6759
  });
@@ -6844,7 +6770,7 @@ var objectUtil;
6844
6770
  objectUtil.mergeShapes = (first, second) => {
6845
6771
  return {
6846
6772
  ...first,
6847
- ...second,
6773
+ ...second, // second overwrites first
6848
6774
  };
6849
6775
  };
6850
6776
  })(objectUtil = exports.objectUtil || (exports.objectUtil = {}));
@@ -6908,7 +6834,7 @@ class ZodObject extends ZodType {
6908
6834
  const parsedType = this._getType(input);
6909
6835
  if (parsedType !== util_1.ZodParsedType.object) {
6910
6836
  const ctx = this._getOrReturnCtx(input);
6911
- parseUtil_1.addIssueToContext(ctx, {
6837
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6912
6838
  code: ZodError_1.ZodIssueCode.invalid_type,
6913
6839
  expected: util_1.ZodParsedType.object,
6914
6840
  received: ctx.parsedType,
@@ -6918,9 +6844,12 @@ class ZodObject extends ZodType {
6918
6844
  const { status, ctx } = this._processInputParams(input);
6919
6845
  const { shape, keys: shapeKeys } = this._getCached();
6920
6846
  const extraKeys = [];
6921
- for (const key in ctx.data) {
6922
- if (!shapeKeys.includes(key)) {
6923
- extraKeys.push(key);
6847
+ if (!(this._def.catchall instanceof ZodNever &&
6848
+ this._def.unknownKeys === "strip")) {
6849
+ for (const key in ctx.data) {
6850
+ if (!shapeKeys.includes(key)) {
6851
+ extraKeys.push(key);
6852
+ }
6924
6853
  }
6925
6854
  }
6926
6855
  const pairs = [];
@@ -6945,7 +6874,7 @@ class ZodObject extends ZodType {
6945
6874
  }
6946
6875
  else if (unknownKeys === "strict") {
6947
6876
  if (extraKeys.length > 0) {
6948
- parseUtil_1.addIssueToContext(ctx, {
6877
+ (0, parseUtil_1.addIssueToContext)(ctx, {
6949
6878
  code: ZodError_1.ZodIssueCode.unrecognized_keys,
6950
6879
  keys: extraKeys,
6951
6880
  });
@@ -7111,15 +7040,32 @@ class ZodObject extends ZodType {
7111
7040
  shape: () => newShape,
7112
7041
  });
7113
7042
  }
7114
- required() {
7043
+ required(mask) {
7115
7044
  const newShape = {};
7116
- for (const key in this.shape) {
7117
- const fieldSchema = this.shape[key];
7118
- let newField = fieldSchema;
7119
- while (newField instanceof ZodOptional) {
7120
- newField = newField._def.innerType;
7045
+ if (mask) {
7046
+ util_1.util.objectKeys(this.shape).map((key) => {
7047
+ if (util_1.util.objectKeys(mask).indexOf(key) === -1) {
7048
+ newShape[key] = this.shape[key];
7049
+ }
7050
+ else {
7051
+ const fieldSchema = this.shape[key];
7052
+ let newField = fieldSchema;
7053
+ while (newField instanceof ZodOptional) {
7054
+ newField = newField._def.innerType;
7055
+ }
7056
+ newShape[key] = newField;
7057
+ }
7058
+ });
7059
+ }
7060
+ else {
7061
+ for (const key in this.shape) {
7062
+ const fieldSchema = this.shape[key];
7063
+ let newField = fieldSchema;
7064
+ while (newField instanceof ZodOptional) {
7065
+ newField = newField._def.innerType;
7066
+ }
7067
+ newShape[key] = newField;
7121
7068
  }
7122
- newShape[key] = newField;
7123
7069
  }
7124
7070
  return new ZodObject({
7125
7071
  ...this._def,
@@ -7178,7 +7124,7 @@ class ZodUnion extends ZodType {
7178
7124
  }
7179
7125
  // return invalid
7180
7126
  const unionErrors = results.map((result) => new ZodError_1.ZodError(result.ctx.common.issues));
7181
- parseUtil_1.addIssueToContext(ctx, {
7127
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7182
7128
  code: ZodError_1.ZodIssueCode.invalid_union,
7183
7129
  unionErrors,
7184
7130
  });
@@ -7236,7 +7182,7 @@ class ZodUnion extends ZodType {
7236
7182
  return dirty.result;
7237
7183
  }
7238
7184
  const unionErrors = issues.map((issues) => new ZodError_1.ZodError(issues));
7239
- parseUtil_1.addIssueToContext(ctx, {
7185
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7240
7186
  code: ZodError_1.ZodIssueCode.invalid_union,
7241
7187
  unionErrors,
7242
7188
  });
@@ -7255,11 +7201,48 @@ ZodUnion.create = (types, params) => {
7255
7201
  ...processCreateParams(params),
7256
7202
  });
7257
7203
  };
7204
+ /////////////////////////////////////////////////////
7205
+ /////////////////////////////////////////////////////
7206
+ ////////// //////////
7207
+ ////////// ZodDiscriminatedUnion //////////
7208
+ ////////// //////////
7209
+ /////////////////////////////////////////////////////
7210
+ /////////////////////////////////////////////////////
7211
+ const getDiscriminator = (type) => {
7212
+ if (type instanceof ZodLazy) {
7213
+ return getDiscriminator(type.schema);
7214
+ }
7215
+ else if (type instanceof ZodEffects) {
7216
+ return getDiscriminator(type.innerType());
7217
+ }
7218
+ else if (type instanceof ZodLiteral) {
7219
+ return [type.value];
7220
+ }
7221
+ else if (type instanceof ZodEnum) {
7222
+ return type.options;
7223
+ }
7224
+ else if (type instanceof ZodNativeEnum) {
7225
+ // eslint-disable-next-line ban/ban
7226
+ return Object.keys(type.enum);
7227
+ }
7228
+ else if (type instanceof ZodDefault) {
7229
+ return getDiscriminator(type._def.innerType);
7230
+ }
7231
+ else if (type instanceof ZodUndefined) {
7232
+ return [undefined];
7233
+ }
7234
+ else if (type instanceof ZodNull) {
7235
+ return [null];
7236
+ }
7237
+ else {
7238
+ return null;
7239
+ }
7240
+ };
7258
7241
  class ZodDiscriminatedUnion extends ZodType {
7259
7242
  _parse(input) {
7260
7243
  const { ctx } = this._processInputParams(input);
7261
7244
  if (ctx.parsedType !== util_1.ZodParsedType.object) {
7262
- parseUtil_1.addIssueToContext(ctx, {
7245
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7263
7246
  code: ZodError_1.ZodIssueCode.invalid_type,
7264
7247
  expected: util_1.ZodParsedType.object,
7265
7248
  received: ctx.parsedType,
@@ -7268,11 +7251,11 @@ class ZodDiscriminatedUnion extends ZodType {
7268
7251
  }
7269
7252
  const discriminator = this.discriminator;
7270
7253
  const discriminatorValue = ctx.data[discriminator];
7271
- const option = this.options.get(discriminatorValue);
7254
+ const option = this.optionsMap.get(discriminatorValue);
7272
7255
  if (!option) {
7273
- parseUtil_1.addIssueToContext(ctx, {
7256
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7274
7257
  code: ZodError_1.ZodIssueCode.invalid_union_discriminator,
7275
- options: this.validDiscriminatorValues,
7258
+ options: Array.from(this.optionsMap.keys()),
7276
7259
  path: [discriminator],
7277
7260
  });
7278
7261
  return parseUtil_1.INVALID;
@@ -7295,12 +7278,12 @@ class ZodDiscriminatedUnion extends ZodType {
7295
7278
  get discriminator() {
7296
7279
  return this._def.discriminator;
7297
7280
  }
7298
- get validDiscriminatorValues() {
7299
- return Array.from(this.options.keys());
7300
- }
7301
7281
  get options() {
7302
7282
  return this._def.options;
7303
7283
  }
7284
+ get optionsMap() {
7285
+ return this._def.optionsMap;
7286
+ }
7304
7287
  /**
7305
7288
  * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
7306
7289
  * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
@@ -7309,34 +7292,35 @@ class ZodDiscriminatedUnion extends ZodType {
7309
7292
  * @param types an array of object schemas
7310
7293
  * @param params
7311
7294
  */
7312
- static create(discriminator, types, params) {
7295
+ static create(discriminator, options, params) {
7313
7296
  // Get all the valid discriminator values
7314
- const options = new Map();
7315
- try {
7316
- types.forEach((type) => {
7317
- const discriminatorValue = type.shape[discriminator].value;
7318
- options.set(discriminatorValue, type);
7319
- });
7320
- }
7321
- catch (e) {
7322
- throw new Error("The discriminator value could not be extracted from all the provided schemas");
7323
- }
7324
- // Assert that all the discriminator values are unique
7325
- if (options.size !== types.length) {
7326
- throw new Error("Some of the discriminator values are not unique");
7297
+ const optionsMap = new Map();
7298
+ // try {
7299
+ for (const type of options) {
7300
+ const discriminatorValues = getDiscriminator(type.shape[discriminator]);
7301
+ if (!discriminatorValues) {
7302
+ throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
7303
+ }
7304
+ for (const value of discriminatorValues) {
7305
+ if (optionsMap.has(value)) {
7306
+ throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
7307
+ }
7308
+ optionsMap.set(value, type);
7309
+ }
7327
7310
  }
7328
7311
  return new ZodDiscriminatedUnion({
7329
7312
  typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
7330
7313
  discriminator,
7331
7314
  options,
7315
+ optionsMap,
7332
7316
  ...processCreateParams(params),
7333
7317
  });
7334
7318
  }
7335
7319
  }
7336
7320
  exports.ZodDiscriminatedUnion = ZodDiscriminatedUnion;
7337
7321
  function mergeValues(a, b) {
7338
- const aType = util_1.getParsedType(a);
7339
- const bType = util_1.getParsedType(b);
7322
+ const aType = (0, util_1.getParsedType)(a);
7323
+ const bType = (0, util_1.getParsedType)(b);
7340
7324
  if (a === b) {
7341
7325
  return { valid: true, data: a };
7342
7326
  }
@@ -7384,17 +7368,17 @@ class ZodIntersection extends ZodType {
7384
7368
  _parse(input) {
7385
7369
  const { status, ctx } = this._processInputParams(input);
7386
7370
  const handleParsed = (parsedLeft, parsedRight) => {
7387
- if (parseUtil_1.isAborted(parsedLeft) || parseUtil_1.isAborted(parsedRight)) {
7371
+ if ((0, parseUtil_1.isAborted)(parsedLeft) || (0, parseUtil_1.isAborted)(parsedRight)) {
7388
7372
  return parseUtil_1.INVALID;
7389
7373
  }
7390
7374
  const merged = mergeValues(parsedLeft.value, parsedRight.value);
7391
7375
  if (!merged.valid) {
7392
- parseUtil_1.addIssueToContext(ctx, {
7376
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7393
7377
  code: ZodError_1.ZodIssueCode.invalid_intersection_types,
7394
7378
  });
7395
7379
  return parseUtil_1.INVALID;
7396
7380
  }
7397
- if (parseUtil_1.isDirty(parsedLeft) || parseUtil_1.isDirty(parsedRight)) {
7381
+ if ((0, parseUtil_1.isDirty)(parsedLeft) || (0, parseUtil_1.isDirty)(parsedRight)) {
7398
7382
  status.dirty();
7399
7383
  }
7400
7384
  return { status: status.value, value: merged.data };
@@ -7439,7 +7423,7 @@ class ZodTuple extends ZodType {
7439
7423
  _parse(input) {
7440
7424
  const { status, ctx } = this._processInputParams(input);
7441
7425
  if (ctx.parsedType !== util_1.ZodParsedType.array) {
7442
- parseUtil_1.addIssueToContext(ctx, {
7426
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7443
7427
  code: ZodError_1.ZodIssueCode.invalid_type,
7444
7428
  expected: util_1.ZodParsedType.array,
7445
7429
  received: ctx.parsedType,
@@ -7447,20 +7431,22 @@ class ZodTuple extends ZodType {
7447
7431
  return parseUtil_1.INVALID;
7448
7432
  }
7449
7433
  if (ctx.data.length < this._def.items.length) {
7450
- parseUtil_1.addIssueToContext(ctx, {
7434
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7451
7435
  code: ZodError_1.ZodIssueCode.too_small,
7452
7436
  minimum: this._def.items.length,
7453
7437
  inclusive: true,
7438
+ exact: false,
7454
7439
  type: "array",
7455
7440
  });
7456
7441
  return parseUtil_1.INVALID;
7457
7442
  }
7458
7443
  const rest = this._def.rest;
7459
7444
  if (!rest && ctx.data.length > this._def.items.length) {
7460
- parseUtil_1.addIssueToContext(ctx, {
7445
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7461
7446
  code: ZodError_1.ZodIssueCode.too_big,
7462
7447
  maximum: this._def.items.length,
7463
7448
  inclusive: true,
7449
+ exact: false,
7464
7450
  type: "array",
7465
7451
  });
7466
7452
  status.dirty();
@@ -7494,6 +7480,9 @@ class ZodTuple extends ZodType {
7494
7480
  }
7495
7481
  exports.ZodTuple = ZodTuple;
7496
7482
  ZodTuple.create = (schemas, params) => {
7483
+ if (!Array.isArray(schemas)) {
7484
+ throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
7485
+ }
7497
7486
  return new ZodTuple({
7498
7487
  items: schemas,
7499
7488
  typeName: ZodFirstPartyTypeKind.ZodTuple,
@@ -7511,7 +7500,7 @@ class ZodRecord extends ZodType {
7511
7500
  _parse(input) {
7512
7501
  const { status, ctx } = this._processInputParams(input);
7513
7502
  if (ctx.parsedType !== util_1.ZodParsedType.object) {
7514
- parseUtil_1.addIssueToContext(ctx, {
7503
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7515
7504
  code: ZodError_1.ZodIssueCode.invalid_type,
7516
7505
  expected: util_1.ZodParsedType.object,
7517
7506
  received: ctx.parsedType,
@@ -7559,7 +7548,7 @@ class ZodMap extends ZodType {
7559
7548
  _parse(input) {
7560
7549
  const { status, ctx } = this._processInputParams(input);
7561
7550
  if (ctx.parsedType !== util_1.ZodParsedType.map) {
7562
- parseUtil_1.addIssueToContext(ctx, {
7551
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7563
7552
  code: ZodError_1.ZodIssueCode.invalid_type,
7564
7553
  expected: util_1.ZodParsedType.map,
7565
7554
  received: ctx.parsedType,
@@ -7621,7 +7610,7 @@ class ZodSet extends ZodType {
7621
7610
  _parse(input) {
7622
7611
  const { status, ctx } = this._processInputParams(input);
7623
7612
  if (ctx.parsedType !== util_1.ZodParsedType.set) {
7624
- parseUtil_1.addIssueToContext(ctx, {
7613
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7625
7614
  code: ZodError_1.ZodIssueCode.invalid_type,
7626
7615
  expected: util_1.ZodParsedType.set,
7627
7616
  received: ctx.parsedType,
@@ -7631,11 +7620,12 @@ class ZodSet extends ZodType {
7631
7620
  const def = this._def;
7632
7621
  if (def.minSize !== null) {
7633
7622
  if (ctx.data.size < def.minSize.value) {
7634
- parseUtil_1.addIssueToContext(ctx, {
7623
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7635
7624
  code: ZodError_1.ZodIssueCode.too_small,
7636
7625
  minimum: def.minSize.value,
7637
7626
  type: "set",
7638
7627
  inclusive: true,
7628
+ exact: false,
7639
7629
  message: def.minSize.message,
7640
7630
  });
7641
7631
  status.dirty();
@@ -7643,11 +7633,12 @@ class ZodSet extends ZodType {
7643
7633
  }
7644
7634
  if (def.maxSize !== null) {
7645
7635
  if (ctx.data.size > def.maxSize.value) {
7646
- parseUtil_1.addIssueToContext(ctx, {
7636
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7647
7637
  code: ZodError_1.ZodIssueCode.too_big,
7648
7638
  maximum: def.maxSize.value,
7649
7639
  type: "set",
7650
7640
  inclusive: true,
7641
+ exact: false,
7651
7642
  message: def.maxSize.message,
7652
7643
  });
7653
7644
  status.dirty();
@@ -7710,7 +7701,7 @@ class ZodFunction extends ZodType {
7710
7701
  _parse(input) {
7711
7702
  const { ctx } = this._processInputParams(input);
7712
7703
  if (ctx.parsedType !== util_1.ZodParsedType.function) {
7713
- parseUtil_1.addIssueToContext(ctx, {
7704
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7714
7705
  code: ZodError_1.ZodIssueCode.invalid_type,
7715
7706
  expected: util_1.ZodParsedType.function,
7716
7707
  received: ctx.parsedType,
@@ -7718,14 +7709,14 @@ class ZodFunction extends ZodType {
7718
7709
  return parseUtil_1.INVALID;
7719
7710
  }
7720
7711
  function makeArgsIssue(args, error) {
7721
- return parseUtil_1.makeIssue({
7712
+ return (0, parseUtil_1.makeIssue)({
7722
7713
  data: args,
7723
7714
  path: ctx.path,
7724
7715
  errorMaps: [
7725
7716
  ctx.common.contextualErrorMap,
7726
7717
  ctx.schemaErrorMap,
7727
- ZodError_1.getErrorMap(),
7728
- ZodError_1.defaultErrorMap,
7718
+ (0, errors_1.getErrorMap)(),
7719
+ errors_1.defaultErrorMap,
7729
7720
  ].filter((x) => !!x),
7730
7721
  issueData: {
7731
7722
  code: ZodError_1.ZodIssueCode.invalid_arguments,
@@ -7734,14 +7725,14 @@ class ZodFunction extends ZodType {
7734
7725
  });
7735
7726
  }
7736
7727
  function makeReturnsIssue(returns, error) {
7737
- return parseUtil_1.makeIssue({
7728
+ return (0, parseUtil_1.makeIssue)({
7738
7729
  data: returns,
7739
7730
  path: ctx.path,
7740
7731
  errorMaps: [
7741
7732
  ctx.common.contextualErrorMap,
7742
7733
  ctx.schemaErrorMap,
7743
- ZodError_1.getErrorMap(),
7744
- ZodError_1.defaultErrorMap,
7734
+ (0, errors_1.getErrorMap)(),
7735
+ errors_1.defaultErrorMap,
7745
7736
  ].filter((x) => !!x),
7746
7737
  issueData: {
7747
7738
  code: ZodError_1.ZodIssueCode.invalid_return_type,
@@ -7752,7 +7743,7 @@ class ZodFunction extends ZodType {
7752
7743
  const params = { errorMap: ctx.common.contextualErrorMap };
7753
7744
  const fn = ctx.data;
7754
7745
  if (this._def.returns instanceof ZodPromise) {
7755
- return parseUtil_1.OK(async (...args) => {
7746
+ return (0, parseUtil_1.OK)(async (...args) => {
7756
7747
  const error = new ZodError_1.ZodError([]);
7757
7748
  const parsedArgs = await this._def.args
7758
7749
  .parseAsync(args, params)
@@ -7771,7 +7762,7 @@ class ZodFunction extends ZodType {
7771
7762
  });
7772
7763
  }
7773
7764
  else {
7774
- return parseUtil_1.OK((...args) => {
7765
+ return (0, parseUtil_1.OK)((...args) => {
7775
7766
  const parsedArgs = this._def.args.safeParse(args, params);
7776
7767
  if (!parsedArgs.success) {
7777
7768
  throw new ZodError_1.ZodError([makeArgsIssue(args, parsedArgs.error)]);
@@ -7811,18 +7802,18 @@ class ZodFunction extends ZodType {
7811
7802
  const validatedFunc = this.parse(func);
7812
7803
  return validatedFunc;
7813
7804
  }
7805
+ static create(args, returns, params) {
7806
+ return new ZodFunction({
7807
+ args: (args
7808
+ ? args
7809
+ : ZodTuple.create([]).rest(ZodUnknown.create())),
7810
+ returns: returns || ZodUnknown.create(),
7811
+ typeName: ZodFirstPartyTypeKind.ZodFunction,
7812
+ ...processCreateParams(params),
7813
+ });
7814
+ }
7814
7815
  }
7815
7816
  exports.ZodFunction = ZodFunction;
7816
- ZodFunction.create = (args, returns, params) => {
7817
- return new ZodFunction({
7818
- args: (args
7819
- ? args.rest(ZodUnknown.create())
7820
- : ZodTuple.create([]).rest(ZodUnknown.create())),
7821
- returns: returns || ZodUnknown.create(),
7822
- typeName: ZodFirstPartyTypeKind.ZodFunction,
7823
- ...processCreateParams(params),
7824
- });
7825
- };
7826
7817
  class ZodLazy extends ZodType {
7827
7818
  get schema() {
7828
7819
  return this._def.getter();
@@ -7845,7 +7836,7 @@ class ZodLiteral extends ZodType {
7845
7836
  _parse(input) {
7846
7837
  if (input.data !== this._def.value) {
7847
7838
  const ctx = this._getOrReturnCtx(input);
7848
- parseUtil_1.addIssueToContext(ctx, {
7839
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7849
7840
  code: ZodError_1.ZodIssueCode.invalid_literal,
7850
7841
  expected: this._def.value,
7851
7842
  });
@@ -7877,7 +7868,7 @@ class ZodEnum extends ZodType {
7877
7868
  if (typeof input.data !== "string") {
7878
7869
  const ctx = this._getOrReturnCtx(input);
7879
7870
  const expectedValues = this._def.values;
7880
- parseUtil_1.addIssueToContext(ctx, {
7871
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7881
7872
  expected: util_1.util.joinValues(expectedValues),
7882
7873
  received: ctx.parsedType,
7883
7874
  code: ZodError_1.ZodIssueCode.invalid_type,
@@ -7887,14 +7878,14 @@ class ZodEnum extends ZodType {
7887
7878
  if (this._def.values.indexOf(input.data) === -1) {
7888
7879
  const ctx = this._getOrReturnCtx(input);
7889
7880
  const expectedValues = this._def.values;
7890
- parseUtil_1.addIssueToContext(ctx, {
7881
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7891
7882
  received: ctx.data,
7892
7883
  code: ZodError_1.ZodIssueCode.invalid_enum_value,
7893
7884
  options: expectedValues,
7894
7885
  });
7895
7886
  return parseUtil_1.INVALID;
7896
7887
  }
7897
- return parseUtil_1.OK(input.data);
7888
+ return (0, parseUtil_1.OK)(input.data);
7898
7889
  }
7899
7890
  get options() {
7900
7891
  return this._def.values;
@@ -7930,7 +7921,7 @@ class ZodNativeEnum extends ZodType {
7930
7921
  if (ctx.parsedType !== util_1.ZodParsedType.string &&
7931
7922
  ctx.parsedType !== util_1.ZodParsedType.number) {
7932
7923
  const expectedValues = util_1.util.objectValues(nativeEnumValues);
7933
- parseUtil_1.addIssueToContext(ctx, {
7924
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7934
7925
  expected: util_1.util.joinValues(expectedValues),
7935
7926
  received: ctx.parsedType,
7936
7927
  code: ZodError_1.ZodIssueCode.invalid_type,
@@ -7939,14 +7930,14 @@ class ZodNativeEnum extends ZodType {
7939
7930
  }
7940
7931
  if (nativeEnumValues.indexOf(input.data) === -1) {
7941
7932
  const expectedValues = util_1.util.objectValues(nativeEnumValues);
7942
- parseUtil_1.addIssueToContext(ctx, {
7933
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7943
7934
  received: ctx.data,
7944
7935
  code: ZodError_1.ZodIssueCode.invalid_enum_value,
7945
7936
  options: expectedValues,
7946
7937
  });
7947
7938
  return parseUtil_1.INVALID;
7948
7939
  }
7949
- return parseUtil_1.OK(input.data);
7940
+ return (0, parseUtil_1.OK)(input.data);
7950
7941
  }
7951
7942
  get enum() {
7952
7943
  return this._def.values;
@@ -7965,7 +7956,7 @@ class ZodPromise extends ZodType {
7965
7956
  const { ctx } = this._processInputParams(input);
7966
7957
  if (ctx.parsedType !== util_1.ZodParsedType.promise &&
7967
7958
  ctx.common.async === false) {
7968
- parseUtil_1.addIssueToContext(ctx, {
7959
+ (0, parseUtil_1.addIssueToContext)(ctx, {
7969
7960
  code: ZodError_1.ZodIssueCode.invalid_type,
7970
7961
  expected: util_1.ZodParsedType.promise,
7971
7962
  received: ctx.parsedType,
@@ -7975,7 +7966,7 @@ class ZodPromise extends ZodType {
7975
7966
  const promisified = ctx.parsedType === util_1.ZodParsedType.promise
7976
7967
  ? ctx.data
7977
7968
  : Promise.resolve(ctx.data);
7978
- return parseUtil_1.OK(promisified.then((data) => {
7969
+ return (0, parseUtil_1.OK)(promisified.then((data) => {
7979
7970
  return this._def.type.parseAsync(data, {
7980
7971
  path: ctx.path,
7981
7972
  errorMap: ctx.common.contextualErrorMap,
@@ -7995,6 +7986,11 @@ class ZodEffects extends ZodType {
7995
7986
  innerType() {
7996
7987
  return this._def.schema;
7997
7988
  }
7989
+ sourceType() {
7990
+ return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects
7991
+ ? this._def.schema.sourceType()
7992
+ : this._def.schema;
7993
+ }
7998
7994
  _parse(input) {
7999
7995
  const { status, ctx } = this._processInputParams(input);
8000
7996
  const effect = this._def.effect || null;
@@ -8019,7 +8015,7 @@ class ZodEffects extends ZodType {
8019
8015
  }
8020
8016
  const checkCtx = {
8021
8017
  addIssue: (arg) => {
8022
- parseUtil_1.addIssueToContext(ctx, arg);
8018
+ (0, parseUtil_1.addIssueToContext)(ctx, arg);
8023
8019
  if (arg.fatal) {
8024
8020
  status.abort();
8025
8021
  }
@@ -8084,7 +8080,7 @@ class ZodEffects extends ZodType {
8084
8080
  // if (base.status === "dirty") {
8085
8081
  // return { status: "dirty", value: base.value };
8086
8082
  // }
8087
- if (!parseUtil_1.isValid(base))
8083
+ if (!(0, parseUtil_1.isValid)(base))
8088
8084
  return base;
8089
8085
  const result = effect.transform(base.value, checkCtx);
8090
8086
  if (result instanceof Promise) {
@@ -8096,7 +8092,7 @@ class ZodEffects extends ZodType {
8096
8092
  return this._def.schema
8097
8093
  ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
8098
8094
  .then((base) => {
8099
- if (!parseUtil_1.isValid(base))
8095
+ if (!(0, parseUtil_1.isValid)(base))
8100
8096
  return base;
8101
8097
  // if (base.status === "aborted") return INVALID;
8102
8098
  // if (base.status === "dirty") {
@@ -8131,7 +8127,7 @@ class ZodOptional extends ZodType {
8131
8127
  _parse(input) {
8132
8128
  const parsedType = this._getType(input);
8133
8129
  if (parsedType === util_1.ZodParsedType.undefined) {
8134
- return parseUtil_1.OK(undefined);
8130
+ return (0, parseUtil_1.OK)(undefined);
8135
8131
  }
8136
8132
  return this._def.innerType._parse(input);
8137
8133
  }
@@ -8151,7 +8147,7 @@ class ZodNullable extends ZodType {
8151
8147
  _parse(input) {
8152
8148
  const parsedType = this._getType(input);
8153
8149
  if (parsedType === util_1.ZodParsedType.null) {
8154
- return parseUtil_1.OK(null);
8150
+ return (0, parseUtil_1.OK)(null);
8155
8151
  }
8156
8152
  return this._def.innerType._parse(input);
8157
8153
  }
@@ -8186,9 +8182,50 @@ class ZodDefault extends ZodType {
8186
8182
  }
8187
8183
  exports.ZodDefault = ZodDefault;
8188
8184
  ZodDefault.create = (type, params) => {
8189
- return new ZodOptional({
8185
+ return new ZodDefault({
8190
8186
  innerType: type,
8191
- typeName: ZodFirstPartyTypeKind.ZodOptional,
8187
+ typeName: ZodFirstPartyTypeKind.ZodDefault,
8188
+ defaultValue: typeof params.default === "function"
8189
+ ? params.default
8190
+ : () => params.default,
8191
+ ...processCreateParams(params),
8192
+ });
8193
+ };
8194
+ class ZodCatch extends ZodType {
8195
+ _parse(input) {
8196
+ const { ctx } = this._processInputParams(input);
8197
+ const result = this._def.innerType._parse({
8198
+ data: ctx.data,
8199
+ path: ctx.path,
8200
+ parent: ctx,
8201
+ });
8202
+ if ((0, parseUtil_1.isAsync)(result)) {
8203
+ return result.then((result) => {
8204
+ return {
8205
+ status: "valid",
8206
+ value: result.status === "valid" ? result.value : this._def.defaultValue(),
8207
+ };
8208
+ });
8209
+ }
8210
+ else {
8211
+ return {
8212
+ status: "valid",
8213
+ value: result.status === "valid" ? result.value : this._def.defaultValue(),
8214
+ };
8215
+ }
8216
+ }
8217
+ removeDefault() {
8218
+ return this._def.innerType;
8219
+ }
8220
+ }
8221
+ exports.ZodCatch = ZodCatch;
8222
+ ZodCatch.create = (type, params) => {
8223
+ return new ZodCatch({
8224
+ innerType: type,
8225
+ typeName: ZodFirstPartyTypeKind.ZodCatch,
8226
+ defaultValue: typeof params.default === "function"
8227
+ ? params.default
8228
+ : () => params.default,
8192
8229
  ...processCreateParams(params),
8193
8230
  });
8194
8231
  };
@@ -8197,7 +8234,7 @@ class ZodNaN extends ZodType {
8197
8234
  const parsedType = this._getType(input);
8198
8235
  if (parsedType !== util_1.ZodParsedType.nan) {
8199
8236
  const ctx = this._getOrReturnCtx(input);
8200
- parseUtil_1.addIssueToContext(ctx, {
8237
+ (0, parseUtil_1.addIssueToContext)(ctx, {
8201
8238
  code: ZodError_1.ZodIssueCode.invalid_type,
8202
8239
  expected: util_1.ZodParsedType.nan,
8203
8240
  received: ctx.parsedType,
@@ -8229,7 +8266,66 @@ class ZodBranded extends ZodType {
8229
8266
  return this._def.type;
8230
8267
  }
8231
8268
  }
8232
- exports.ZodBranded = ZodBranded;
8269
+ exports.ZodBranded = ZodBranded;
8270
+ class ZodPipeline extends ZodType {
8271
+ _parse(input) {
8272
+ const { status, ctx } = this._processInputParams(input);
8273
+ if (ctx.common.async) {
8274
+ const handleAsync = async () => {
8275
+ const inResult = await this._def.in._parseAsync({
8276
+ data: ctx.data,
8277
+ path: ctx.path,
8278
+ parent: ctx,
8279
+ });
8280
+ if (inResult.status === "aborted")
8281
+ return parseUtil_1.INVALID;
8282
+ if (inResult.status === "dirty") {
8283
+ status.dirty();
8284
+ return (0, parseUtil_1.DIRTY)(inResult.value);
8285
+ }
8286
+ else {
8287
+ return this._def.out._parseAsync({
8288
+ data: inResult.value,
8289
+ path: ctx.path,
8290
+ parent: ctx,
8291
+ });
8292
+ }
8293
+ };
8294
+ return handleAsync();
8295
+ }
8296
+ else {
8297
+ const inResult = this._def.in._parseSync({
8298
+ data: ctx.data,
8299
+ path: ctx.path,
8300
+ parent: ctx,
8301
+ });
8302
+ if (inResult.status === "aborted")
8303
+ return parseUtil_1.INVALID;
8304
+ if (inResult.status === "dirty") {
8305
+ status.dirty();
8306
+ return {
8307
+ status: "dirty",
8308
+ value: inResult.value,
8309
+ };
8310
+ }
8311
+ else {
8312
+ return this._def.out._parseSync({
8313
+ data: inResult.value,
8314
+ path: ctx.path,
8315
+ parent: ctx,
8316
+ });
8317
+ }
8318
+ }
8319
+ }
8320
+ static create(a, b) {
8321
+ return new ZodPipeline({
8322
+ in: a,
8323
+ out: b,
8324
+ typeName: ZodFirstPartyTypeKind.ZodPipeline,
8325
+ });
8326
+ }
8327
+ }
8328
+ exports.ZodPipeline = ZodPipeline;
8233
8329
  const custom = (check, params = {}, fatal) => {
8234
8330
  if (check)
8235
8331
  return ZodAny.create().superRefine((data, ctx) => {
@@ -8253,6 +8349,7 @@ var ZodFirstPartyTypeKind;
8253
8349
  ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
8254
8350
  ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
8255
8351
  ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
8352
+ ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
8256
8353
  ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
8257
8354
  ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
8258
8355
  ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
@@ -8277,12 +8374,21 @@ var ZodFirstPartyTypeKind;
8277
8374
  ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
8278
8375
  ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
8279
8376
  ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
8377
+ ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
8280
8378
  ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
8281
8379
  ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
8380
+ ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
8282
8381
  })(ZodFirstPartyTypeKind = exports.ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = {}));
8283
- const instanceOfType = (cls, params = {
8382
+ // new approach that works for abstract classes
8383
+ // but requires TS 4.4+
8384
+ class Class {
8385
+ constructor(..._) { }
8386
+ }
8387
+ const instanceOfType = (
8388
+ // const instanceOfType = <T extends new (...args: any[]) => any>(
8389
+ cls, params = {
8284
8390
  message: `Input not instance of ${cls.name}`,
8285
- }) => exports.custom((data) => data instanceof cls, params, true);
8391
+ }) => (0, exports.custom)((data) => data instanceof cls, params, true);
8286
8392
  exports["instanceof"] = instanceOfType;
8287
8393
  const stringType = ZodString.create;
8288
8394
  exports.string = stringType;
@@ -8296,6 +8402,8 @@ const booleanType = ZodBoolean.create;
8296
8402
  exports.boolean = booleanType;
8297
8403
  const dateType = ZodDate.create;
8298
8404
  exports.date = dateType;
8405
+ const symbolType = ZodSymbol.create;
8406
+ exports.symbol = symbolType;
8299
8407
  const undefinedType = ZodUndefined.create;
8300
8408
  exports.undefined = undefinedType;
8301
8409
  const nullType = ZodNull.create;
@@ -8349,23 +8457,33 @@ const nullableType = ZodNullable.create;
8349
8457
  exports.nullable = nullableType;
8350
8458
  const preprocessType = ZodEffects.createWithPreprocess;
8351
8459
  exports.preprocess = preprocessType;
8460
+ const pipelineType = ZodPipeline.create;
8461
+ exports.pipeline = pipelineType;
8352
8462
  const ostring = () => stringType().optional();
8353
8463
  exports.ostring = ostring;
8354
8464
  const onumber = () => numberType().optional();
8355
8465
  exports.onumber = onumber;
8356
8466
  const oboolean = () => booleanType().optional();
8357
8467
  exports.oboolean = oboolean;
8468
+ exports.coerce = {
8469
+ string: ((arg) => ZodString.create({ ...arg, coerce: true })),
8470
+ number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),
8471
+ boolean: ((arg) => ZodBoolean.create({ ...arg, coerce: true })),
8472
+ bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),
8473
+ date: ((arg) => ZodDate.create({ ...arg, coerce: true })),
8474
+ };
8475
+ exports.NEVER = parseUtil_1.INVALID;
8358
8476
 
8359
8477
 
8360
8478
  /***/ }),
8361
8479
 
8362
- /***/ 87:
8480
+ /***/ 2124:
8363
8481
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
8364
8482
 
8365
8483
 
8366
8484
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8367
8485
  exports.defaultTimeout = exports.defaultMetadata = exports.scope = exports.jwksUri = exports.accessTokenEndpoint = exports.authorizationEndpoint = exports.issuer = void 0;
8368
- const connector_kit_1 = __nccwpck_require__(375);
8486
+ const connector_kit_1 = __nccwpck_require__(4758);
8369
8487
  // https://appleid.apple.com/.well-known/openid-configuration
8370
8488
  exports.issuer = 'https://appleid.apple.com';
8371
8489
  exports.authorizationEndpoint = `${exports.issuer}/auth/authorize`;
@@ -8399,13 +8517,13 @@ exports.defaultTimeout = 5000;
8399
8517
 
8400
8518
  /***/ }),
8401
8519
 
8402
- /***/ 7760:
8520
+ /***/ 2174:
8403
8521
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
8404
8522
 
8405
8523
 
8406
8524
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8407
8525
  exports.dataGuard = exports.appleConfigGuard = void 0;
8408
- const zod_1 = __nccwpck_require__(8062);
8526
+ const zod_1 = __nccwpck_require__(6319);
8409
8527
  exports.appleConfigGuard = zod_1.z.object({
8410
8528
  clientId: zod_1.z.string(),
8411
8529
  });
@@ -8464,6 +8582,332 @@ module.exports = require("util");
8464
8582
 
8465
8583
  module.exports = require("zlib");
8466
8584
 
8585
+ /***/ }),
8586
+
8587
+ /***/ 4758:
8588
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
8589
+
8590
+
8591
+
8592
+ var types = __nccwpck_require__(1876);
8593
+
8594
+ function validateConfig(config, guard) {
8595
+ const result = guard.safeParse(config);
8596
+ if (!result.success) {
8597
+ throw new types.ConnectorError(types.ConnectorErrorCodes.InvalidConfig, result.error);
8598
+ }
8599
+ }
8600
+ const parseJson = (jsonString, errorCode = types.ConnectorErrorCodes.InvalidResponse, errorPayload) => {
8601
+ try {
8602
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
8603
+ return JSON.parse(jsonString);
8604
+ }
8605
+ catch {
8606
+ throw new types.ConnectorError(errorCode, errorPayload ?? jsonString);
8607
+ }
8608
+ };
8609
+
8610
+ exports.ConnectorError = types.ConnectorError;
8611
+ Object.defineProperty(exports, "ConnectorErrorCodes", ({
8612
+ enumerable: true,
8613
+ get: function () { return types.ConnectorErrorCodes; }
8614
+ }));
8615
+ Object.defineProperty(exports, "ConnectorPlatform", ({
8616
+ enumerable: true,
8617
+ get: function () { return types.ConnectorPlatform; }
8618
+ }));
8619
+ Object.defineProperty(exports, "ConnectorType", ({
8620
+ enumerable: true,
8621
+ get: function () { return types.ConnectorType; }
8622
+ }));
8623
+ Object.defineProperty(exports, "MessageTypes", ({
8624
+ enumerable: true,
8625
+ get: function () { return types.MessageTypes; }
8626
+ }));
8627
+ exports.configurableConnectorMetadataGuard = types.configurableConnectorMetadataGuard;
8628
+ exports.connectorSessionGuard = types.connectorSessionGuard;
8629
+ exports.i18nPhrasesGuard = types.i18nPhrasesGuard;
8630
+ exports.messageTypesGuard = types.messageTypesGuard;
8631
+ exports.parseJson = parseJson;
8632
+ exports.validateConfig = validateConfig;
8633
+
8634
+
8635
+ /***/ }),
8636
+
8637
+ /***/ 1876:
8638
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
8639
+
8640
+
8641
+
8642
+ var languageKit = __nccwpck_require__(1230);
8643
+ var zod = __nccwpck_require__(6319);
8644
+
8645
+ // MARK: Foundation
8646
+ exports.ConnectorType = void 0;
8647
+ (function (ConnectorType) {
8648
+ ConnectorType["Email"] = "Email";
8649
+ ConnectorType["Sms"] = "Sms";
8650
+ ConnectorType["Social"] = "Social";
8651
+ })(exports.ConnectorType || (exports.ConnectorType = {}));
8652
+ exports.ConnectorPlatform = void 0;
8653
+ (function (ConnectorPlatform) {
8654
+ ConnectorPlatform["Native"] = "Native";
8655
+ ConnectorPlatform["Universal"] = "Universal";
8656
+ ConnectorPlatform["Web"] = "Web";
8657
+ })(exports.ConnectorPlatform || (exports.ConnectorPlatform = {}));
8658
+ const i18nPhrasesGuard = zod.z
8659
+ .object({ en: zod.z.string() })
8660
+ .and(zod.z.record(zod.z.string()))
8661
+ .refine((i18nObject) => {
8662
+ const keys = Object.keys(i18nObject);
8663
+ if (!keys.includes('en')) {
8664
+ return false;
8665
+ }
8666
+ for (const value of keys) {
8667
+ if (!languageKit.isLanguageTag(value)) {
8668
+ return false;
8669
+ }
8670
+ }
8671
+ return true;
8672
+ });
8673
+ exports.ConnectorErrorCodes = void 0;
8674
+ (function (ConnectorErrorCodes) {
8675
+ ConnectorErrorCodes["General"] = "general";
8676
+ ConnectorErrorCodes["InvalidMetadata"] = "invalid_metadata";
8677
+ ConnectorErrorCodes["UnexpectedType"] = "unexpected_type";
8678
+ ConnectorErrorCodes["InvalidConfigGuard"] = "invalid_config_guard";
8679
+ ConnectorErrorCodes["InvalidRequestParameters"] = "invalid_request_parameters";
8680
+ ConnectorErrorCodes["InsufficientRequestParameters"] = "insufficient_request_parameters";
8681
+ ConnectorErrorCodes["InvalidConfig"] = "invalid_config";
8682
+ ConnectorErrorCodes["InvalidResponse"] = "invalid_response";
8683
+ ConnectorErrorCodes["TemplateNotFound"] = "template_not_found";
8684
+ ConnectorErrorCodes["NotImplemented"] = "not_implemented";
8685
+ ConnectorErrorCodes["SocialAuthCodeInvalid"] = "social_auth_code_invalid";
8686
+ ConnectorErrorCodes["SocialAccessTokenInvalid"] = "social_invalid_access_token";
8687
+ ConnectorErrorCodes["SocialIdTokenInvalid"] = "social_invalid_id_token";
8688
+ ConnectorErrorCodes["AuthorizationFailed"] = "authorization_failed";
8689
+ })(exports.ConnectorErrorCodes || (exports.ConnectorErrorCodes = {}));
8690
+ class ConnectorError extends Error {
8691
+ constructor(code, data) {
8692
+ const message = typeof data === 'string' ? data : 'Connector error occurred.';
8693
+ super(message);
8694
+ this.code = code;
8695
+ this.data = typeof data === 'string' ? { message: data } : data;
8696
+ }
8697
+ }
8698
+ exports.MessageTypes = void 0;
8699
+ (function (MessageTypes) {
8700
+ MessageTypes["SignIn"] = "SignIn";
8701
+ MessageTypes["Register"] = "Register";
8702
+ MessageTypes["ForgotPassword"] = "ForgotPassword";
8703
+ MessageTypes["Continue"] = "Continue";
8704
+ MessageTypes["Test"] = "Test";
8705
+ })(exports.MessageTypes || (exports.MessageTypes = {}));
8706
+ const messageTypesGuard = zod.z.nativeEnum(exports.MessageTypes);
8707
+ const connectorMetadataGuard = zod.z.object({
8708
+ id: zod.z.string(),
8709
+ target: zod.z.string(),
8710
+ platform: zod.z.nativeEnum(exports.ConnectorPlatform).nullable(),
8711
+ name: i18nPhrasesGuard,
8712
+ logo: zod.z.string(),
8713
+ logoDark: zod.z.string().nullable(),
8714
+ description: i18nPhrasesGuard,
8715
+ isStandard: zod.z.boolean().optional(),
8716
+ readme: zod.z.string(),
8717
+ configTemplate: zod.z.string(),
8718
+ });
8719
+ const configurableConnectorMetadataGuard = connectorMetadataGuard
8720
+ .pick({
8721
+ target: true,
8722
+ name: true,
8723
+ logo: true,
8724
+ logoDark: true,
8725
+ })
8726
+ .partial();
8727
+ const connectorSessionGuard = zod.z.object({
8728
+ nonce: zod.z.string().optional(),
8729
+ redirectUri: zod.z.string().optional(),
8730
+ });
8731
+
8732
+ exports.ConnectorError = ConnectorError;
8733
+ exports.configurableConnectorMetadataGuard = configurableConnectorMetadataGuard;
8734
+ exports.connectorSessionGuard = connectorSessionGuard;
8735
+ exports.i18nPhrasesGuard = i18nPhrasesGuard;
8736
+ exports.messageTypesGuard = messageTypesGuard;
8737
+
8738
+
8739
+ /***/ }),
8740
+
8741
+ /***/ 8670:
8742
+ /***/ ((__unused_webpack_module, exports) => {
8743
+
8744
+
8745
+
8746
+ const languages = Object.freeze({
8747
+ 'af-ZA': 'Afrikaans',
8748
+ 'am-ET': 'አማርኛ',
8749
+ 'ar-AR': 'العربية',
8750
+ 'as-IN': 'অসমীয়া',
8751
+ 'az-AZ': 'Azərbaycan dili',
8752
+ 'be-BY': 'Беларуская',
8753
+ 'bg-BG': 'Български',
8754
+ 'bn-IN': 'বাংলা',
8755
+ 'br-FR': 'Brezhoneg',
8756
+ 'bs-BA': 'Bosanski',
8757
+ 'ca-ES': 'Català',
8758
+ 'cb-IQ': 'کوردیی ناوەندی',
8759
+ 'co-FR': 'Corsu',
8760
+ 'cs-CZ': 'Čeština',
8761
+ 'cx-PH': 'Bisaya',
8762
+ 'cy-GB': 'Cymraeg',
8763
+ 'da-DK': 'Dansk',
8764
+ de: 'Deutsch',
8765
+ 'de-DE': 'Deutsch (Deutschland)',
8766
+ 'el-GR': 'Ελληνικά',
8767
+ en: 'English',
8768
+ 'en-GB': 'English (UK)',
8769
+ 'en-US': 'English (US)',
8770
+ 'eo-EO': 'Esperanto',
8771
+ es: 'Español',
8772
+ 'es-ES': 'Español (España)',
8773
+ 'es-419': 'Español (Latinoamérica)',
8774
+ 'et-EE': 'Eesti',
8775
+ 'eu-ES': 'Euskara',
8776
+ 'fa-IR': 'فارسی',
8777
+ 'ff-NG': 'Fula',
8778
+ 'fi-FI': 'Suomi',
8779
+ 'fo-FO': 'Føroyskt',
8780
+ fr: 'Français',
8781
+ 'fr-CA': 'Français (Canada)',
8782
+ 'fr-FR': 'Français (France)',
8783
+ 'fy-NL': 'Frysk',
8784
+ 'ga-IE': 'Gaeilge',
8785
+ 'gl-ES': 'Galego',
8786
+ 'gn-PY': 'Guarani',
8787
+ 'gu-IN': 'ગુજરાતી',
8788
+ 'ha-NG': 'Hausa',
8789
+ 'he-IL': 'עברית',
8790
+ 'hi-IN': 'हिन्दी',
8791
+ 'hr-HR': 'Hrvatski',
8792
+ 'ht-HT': 'Kreyòl Ayisyen',
8793
+ 'hu-HU': 'Magyar',
8794
+ 'hy-AM': 'Հայերեն',
8795
+ 'id-ID': 'Bahasa Indonesia',
8796
+ 'ik-US': 'Iñupiatun',
8797
+ 'is-IS': 'Íslenska',
8798
+ it: 'Italiano',
8799
+ 'it-IT': 'italiano (Italia)',
8800
+ 'iu-CA': 'Inuktitut',
8801
+ ja: '日本語',
8802
+ 'ja-JP': '日本語',
8803
+ 'ja-KS': '日本語(関西)',
8804
+ 'jv-ID': 'Basa Jawa',
8805
+ 'ka-GE': 'ქართული',
8806
+ 'kk-KZ': 'Қазақша',
8807
+ 'km-KH': 'ភាសាខ្មែរ',
8808
+ 'kn-IN': 'ಕನ್ನಡ',
8809
+ ko: '한국어',
8810
+ 'ko-KR': '한국어',
8811
+ 'ku-TR': 'Kurdî (Kurmancî)',
8812
+ 'ky-KG': 'кыргызча',
8813
+ 'lo-LA': 'ພາສາລາວ',
8814
+ 'lt-LT': 'Lietuvių',
8815
+ 'lv-LV': 'Latviešu',
8816
+ 'mg-MG': 'Malagasy',
8817
+ 'mk-MK': 'Македонски',
8818
+ 'ml-IN': 'മലയാളം',
8819
+ 'mn-MN': 'Монгол',
8820
+ 'mr-IN': 'मराठी',
8821
+ 'ms-MY': 'Bahasa Melayu',
8822
+ 'mt-MT': 'Malti',
8823
+ 'my-MM': 'မြန်မာဘာသာ',
8824
+ 'nb-NO': 'Norsk (bokmål)',
8825
+ 'ne-NP': 'नेपाली',
8826
+ 'nl-BE': 'Vlaams',
8827
+ 'nl-NL': 'Nederlands',
8828
+ 'nn-NO': 'Norsk (nynorsk)',
8829
+ 'or-IN': 'ଓଡ଼ିଆ',
8830
+ 'pa-IN': 'ਪੰਜਾਬੀ',
8831
+ 'pl-PL': 'Polski',
8832
+ 'ps-AF': 'پښتو',
8833
+ pt: 'português',
8834
+ 'pt-BR': 'Português (Brasil)',
8835
+ 'pt-PT': 'português (Portugal)',
8836
+ 'ro-RO': 'Română',
8837
+ ru: 'Русский',
8838
+ 'ru-RU': 'Русский',
8839
+ 'rw-RW': 'Ikinyarwanda',
8840
+ 'sc-IT': 'Sardu',
8841
+ 'si-LK': 'සිංහල',
8842
+ 'sk-SK': 'Slovenčina',
8843
+ 'sl-SI': 'Slovenščina',
8844
+ 'sn-ZW': 'Shona',
8845
+ 'sq-AL': 'Shqip',
8846
+ 'sr-RS': 'Српски',
8847
+ 'sv-SE': 'Svenska',
8848
+ 'sw-KE': 'Kiswahili',
8849
+ 'sy-SY': 'ܣܘܪܝܝܐ',
8850
+ 'sz-PL': 'ślōnskŏ gŏdka',
8851
+ 'ta-IN': 'தமிழ்',
8852
+ 'te-IN': 'తెలుగు',
8853
+ 'tg-TJ': 'Тоҷикӣ',
8854
+ 'th-TH': 'ภาษาไทย',
8855
+ 'tl-PH': 'Filipino',
8856
+ tr: 'Türkçe',
8857
+ 'tr-TR': 'Türkçe',
8858
+ 'tt-RU': 'Татарча',
8859
+ 'tz-MA': 'ⵜⴰⵎⴰⵣⵉⵖⵜ',
8860
+ 'uk-UA': 'Українська',
8861
+ 'ur-PK': 'اردو',
8862
+ 'uz-UZ': "O'zbek",
8863
+ 'vi-VN': 'Tiếng Việt',
8864
+ zh: '中文',
8865
+ 'zh-CN': '简体中文',
8866
+ 'zh-HK': '繁體中文(香港)',
8867
+ 'zh-MO': '繁體中文(澳門)',
8868
+ 'zh-TW': '繁體中文(台灣)',
8869
+ 'zz-TR': 'Zaza',
8870
+ });
8871
+
8872
+ exports.languages = languages;
8873
+
8874
+
8875
+ /***/ }),
8876
+
8877
+ /***/ 1230:
8878
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
8879
+
8880
+
8881
+
8882
+ var _const = __nccwpck_require__(8670);
8883
+ var utility = __nccwpck_require__(2304);
8884
+
8885
+
8886
+
8887
+ exports.languages = _const.languages;
8888
+ exports.isLanguageTag = utility.isLanguageTag;
8889
+ exports.languageTagGuard = utility.languageTagGuard;
8890
+
8891
+
8892
+ /***/ }),
8893
+
8894
+ /***/ 2304:
8895
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
8896
+
8897
+
8898
+
8899
+ var zod = __nccwpck_require__(6319);
8900
+ var _const = __nccwpck_require__(8670);
8901
+
8902
+ const isLanguageTag = (value) => typeof value === 'string' && value in _const.languages;
8903
+ const languageTagGuard = zod.z
8904
+ .any()
8905
+ .refine((value) => isLanguageTag(value));
8906
+
8907
+ exports.isLanguageTag = isLanguageTag;
8908
+ exports.languageTagGuard = languageTagGuard;
8909
+
8910
+
8467
8911
  /***/ })
8468
8912
 
8469
8913
  /******/ });
@@ -8510,10 +8954,10 @@ var __webpack_exports__ = {};
8510
8954
  var exports = __webpack_exports__;
8511
8955
 
8512
8956
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8513
- const connector_kit_1 = __nccwpck_require__(375);
8514
- const jose_1 = __nccwpck_require__(4974);
8515
- const constant_1 = __nccwpck_require__(87);
8516
- const types_1 = __nccwpck_require__(7760);
8957
+ const connector_kit_1 = __nccwpck_require__(4758);
8958
+ const jose_1 = __nccwpck_require__(9179);
8959
+ const constant_1 = __nccwpck_require__(2124);
8960
+ const types_1 = __nccwpck_require__(2174);
8517
8961
  // TO-DO: support nonce validation
8518
8962
  const getAuthorizationUri = (getConfig) => async ({ state, redirectUri }) => {
8519
8963
  const config = await getConfig(constant_1.defaultMetadata.id);