@seed-ship/mcp-ui-solid 5.3.1 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +104 -0
  2. package/dist/components/StreamingUIRenderer.cjs +106 -90
  3. package/dist/components/StreamingUIRenderer.cjs.map +1 -1
  4. package/dist/components/StreamingUIRenderer.d.ts +7 -0
  5. package/dist/components/StreamingUIRenderer.d.ts.map +1 -1
  6. package/dist/components/StreamingUIRenderer.js +107 -91
  7. package/dist/components/StreamingUIRenderer.js.map +1 -1
  8. package/dist/components/UIResourceRenderer.cjs +101 -82
  9. package/dist/components/UIResourceRenderer.cjs.map +1 -1
  10. package/dist/components/UIResourceRenderer.d.ts +23 -0
  11. package/dist/components/UIResourceRenderer.d.ts.map +1 -1
  12. package/dist/components/UIResourceRenderer.js +102 -83
  13. package/dist/components/UIResourceRenderer.js.map +1 -1
  14. package/dist/index.cjs +7 -0
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +3 -0
  17. package/dist/index.d.ts +3 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +7 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/mcp-ui-spec/dist/schemas.cjs +493 -0
  22. package/dist/mcp-ui-spec/dist/schemas.cjs.map +1 -0
  23. package/dist/mcp-ui-spec/dist/schemas.js +493 -0
  24. package/dist/mcp-ui-spec/dist/schemas.js.map +1 -0
  25. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.cjs +118 -0
  26. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.cjs.map +1 -0
  27. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +118 -0
  28. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js.map +1 -0
  29. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.cjs +10 -0
  30. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.cjs.map +1 -0
  31. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +10 -0
  32. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js.map +1 -0
  33. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.cjs +8 -0
  34. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.cjs.map +1 -0
  35. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +9 -0
  36. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js.map +1 -0
  37. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.cjs +122 -0
  38. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.cjs.map +1 -0
  39. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +122 -0
  40. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js.map +1 -0
  41. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.cjs +137 -0
  42. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.cjs.map +1 -0
  43. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +139 -0
  44. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js.map +1 -0
  45. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.cjs +105 -0
  46. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.cjs.map +1 -0
  47. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +106 -0
  48. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js.map +1 -0
  49. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.cjs +3229 -0
  50. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.cjs.map +1 -0
  51. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +3230 -0
  52. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js.map +1 -0
  53. package/dist/services/validation.cjs +70 -152
  54. package/dist/services/validation.cjs.map +1 -1
  55. package/dist/services/validation.d.ts.map +1 -1
  56. package/dist/services/validation.js +70 -152
  57. package/dist/services/validation.js.map +1 -1
  58. package/dist/utils/logger.cjs +26 -4
  59. package/dist/utils/logger.cjs.map +1 -1
  60. package/dist/utils/logger.d.ts +30 -3
  61. package/dist/utils/logger.d.ts.map +1 -1
  62. package/dist/utils/logger.js +27 -5
  63. package/dist/utils/logger.js.map +1 -1
  64. package/dist/utils/perf.cjs +34 -0
  65. package/dist/utils/perf.cjs.map +1 -0
  66. package/dist/utils/perf.d.ts +19 -0
  67. package/dist/utils/perf.d.ts.map +1 -0
  68. package/dist/utils/perf.js +34 -0
  69. package/dist/utils/perf.js.map +1 -0
  70. package/package.json +3 -2
  71. package/src/components/StreamingUIRenderer.tsx +54 -2
  72. package/src/components/UIResourceRenderer.errorMode.test.tsx +95 -0
  73. package/src/components/UIResourceRenderer.tsx +72 -4
  74. package/src/index.ts +7 -0
  75. package/src/services/validation.spec-migration.test.ts +207 -0
  76. package/src/services/validation.ts +132 -178
  77. package/src/utils/logger.test.ts +130 -0
  78. package/src/utils/logger.ts +60 -7
  79. package/src/utils/perf.test.ts +59 -0
  80. package/src/utils/perf.ts +50 -0
  81. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const util = require("./helpers/util.cjs");
4
+ const ZodIssueCode = util.util.arrayToEnum([
5
+ "invalid_type",
6
+ "invalid_literal",
7
+ "custom",
8
+ "invalid_union",
9
+ "invalid_union_discriminator",
10
+ "invalid_enum_value",
11
+ "unrecognized_keys",
12
+ "invalid_arguments",
13
+ "invalid_return_type",
14
+ "invalid_date",
15
+ "invalid_string",
16
+ "too_small",
17
+ "too_big",
18
+ "invalid_intersection_types",
19
+ "not_multiple_of",
20
+ "not_finite"
21
+ ]);
22
+ class ZodError extends Error {
23
+ get errors() {
24
+ return this.issues;
25
+ }
26
+ constructor(issues) {
27
+ super();
28
+ this.issues = [];
29
+ this.addIssue = (sub) => {
30
+ this.issues = [...this.issues, sub];
31
+ };
32
+ this.addIssues = (subs = []) => {
33
+ this.issues = [...this.issues, ...subs];
34
+ };
35
+ const actualProto = new.target.prototype;
36
+ if (Object.setPrototypeOf) {
37
+ Object.setPrototypeOf(this, actualProto);
38
+ } else {
39
+ this.__proto__ = actualProto;
40
+ }
41
+ this.name = "ZodError";
42
+ this.issues = issues;
43
+ }
44
+ format(_mapper) {
45
+ const mapper = _mapper || function(issue) {
46
+ return issue.message;
47
+ };
48
+ const fieldErrors = { _errors: [] };
49
+ const processError = (error) => {
50
+ for (const issue of error.issues) {
51
+ if (issue.code === "invalid_union") {
52
+ issue.unionErrors.map(processError);
53
+ } else if (issue.code === "invalid_return_type") {
54
+ processError(issue.returnTypeError);
55
+ } else if (issue.code === "invalid_arguments") {
56
+ processError(issue.argumentsError);
57
+ } else if (issue.path.length === 0) {
58
+ fieldErrors._errors.push(mapper(issue));
59
+ } else {
60
+ let curr = fieldErrors;
61
+ let i = 0;
62
+ while (i < issue.path.length) {
63
+ const el = issue.path[i];
64
+ const terminal = i === issue.path.length - 1;
65
+ if (!terminal) {
66
+ curr[el] = curr[el] || { _errors: [] };
67
+ } else {
68
+ curr[el] = curr[el] || { _errors: [] };
69
+ curr[el]._errors.push(mapper(issue));
70
+ }
71
+ curr = curr[el];
72
+ i++;
73
+ }
74
+ }
75
+ }
76
+ };
77
+ processError(this);
78
+ return fieldErrors;
79
+ }
80
+ static assert(value) {
81
+ if (!(value instanceof ZodError)) {
82
+ throw new Error(`Not a ZodError: ${value}`);
83
+ }
84
+ }
85
+ toString() {
86
+ return this.message;
87
+ }
88
+ get message() {
89
+ return JSON.stringify(this.issues, util.util.jsonStringifyReplacer, 2);
90
+ }
91
+ get isEmpty() {
92
+ return this.issues.length === 0;
93
+ }
94
+ flatten(mapper = (issue) => issue.message) {
95
+ const fieldErrors = {};
96
+ const formErrors = [];
97
+ for (const sub of this.issues) {
98
+ if (sub.path.length > 0) {
99
+ const firstEl = sub.path[0];
100
+ fieldErrors[firstEl] = fieldErrors[firstEl] || [];
101
+ fieldErrors[firstEl].push(mapper(sub));
102
+ } else {
103
+ formErrors.push(mapper(sub));
104
+ }
105
+ }
106
+ return { formErrors, fieldErrors };
107
+ }
108
+ get formErrors() {
109
+ return this.flatten();
110
+ }
111
+ }
112
+ ZodError.create = (issues) => {
113
+ const error = new ZodError(issues);
114
+ return error;
115
+ };
116
+ exports.ZodError = ZodError;
117
+ exports.ZodIssueCode = ZodIssueCode;
118
+ //# sourceMappingURL=ZodError.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZodError.cjs","sources":["../../../../../../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js"],"sourcesContent":["import { util } from \"./helpers/util.js\";\nexport const ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nexport const quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nexport class ZodError extends Error {\n get errors() {\n return this.issues;\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n static assert(value) {\n if (!(value instanceof ZodError)) {\n throw new Error(`Not a ZodError: ${value}`);\n }\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n const firstEl = sub.path[0];\n fieldErrors[firstEl] = fieldErrors[firstEl] || [];\n fieldErrors[firstEl].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n"],"names":["util"],"mappings":";;;AACY,MAAC,eAAeA,KAAAA,KAAK,YAAY;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;AAKM,MAAM,iBAAiB,MAAM;AAAA,EAChC,IAAI,SAAS;AACT,WAAO,KAAK;AAAA,EAChB;AAAA,EACA,YAAY,QAAQ;AAChB,UAAK;AACL,SAAK,SAAS,CAAA;AACd,SAAK,WAAW,CAAC,QAAQ;AACrB,WAAK,SAAS,CAAC,GAAG,KAAK,QAAQ,GAAG;AAAA,IACtC;AACA,SAAK,YAAY,CAAC,OAAO,OAAO;AAC5B,WAAK,SAAS,CAAC,GAAG,KAAK,QAAQ,GAAG,IAAI;AAAA,IAC1C;AACA,UAAM,cAAc,WAAW;AAC/B,QAAI,OAAO,gBAAgB;AAEvB,aAAO,eAAe,MAAM,WAAW;AAAA,IAC3C,OACK;AACD,WAAK,YAAY;AAAA,IACrB;AACA,SAAK,OAAO;AACZ,SAAK,SAAS;AAAA,EAClB;AAAA,EACA,OAAO,SAAS;AACZ,UAAM,SAAS,WACX,SAAU,OAAO;AACb,aAAO,MAAM;AAAA,IACjB;AACJ,UAAM,cAAc,EAAE,SAAS,GAAE;AACjC,UAAM,eAAe,CAAC,UAAU;AAC5B,iBAAW,SAAS,MAAM,QAAQ;AAC9B,YAAI,MAAM,SAAS,iBAAiB;AAChC,gBAAM,YAAY,IAAI,YAAY;AAAA,QACtC,WACS,MAAM,SAAS,uBAAuB;AAC3C,uBAAa,MAAM,eAAe;AAAA,Q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YAAY,OAAO,KAAK,CAAA;AAC/C,oBAAY,OAAO,EAAE,KAAK,OAAO,GAAG,CAAC;AAAA,MACzC,OACK;AACD,mBAAW,KAAK,OAAO,GAAG,CAAC;AAAA,MAC/B;AAAA,IACJ;AACA,WAAO,EAAE,YAAY,YAAW;AAAA,EACpC;AAAA,EACA,IAAI,aAAa;AACb,WAAO,KAAK,QAAO;AAAA,EACvB;AACJ;AACA,SAAS,SAAS,CAAC,WAAW;AAC1B,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,SAAO;AACX;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,118 @@
1
+ import { util } from "./helpers/util.js";
2
+ const ZodIssueCode = util.arrayToEnum([
3
+ "invalid_type",
4
+ "invalid_literal",
5
+ "custom",
6
+ "invalid_union",
7
+ "invalid_union_discriminator",
8
+ "invalid_enum_value",
9
+ "unrecognized_keys",
10
+ "invalid_arguments",
11
+ "invalid_return_type",
12
+ "invalid_date",
13
+ "invalid_string",
14
+ "too_small",
15
+ "too_big",
16
+ "invalid_intersection_types",
17
+ "not_multiple_of",
18
+ "not_finite"
19
+ ]);
20
+ class ZodError extends Error {
21
+ get errors() {
22
+ return this.issues;
23
+ }
24
+ constructor(issues) {
25
+ super();
26
+ this.issues = [];
27
+ this.addIssue = (sub) => {
28
+ this.issues = [...this.issues, sub];
29
+ };
30
+ this.addIssues = (subs = []) => {
31
+ this.issues = [...this.issues, ...subs];
32
+ };
33
+ const actualProto = new.target.prototype;
34
+ if (Object.setPrototypeOf) {
35
+ Object.setPrototypeOf(this, actualProto);
36
+ } else {
37
+ this.__proto__ = actualProto;
38
+ }
39
+ this.name = "ZodError";
40
+ this.issues = issues;
41
+ }
42
+ format(_mapper) {
43
+ const mapper = _mapper || function(issue) {
44
+ return issue.message;
45
+ };
46
+ const fieldErrors = { _errors: [] };
47
+ const processError = (error) => {
48
+ for (const issue of error.issues) {
49
+ if (issue.code === "invalid_union") {
50
+ issue.unionErrors.map(processError);
51
+ } else if (issue.code === "invalid_return_type") {
52
+ processError(issue.returnTypeError);
53
+ } else if (issue.code === "invalid_arguments") {
54
+ processError(issue.argumentsError);
55
+ } else if (issue.path.length === 0) {
56
+ fieldErrors._errors.push(mapper(issue));
57
+ } else {
58
+ let curr = fieldErrors;
59
+ let i = 0;
60
+ while (i < issue.path.length) {
61
+ const el = issue.path[i];
62
+ const terminal = i === issue.path.length - 1;
63
+ if (!terminal) {
64
+ curr[el] = curr[el] || { _errors: [] };
65
+ } else {
66
+ curr[el] = curr[el] || { _errors: [] };
67
+ curr[el]._errors.push(mapper(issue));
68
+ }
69
+ curr = curr[el];
70
+ i++;
71
+ }
72
+ }
73
+ }
74
+ };
75
+ processError(this);
76
+ return fieldErrors;
77
+ }
78
+ static assert(value) {
79
+ if (!(value instanceof ZodError)) {
80
+ throw new Error(`Not a ZodError: ${value}`);
81
+ }
82
+ }
83
+ toString() {
84
+ return this.message;
85
+ }
86
+ get message() {
87
+ return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
88
+ }
89
+ get isEmpty() {
90
+ return this.issues.length === 0;
91
+ }
92
+ flatten(mapper = (issue) => issue.message) {
93
+ const fieldErrors = {};
94
+ const formErrors = [];
95
+ for (const sub of this.issues) {
96
+ if (sub.path.length > 0) {
97
+ const firstEl = sub.path[0];
98
+ fieldErrors[firstEl] = fieldErrors[firstEl] || [];
99
+ fieldErrors[firstEl].push(mapper(sub));
100
+ } else {
101
+ formErrors.push(mapper(sub));
102
+ }
103
+ }
104
+ return { formErrors, fieldErrors };
105
+ }
106
+ get formErrors() {
107
+ return this.flatten();
108
+ }
109
+ }
110
+ ZodError.create = (issues) => {
111
+ const error = new ZodError(issues);
112
+ return error;
113
+ };
114
+ export {
115
+ ZodError,
116
+ ZodIssueCode
117
+ };
118
+ //# sourceMappingURL=ZodError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZodError.js","sources":["../../../../../../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js"],"sourcesContent":["import { util } from \"./helpers/util.js\";\nexport const ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nexport const quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nexport class ZodError extends Error {\n get errors() {\n return this.issues;\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n static assert(value) {\n if (!(value instanceof ZodError)) {\n throw new Error(`Not a ZodError: ${value}`);\n }\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n const firstEl = sub.path[0];\n fieldErrors[firstEl] = fieldErrors[firstEl] || [];\n fieldErrors[firstEl].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n"],"names":[],"mappings":";AACY,MAAC,eAAe,KAAK,YAAY;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;AAKM,MAAM,iBAAiB,MAAM;AAAA,EAChC,IAAI,SAAS;AACT,WAAO,KAAK;AAAA,EAChB;AAAA,EACA,YAAY,QAAQ;AAChB,UAAK;AACL,SAAK,SAAS,CAAA;AACd,SAAK,WAAW,CAAC,QAAQ;AACrB,WAAK,SAAS,CAAC,GAAG,KAAK,QAAQ,GAAG;AAAA,IACtC;AACA,SAAK,YAAY,CAAC,OAAO,OAAO;AAC5B,WAAK,SAAS,CAAC,GAAG,KAAK,QAAQ,GAAG,IAAI;AAAA,IAC1C;AACA,UAAM,cAAc,WAAW;AAC/B,QAAI,OAAO,gBAAgB;AAEvB,aAAO,eAAe,MAAM,WAAW;AAAA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AO,KAAK;AAAA,EAChB;AAAA,EACA,IAAI,UAAU;AACV,WAAO,KAAK,UAAU,KAAK,QAAQ,KAAK,uBAAuB,CAAC;AAAA,EACpE;AAAA,EACA,IAAI,UAAU;AACV,WAAO,KAAK,OAAO,WAAW;AAAA,EAClC;AAAA,EACA,QAAQ,SAAS,CAAC,UAAU,MAAM,SAAS;AACvC,UAAM,cAAc,CAAA;AACpB,UAAM,aAAa,CAAA;AACnB,eAAW,OAAO,KAAK,QAAQ;AAC3B,UAAI,IAAI,KAAK,SAAS,GAAG;AACrB,cAAM,UAAU,IAAI,KAAK,CAAC;AAC1B,oBAAY,OAAO,IAAI,YAAY,OAAO,KAAK,CAAA;AAC/C,oBAAY,OAAO,EAAE,KAAK,OAAO,GAAG,CAAC;AAAA,MACzC,OACK;AACD,mBAAW,KAAK,OAAO,GAAG,CAAC;AAAA,MAC/B;AAAA,IACJ;AACA,WAAO,EAAE,YAAY,YAAW;AAAA,EACpC;AAAA,EACA,IAAI,aAAa;AACb,WAAO,KAAK,QAAO;AAAA,EACvB;AACJ;AACA,SAAS,SAAS,CAAC,WAAW;AAC1B,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,SAAO;AACX;","x_google_ignoreList":[0]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const en = require("./locales/en.cjs");
4
+ let overrideErrorMap = en;
5
+ function getErrorMap() {
6
+ return overrideErrorMap;
7
+ }
8
+ exports.defaultErrorMap = en;
9
+ exports.getErrorMap = getErrorMap;
10
+ //# sourceMappingURL=errors.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.cjs","sources":["../../../../../../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js"],"sourcesContent":["import defaultErrorMap from \"./locales/en.js\";\nlet overrideErrorMap = defaultErrorMap;\nexport { defaultErrorMap };\nexport function setErrorMap(map) {\n overrideErrorMap = map;\n}\nexport function getErrorMap() {\n return overrideErrorMap;\n}\n"],"names":["defaultErrorMap"],"mappings":";;;AACA,IAAI,mBAAmBA;AAKhB,SAAS,cAAc;AAC1B,SAAO;AACX;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,10 @@
1
+ import errorMap from "./locales/en.js";
2
+ let overrideErrorMap = errorMap;
3
+ function getErrorMap() {
4
+ return overrideErrorMap;
5
+ }
6
+ export {
7
+ errorMap as defaultErrorMap,
8
+ getErrorMap
9
+ };
10
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sources":["../../../../../../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js"],"sourcesContent":["import defaultErrorMap from \"./locales/en.js\";\nlet overrideErrorMap = defaultErrorMap;\nexport { defaultErrorMap };\nexport function setErrorMap(map) {\n overrideErrorMap = map;\n}\nexport function getErrorMap() {\n return overrideErrorMap;\n}\n"],"names":["defaultErrorMap"],"mappings":";AACA,IAAI,mBAAmBA;AAKhB,SAAS,cAAc;AAC1B,SAAO;AACX;","x_google_ignoreList":[0]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ exports.errorUtil = void 0;
4
+ (function(errorUtil) {
5
+ errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
6
+ errorUtil.toString = (message) => typeof message === "string" ? message : message == null ? void 0 : message.message;
7
+ })(exports.errorUtil || (exports.errorUtil = {}));
8
+ //# sourceMappingURL=errorUtil.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorUtil.cjs","sources":["../../../../../../../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js"],"sourcesContent":["export var errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n // biome-ignore lint:\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message?.message;\n})(errorUtil || (errorUtil = {}));\n"],"names":["errorUtil"],"mappings":";;AAAWA,QAAAA,YAAAA;AAAAA,CACV,SAAU,WAAW;AAClB,YAAU,WAAW,CAAC,YAAY,OAAO,YAAY,WAAW,EAAE,YAAY,WAAW,CAAA;AAEzF,YAAU,WAAW,CAAC,YAAY,OAAO,YAAY,WAAW,UAAU,mCAAS;AACvF,GAAGA,QAAAA,cAAcA,oBAAY,CAAA,EAAG;","x_google_ignoreList":[0]}
@@ -0,0 +1,9 @@
1
+ var errorUtil;
2
+ (function(errorUtil2) {
3
+ errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
4
+ errorUtil2.toString = (message) => typeof message === "string" ? message : message == null ? void 0 : message.message;
5
+ })(errorUtil || (errorUtil = {}));
6
+ export {
7
+ errorUtil
8
+ };
9
+ //# sourceMappingURL=errorUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorUtil.js","sources":["../../../../../../../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js"],"sourcesContent":["export var errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n // biome-ignore lint:\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message?.message;\n})(errorUtil || (errorUtil = {}));\n"],"names":["errorUtil"],"mappings":"AAAU,IAAC;AAAA,CACV,SAAUA,YAAW;AAClB,EAAAA,WAAU,WAAW,CAAC,YAAY,OAAO,YAAY,WAAW,EAAE,YAAY,WAAW,CAAA;AAEzF,EAAAA,WAAU,WAAW,CAAC,YAAY,OAAO,YAAY,WAAW,UAAU,mCAAS;AACvF,GAAG,cAAc,YAAY,CAAA,EAAG;","x_google_ignoreList":[0]}
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const errors = require("../errors.cjs");
4
+ const en = require("../locales/en.cjs");
5
+ const makeIssue = (params) => {
6
+ const { data, path, errorMaps, issueData } = params;
7
+ const fullPath = [...path, ...issueData.path || []];
8
+ const fullIssue = {
9
+ ...issueData,
10
+ path: fullPath
11
+ };
12
+ if (issueData.message !== void 0) {
13
+ return {
14
+ ...issueData,
15
+ path: fullPath,
16
+ message: issueData.message
17
+ };
18
+ }
19
+ let errorMessage = "";
20
+ const maps = errorMaps.filter((m) => !!m).slice().reverse();
21
+ for (const map of maps) {
22
+ errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
23
+ }
24
+ return {
25
+ ...issueData,
26
+ path: fullPath,
27
+ message: errorMessage
28
+ };
29
+ };
30
+ function addIssueToContext(ctx, issueData) {
31
+ const overrideMap = errors.getErrorMap();
32
+ const issue = makeIssue({
33
+ issueData,
34
+ data: ctx.data,
35
+ path: ctx.path,
36
+ errorMaps: [
37
+ ctx.common.contextualErrorMap,
38
+ // contextual error map is first priority
39
+ ctx.schemaErrorMap,
40
+ // then schema-bound map if available
41
+ overrideMap,
42
+ // then global override map
43
+ overrideMap === en ? void 0 : en
44
+ // then global default map
45
+ ].filter((x) => !!x)
46
+ });
47
+ ctx.common.issues.push(issue);
48
+ }
49
+ class ParseStatus {
50
+ constructor() {
51
+ this.value = "valid";
52
+ }
53
+ dirty() {
54
+ if (this.value === "valid")
55
+ this.value = "dirty";
56
+ }
57
+ abort() {
58
+ if (this.value !== "aborted")
59
+ this.value = "aborted";
60
+ }
61
+ static mergeArray(status, results) {
62
+ const arrayValue = [];
63
+ for (const s of results) {
64
+ if (s.status === "aborted")
65
+ return INVALID;
66
+ if (s.status === "dirty")
67
+ status.dirty();
68
+ arrayValue.push(s.value);
69
+ }
70
+ return { status: status.value, value: arrayValue };
71
+ }
72
+ static async mergeObjectAsync(status, pairs) {
73
+ const syncPairs = [];
74
+ for (const pair of pairs) {
75
+ const key = await pair.key;
76
+ const value = await pair.value;
77
+ syncPairs.push({
78
+ key,
79
+ value
80
+ });
81
+ }
82
+ return ParseStatus.mergeObjectSync(status, syncPairs);
83
+ }
84
+ static mergeObjectSync(status, pairs) {
85
+ const finalObject = {};
86
+ for (const pair of pairs) {
87
+ const { key, value } = pair;
88
+ if (key.status === "aborted")
89
+ return INVALID;
90
+ if (value.status === "aborted")
91
+ return INVALID;
92
+ if (key.status === "dirty")
93
+ status.dirty();
94
+ if (value.status === "dirty")
95
+ status.dirty();
96
+ if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
97
+ finalObject[key.value] = value.value;
98
+ }
99
+ }
100
+ return { status: status.value, value: finalObject };
101
+ }
102
+ }
103
+ const INVALID = Object.freeze({
104
+ status: "aborted"
105
+ });
106
+ const DIRTY = (value) => ({ status: "dirty", value });
107
+ const OK = (value) => ({ status: "valid", value });
108
+ const isAborted = (x) => x.status === "aborted";
109
+ const isDirty = (x) => x.status === "dirty";
110
+ const isValid = (x) => x.status === "valid";
111
+ const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
112
+ exports.DIRTY = DIRTY;
113
+ exports.INVALID = INVALID;
114
+ exports.OK = OK;
115
+ exports.ParseStatus = ParseStatus;
116
+ exports.addIssueToContext = addIssueToContext;
117
+ exports.isAborted = isAborted;
118
+ exports.isAsync = isAsync;
119
+ exports.isDirty = isDirty;
120
+ exports.isValid = isValid;
121
+ exports.makeIssue = makeIssue;
122
+ //# sourceMappingURL=parseUtil.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseUtil.cjs","sources":["../../../../../../../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js"],"sourcesContent":["import { getErrorMap } from \"../errors.js\";\nimport defaultErrorMap from \"../locales/en.js\";\nexport const makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n if (issueData.message !== undefined) {\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message,\n };\n }\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: errorMessage,\n };\n};\nexport const EMPTY_PATH = [];\nexport function addIssueToContext(ctx, issueData) {\n const overrideMap = getErrorMap();\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === defaultErrorMap ? undefined : defaultErrorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nexport class ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nexport const INVALID = Object.freeze({\n status: \"aborted\",\n});\nexport const DIRTY = (value) => ({ status: \"dirty\", value });\nexport const OK = (value) => ({ status: \"valid\", value });\nexport const isAborted = (x) => x.status === \"aborted\";\nexport const isDirty = (x) => x.status === \"dirty\";\nexport const isValid = (x) => x.status === \"valid\";\nexport const isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n"],"names":["getErrorMap","defaultErrorMap"],"mappings":";;;;AAEY,MAAC,YAAY,CAAC,WAAW;AACjC,QAAM,EAAE,MAAM,MAAM,WAAW,UAAS,IAAK;AAC7C,QAAM,WAAW,CAAC,GAAG,MAAM,GAAI,UAAU,QAAQ,CAAA,CAAG;AACpD,QAAM,YAAY;AAAA,IACd,GAAG;AAAA,IACH,MAAM;AAAA,EACd;AACI,MAAI,UAAU,YAAY,QAAW;AACjC,WAAO;AAAA,MACH,GAAG;AAAA,MACH,MAAM;AAAA,MACN,SAAS,UAAU;AAAA,IAC/B;AAAA,EACI;AACA,MAAI,eAAe;AACnB,QAAM,OAAO,UACR,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EACjB,MAAK,EACL,QAAO;AACZ,aAAW,OAAO,MAAM;AACpB,mBAAe,IAAI,WAAW,EAAE,MAAM,cAAc,aAAY,CAAE,EAAE;AAAA,EACxE;AACA,SAAO;AAAA,IACH,GAAG;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA,EACjB;AACA;AAEO,SAAS,kBAAkB,KAAK,WAAW;AAC9C,QAAM,cAAcA,OAAAA,YAAW;AAC/B,QAAM,QAAQ,UAAU;AAAA,IACpB;AAAA,IACA,MAAM,IAAI;AAAA,IACV,MAAM,IAAI;AAAA,IACV,WAAW;AAAA,MACP,IAAI,OAAO;AAAA;AAAA,MACX,IAAI;AAAA;AAAA,MACJ;AAAA;AAAA,MACA,gBAAgBC,KAAkB,SAAYA;AAAAA;AAAAA,IAC1D,EAAU,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAAA,EAC3B,CAAK;AACD,MAAI,OAAO,OAAO,KAAK,KAAK;AAChC;AACO,MAAM,YAAY;AAAA,EACrB,cAAc;AACV,SAAK,QAAQ;AAAA,EACjB;AAAA,EACA,QAAQ;AACJ,QAAI,KAAK,UAAU;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AAC,KAAK,CAAC,WAAW,EAAE,QAAQ,SAAS,MAAK;AAC1C,MAAC,YAAY,CAAC,MAAM,EAAE,WAAW;AACjC,MAAC,UAAU,CAAC,MAAM,EAAE,WAAW;AAC/B,MAAC,UAAU,CAAC,MAAM,EAAE,WAAW;AAC/B,MAAC,UAAU,CAAC,MAAM,OAAO,YAAY,eAAe,aAAa;;;;;;;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,122 @@
1
+ import { getErrorMap } from "../errors.js";
2
+ import errorMap from "../locales/en.js";
3
+ const makeIssue = (params) => {
4
+ const { data, path, errorMaps, issueData } = params;
5
+ const fullPath = [...path, ...issueData.path || []];
6
+ const fullIssue = {
7
+ ...issueData,
8
+ path: fullPath
9
+ };
10
+ if (issueData.message !== void 0) {
11
+ return {
12
+ ...issueData,
13
+ path: fullPath,
14
+ message: issueData.message
15
+ };
16
+ }
17
+ let errorMessage = "";
18
+ const maps = errorMaps.filter((m) => !!m).slice().reverse();
19
+ for (const map of maps) {
20
+ errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
21
+ }
22
+ return {
23
+ ...issueData,
24
+ path: fullPath,
25
+ message: errorMessage
26
+ };
27
+ };
28
+ function addIssueToContext(ctx, issueData) {
29
+ const overrideMap = getErrorMap();
30
+ const issue = makeIssue({
31
+ issueData,
32
+ data: ctx.data,
33
+ path: ctx.path,
34
+ errorMaps: [
35
+ ctx.common.contextualErrorMap,
36
+ // contextual error map is first priority
37
+ ctx.schemaErrorMap,
38
+ // then schema-bound map if available
39
+ overrideMap,
40
+ // then global override map
41
+ overrideMap === errorMap ? void 0 : errorMap
42
+ // then global default map
43
+ ].filter((x) => !!x)
44
+ });
45
+ ctx.common.issues.push(issue);
46
+ }
47
+ class ParseStatus {
48
+ constructor() {
49
+ this.value = "valid";
50
+ }
51
+ dirty() {
52
+ if (this.value === "valid")
53
+ this.value = "dirty";
54
+ }
55
+ abort() {
56
+ if (this.value !== "aborted")
57
+ this.value = "aborted";
58
+ }
59
+ static mergeArray(status, results) {
60
+ const arrayValue = [];
61
+ for (const s of results) {
62
+ if (s.status === "aborted")
63
+ return INVALID;
64
+ if (s.status === "dirty")
65
+ status.dirty();
66
+ arrayValue.push(s.value);
67
+ }
68
+ return { status: status.value, value: arrayValue };
69
+ }
70
+ static async mergeObjectAsync(status, pairs) {
71
+ const syncPairs = [];
72
+ for (const pair of pairs) {
73
+ const key = await pair.key;
74
+ const value = await pair.value;
75
+ syncPairs.push({
76
+ key,
77
+ value
78
+ });
79
+ }
80
+ return ParseStatus.mergeObjectSync(status, syncPairs);
81
+ }
82
+ static mergeObjectSync(status, pairs) {
83
+ const finalObject = {};
84
+ for (const pair of pairs) {
85
+ const { key, value } = pair;
86
+ if (key.status === "aborted")
87
+ return INVALID;
88
+ if (value.status === "aborted")
89
+ return INVALID;
90
+ if (key.status === "dirty")
91
+ status.dirty();
92
+ if (value.status === "dirty")
93
+ status.dirty();
94
+ if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
95
+ finalObject[key.value] = value.value;
96
+ }
97
+ }
98
+ return { status: status.value, value: finalObject };
99
+ }
100
+ }
101
+ const INVALID = Object.freeze({
102
+ status: "aborted"
103
+ });
104
+ const DIRTY = (value) => ({ status: "dirty", value });
105
+ const OK = (value) => ({ status: "valid", value });
106
+ const isAborted = (x) => x.status === "aborted";
107
+ const isDirty = (x) => x.status === "dirty";
108
+ const isValid = (x) => x.status === "valid";
109
+ const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
110
+ export {
111
+ DIRTY,
112
+ INVALID,
113
+ OK,
114
+ ParseStatus,
115
+ addIssueToContext,
116
+ isAborted,
117
+ isAsync,
118
+ isDirty,
119
+ isValid,
120
+ makeIssue
121
+ };
122
+ //# sourceMappingURL=parseUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseUtil.js","sources":["../../../../../../../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js"],"sourcesContent":["import { getErrorMap } from \"../errors.js\";\nimport defaultErrorMap from \"../locales/en.js\";\nexport const makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n if (issueData.message !== undefined) {\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message,\n };\n }\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: errorMessage,\n };\n};\nexport const EMPTY_PATH = [];\nexport function addIssueToContext(ctx, issueData) {\n const overrideMap = getErrorMap();\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === defaultErrorMap ? undefined : defaultErrorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nexport class ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nexport const INVALID = Object.freeze({\n status: \"aborted\",\n});\nexport const DIRTY = (value) => ({ status: \"dirty\", value });\nexport const OK = (value) => ({ status: \"valid\", value });\nexport const isAborted = (x) => x.status === \"aborted\";\nexport const isDirty = (x) => x.status === \"dirty\";\nexport const isValid = (x) => x.status === \"valid\";\nexport const isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n"],"names":["defaultErrorMap"],"mappings":";;AAEY,MAAC,YAAY,CAAC,WAAW;AACjC,QAAM,EAAE,MAAM,MAAM,WAAW,UAAS,IAAK;AAC7C,QAAM,WAAW,CAAC,GAAG,MAAM,GAAI,UAAU,QAAQ,CAAA,CAAG;AACpD,QAAM,YAAY;AAAA,IACd,GAAG;AAAA,IACH,MAAM;AAAA,EACd;AACI,MAAI,UAAU,YAAY,QAAW;AACjC,WAAO;AAAA,MACH,GAAG;AAAA,MACH,MAAM;AAAA,MACN,SAAS,UAAU;AAAA,IAC/B;AAAA,EACI;AACA,MAAI,eAAe;AACnB,QAAM,OAAO,UACR,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EACjB,MAAK,EACL,QAAO;AACZ,aAAW,OAAO,MAAM;AACpB,mBAAe,IAAI,WAAW,EAAE,MAAM,cAAc,aAAY,CAAE,EAAE;AAAA,EACxE;AACA,SAAO;AAAA,IACH,GAAG;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA,EACjB;AACA;AAEO,SAAS,kBAAkB,KAAK,WAAW;AAC9C,QAAM,cAAc,YAAW;AAC/B,QAAM,QAAQ,UAAU;AAAA,IACpB;AAAA,IACA,MAAM,IAAI;AAAA,IACV,MAAM,IAAI;AAAA,IACV,WAAW;AAAA,MACP,IAAI,OAAO;AAAA;AAAA,MACX,IAAI;A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