@lssm/example.learning-journey-platform-tour 0.0.0-canary-20251217080011 → 0.0.0-canary-20251219202229
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/.turbo/turbo-build$colon$bundle.log +272 -220
- package/.turbo/turbo-build.log +273 -11
- package/CHANGELOG.md +4 -4
- package/LICENSE +21 -0
- package/dist/contracts/index.d.ts +2 -1
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +29 -30
- package/dist/contracts/index.js.map +1 -0
- package/dist/docs/platform-tour.docblock.js +2 -1
- package/dist/docs/platform-tour.docblock.js.map +1 -0
- package/dist/example.d.ts +2 -1
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +2 -1
- package/dist/example.js.map +1 -0
- package/dist/handlers/demo.handlers.d.ts +2 -1
- package/dist/handlers/demo.handlers.d.ts.map +1 -0
- package/dist/handlers/demo.handlers.js +2 -1
- package/dist/handlers/demo.handlers.js.map +1 -0
- package/dist/learning-journey-platform-tour.feature.d.ts +2 -1
- package/dist/learning-journey-platform-tour.feature.d.ts.map +1 -0
- package/dist/learning-journey-platform-tour.feature.js +2 -1
- package/dist/learning-journey-platform-tour.feature.js.map +1 -0
- package/dist/libs/contracts/dist/capabilities/openbanking.js +2 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js.map +1 -0
- package/dist/libs/contracts/dist/contract-registry/schemas.js +2 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js.map +1 -0
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/index.js +2 -6
- package/dist/libs/contracts/dist/docs/meta.docs.js +30 -0
- package/dist/libs/contracts/dist/docs/meta.docs.js.map +1 -0
- package/dist/libs/contracts/dist/docs/presentations.js +2 -1
- package/dist/libs/contracts/dist/docs/presentations.js.map +1 -0
- package/dist/libs/contracts/dist/docs/registry.js +2 -1
- package/dist/libs/contracts/dist/docs/registry.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +2 -1
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech-contracts.docs.js +97 -0
- package/dist/libs/contracts/dist/docs/tech-contracts.docs.js.map +1 -0
- package/dist/libs/contracts/dist/index.js +2 -1
- package/dist/libs/contracts/dist/integrations/contracts.js +65 -66
- package/dist/libs/contracts/dist/integrations/contracts.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +31 -32
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +18 -19
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +32 -33
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +60 -61
- package/dist/libs/contracts/dist/integrations/openbanking/models.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +2 -1
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/gmail.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/mistral.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/postmark.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/powens.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/powens.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/stripe.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/contracts.js +44 -45
- package/dist/libs/contracts/dist/knowledge/contracts.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +2 -1
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +2 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +2 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +2 -1
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +2 -1
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +2 -1
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js.map +1 -0
- package/dist/libs/contracts/dist/llm/exporters.js +2 -1
- package/dist/libs/contracts/dist/llm/exporters.js.map +1 -0
- package/dist/libs/contracts/dist/onboarding-base.js +22 -23
- package/dist/libs/contracts/dist/onboarding-base.js.map +1 -0
- package/dist/libs/contracts/dist/ownership.js +4 -2
- package/dist/libs/contracts/dist/ownership.js.map +1 -0
- package/dist/libs/contracts/dist/presentations.v2.js +2 -1
- package/dist/libs/contracts/dist/presentations.v2.js.map +1 -0
- package/dist/libs/contracts/dist/regenerator/service.js +2 -1
- package/dist/libs/contracts/dist/regenerator/service.js.map +1 -0
- package/dist/libs/contracts/dist/schema/dist/index.js +3873 -6
- package/dist/libs/contracts/dist/schema/dist/index.js.map +1 -0
- package/dist/libs/contracts/dist/spec.js +2 -1
- package/dist/libs/contracts/dist/spec.js.map +1 -0
- package/dist/libs/schema/dist/index.js +4684 -6
- package/dist/libs/schema/dist/index.js.map +1 -0
- package/dist/presentations/index.d.ts +2 -1
- package/dist/presentations/index.d.ts.map +1 -0
- package/dist/presentations/index.js +2 -1
- package/dist/presentations/index.js.map +1 -0
- package/dist/track.d.ts +2 -1
- package/dist/track.d.ts.map +1 -0
- package/dist/track.js +2 -1
- package/dist/track.js.map +1 -0
- package/package.json +9 -8
- package/tsconfig.tsbuildinfo +1 -1
- package/tsdown.config.js +11 -1
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
- package/dist/libs/schema/dist/EnumType.js +0 -2
- package/dist/libs/schema/dist/FieldType.js +0 -49
- package/dist/libs/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/schema/dist/SchemaModel.js +0 -39
- package/dist/libs/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/schema/dist/entity/index.js +0 -2
- package/dist/libs/schema/dist/entity/types.js +0 -1
|
@@ -1,6 +1,4684 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
//#region ../../libs/schema/dist/index.js
|
|
2
|
+
var c8 = Object.defineProperty;
|
|
3
|
+
var U6 = (J, X) => {
|
|
4
|
+
for (var Y in X) c8(J, Y, {
|
|
5
|
+
get: X[Y],
|
|
6
|
+
enumerable: !0,
|
|
7
|
+
configurable: !0,
|
|
8
|
+
set: (W) => X[Y] = () => W
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
function u(J, X) {
|
|
12
|
+
if (!Boolean(J)) throw Error(X);
|
|
13
|
+
}
|
|
14
|
+
function _0(J) {
|
|
15
|
+
return typeof J == "object" && J !== null;
|
|
16
|
+
}
|
|
17
|
+
function I6(J, X) {
|
|
18
|
+
if (!Boolean(J)) throw Error(X != null ? X : "Unexpected invariant triggered.");
|
|
19
|
+
}
|
|
20
|
+
var y8 = /\r\n|[\n\r]/g;
|
|
21
|
+
function W0(J, X) {
|
|
22
|
+
let Y = 0, W = 1;
|
|
23
|
+
for (let q of J.body.matchAll(y8)) {
|
|
24
|
+
if (typeof q.index === "number" || I6(!1), q.index >= X) break;
|
|
25
|
+
Y = q.index + q[0].length, W += 1;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
line: W,
|
|
29
|
+
column: X + 1 - Y
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function X4(J) {
|
|
33
|
+
return b0(J.source, W0(J.source, J.start));
|
|
34
|
+
}
|
|
35
|
+
function b0(J, X) {
|
|
36
|
+
let Y = J.locationOffset.column - 1, W = "".padStart(Y) + J.body, q = X.line - 1, H = J.locationOffset.line - 1, B = X.line + H, Q = X.line === 1 ? Y : 0, G = X.column + Q, z = `${J.name}:${B}:${G}
|
|
37
|
+
`, I = W.split(/\r\n|[\n\r]/g), w = I[q];
|
|
38
|
+
if (w.length > 120) {
|
|
39
|
+
let M = Math.floor(G / 80), P = G % 80, N = [];
|
|
40
|
+
for (let _ = 0; _ < w.length; _ += 80) N.push(w.slice(_, _ + 80));
|
|
41
|
+
return z + w6([
|
|
42
|
+
[`${B} |`, N[0]],
|
|
43
|
+
...N.slice(1, M + 1).map((_) => ["|", _]),
|
|
44
|
+
["|", "^".padStart(P)],
|
|
45
|
+
["|", N[M + 1]]
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
48
|
+
return z + w6([
|
|
49
|
+
[`${B - 1} |`, I[q - 1]],
|
|
50
|
+
[`${B} |`, w],
|
|
51
|
+
["|", "^".padStart(G)],
|
|
52
|
+
[`${B + 1} |`, I[q + 1]]
|
|
53
|
+
]);
|
|
54
|
+
}
|
|
55
|
+
function w6(J) {
|
|
56
|
+
let X = J.filter(([W, q]) => q !== void 0), Y = Math.max(...X.map(([W]) => W.length));
|
|
57
|
+
return X.map(([W, q]) => W.padStart(Y) + (q ? " " + q : "")).join(`
|
|
58
|
+
`);
|
|
59
|
+
}
|
|
60
|
+
function m8(J) {
|
|
61
|
+
let X = J[0];
|
|
62
|
+
if (X == null || "kind" in X || "length" in X) return {
|
|
63
|
+
nodes: X,
|
|
64
|
+
source: J[1],
|
|
65
|
+
positions: J[2],
|
|
66
|
+
path: J[3],
|
|
67
|
+
originalError: J[4],
|
|
68
|
+
extensions: J[5]
|
|
69
|
+
};
|
|
70
|
+
return X;
|
|
71
|
+
}
|
|
72
|
+
var h = class h extends Error {
|
|
73
|
+
constructor(J, ...X) {
|
|
74
|
+
var Y, W, q;
|
|
75
|
+
let { nodes: H, source: B, positions: Q, path: G, originalError: z, extensions: I } = m8(X);
|
|
76
|
+
super(J);
|
|
77
|
+
this.name = "GraphQLError", this.path = G !== null && G !== void 0 ? G : void 0, this.originalError = z !== null && z !== void 0 ? z : void 0, this.nodes = D6(Array.isArray(H) ? H : H ? [H] : void 0);
|
|
78
|
+
let w = D6((Y = this.nodes) === null || Y === void 0 ? void 0 : Y.map((P) => P.loc).filter((P) => P != null));
|
|
79
|
+
this.source = B !== null && B !== void 0 ? B : w === null || w === void 0 ? void 0 : (W = w[0]) === null || W === void 0 ? void 0 : W.source, this.positions = Q !== null && Q !== void 0 ? Q : w === null || w === void 0 ? void 0 : w.map((P) => P.start), this.locations = Q && B ? Q.map((P) => W0(B, P)) : w === null || w === void 0 ? void 0 : w.map((P) => W0(P.source, P.start));
|
|
80
|
+
let M = _0(z === null || z === void 0 ? void 0 : z.extensions) ? z === null || z === void 0 ? void 0 : z.extensions : void 0;
|
|
81
|
+
if (this.extensions = (q = I !== null && I !== void 0 ? I : M) !== null && q !== void 0 ? q : Object.create(null), Object.defineProperties(this, {
|
|
82
|
+
message: {
|
|
83
|
+
writable: !0,
|
|
84
|
+
enumerable: !0
|
|
85
|
+
},
|
|
86
|
+
name: { enumerable: !1 },
|
|
87
|
+
nodes: { enumerable: !1 },
|
|
88
|
+
source: { enumerable: !1 },
|
|
89
|
+
positions: { enumerable: !1 },
|
|
90
|
+
originalError: { enumerable: !1 }
|
|
91
|
+
}), z !== null && z !== void 0 && z.stack) Object.defineProperty(this, "stack", {
|
|
92
|
+
value: z.stack,
|
|
93
|
+
writable: !0,
|
|
94
|
+
configurable: !0
|
|
95
|
+
});
|
|
96
|
+
else if (Error.captureStackTrace) Error.captureStackTrace(this, h);
|
|
97
|
+
else Object.defineProperty(this, "stack", {
|
|
98
|
+
value: Error().stack,
|
|
99
|
+
writable: !0,
|
|
100
|
+
configurable: !0
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
get [Symbol.toStringTag]() {
|
|
104
|
+
return "GraphQLError";
|
|
105
|
+
}
|
|
106
|
+
toString() {
|
|
107
|
+
let J = this.message;
|
|
108
|
+
if (this.nodes) {
|
|
109
|
+
for (let X of this.nodes) if (X.loc) J += `
|
|
110
|
+
|
|
111
|
+
` + X4(X.loc);
|
|
112
|
+
} else if (this.source && this.locations) for (let X of this.locations) J += `
|
|
113
|
+
|
|
114
|
+
` + b0(this.source, X);
|
|
115
|
+
return J;
|
|
116
|
+
}
|
|
117
|
+
toJSON() {
|
|
118
|
+
let J = { message: this.message };
|
|
119
|
+
if (this.locations != null) J.locations = this.locations;
|
|
120
|
+
if (this.path != null) J.path = this.path;
|
|
121
|
+
if (this.extensions != null && Object.keys(this.extensions).length > 0) J.extensions = this.extensions;
|
|
122
|
+
return J;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
function D6(J) {
|
|
126
|
+
return J === void 0 || J.length === 0 ? void 0 : J;
|
|
127
|
+
}
|
|
128
|
+
var W4 = {
|
|
129
|
+
Name: [],
|
|
130
|
+
Document: ["definitions"],
|
|
131
|
+
OperationDefinition: [
|
|
132
|
+
"description",
|
|
133
|
+
"name",
|
|
134
|
+
"variableDefinitions",
|
|
135
|
+
"directives",
|
|
136
|
+
"selectionSet"
|
|
137
|
+
],
|
|
138
|
+
VariableDefinition: [
|
|
139
|
+
"description",
|
|
140
|
+
"variable",
|
|
141
|
+
"type",
|
|
142
|
+
"defaultValue",
|
|
143
|
+
"directives"
|
|
144
|
+
],
|
|
145
|
+
Variable: ["name"],
|
|
146
|
+
SelectionSet: ["selections"],
|
|
147
|
+
Field: [
|
|
148
|
+
"alias",
|
|
149
|
+
"name",
|
|
150
|
+
"arguments",
|
|
151
|
+
"directives",
|
|
152
|
+
"selectionSet"
|
|
153
|
+
],
|
|
154
|
+
Argument: ["name", "value"],
|
|
155
|
+
FragmentSpread: ["name", "directives"],
|
|
156
|
+
InlineFragment: [
|
|
157
|
+
"typeCondition",
|
|
158
|
+
"directives",
|
|
159
|
+
"selectionSet"
|
|
160
|
+
],
|
|
161
|
+
FragmentDefinition: [
|
|
162
|
+
"description",
|
|
163
|
+
"name",
|
|
164
|
+
"variableDefinitions",
|
|
165
|
+
"typeCondition",
|
|
166
|
+
"directives",
|
|
167
|
+
"selectionSet"
|
|
168
|
+
],
|
|
169
|
+
IntValue: [],
|
|
170
|
+
FloatValue: [],
|
|
171
|
+
StringValue: [],
|
|
172
|
+
BooleanValue: [],
|
|
173
|
+
NullValue: [],
|
|
174
|
+
EnumValue: [],
|
|
175
|
+
ListValue: ["values"],
|
|
176
|
+
ObjectValue: ["fields"],
|
|
177
|
+
ObjectField: ["name", "value"],
|
|
178
|
+
Directive: ["name", "arguments"],
|
|
179
|
+
NamedType: ["name"],
|
|
180
|
+
ListType: ["type"],
|
|
181
|
+
NonNullType: ["type"],
|
|
182
|
+
SchemaDefinition: [
|
|
183
|
+
"description",
|
|
184
|
+
"directives",
|
|
185
|
+
"operationTypes"
|
|
186
|
+
],
|
|
187
|
+
OperationTypeDefinition: ["type"],
|
|
188
|
+
ScalarTypeDefinition: [
|
|
189
|
+
"description",
|
|
190
|
+
"name",
|
|
191
|
+
"directives"
|
|
192
|
+
],
|
|
193
|
+
ObjectTypeDefinition: [
|
|
194
|
+
"description",
|
|
195
|
+
"name",
|
|
196
|
+
"interfaces",
|
|
197
|
+
"directives",
|
|
198
|
+
"fields"
|
|
199
|
+
],
|
|
200
|
+
FieldDefinition: [
|
|
201
|
+
"description",
|
|
202
|
+
"name",
|
|
203
|
+
"arguments",
|
|
204
|
+
"type",
|
|
205
|
+
"directives"
|
|
206
|
+
],
|
|
207
|
+
InputValueDefinition: [
|
|
208
|
+
"description",
|
|
209
|
+
"name",
|
|
210
|
+
"type",
|
|
211
|
+
"defaultValue",
|
|
212
|
+
"directives"
|
|
213
|
+
],
|
|
214
|
+
InterfaceTypeDefinition: [
|
|
215
|
+
"description",
|
|
216
|
+
"name",
|
|
217
|
+
"interfaces",
|
|
218
|
+
"directives",
|
|
219
|
+
"fields"
|
|
220
|
+
],
|
|
221
|
+
UnionTypeDefinition: [
|
|
222
|
+
"description",
|
|
223
|
+
"name",
|
|
224
|
+
"directives",
|
|
225
|
+
"types"
|
|
226
|
+
],
|
|
227
|
+
EnumTypeDefinition: [
|
|
228
|
+
"description",
|
|
229
|
+
"name",
|
|
230
|
+
"directives",
|
|
231
|
+
"values"
|
|
232
|
+
],
|
|
233
|
+
EnumValueDefinition: [
|
|
234
|
+
"description",
|
|
235
|
+
"name",
|
|
236
|
+
"directives"
|
|
237
|
+
],
|
|
238
|
+
InputObjectTypeDefinition: [
|
|
239
|
+
"description",
|
|
240
|
+
"name",
|
|
241
|
+
"directives",
|
|
242
|
+
"fields"
|
|
243
|
+
],
|
|
244
|
+
DirectiveDefinition: [
|
|
245
|
+
"description",
|
|
246
|
+
"name",
|
|
247
|
+
"arguments",
|
|
248
|
+
"locations"
|
|
249
|
+
],
|
|
250
|
+
SchemaExtension: ["directives", "operationTypes"],
|
|
251
|
+
ScalarTypeExtension: ["name", "directives"],
|
|
252
|
+
ObjectTypeExtension: [
|
|
253
|
+
"name",
|
|
254
|
+
"interfaces",
|
|
255
|
+
"directives",
|
|
256
|
+
"fields"
|
|
257
|
+
],
|
|
258
|
+
InterfaceTypeExtension: [
|
|
259
|
+
"name",
|
|
260
|
+
"interfaces",
|
|
261
|
+
"directives",
|
|
262
|
+
"fields"
|
|
263
|
+
],
|
|
264
|
+
UnionTypeExtension: [
|
|
265
|
+
"name",
|
|
266
|
+
"directives",
|
|
267
|
+
"types"
|
|
268
|
+
],
|
|
269
|
+
EnumTypeExtension: [
|
|
270
|
+
"name",
|
|
271
|
+
"directives",
|
|
272
|
+
"values"
|
|
273
|
+
],
|
|
274
|
+
InputObjectTypeExtension: [
|
|
275
|
+
"name",
|
|
276
|
+
"directives",
|
|
277
|
+
"fields"
|
|
278
|
+
],
|
|
279
|
+
TypeCoordinate: ["name"],
|
|
280
|
+
MemberCoordinate: ["name", "memberName"],
|
|
281
|
+
ArgumentCoordinate: [
|
|
282
|
+
"name",
|
|
283
|
+
"fieldName",
|
|
284
|
+
"argumentName"
|
|
285
|
+
],
|
|
286
|
+
DirectiveCoordinate: ["name"],
|
|
287
|
+
DirectiveArgumentCoordinate: ["name", "argumentName"]
|
|
288
|
+
}, f8 = new Set(Object.keys(W4));
|
|
289
|
+
function q4(J) {
|
|
290
|
+
let X = J === null || J === void 0 ? void 0 : J.kind;
|
|
291
|
+
return typeof X === "string" && f8.has(X);
|
|
292
|
+
}
|
|
293
|
+
var Y4;
|
|
294
|
+
(function(J) {
|
|
295
|
+
J.QUERY = "query", J.MUTATION = "mutation", J.SUBSCRIPTION = "subscription";
|
|
296
|
+
})(Y4 || (Y4 = {}));
|
|
297
|
+
var K;
|
|
298
|
+
(function(J) {
|
|
299
|
+
J.NAME = "Name", J.DOCUMENT = "Document", J.OPERATION_DEFINITION = "OperationDefinition", J.VARIABLE_DEFINITION = "VariableDefinition", J.SELECTION_SET = "SelectionSet", J.FIELD = "Field", J.ARGUMENT = "Argument", J.FRAGMENT_SPREAD = "FragmentSpread", J.INLINE_FRAGMENT = "InlineFragment", J.FRAGMENT_DEFINITION = "FragmentDefinition", J.VARIABLE = "Variable", J.INT = "IntValue", J.FLOAT = "FloatValue", J.STRING = "StringValue", J.BOOLEAN = "BooleanValue", J.NULL = "NullValue", J.ENUM = "EnumValue", J.LIST = "ListValue", J.OBJECT = "ObjectValue", J.OBJECT_FIELD = "ObjectField", J.DIRECTIVE = "Directive", J.NAMED_TYPE = "NamedType", J.LIST_TYPE = "ListType", J.NON_NULL_TYPE = "NonNullType", J.SCHEMA_DEFINITION = "SchemaDefinition", J.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", J.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", J.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", J.FIELD_DEFINITION = "FieldDefinition", J.INPUT_VALUE_DEFINITION = "InputValueDefinition", J.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", J.UNION_TYPE_DEFINITION = "UnionTypeDefinition", J.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", J.ENUM_VALUE_DEFINITION = "EnumValueDefinition", J.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", J.DIRECTIVE_DEFINITION = "DirectiveDefinition", J.SCHEMA_EXTENSION = "SchemaExtension", J.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", J.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", J.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", J.UNION_TYPE_EXTENSION = "UnionTypeExtension", J.ENUM_TYPE_EXTENSION = "EnumTypeExtension", J.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", J.TYPE_COORDINATE = "TypeCoordinate", J.MEMBER_COORDINATE = "MemberCoordinate", J.ARGUMENT_COORDINATE = "ArgumentCoordinate", J.DIRECTIVE_COORDINATE = "DirectiveCoordinate", J.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
|
|
300
|
+
})(K || (K = {}));
|
|
301
|
+
function H4(J) {
|
|
302
|
+
return J === 9 || J === 32;
|
|
303
|
+
}
|
|
304
|
+
function o8(J) {
|
|
305
|
+
return J >= 48 && J <= 57;
|
|
306
|
+
}
|
|
307
|
+
function P6(J) {
|
|
308
|
+
return J >= 97 && J <= 122 || J >= 65 && J <= 90;
|
|
309
|
+
}
|
|
310
|
+
function O6(J) {
|
|
311
|
+
return P6(J) || J === 95;
|
|
312
|
+
}
|
|
313
|
+
function M6(J) {
|
|
314
|
+
return P6(J) || o8(J) || J === 95;
|
|
315
|
+
}
|
|
316
|
+
function A6(J, X) {
|
|
317
|
+
let Y = J.replace(/"""/g, "\\\"\"\""), W = Y.split(/\r\n|[\n\r]/g), q = W.length === 1, H = W.length > 1 && W.slice(1).every((P) => P.length === 0 || H4(P.charCodeAt(0))), B = Y.endsWith("\\\"\"\""), Q = J.endsWith("\"") && !B, G = J.endsWith("\\"), z = Q || G, I = !(X !== null && X !== void 0 && X.minimize) && (!q || J.length > 70 || z || H || B), w = "", M = q && H4(J.charCodeAt(0));
|
|
318
|
+
if (I && !M || H) w += `
|
|
319
|
+
`;
|
|
320
|
+
if (w += Y, I || z) w += `
|
|
321
|
+
`;
|
|
322
|
+
return "\"\"\"" + w + "\"\"\"";
|
|
323
|
+
}
|
|
324
|
+
function e(J) {
|
|
325
|
+
return C0(J, []);
|
|
326
|
+
}
|
|
327
|
+
function C0(J, X) {
|
|
328
|
+
switch (typeof J) {
|
|
329
|
+
case "string": return JSON.stringify(J);
|
|
330
|
+
case "function": return J.name ? `[function ${J.name}]` : "[function]";
|
|
331
|
+
case "object": return r8(J, X);
|
|
332
|
+
default: return String(J);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
function r8(J, X) {
|
|
336
|
+
if (J === null) return "null";
|
|
337
|
+
if (X.includes(J)) return "[Circular]";
|
|
338
|
+
let Y = [...X, J];
|
|
339
|
+
if (l8(J)) {
|
|
340
|
+
let W = J.toJSON();
|
|
341
|
+
if (W !== J) return typeof W === "string" ? W : C0(W, Y);
|
|
342
|
+
} else if (Array.isArray(J)) return d8(J, Y);
|
|
343
|
+
return p8(J, Y);
|
|
344
|
+
}
|
|
345
|
+
function l8(J) {
|
|
346
|
+
return typeof J.toJSON === "function";
|
|
347
|
+
}
|
|
348
|
+
function p8(J, X) {
|
|
349
|
+
let Y = Object.entries(J);
|
|
350
|
+
if (Y.length === 0) return "{}";
|
|
351
|
+
if (X.length > 2) return "[" + n8(J) + "]";
|
|
352
|
+
return "{ " + Y.map(([q, H]) => q + ": " + C0(H, X)).join(", ") + " }";
|
|
353
|
+
}
|
|
354
|
+
function d8(J, X) {
|
|
355
|
+
if (J.length === 0) return "[]";
|
|
356
|
+
if (X.length > 2) return "[Array]";
|
|
357
|
+
let Y = Math.min(10, J.length), W = J.length - Y, q = [];
|
|
358
|
+
for (let H = 0; H < Y; ++H) q.push(C0(J[H], X));
|
|
359
|
+
if (W === 1) q.push("... 1 more item");
|
|
360
|
+
else if (W > 1) q.push(`... ${W} more items`);
|
|
361
|
+
return "[" + q.join(", ") + "]";
|
|
362
|
+
}
|
|
363
|
+
function n8(J) {
|
|
364
|
+
let X = Object.prototype.toString.call(J).replace(/^\[object /, "").replace(/]$/, "");
|
|
365
|
+
if (X === "Object" && typeof J.constructor === "function") {
|
|
366
|
+
let Y = J.constructor.name;
|
|
367
|
+
if (typeof Y === "string" && Y !== "") return Y;
|
|
368
|
+
}
|
|
369
|
+
return X;
|
|
370
|
+
}
|
|
371
|
+
function F6(J, X) {
|
|
372
|
+
let [Y, W] = X ? [J, X] : [void 0, J], q = " Did you mean ";
|
|
373
|
+
if (Y) q += Y + " ";
|
|
374
|
+
let H = W.map((G) => `"${G}"`);
|
|
375
|
+
switch (H.length) {
|
|
376
|
+
case 0: return "";
|
|
377
|
+
case 1: return q + H[0] + "?";
|
|
378
|
+
case 2: return q + H[0] + " or " + H[1] + "?";
|
|
379
|
+
}
|
|
380
|
+
let B = H.slice(0, 5), Q = B.pop();
|
|
381
|
+
return q + B.join(", ") + ", or " + Q + "?";
|
|
382
|
+
}
|
|
383
|
+
function B4(J) {
|
|
384
|
+
return J;
|
|
385
|
+
}
|
|
386
|
+
function E6(J, X) {
|
|
387
|
+
let Y = Object.create(null);
|
|
388
|
+
for (let W of J) Y[X(W)] = W;
|
|
389
|
+
return Y;
|
|
390
|
+
}
|
|
391
|
+
function k0(J, X, Y) {
|
|
392
|
+
let W = Object.create(null);
|
|
393
|
+
for (let q of J) W[X(q)] = Y(q);
|
|
394
|
+
return W;
|
|
395
|
+
}
|
|
396
|
+
function $6(J, X) {
|
|
397
|
+
let Y = 0, W = 0;
|
|
398
|
+
while (Y < J.length && W < X.length) {
|
|
399
|
+
let q = J.charCodeAt(Y), H = X.charCodeAt(W);
|
|
400
|
+
if (T0(q) && T0(H)) {
|
|
401
|
+
let B = 0;
|
|
402
|
+
do
|
|
403
|
+
++Y, B = B * 10 + q - Q4, q = J.charCodeAt(Y);
|
|
404
|
+
while (T0(q) && B > 0);
|
|
405
|
+
let Q = 0;
|
|
406
|
+
do
|
|
407
|
+
++W, Q = Q * 10 + H - Q4, H = X.charCodeAt(W);
|
|
408
|
+
while (T0(H) && Q > 0);
|
|
409
|
+
if (B < Q) return -1;
|
|
410
|
+
if (B > Q) return 1;
|
|
411
|
+
} else {
|
|
412
|
+
if (q < H) return -1;
|
|
413
|
+
if (q > H) return 1;
|
|
414
|
+
++Y, ++W;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
return J.length - X.length;
|
|
418
|
+
}
|
|
419
|
+
var Q4 = 48, i8 = 57;
|
|
420
|
+
function T0(J) {
|
|
421
|
+
return !isNaN(J) && Q4 <= J && J <= i8;
|
|
422
|
+
}
|
|
423
|
+
function V6(J, X) {
|
|
424
|
+
let Y = Object.create(null), W = new R6(J), q = Math.floor(J.length * .4) + 1;
|
|
425
|
+
for (let H of X) {
|
|
426
|
+
let B = W.measure(H, q);
|
|
427
|
+
if (B !== void 0) Y[H] = B;
|
|
428
|
+
}
|
|
429
|
+
return Object.keys(Y).sort((H, B) => {
|
|
430
|
+
let Q = Y[H] - Y[B];
|
|
431
|
+
return Q !== 0 ? Q : $6(H, B);
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
var R6 = class {
|
|
435
|
+
constructor(J) {
|
|
436
|
+
this._input = J, this._inputLowerCase = J.toLowerCase(), this._inputArray = K6(this._inputLowerCase), this._rows = [
|
|
437
|
+
Array(J.length + 1).fill(0),
|
|
438
|
+
Array(J.length + 1).fill(0),
|
|
439
|
+
Array(J.length + 1).fill(0)
|
|
440
|
+
];
|
|
441
|
+
}
|
|
442
|
+
measure(J, X) {
|
|
443
|
+
if (this._input === J) return 0;
|
|
444
|
+
let Y = J.toLowerCase();
|
|
445
|
+
if (this._inputLowerCase === Y) return 1;
|
|
446
|
+
let W = K6(Y), q = this._inputArray;
|
|
447
|
+
if (W.length < q.length) {
|
|
448
|
+
let z = W;
|
|
449
|
+
W = q, q = z;
|
|
450
|
+
}
|
|
451
|
+
let H = W.length, B = q.length;
|
|
452
|
+
if (H - B > X) return;
|
|
453
|
+
let Q = this._rows;
|
|
454
|
+
for (let z = 0; z <= B; z++) Q[0][z] = z;
|
|
455
|
+
for (let z = 1; z <= H; z++) {
|
|
456
|
+
let I = Q[(z - 1) % 3], w = Q[z % 3], M = w[0] = z;
|
|
457
|
+
for (let P = 1; P <= B; P++) {
|
|
458
|
+
let N = W[z - 1] === q[P - 1] ? 0 : 1, _ = Math.min(I[P] + 1, w[P - 1] + 1, I[P - 1] + N);
|
|
459
|
+
if (z > 1 && P > 1 && W[z - 1] === q[P - 2] && W[z - 2] === q[P - 1]) {
|
|
460
|
+
let d = Q[(z - 2) % 3][P - 2];
|
|
461
|
+
_ = Math.min(_, d + 1);
|
|
462
|
+
}
|
|
463
|
+
if (_ < M) M = _;
|
|
464
|
+
w[P] = _;
|
|
465
|
+
}
|
|
466
|
+
if (M > X) return;
|
|
467
|
+
}
|
|
468
|
+
let G = Q[H % 3][B];
|
|
469
|
+
return G <= X ? G : void 0;
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
function K6(J) {
|
|
473
|
+
let X = J.length, Y = Array(X);
|
|
474
|
+
for (let W = 0; W < X; ++W) Y[W] = J.charCodeAt(W);
|
|
475
|
+
return Y;
|
|
476
|
+
}
|
|
477
|
+
function j0(J) {
|
|
478
|
+
if (J == null) return Object.create(null);
|
|
479
|
+
if (Object.getPrototypeOf(J) === null) return J;
|
|
480
|
+
let X = Object.create(null);
|
|
481
|
+
for (let [Y, W] of Object.entries(J)) X[Y] = W;
|
|
482
|
+
return X;
|
|
483
|
+
}
|
|
484
|
+
function N6(J) {
|
|
485
|
+
return `"${J.replace(t8, a8)}"`;
|
|
486
|
+
}
|
|
487
|
+
var t8 = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
488
|
+
function a8(J) {
|
|
489
|
+
return s8[J.charCodeAt(0)];
|
|
490
|
+
}
|
|
491
|
+
var s8 = [
|
|
492
|
+
"\\u0000",
|
|
493
|
+
"\\u0001",
|
|
494
|
+
"\\u0002",
|
|
495
|
+
"\\u0003",
|
|
496
|
+
"\\u0004",
|
|
497
|
+
"\\u0005",
|
|
498
|
+
"\\u0006",
|
|
499
|
+
"\\u0007",
|
|
500
|
+
"\\b",
|
|
501
|
+
"\\t",
|
|
502
|
+
"\\n",
|
|
503
|
+
"\\u000B",
|
|
504
|
+
"\\f",
|
|
505
|
+
"\\r",
|
|
506
|
+
"\\u000E",
|
|
507
|
+
"\\u000F",
|
|
508
|
+
"\\u0010",
|
|
509
|
+
"\\u0011",
|
|
510
|
+
"\\u0012",
|
|
511
|
+
"\\u0013",
|
|
512
|
+
"\\u0014",
|
|
513
|
+
"\\u0015",
|
|
514
|
+
"\\u0016",
|
|
515
|
+
"\\u0017",
|
|
516
|
+
"\\u0018",
|
|
517
|
+
"\\u0019",
|
|
518
|
+
"\\u001A",
|
|
519
|
+
"\\u001B",
|
|
520
|
+
"\\u001C",
|
|
521
|
+
"\\u001D",
|
|
522
|
+
"\\u001E",
|
|
523
|
+
"\\u001F",
|
|
524
|
+
"",
|
|
525
|
+
"",
|
|
526
|
+
"\\\"",
|
|
527
|
+
"",
|
|
528
|
+
"",
|
|
529
|
+
"",
|
|
530
|
+
"",
|
|
531
|
+
"",
|
|
532
|
+
"",
|
|
533
|
+
"",
|
|
534
|
+
"",
|
|
535
|
+
"",
|
|
536
|
+
"",
|
|
537
|
+
"",
|
|
538
|
+
"",
|
|
539
|
+
"",
|
|
540
|
+
"",
|
|
541
|
+
"",
|
|
542
|
+
"",
|
|
543
|
+
"",
|
|
544
|
+
"",
|
|
545
|
+
"",
|
|
546
|
+
"",
|
|
547
|
+
"",
|
|
548
|
+
"",
|
|
549
|
+
"",
|
|
550
|
+
"",
|
|
551
|
+
"",
|
|
552
|
+
"",
|
|
553
|
+
"",
|
|
554
|
+
"",
|
|
555
|
+
"",
|
|
556
|
+
"",
|
|
557
|
+
"",
|
|
558
|
+
"",
|
|
559
|
+
"",
|
|
560
|
+
"",
|
|
561
|
+
"",
|
|
562
|
+
"",
|
|
563
|
+
"",
|
|
564
|
+
"",
|
|
565
|
+
"",
|
|
566
|
+
"",
|
|
567
|
+
"",
|
|
568
|
+
"",
|
|
569
|
+
"",
|
|
570
|
+
"",
|
|
571
|
+
"",
|
|
572
|
+
"",
|
|
573
|
+
"",
|
|
574
|
+
"",
|
|
575
|
+
"",
|
|
576
|
+
"",
|
|
577
|
+
"",
|
|
578
|
+
"",
|
|
579
|
+
"",
|
|
580
|
+
"",
|
|
581
|
+
"",
|
|
582
|
+
"",
|
|
583
|
+
"",
|
|
584
|
+
"\\\\",
|
|
585
|
+
"",
|
|
586
|
+
"",
|
|
587
|
+
"",
|
|
588
|
+
"",
|
|
589
|
+
"",
|
|
590
|
+
"",
|
|
591
|
+
"",
|
|
592
|
+
"",
|
|
593
|
+
"",
|
|
594
|
+
"",
|
|
595
|
+
"",
|
|
596
|
+
"",
|
|
597
|
+
"",
|
|
598
|
+
"",
|
|
599
|
+
"",
|
|
600
|
+
"",
|
|
601
|
+
"",
|
|
602
|
+
"",
|
|
603
|
+
"",
|
|
604
|
+
"",
|
|
605
|
+
"",
|
|
606
|
+
"",
|
|
607
|
+
"",
|
|
608
|
+
"",
|
|
609
|
+
"",
|
|
610
|
+
"",
|
|
611
|
+
"",
|
|
612
|
+
"",
|
|
613
|
+
"",
|
|
614
|
+
"",
|
|
615
|
+
"",
|
|
616
|
+
"",
|
|
617
|
+
"",
|
|
618
|
+
"",
|
|
619
|
+
"\\u007F",
|
|
620
|
+
"\\u0080",
|
|
621
|
+
"\\u0081",
|
|
622
|
+
"\\u0082",
|
|
623
|
+
"\\u0083",
|
|
624
|
+
"\\u0084",
|
|
625
|
+
"\\u0085",
|
|
626
|
+
"\\u0086",
|
|
627
|
+
"\\u0087",
|
|
628
|
+
"\\u0088",
|
|
629
|
+
"\\u0089",
|
|
630
|
+
"\\u008A",
|
|
631
|
+
"\\u008B",
|
|
632
|
+
"\\u008C",
|
|
633
|
+
"\\u008D",
|
|
634
|
+
"\\u008E",
|
|
635
|
+
"\\u008F",
|
|
636
|
+
"\\u0090",
|
|
637
|
+
"\\u0091",
|
|
638
|
+
"\\u0092",
|
|
639
|
+
"\\u0093",
|
|
640
|
+
"\\u0094",
|
|
641
|
+
"\\u0095",
|
|
642
|
+
"\\u0096",
|
|
643
|
+
"\\u0097",
|
|
644
|
+
"\\u0098",
|
|
645
|
+
"\\u0099",
|
|
646
|
+
"\\u009A",
|
|
647
|
+
"\\u009B",
|
|
648
|
+
"\\u009C",
|
|
649
|
+
"\\u009D",
|
|
650
|
+
"\\u009E",
|
|
651
|
+
"\\u009F"
|
|
652
|
+
];
|
|
653
|
+
var S6 = Object.freeze({});
|
|
654
|
+
function z4(J, X, Y = W4) {
|
|
655
|
+
let W = /* @__PURE__ */ new Map();
|
|
656
|
+
for (let g of Object.values(K)) W.set(g, L6(X, g));
|
|
657
|
+
let q = void 0, H = Array.isArray(J), B = [J], Q = -1, G = [], z = J, I = void 0, w = void 0, M = [], P = [];
|
|
658
|
+
do {
|
|
659
|
+
Q++;
|
|
660
|
+
let g = Q === B.length, Z0 = g && G.length !== 0;
|
|
661
|
+
if (g) {
|
|
662
|
+
if (I = P.length === 0 ? void 0 : M[M.length - 1], z = w, w = P.pop(), Z0) if (H) {
|
|
663
|
+
z = z.slice();
|
|
664
|
+
let C = 0;
|
|
665
|
+
for (let [o, z6] of G) {
|
|
666
|
+
let G6 = o - C;
|
|
667
|
+
if (z6 === null) z.splice(G6, 1), C++;
|
|
668
|
+
else z[G6] = z6;
|
|
669
|
+
}
|
|
670
|
+
} else {
|
|
671
|
+
z = { ...z };
|
|
672
|
+
for (let [C, o] of G) z[C] = o;
|
|
673
|
+
}
|
|
674
|
+
Q = q.index, B = q.keys, G = q.edits, H = q.inArray, q = q.prev;
|
|
675
|
+
} else if (w) {
|
|
676
|
+
if (I = H ? Q : B[Q], z = w[I], z === null || z === void 0) continue;
|
|
677
|
+
M.push(I);
|
|
678
|
+
}
|
|
679
|
+
let k;
|
|
680
|
+
if (!Array.isArray(z)) {
|
|
681
|
+
var N, _;
|
|
682
|
+
q4(z) || u(!1, `Invalid AST Node: ${e(z)}.`);
|
|
683
|
+
let C = g ? (N = W.get(z.kind)) === null || N === void 0 ? void 0 : N.leave : (_ = W.get(z.kind)) === null || _ === void 0 ? void 0 : _.enter;
|
|
684
|
+
if (k = C === null || C === void 0 ? void 0 : C.call(X, z, I, w, M, P), k === S6) break;
|
|
685
|
+
if (k === !1) {
|
|
686
|
+
if (!g) {
|
|
687
|
+
M.pop();
|
|
688
|
+
continue;
|
|
689
|
+
}
|
|
690
|
+
} else if (k !== void 0) {
|
|
691
|
+
if (G.push([I, k]), !g) if (q4(k)) z = k;
|
|
692
|
+
else {
|
|
693
|
+
M.pop();
|
|
694
|
+
continue;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
if (k === void 0 && Z0) G.push([I, z]);
|
|
699
|
+
if (g) M.pop();
|
|
700
|
+
else {
|
|
701
|
+
var d;
|
|
702
|
+
if (q = {
|
|
703
|
+
inArray: H,
|
|
704
|
+
index: Q,
|
|
705
|
+
keys: B,
|
|
706
|
+
edits: G,
|
|
707
|
+
prev: q
|
|
708
|
+
}, H = Array.isArray(z), B = H ? z : (d = Y[z.kind]) !== null && d !== void 0 ? d : [], Q = -1, G = [], w) P.push(w);
|
|
709
|
+
w = z;
|
|
710
|
+
}
|
|
711
|
+
} while (q !== void 0);
|
|
712
|
+
if (G.length !== 0) return G[G.length - 1][1];
|
|
713
|
+
return J;
|
|
714
|
+
}
|
|
715
|
+
function L6(J, X) {
|
|
716
|
+
let Y = J[X];
|
|
717
|
+
if (typeof Y === "object") return Y;
|
|
718
|
+
else if (typeof Y === "function") return {
|
|
719
|
+
enter: Y,
|
|
720
|
+
leave: void 0
|
|
721
|
+
};
|
|
722
|
+
return {
|
|
723
|
+
enter: J.enter,
|
|
724
|
+
leave: J.leave
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
function x0(J) {
|
|
728
|
+
return z4(J, J9);
|
|
729
|
+
}
|
|
730
|
+
var e8 = 80, J9 = {
|
|
731
|
+
Name: { leave: (J) => J.value },
|
|
732
|
+
Variable: { leave: (J) => "$" + J.name },
|
|
733
|
+
Document: { leave: (J) => D(J.definitions, `
|
|
734
|
+
|
|
735
|
+
`) },
|
|
736
|
+
OperationDefinition: { leave(J) {
|
|
737
|
+
let X = G4(J.variableDefinitions) ? A(`(
|
|
738
|
+
`, D(J.variableDefinitions, `
|
|
739
|
+
`), `
|
|
740
|
+
)`) : A("(", D(J.variableDefinitions, ", "), ")"), Y = A("", J.description, `
|
|
741
|
+
`) + D([
|
|
742
|
+
J.operation,
|
|
743
|
+
D([J.name, X]),
|
|
744
|
+
D(J.directives, " ")
|
|
745
|
+
], " ");
|
|
746
|
+
return (Y === "query" ? "" : Y + " ") + J.selectionSet;
|
|
747
|
+
} },
|
|
748
|
+
VariableDefinition: { leave: ({ variable: J, type: X, defaultValue: Y, directives: W, description: q }) => A("", q, `
|
|
749
|
+
`) + J + ": " + X + A(" = ", Y) + A(" ", D(W, " ")) },
|
|
750
|
+
SelectionSet: { leave: ({ selections: J }) => c(J) },
|
|
751
|
+
Field: { leave({ alias: J, name: X, arguments: Y, directives: W, selectionSet: q }) {
|
|
752
|
+
let H = A("", J, ": ") + X, B = H + A("(", D(Y, ", "), ")");
|
|
753
|
+
if (B.length > e8) B = H + A(`(
|
|
754
|
+
`, h0(D(Y, `
|
|
755
|
+
`)), `
|
|
756
|
+
)`);
|
|
757
|
+
return D([
|
|
758
|
+
B,
|
|
759
|
+
D(W, " "),
|
|
760
|
+
q
|
|
761
|
+
], " ");
|
|
762
|
+
} },
|
|
763
|
+
Argument: { leave: ({ name: J, value: X }) => J + ": " + X },
|
|
764
|
+
FragmentSpread: { leave: ({ name: J, directives: X }) => "..." + J + A(" ", D(X, " ")) },
|
|
765
|
+
InlineFragment: { leave: ({ typeCondition: J, directives: X, selectionSet: Y }) => D([
|
|
766
|
+
"...",
|
|
767
|
+
A("on ", J),
|
|
768
|
+
D(X, " "),
|
|
769
|
+
Y
|
|
770
|
+
], " ") },
|
|
771
|
+
FragmentDefinition: { leave: ({ name: J, typeCondition: X, variableDefinitions: Y, directives: W, selectionSet: q, description: H }) => A("", H, `
|
|
772
|
+
`) + `fragment ${J}${A("(", D(Y, ", "), ")")} on ${X} ${A("", D(W, " "), " ")}` + q },
|
|
773
|
+
IntValue: { leave: ({ value: J }) => J },
|
|
774
|
+
FloatValue: { leave: ({ value: J }) => J },
|
|
775
|
+
StringValue: { leave: ({ value: J, block: X }) => X ? A6(J) : N6(J) },
|
|
776
|
+
BooleanValue: { leave: ({ value: J }) => J ? "true" : "false" },
|
|
777
|
+
NullValue: { leave: () => "null" },
|
|
778
|
+
EnumValue: { leave: ({ value: J }) => J },
|
|
779
|
+
ListValue: { leave: ({ values: J }) => "[" + D(J, ", ") + "]" },
|
|
780
|
+
ObjectValue: { leave: ({ fields: J }) => "{" + D(J, ", ") + "}" },
|
|
781
|
+
ObjectField: { leave: ({ name: J, value: X }) => J + ": " + X },
|
|
782
|
+
Directive: { leave: ({ name: J, arguments: X }) => "@" + J + A("(", D(X, ", "), ")") },
|
|
783
|
+
NamedType: { leave: ({ name: J }) => J },
|
|
784
|
+
ListType: { leave: ({ type: J }) => "[" + J + "]" },
|
|
785
|
+
NonNullType: { leave: ({ type: J }) => J + "!" },
|
|
786
|
+
SchemaDefinition: { leave: ({ description: J, directives: X, operationTypes: Y }) => A("", J, `
|
|
787
|
+
`) + D([
|
|
788
|
+
"schema",
|
|
789
|
+
D(X, " "),
|
|
790
|
+
c(Y)
|
|
791
|
+
], " ") },
|
|
792
|
+
OperationTypeDefinition: { leave: ({ operation: J, type: X }) => J + ": " + X },
|
|
793
|
+
ScalarTypeDefinition: { leave: ({ description: J, name: X, directives: Y }) => A("", J, `
|
|
794
|
+
`) + D([
|
|
795
|
+
"scalar",
|
|
796
|
+
X,
|
|
797
|
+
D(Y, " ")
|
|
798
|
+
], " ") },
|
|
799
|
+
ObjectTypeDefinition: { leave: ({ description: J, name: X, interfaces: Y, directives: W, fields: q }) => A("", J, `
|
|
800
|
+
`) + D([
|
|
801
|
+
"type",
|
|
802
|
+
X,
|
|
803
|
+
A("implements ", D(Y, " & ")),
|
|
804
|
+
D(W, " "),
|
|
805
|
+
c(q)
|
|
806
|
+
], " ") },
|
|
807
|
+
FieldDefinition: { leave: ({ description: J, name: X, arguments: Y, type: W, directives: q }) => A("", J, `
|
|
808
|
+
`) + X + (G4(Y) ? A(`(
|
|
809
|
+
`, h0(D(Y, `
|
|
810
|
+
`)), `
|
|
811
|
+
)`) : A("(", D(Y, ", "), ")")) + ": " + W + A(" ", D(q, " ")) },
|
|
812
|
+
InputValueDefinition: { leave: ({ description: J, name: X, type: Y, defaultValue: W, directives: q }) => A("", J, `
|
|
813
|
+
`) + D([
|
|
814
|
+
X + ": " + Y,
|
|
815
|
+
A("= ", W),
|
|
816
|
+
D(q, " ")
|
|
817
|
+
], " ") },
|
|
818
|
+
InterfaceTypeDefinition: { leave: ({ description: J, name: X, interfaces: Y, directives: W, fields: q }) => A("", J, `
|
|
819
|
+
`) + D([
|
|
820
|
+
"interface",
|
|
821
|
+
X,
|
|
822
|
+
A("implements ", D(Y, " & ")),
|
|
823
|
+
D(W, " "),
|
|
824
|
+
c(q)
|
|
825
|
+
], " ") },
|
|
826
|
+
UnionTypeDefinition: { leave: ({ description: J, name: X, directives: Y, types: W }) => A("", J, `
|
|
827
|
+
`) + D([
|
|
828
|
+
"union",
|
|
829
|
+
X,
|
|
830
|
+
D(Y, " "),
|
|
831
|
+
A("= ", D(W, " | "))
|
|
832
|
+
], " ") },
|
|
833
|
+
EnumTypeDefinition: { leave: ({ description: J, name: X, directives: Y, values: W }) => A("", J, `
|
|
834
|
+
`) + D([
|
|
835
|
+
"enum",
|
|
836
|
+
X,
|
|
837
|
+
D(Y, " "),
|
|
838
|
+
c(W)
|
|
839
|
+
], " ") },
|
|
840
|
+
EnumValueDefinition: { leave: ({ description: J, name: X, directives: Y }) => A("", J, `
|
|
841
|
+
`) + D([X, D(Y, " ")], " ") },
|
|
842
|
+
InputObjectTypeDefinition: { leave: ({ description: J, name: X, directives: Y, fields: W }) => A("", J, `
|
|
843
|
+
`) + D([
|
|
844
|
+
"input",
|
|
845
|
+
X,
|
|
846
|
+
D(Y, " "),
|
|
847
|
+
c(W)
|
|
848
|
+
], " ") },
|
|
849
|
+
DirectiveDefinition: { leave: ({ description: J, name: X, arguments: Y, repeatable: W, locations: q }) => A("", J, `
|
|
850
|
+
`) + "directive @" + X + (G4(Y) ? A(`(
|
|
851
|
+
`, h0(D(Y, `
|
|
852
|
+
`)), `
|
|
853
|
+
)`) : A("(", D(Y, ", "), ")")) + (W ? " repeatable" : "") + " on " + D(q, " | ") },
|
|
854
|
+
SchemaExtension: { leave: ({ directives: J, operationTypes: X }) => D([
|
|
855
|
+
"extend schema",
|
|
856
|
+
D(J, " "),
|
|
857
|
+
c(X)
|
|
858
|
+
], " ") },
|
|
859
|
+
ScalarTypeExtension: { leave: ({ name: J, directives: X }) => D([
|
|
860
|
+
"extend scalar",
|
|
861
|
+
J,
|
|
862
|
+
D(X, " ")
|
|
863
|
+
], " ") },
|
|
864
|
+
ObjectTypeExtension: { leave: ({ name: J, interfaces: X, directives: Y, fields: W }) => D([
|
|
865
|
+
"extend type",
|
|
866
|
+
J,
|
|
867
|
+
A("implements ", D(X, " & ")),
|
|
868
|
+
D(Y, " "),
|
|
869
|
+
c(W)
|
|
870
|
+
], " ") },
|
|
871
|
+
InterfaceTypeExtension: { leave: ({ name: J, interfaces: X, directives: Y, fields: W }) => D([
|
|
872
|
+
"extend interface",
|
|
873
|
+
J,
|
|
874
|
+
A("implements ", D(X, " & ")),
|
|
875
|
+
D(Y, " "),
|
|
876
|
+
c(W)
|
|
877
|
+
], " ") },
|
|
878
|
+
UnionTypeExtension: { leave: ({ name: J, directives: X, types: Y }) => D([
|
|
879
|
+
"extend union",
|
|
880
|
+
J,
|
|
881
|
+
D(X, " "),
|
|
882
|
+
A("= ", D(Y, " | "))
|
|
883
|
+
], " ") },
|
|
884
|
+
EnumTypeExtension: { leave: ({ name: J, directives: X, values: Y }) => D([
|
|
885
|
+
"extend enum",
|
|
886
|
+
J,
|
|
887
|
+
D(X, " "),
|
|
888
|
+
c(Y)
|
|
889
|
+
], " ") },
|
|
890
|
+
InputObjectTypeExtension: { leave: ({ name: J, directives: X, fields: Y }) => D([
|
|
891
|
+
"extend input",
|
|
892
|
+
J,
|
|
893
|
+
D(X, " "),
|
|
894
|
+
c(Y)
|
|
895
|
+
], " ") },
|
|
896
|
+
TypeCoordinate: { leave: ({ name: J }) => J },
|
|
897
|
+
MemberCoordinate: { leave: ({ name: J, memberName: X }) => D([J, A(".", X)]) },
|
|
898
|
+
ArgumentCoordinate: { leave: ({ name: J, fieldName: X, argumentName: Y }) => D([
|
|
899
|
+
J,
|
|
900
|
+
A(".", X),
|
|
901
|
+
A("(", Y, ":)")
|
|
902
|
+
]) },
|
|
903
|
+
DirectiveCoordinate: { leave: ({ name: J }) => D(["@", J]) },
|
|
904
|
+
DirectiveArgumentCoordinate: { leave: ({ name: J, argumentName: X }) => D([
|
|
905
|
+
"@",
|
|
906
|
+
J,
|
|
907
|
+
A("(", X, ":)")
|
|
908
|
+
]) }
|
|
909
|
+
};
|
|
910
|
+
function D(J, X = "") {
|
|
911
|
+
var Y;
|
|
912
|
+
return (Y = J === null || J === void 0 ? void 0 : J.filter((W) => W).join(X)) !== null && Y !== void 0 ? Y : "";
|
|
913
|
+
}
|
|
914
|
+
function c(J) {
|
|
915
|
+
return A(`{
|
|
916
|
+
`, h0(D(J, `
|
|
917
|
+
`)), `
|
|
918
|
+
}`);
|
|
919
|
+
}
|
|
920
|
+
function A(J, X, Y = "") {
|
|
921
|
+
return X != null && X !== "" ? J + X + Y : "";
|
|
922
|
+
}
|
|
923
|
+
function h0(J) {
|
|
924
|
+
return A(" ", J.replace(/\n/g, `
|
|
925
|
+
`));
|
|
926
|
+
}
|
|
927
|
+
function G4(J) {
|
|
928
|
+
var X;
|
|
929
|
+
return (X = J === null || J === void 0 ? void 0 : J.some((Y) => Y.includes(`
|
|
930
|
+
`))) !== null && X !== void 0 ? X : !1;
|
|
931
|
+
}
|
|
932
|
+
function v0(J, X) {
|
|
933
|
+
switch (J.kind) {
|
|
934
|
+
case K.NULL: return null;
|
|
935
|
+
case K.INT: return parseInt(J.value, 10);
|
|
936
|
+
case K.FLOAT: return parseFloat(J.value);
|
|
937
|
+
case K.STRING:
|
|
938
|
+
case K.ENUM:
|
|
939
|
+
case K.BOOLEAN: return J.value;
|
|
940
|
+
case K.LIST: return J.values.map((Y) => v0(Y, X));
|
|
941
|
+
case K.OBJECT: return k0(J.fields, (Y) => Y.name.value, (Y) => v0(Y.value, X));
|
|
942
|
+
case K.VARIABLE: return X === null || X === void 0 ? void 0 : X[J.name.value];
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
function w0(J) {
|
|
946
|
+
if (J ?? u(!1, "Must provide name."), typeof J === "string" || u(!1, "Expected name to be a string."), J.length === 0) throw new h("Expected name to be a non-empty string.");
|
|
947
|
+
for (let X = 1; X < J.length; ++X) if (!M6(J.charCodeAt(X))) throw new h(`Names must only contain [_a-zA-Z0-9] but "${J}" does not.`);
|
|
948
|
+
if (!O6(J.charCodeAt(0))) throw new h(`Names must start with [_a-zA-Z] but "${J}" does not.`);
|
|
949
|
+
return J;
|
|
950
|
+
}
|
|
951
|
+
function U4(J) {
|
|
952
|
+
if (J === "true" || J === "false" || J === "null") throw new h(`Enum values cannot be named: ${J}`);
|
|
953
|
+
return w0(J);
|
|
954
|
+
}
|
|
955
|
+
var D0 = class {
|
|
956
|
+
constructor(J) {
|
|
957
|
+
var X, Y, W, q;
|
|
958
|
+
let H = (X = J.parseValue) !== null && X !== void 0 ? X : B4;
|
|
959
|
+
if (this.name = w0(J.name), this.description = J.description, this.specifiedByURL = J.specifiedByURL, this.serialize = (Y = J.serialize) !== null && Y !== void 0 ? Y : B4, this.parseValue = H, this.parseLiteral = (W = J.parseLiteral) !== null && W !== void 0 ? W : (B, Q) => H(v0(B, Q)), this.extensions = j0(J.extensions), this.astNode = J.astNode, this.extensionASTNodes = (q = J.extensionASTNodes) !== null && q !== void 0 ? q : [], J.specifiedByURL == null || typeof J.specifiedByURL === "string" || u(!1, `${this.name} must provide "specifiedByURL" as a string, but got: ${e(J.specifiedByURL)}.`), J.serialize == null || typeof J.serialize === "function" || u(!1, `${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`), J.parseLiteral) typeof J.parseValue === "function" && typeof J.parseLiteral === "function" || u(!1, `${this.name} must provide both "parseValue" and "parseLiteral" functions.`);
|
|
960
|
+
}
|
|
961
|
+
get [Symbol.toStringTag]() {
|
|
962
|
+
return "GraphQLScalarType";
|
|
963
|
+
}
|
|
964
|
+
toConfig() {
|
|
965
|
+
return {
|
|
966
|
+
name: this.name,
|
|
967
|
+
description: this.description,
|
|
968
|
+
specifiedByURL: this.specifiedByURL,
|
|
969
|
+
serialize: this.serialize,
|
|
970
|
+
parseValue: this.parseValue,
|
|
971
|
+
parseLiteral: this.parseLiteral,
|
|
972
|
+
extensions: this.extensions,
|
|
973
|
+
astNode: this.astNode,
|
|
974
|
+
extensionASTNodes: this.extensionASTNodes
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
toString() {
|
|
978
|
+
return this.name;
|
|
979
|
+
}
|
|
980
|
+
toJSON() {
|
|
981
|
+
return this.toString();
|
|
982
|
+
}
|
|
983
|
+
};
|
|
984
|
+
function Z6(J) {
|
|
985
|
+
return _0(J) && !Array.isArray(J);
|
|
986
|
+
}
|
|
987
|
+
var P0 = class {
|
|
988
|
+
constructor(J) {
|
|
989
|
+
var X;
|
|
990
|
+
this.name = w0(J.name), this.description = J.description, this.extensions = j0(J.extensions), this.astNode = J.astNode, this.extensionASTNodes = (X = J.extensionASTNodes) !== null && X !== void 0 ? X : [], this._values = typeof J.values === "function" ? J.values : _6(this.name, J.values), this._valueLookup = null, this._nameLookup = null;
|
|
991
|
+
}
|
|
992
|
+
get [Symbol.toStringTag]() {
|
|
993
|
+
return "GraphQLEnumType";
|
|
994
|
+
}
|
|
995
|
+
getValues() {
|
|
996
|
+
if (typeof this._values === "function") this._values = _6(this.name, this._values());
|
|
997
|
+
return this._values;
|
|
998
|
+
}
|
|
999
|
+
getValue(J) {
|
|
1000
|
+
if (this._nameLookup === null) this._nameLookup = E6(this.getValues(), (X) => X.name);
|
|
1001
|
+
return this._nameLookup[J];
|
|
1002
|
+
}
|
|
1003
|
+
serialize(J) {
|
|
1004
|
+
if (this._valueLookup === null) this._valueLookup = new Map(this.getValues().map((Y) => [Y.value, Y]));
|
|
1005
|
+
let X = this._valueLookup.get(J);
|
|
1006
|
+
if (X === void 0) throw new h(`Enum "${this.name}" cannot represent value: ${e(J)}`);
|
|
1007
|
+
return X.name;
|
|
1008
|
+
}
|
|
1009
|
+
parseValue(J) {
|
|
1010
|
+
if (typeof J !== "string") {
|
|
1011
|
+
let Y = e(J);
|
|
1012
|
+
throw new h(`Enum "${this.name}" cannot represent non-string value: ${Y}.` + g0(this, Y));
|
|
1013
|
+
}
|
|
1014
|
+
let X = this.getValue(J);
|
|
1015
|
+
if (X == null) throw new h(`Value "${J}" does not exist in "${this.name}" enum.` + g0(this, J));
|
|
1016
|
+
return X.value;
|
|
1017
|
+
}
|
|
1018
|
+
parseLiteral(J, X) {
|
|
1019
|
+
if (J.kind !== K.ENUM) {
|
|
1020
|
+
let W = x0(J);
|
|
1021
|
+
throw new h(`Enum "${this.name}" cannot represent non-enum value: ${W}.` + g0(this, W), { nodes: J });
|
|
1022
|
+
}
|
|
1023
|
+
let Y = this.getValue(J.value);
|
|
1024
|
+
if (Y == null) {
|
|
1025
|
+
let W = x0(J);
|
|
1026
|
+
throw new h(`Value "${W}" does not exist in "${this.name}" enum.` + g0(this, W), { nodes: J });
|
|
1027
|
+
}
|
|
1028
|
+
return Y.value;
|
|
1029
|
+
}
|
|
1030
|
+
toConfig() {
|
|
1031
|
+
let J = k0(this.getValues(), (X) => X.name, (X) => ({
|
|
1032
|
+
description: X.description,
|
|
1033
|
+
value: X.value,
|
|
1034
|
+
deprecationReason: X.deprecationReason,
|
|
1035
|
+
extensions: X.extensions,
|
|
1036
|
+
astNode: X.astNode
|
|
1037
|
+
}));
|
|
1038
|
+
return {
|
|
1039
|
+
name: this.name,
|
|
1040
|
+
description: this.description,
|
|
1041
|
+
values: J,
|
|
1042
|
+
extensions: this.extensions,
|
|
1043
|
+
astNode: this.astNode,
|
|
1044
|
+
extensionASTNodes: this.extensionASTNodes
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
toString() {
|
|
1048
|
+
return this.name;
|
|
1049
|
+
}
|
|
1050
|
+
toJSON() {
|
|
1051
|
+
return this.toString();
|
|
1052
|
+
}
|
|
1053
|
+
};
|
|
1054
|
+
function g0(J, X) {
|
|
1055
|
+
return F6("the enum value", V6(X, J.getValues().map((q) => q.name)));
|
|
1056
|
+
}
|
|
1057
|
+
function _6(J, X) {
|
|
1058
|
+
return Z6(X) || u(!1, `${J} values must be an object with value names as keys.`), Object.entries(X).map(([Y, W]) => {
|
|
1059
|
+
return Z6(W) || u(!1, `${J}.${Y} must refer to an object with a "value" key representing an internal value but got: ${e(W)}.`), {
|
|
1060
|
+
name: U4(Y),
|
|
1061
|
+
description: W.description,
|
|
1062
|
+
value: W.value !== void 0 ? W.value : Y,
|
|
1063
|
+
deprecationReason: W.deprecationReason,
|
|
1064
|
+
extensions: j0(W.extensions),
|
|
1065
|
+
astNode: W.astNode
|
|
1066
|
+
};
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
var Z = class extends D0 {
|
|
1070
|
+
zodSchema;
|
|
1071
|
+
jsonSchemaDef;
|
|
1072
|
+
constructor(J) {
|
|
1073
|
+
super(J);
|
|
1074
|
+
this.zodSchema = J.zod, this.jsonSchemaDef = J.jsonSchema;
|
|
1075
|
+
}
|
|
1076
|
+
getZod() {
|
|
1077
|
+
return this.zodSchema;
|
|
1078
|
+
}
|
|
1079
|
+
getPothos() {
|
|
1080
|
+
return this;
|
|
1081
|
+
}
|
|
1082
|
+
getJson() {
|
|
1083
|
+
return typeof this.jsonSchemaDef === "function" ? this.jsonSchemaDef() : this.jsonSchemaDef;
|
|
1084
|
+
}
|
|
1085
|
+
getJsonSchemaDef() {
|
|
1086
|
+
return this.jsonSchemaDef;
|
|
1087
|
+
}
|
|
1088
|
+
getJsonSchema() {
|
|
1089
|
+
let J = (X) => {
|
|
1090
|
+
let Y = typeof X === "function" ? X() : X;
|
|
1091
|
+
if (Array.isArray(Y)) return Y.map((W) => J(W));
|
|
1092
|
+
if (Y && typeof Y === "object") {
|
|
1093
|
+
let W = {};
|
|
1094
|
+
for (let [q, H] of Object.entries(Y)) W[q] = J(H);
|
|
1095
|
+
return W;
|
|
1096
|
+
}
|
|
1097
|
+
return Y;
|
|
1098
|
+
};
|
|
1099
|
+
return J(this.getJson());
|
|
1100
|
+
}
|
|
1101
|
+
};
|
|
1102
|
+
Object.freeze({ status: "aborted" });
|
|
1103
|
+
function U(J, X, Y) {
|
|
1104
|
+
function W(Q, G) {
|
|
1105
|
+
if (!Q._zod) Object.defineProperty(Q, "_zod", {
|
|
1106
|
+
value: {
|
|
1107
|
+
def: G,
|
|
1108
|
+
constr: B,
|
|
1109
|
+
traits: /* @__PURE__ */ new Set()
|
|
1110
|
+
},
|
|
1111
|
+
enumerable: !1
|
|
1112
|
+
});
|
|
1113
|
+
if (Q._zod.traits.has(J)) return;
|
|
1114
|
+
Q._zod.traits.add(J), X(Q, G);
|
|
1115
|
+
let z = B.prototype, I = Object.keys(z);
|
|
1116
|
+
for (let w = 0; w < I.length; w++) {
|
|
1117
|
+
let M = I[w];
|
|
1118
|
+
if (!(M in Q)) Q[M] = z[M].bind(Q);
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
let q = Y?.Parent ?? Object;
|
|
1122
|
+
class H extends q {}
|
|
1123
|
+
Object.defineProperty(H, "name", { value: J });
|
|
1124
|
+
function B(Q) {
|
|
1125
|
+
var G;
|
|
1126
|
+
let z = Y?.Parent ? new H() : this;
|
|
1127
|
+
W(z, Q), (G = z._zod).deferred ?? (G.deferred = []);
|
|
1128
|
+
for (let I of z._zod.deferred) I();
|
|
1129
|
+
return z;
|
|
1130
|
+
}
|
|
1131
|
+
return Object.defineProperty(B, "init", { value: W }), Object.defineProperty(B, Symbol.hasInstance, { value: (Q) => {
|
|
1132
|
+
if (Y?.Parent && Q instanceof Y.Parent) return !0;
|
|
1133
|
+
return Q?._zod?.traits?.has(J);
|
|
1134
|
+
} }), Object.defineProperty(B, "name", { value: J }), B;
|
|
1135
|
+
}
|
|
1136
|
+
var r = class extends Error {
|
|
1137
|
+
constructor() {
|
|
1138
|
+
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
1139
|
+
}
|
|
1140
|
+
};
|
|
1141
|
+
var O0 = class extends Error {
|
|
1142
|
+
constructor(J) {
|
|
1143
|
+
super(`Encountered unidirectional transform during encode: ${J}`);
|
|
1144
|
+
this.name = "ZodEncodeError";
|
|
1145
|
+
}
|
|
1146
|
+
};
|
|
1147
|
+
var u0 = {};
|
|
1148
|
+
function v(J) {
|
|
1149
|
+
if (J) Object.assign(u0, J);
|
|
1150
|
+
return u0;
|
|
1151
|
+
}
|
|
1152
|
+
var F = {};
|
|
1153
|
+
U6(F, {
|
|
1154
|
+
unwrapMessage: () => M0,
|
|
1155
|
+
uint8ArrayToHex: () => AX,
|
|
1156
|
+
uint8ArrayToBase64url: () => OX,
|
|
1157
|
+
uint8ArrayToBase64: () => x6,
|
|
1158
|
+
stringifyPrimitive: () => f0,
|
|
1159
|
+
slugify: () => D4,
|
|
1160
|
+
shallowClone: () => C6,
|
|
1161
|
+
safeExtend: () => GX,
|
|
1162
|
+
required: () => wX,
|
|
1163
|
+
randomString: () => YX,
|
|
1164
|
+
propertyKeyTypes: () => O4,
|
|
1165
|
+
promiseAllObject: () => XX,
|
|
1166
|
+
primitiveTypes: () => k6,
|
|
1167
|
+
prefixIssues: () => l,
|
|
1168
|
+
pick: () => BX,
|
|
1169
|
+
partial: () => IX,
|
|
1170
|
+
optionalKeys: () => M4,
|
|
1171
|
+
omit: () => QX,
|
|
1172
|
+
objectClone: () => s9,
|
|
1173
|
+
numKeys: () => WX,
|
|
1174
|
+
nullish: () => E0,
|
|
1175
|
+
normalizeParams: () => O,
|
|
1176
|
+
mergeDefs: () => i,
|
|
1177
|
+
merge: () => UX,
|
|
1178
|
+
jsonStringifyReplacer: () => H0,
|
|
1179
|
+
joinValues: () => c0,
|
|
1180
|
+
issue: () => B0,
|
|
1181
|
+
isPlainObject: () => t,
|
|
1182
|
+
isObject: () => q0,
|
|
1183
|
+
hexToUint8Array: () => MX,
|
|
1184
|
+
getSizableOrigin: () => j6,
|
|
1185
|
+
getParsedType: () => qX,
|
|
1186
|
+
getLengthableOrigin: () => K0,
|
|
1187
|
+
getEnumValues: () => A0,
|
|
1188
|
+
getElementAtPath: () => JX,
|
|
1189
|
+
floatSafeRemainder: () => w4,
|
|
1190
|
+
finalizeIssue: () => m,
|
|
1191
|
+
extend: () => zX,
|
|
1192
|
+
escapeRegex: () => J0,
|
|
1193
|
+
esc: () => y0,
|
|
1194
|
+
defineLazy: () => E,
|
|
1195
|
+
createTransparentProxy: () => HX,
|
|
1196
|
+
cloneDef: () => e9,
|
|
1197
|
+
clone: () => y,
|
|
1198
|
+
cleanRegex: () => $0,
|
|
1199
|
+
cleanEnum: () => DX,
|
|
1200
|
+
captureStackTrace: () => m0,
|
|
1201
|
+
cached: () => F0,
|
|
1202
|
+
base64urlToUint8Array: () => PX,
|
|
1203
|
+
base64ToUint8Array: () => h6,
|
|
1204
|
+
assignProp: () => n,
|
|
1205
|
+
assertNotEqual: () => n9,
|
|
1206
|
+
assertNever: () => t9,
|
|
1207
|
+
assertIs: () => i9,
|
|
1208
|
+
assertEqual: () => d9,
|
|
1209
|
+
assert: () => a9,
|
|
1210
|
+
allowsEval: () => P4,
|
|
1211
|
+
aborted: () => a,
|
|
1212
|
+
NUMBER_FORMAT_RANGES: () => A4,
|
|
1213
|
+
Class: () => v6,
|
|
1214
|
+
BIGINT_FORMAT_RANGES: () => T6
|
|
1215
|
+
});
|
|
1216
|
+
function d9(J) {
|
|
1217
|
+
return J;
|
|
1218
|
+
}
|
|
1219
|
+
function n9(J) {
|
|
1220
|
+
return J;
|
|
1221
|
+
}
|
|
1222
|
+
function i9(J) {}
|
|
1223
|
+
function t9(J) {
|
|
1224
|
+
throw Error("Unexpected value in exhaustive check");
|
|
1225
|
+
}
|
|
1226
|
+
function a9(J) {}
|
|
1227
|
+
function A0(J) {
|
|
1228
|
+
let X = Object.values(J).filter((W) => typeof W === "number");
|
|
1229
|
+
return Object.entries(J).filter(([W, q]) => X.indexOf(+W) === -1).map(([W, q]) => q);
|
|
1230
|
+
}
|
|
1231
|
+
function c0(J, X = "|") {
|
|
1232
|
+
return J.map((Y) => f0(Y)).join(X);
|
|
1233
|
+
}
|
|
1234
|
+
function H0(J, X) {
|
|
1235
|
+
if (typeof X === "bigint") return X.toString();
|
|
1236
|
+
return X;
|
|
1237
|
+
}
|
|
1238
|
+
function F0(J) {
|
|
1239
|
+
return { get value() {
|
|
1240
|
+
{
|
|
1241
|
+
let Y = J();
|
|
1242
|
+
return Object.defineProperty(this, "value", { value: Y }), Y;
|
|
1243
|
+
}
|
|
1244
|
+
throw Error("cached value already set");
|
|
1245
|
+
} };
|
|
1246
|
+
}
|
|
1247
|
+
function E0(J) {
|
|
1248
|
+
return J === null || J === void 0;
|
|
1249
|
+
}
|
|
1250
|
+
function $0(J) {
|
|
1251
|
+
let X = J.startsWith("^") ? 1 : 0, Y = J.endsWith("$") ? J.length - 1 : J.length;
|
|
1252
|
+
return J.slice(X, Y);
|
|
1253
|
+
}
|
|
1254
|
+
function w4(J, X) {
|
|
1255
|
+
let Y = (J.toString().split(".")[1] || "").length, W = X.toString(), q = (W.split(".")[1] || "").length;
|
|
1256
|
+
if (q === 0 && /\d?e-\d?/.test(W)) {
|
|
1257
|
+
let G = W.match(/\d?e-(\d?)/);
|
|
1258
|
+
if (G?.[1]) q = Number.parseInt(G[1]);
|
|
1259
|
+
}
|
|
1260
|
+
let H = Y > q ? Y : q;
|
|
1261
|
+
return Number.parseInt(J.toFixed(H).replace(".", "")) % Number.parseInt(X.toFixed(H).replace(".", "")) / 10 ** H;
|
|
1262
|
+
}
|
|
1263
|
+
var b6 = Symbol("evaluating");
|
|
1264
|
+
function E(J, X, Y) {
|
|
1265
|
+
let W = void 0;
|
|
1266
|
+
Object.defineProperty(J, X, {
|
|
1267
|
+
get() {
|
|
1268
|
+
if (W === b6) return;
|
|
1269
|
+
if (W === void 0) W = b6, W = Y();
|
|
1270
|
+
return W;
|
|
1271
|
+
},
|
|
1272
|
+
set(q) {
|
|
1273
|
+
Object.defineProperty(J, X, { value: q });
|
|
1274
|
+
},
|
|
1275
|
+
configurable: !0
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
function s9(J) {
|
|
1279
|
+
return Object.create(Object.getPrototypeOf(J), Object.getOwnPropertyDescriptors(J));
|
|
1280
|
+
}
|
|
1281
|
+
function n(J, X, Y) {
|
|
1282
|
+
Object.defineProperty(J, X, {
|
|
1283
|
+
value: Y,
|
|
1284
|
+
writable: !0,
|
|
1285
|
+
enumerable: !0,
|
|
1286
|
+
configurable: !0
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1289
|
+
function i(...J) {
|
|
1290
|
+
let X = {};
|
|
1291
|
+
for (let Y of J) {
|
|
1292
|
+
let W = Object.getOwnPropertyDescriptors(Y);
|
|
1293
|
+
Object.assign(X, W);
|
|
1294
|
+
}
|
|
1295
|
+
return Object.defineProperties({}, X);
|
|
1296
|
+
}
|
|
1297
|
+
function e9(J) {
|
|
1298
|
+
return i(J._zod.def);
|
|
1299
|
+
}
|
|
1300
|
+
function JX(J, X) {
|
|
1301
|
+
if (!X) return J;
|
|
1302
|
+
return X.reduce((Y, W) => Y?.[W], J);
|
|
1303
|
+
}
|
|
1304
|
+
function XX(J) {
|
|
1305
|
+
let X = Object.keys(J), Y = X.map((W) => J[W]);
|
|
1306
|
+
return Promise.all(Y).then((W) => {
|
|
1307
|
+
let q = {};
|
|
1308
|
+
for (let H = 0; H < X.length; H++) q[X[H]] = W[H];
|
|
1309
|
+
return q;
|
|
1310
|
+
});
|
|
1311
|
+
}
|
|
1312
|
+
function YX(J = 10) {
|
|
1313
|
+
let Y = "";
|
|
1314
|
+
for (let W = 0; W < J; W++) Y += "abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random() * 26)];
|
|
1315
|
+
return Y;
|
|
1316
|
+
}
|
|
1317
|
+
function y0(J) {
|
|
1318
|
+
return JSON.stringify(J);
|
|
1319
|
+
}
|
|
1320
|
+
function D4(J) {
|
|
1321
|
+
return J.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1322
|
+
}
|
|
1323
|
+
var m0 = "captureStackTrace" in Error ? Error.captureStackTrace : (...J) => {};
|
|
1324
|
+
function q0(J) {
|
|
1325
|
+
return typeof J === "object" && J !== null && !Array.isArray(J);
|
|
1326
|
+
}
|
|
1327
|
+
var P4 = F0(() => {
|
|
1328
|
+
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
|
|
1329
|
+
try {
|
|
1330
|
+
return new Function(""), !0;
|
|
1331
|
+
} catch (J) {
|
|
1332
|
+
return !1;
|
|
1333
|
+
}
|
|
1334
|
+
});
|
|
1335
|
+
function t(J) {
|
|
1336
|
+
if (q0(J) === !1) return !1;
|
|
1337
|
+
let X = J.constructor;
|
|
1338
|
+
if (X === void 0) return !0;
|
|
1339
|
+
if (typeof X !== "function") return !0;
|
|
1340
|
+
let Y = X.prototype;
|
|
1341
|
+
if (q0(Y) === !1) return !1;
|
|
1342
|
+
if (Object.prototype.hasOwnProperty.call(Y, "isPrototypeOf") === !1) return !1;
|
|
1343
|
+
return !0;
|
|
1344
|
+
}
|
|
1345
|
+
function C6(J) {
|
|
1346
|
+
if (t(J)) return { ...J };
|
|
1347
|
+
if (Array.isArray(J)) return [...J];
|
|
1348
|
+
return J;
|
|
1349
|
+
}
|
|
1350
|
+
function WX(J) {
|
|
1351
|
+
let X = 0;
|
|
1352
|
+
for (let Y in J) if (Object.prototype.hasOwnProperty.call(J, Y)) X++;
|
|
1353
|
+
return X;
|
|
1354
|
+
}
|
|
1355
|
+
var qX = (J) => {
|
|
1356
|
+
let X = typeof J;
|
|
1357
|
+
switch (X) {
|
|
1358
|
+
case "undefined": return "undefined";
|
|
1359
|
+
case "string": return "string";
|
|
1360
|
+
case "number": return Number.isNaN(J) ? "nan" : "number";
|
|
1361
|
+
case "boolean": return "boolean";
|
|
1362
|
+
case "function": return "function";
|
|
1363
|
+
case "bigint": return "bigint";
|
|
1364
|
+
case "symbol": return "symbol";
|
|
1365
|
+
case "object":
|
|
1366
|
+
if (Array.isArray(J)) return "array";
|
|
1367
|
+
if (J === null) return "null";
|
|
1368
|
+
if (J.then && typeof J.then === "function" && J.catch && typeof J.catch === "function") return "promise";
|
|
1369
|
+
if (typeof Map < "u" && J instanceof Map) return "map";
|
|
1370
|
+
if (typeof Set < "u" && J instanceof Set) return "set";
|
|
1371
|
+
if (typeof Date < "u" && J instanceof Date) return "date";
|
|
1372
|
+
if (typeof File < "u" && J instanceof File) return "file";
|
|
1373
|
+
return "object";
|
|
1374
|
+
default: throw Error(`Unknown data type: ${X}`);
|
|
1375
|
+
}
|
|
1376
|
+
}, O4 = new Set([
|
|
1377
|
+
"string",
|
|
1378
|
+
"number",
|
|
1379
|
+
"symbol"
|
|
1380
|
+
]), k6 = new Set([
|
|
1381
|
+
"string",
|
|
1382
|
+
"number",
|
|
1383
|
+
"bigint",
|
|
1384
|
+
"boolean",
|
|
1385
|
+
"symbol",
|
|
1386
|
+
"undefined"
|
|
1387
|
+
]);
|
|
1388
|
+
function J0(J) {
|
|
1389
|
+
return J.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1390
|
+
}
|
|
1391
|
+
function y(J, X, Y) {
|
|
1392
|
+
let W = new J._zod.constr(X ?? J._zod.def);
|
|
1393
|
+
if (!X || Y?.parent) W._zod.parent = J;
|
|
1394
|
+
return W;
|
|
1395
|
+
}
|
|
1396
|
+
function O(J) {
|
|
1397
|
+
let X = J;
|
|
1398
|
+
if (!X) return {};
|
|
1399
|
+
if (typeof X === "string") return { error: () => X };
|
|
1400
|
+
if (X?.message !== void 0) {
|
|
1401
|
+
if (X?.error !== void 0) throw Error("Cannot specify both `message` and `error` params");
|
|
1402
|
+
X.error = X.message;
|
|
1403
|
+
}
|
|
1404
|
+
if (delete X.message, typeof X.error === "string") return {
|
|
1405
|
+
...X,
|
|
1406
|
+
error: () => X.error
|
|
1407
|
+
};
|
|
1408
|
+
return X;
|
|
1409
|
+
}
|
|
1410
|
+
function HX(J) {
|
|
1411
|
+
let X;
|
|
1412
|
+
return new Proxy({}, {
|
|
1413
|
+
get(Y, W, q) {
|
|
1414
|
+
return X ?? (X = J()), Reflect.get(X, W, q);
|
|
1415
|
+
},
|
|
1416
|
+
set(Y, W, q, H) {
|
|
1417
|
+
return X ?? (X = J()), Reflect.set(X, W, q, H);
|
|
1418
|
+
},
|
|
1419
|
+
has(Y, W) {
|
|
1420
|
+
return X ?? (X = J()), Reflect.has(X, W);
|
|
1421
|
+
},
|
|
1422
|
+
deleteProperty(Y, W) {
|
|
1423
|
+
return X ?? (X = J()), Reflect.deleteProperty(X, W);
|
|
1424
|
+
},
|
|
1425
|
+
ownKeys(Y) {
|
|
1426
|
+
return X ?? (X = J()), Reflect.ownKeys(X);
|
|
1427
|
+
},
|
|
1428
|
+
getOwnPropertyDescriptor(Y, W) {
|
|
1429
|
+
return X ?? (X = J()), Reflect.getOwnPropertyDescriptor(X, W);
|
|
1430
|
+
},
|
|
1431
|
+
defineProperty(Y, W, q) {
|
|
1432
|
+
return X ?? (X = J()), Reflect.defineProperty(X, W, q);
|
|
1433
|
+
}
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
function f0(J) {
|
|
1437
|
+
if (typeof J === "bigint") return J.toString() + "n";
|
|
1438
|
+
if (typeof J === "string") return `"${J}"`;
|
|
1439
|
+
return `${J}`;
|
|
1440
|
+
}
|
|
1441
|
+
function M4(J) {
|
|
1442
|
+
return Object.keys(J).filter((X) => {
|
|
1443
|
+
return J[X]._zod.optin === "optional" && J[X]._zod.optout === "optional";
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
var A4 = {
|
|
1447
|
+
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
1448
|
+
int32: [-2147483648, 2147483647],
|
|
1449
|
+
uint32: [0, 4294967295],
|
|
1450
|
+
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
1451
|
+
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
1452
|
+
}, T6 = {
|
|
1453
|
+
int64: [BigInt("-9223372036854775808"), BigInt("9223372036854775807")],
|
|
1454
|
+
uint64: [BigInt(0), BigInt("18446744073709551615")]
|
|
1455
|
+
};
|
|
1456
|
+
function BX(J, X) {
|
|
1457
|
+
let Y = J._zod.def;
|
|
1458
|
+
return y(J, i(J._zod.def, {
|
|
1459
|
+
get shape() {
|
|
1460
|
+
let q = {};
|
|
1461
|
+
for (let H in X) {
|
|
1462
|
+
if (!(H in Y.shape)) throw Error(`Unrecognized key: "${H}"`);
|
|
1463
|
+
if (!X[H]) continue;
|
|
1464
|
+
q[H] = Y.shape[H];
|
|
1465
|
+
}
|
|
1466
|
+
return n(this, "shape", q), q;
|
|
1467
|
+
},
|
|
1468
|
+
checks: []
|
|
1469
|
+
}));
|
|
1470
|
+
}
|
|
1471
|
+
function QX(J, X) {
|
|
1472
|
+
let Y = J._zod.def;
|
|
1473
|
+
return y(J, i(J._zod.def, {
|
|
1474
|
+
get shape() {
|
|
1475
|
+
let q = { ...J._zod.def.shape };
|
|
1476
|
+
for (let H in X) {
|
|
1477
|
+
if (!(H in Y.shape)) throw Error(`Unrecognized key: "${H}"`);
|
|
1478
|
+
if (!X[H]) continue;
|
|
1479
|
+
delete q[H];
|
|
1480
|
+
}
|
|
1481
|
+
return n(this, "shape", q), q;
|
|
1482
|
+
},
|
|
1483
|
+
checks: []
|
|
1484
|
+
}));
|
|
1485
|
+
}
|
|
1486
|
+
function zX(J, X) {
|
|
1487
|
+
if (!t(X)) throw Error("Invalid input to extend: expected a plain object");
|
|
1488
|
+
let Y = J._zod.def.checks;
|
|
1489
|
+
if (Y && Y.length > 0) throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
1490
|
+
return y(J, i(J._zod.def, {
|
|
1491
|
+
get shape() {
|
|
1492
|
+
let H = {
|
|
1493
|
+
...J._zod.def.shape,
|
|
1494
|
+
...X
|
|
1495
|
+
};
|
|
1496
|
+
return n(this, "shape", H), H;
|
|
1497
|
+
},
|
|
1498
|
+
checks: []
|
|
1499
|
+
}));
|
|
1500
|
+
}
|
|
1501
|
+
function GX(J, X) {
|
|
1502
|
+
if (!t(X)) throw Error("Invalid input to safeExtend: expected a plain object");
|
|
1503
|
+
return y(J, {
|
|
1504
|
+
...J._zod.def,
|
|
1505
|
+
get shape() {
|
|
1506
|
+
let W = {
|
|
1507
|
+
...J._zod.def.shape,
|
|
1508
|
+
...X
|
|
1509
|
+
};
|
|
1510
|
+
return n(this, "shape", W), W;
|
|
1511
|
+
},
|
|
1512
|
+
checks: J._zod.def.checks
|
|
1513
|
+
});
|
|
1514
|
+
}
|
|
1515
|
+
function UX(J, X) {
|
|
1516
|
+
return y(J, i(J._zod.def, {
|
|
1517
|
+
get shape() {
|
|
1518
|
+
let W = {
|
|
1519
|
+
...J._zod.def.shape,
|
|
1520
|
+
...X._zod.def.shape
|
|
1521
|
+
};
|
|
1522
|
+
return n(this, "shape", W), W;
|
|
1523
|
+
},
|
|
1524
|
+
get catchall() {
|
|
1525
|
+
return X._zod.def.catchall;
|
|
1526
|
+
},
|
|
1527
|
+
checks: []
|
|
1528
|
+
}));
|
|
1529
|
+
}
|
|
1530
|
+
function IX(J, X, Y) {
|
|
1531
|
+
return y(X, i(X._zod.def, {
|
|
1532
|
+
get shape() {
|
|
1533
|
+
let q = X._zod.def.shape, H = { ...q };
|
|
1534
|
+
if (Y) for (let B in Y) {
|
|
1535
|
+
if (!(B in q)) throw Error(`Unrecognized key: "${B}"`);
|
|
1536
|
+
if (!Y[B]) continue;
|
|
1537
|
+
H[B] = J ? new J({
|
|
1538
|
+
type: "optional",
|
|
1539
|
+
innerType: q[B]
|
|
1540
|
+
}) : q[B];
|
|
1541
|
+
}
|
|
1542
|
+
else for (let B in q) H[B] = J ? new J({
|
|
1543
|
+
type: "optional",
|
|
1544
|
+
innerType: q[B]
|
|
1545
|
+
}) : q[B];
|
|
1546
|
+
return n(this, "shape", H), H;
|
|
1547
|
+
},
|
|
1548
|
+
checks: []
|
|
1549
|
+
}));
|
|
1550
|
+
}
|
|
1551
|
+
function wX(J, X, Y) {
|
|
1552
|
+
return y(X, i(X._zod.def, {
|
|
1553
|
+
get shape() {
|
|
1554
|
+
let q = X._zod.def.shape, H = { ...q };
|
|
1555
|
+
if (Y) for (let B in Y) {
|
|
1556
|
+
if (!(B in H)) throw Error(`Unrecognized key: "${B}"`);
|
|
1557
|
+
if (!Y[B]) continue;
|
|
1558
|
+
H[B] = new J({
|
|
1559
|
+
type: "nonoptional",
|
|
1560
|
+
innerType: q[B]
|
|
1561
|
+
});
|
|
1562
|
+
}
|
|
1563
|
+
else for (let B in q) H[B] = new J({
|
|
1564
|
+
type: "nonoptional",
|
|
1565
|
+
innerType: q[B]
|
|
1566
|
+
});
|
|
1567
|
+
return n(this, "shape", H), H;
|
|
1568
|
+
},
|
|
1569
|
+
checks: []
|
|
1570
|
+
}));
|
|
1571
|
+
}
|
|
1572
|
+
function a(J, X = 0) {
|
|
1573
|
+
if (J.aborted === !0) return !0;
|
|
1574
|
+
for (let Y = X; Y < J.issues.length; Y++) if (J.issues[Y]?.continue !== !0) return !0;
|
|
1575
|
+
return !1;
|
|
1576
|
+
}
|
|
1577
|
+
function l(J, X) {
|
|
1578
|
+
return X.map((Y) => {
|
|
1579
|
+
var W;
|
|
1580
|
+
return (W = Y).path ?? (W.path = []), Y.path.unshift(J), Y;
|
|
1581
|
+
});
|
|
1582
|
+
}
|
|
1583
|
+
function M0(J) {
|
|
1584
|
+
return typeof J === "string" ? J : J?.message;
|
|
1585
|
+
}
|
|
1586
|
+
function m(J, X, Y) {
|
|
1587
|
+
let W = {
|
|
1588
|
+
...J,
|
|
1589
|
+
path: J.path ?? []
|
|
1590
|
+
};
|
|
1591
|
+
if (!J.message) W.message = M0(J.inst?._zod.def?.error?.(J)) ?? M0(X?.error?.(J)) ?? M0(Y.customError?.(J)) ?? M0(Y.localeError?.(J)) ?? "Invalid input";
|
|
1592
|
+
if (delete W.inst, delete W.continue, !X?.reportInput) delete W.input;
|
|
1593
|
+
return W;
|
|
1594
|
+
}
|
|
1595
|
+
function j6(J) {
|
|
1596
|
+
if (J instanceof Set) return "set";
|
|
1597
|
+
if (J instanceof Map) return "map";
|
|
1598
|
+
if (J instanceof File) return "file";
|
|
1599
|
+
return "unknown";
|
|
1600
|
+
}
|
|
1601
|
+
function K0(J) {
|
|
1602
|
+
if (Array.isArray(J)) return "array";
|
|
1603
|
+
if (typeof J === "string") return "string";
|
|
1604
|
+
return "unknown";
|
|
1605
|
+
}
|
|
1606
|
+
function B0(...J) {
|
|
1607
|
+
let [X, Y, W] = J;
|
|
1608
|
+
if (typeof X === "string") return {
|
|
1609
|
+
message: X,
|
|
1610
|
+
code: "custom",
|
|
1611
|
+
input: Y,
|
|
1612
|
+
inst: W
|
|
1613
|
+
};
|
|
1614
|
+
return { ...X };
|
|
1615
|
+
}
|
|
1616
|
+
function DX(J) {
|
|
1617
|
+
return Object.entries(J).filter(([X, Y]) => {
|
|
1618
|
+
return Number.isNaN(Number.parseInt(X, 10));
|
|
1619
|
+
}).map((X) => X[1]);
|
|
1620
|
+
}
|
|
1621
|
+
function h6(J) {
|
|
1622
|
+
let X = atob(J), Y = new Uint8Array(X.length);
|
|
1623
|
+
for (let W = 0; W < X.length; W++) Y[W] = X.charCodeAt(W);
|
|
1624
|
+
return Y;
|
|
1625
|
+
}
|
|
1626
|
+
function x6(J) {
|
|
1627
|
+
let X = "";
|
|
1628
|
+
for (let Y = 0; Y < J.length; Y++) X += String.fromCharCode(J[Y]);
|
|
1629
|
+
return btoa(X);
|
|
1630
|
+
}
|
|
1631
|
+
function PX(J) {
|
|
1632
|
+
let X = J.replace(/-/g, "+").replace(/_/g, "/");
|
|
1633
|
+
return h6(X + "=".repeat((4 - X.length % 4) % 4));
|
|
1634
|
+
}
|
|
1635
|
+
function OX(J) {
|
|
1636
|
+
return x6(J).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
1637
|
+
}
|
|
1638
|
+
function MX(J) {
|
|
1639
|
+
let X = J.replace(/^0x/, "");
|
|
1640
|
+
if (X.length % 2 !== 0) throw Error("Invalid hex string length");
|
|
1641
|
+
let Y = new Uint8Array(X.length / 2);
|
|
1642
|
+
for (let W = 0; W < X.length; W += 2) Y[W / 2] = Number.parseInt(X.slice(W, W + 2), 16);
|
|
1643
|
+
return Y;
|
|
1644
|
+
}
|
|
1645
|
+
function AX(J) {
|
|
1646
|
+
return Array.from(J).map((X) => X.toString(16).padStart(2, "0")).join("");
|
|
1647
|
+
}
|
|
1648
|
+
var v6 = class {
|
|
1649
|
+
constructor(...J) {}
|
|
1650
|
+
};
|
|
1651
|
+
var g6 = (J, X) => {
|
|
1652
|
+
J.name = "$ZodError", Object.defineProperty(J, "_zod", {
|
|
1653
|
+
value: J._zod,
|
|
1654
|
+
enumerable: !1
|
|
1655
|
+
}), Object.defineProperty(J, "issues", {
|
|
1656
|
+
value: X,
|
|
1657
|
+
enumerable: !1
|
|
1658
|
+
}), J.message = JSON.stringify(X, H0, 2), Object.defineProperty(J, "toString", {
|
|
1659
|
+
value: () => J.message,
|
|
1660
|
+
enumerable: !1
|
|
1661
|
+
});
|
|
1662
|
+
}, o0 = U("$ZodError", g6), F4 = U("$ZodError", g6, { Parent: Error });
|
|
1663
|
+
function u6(J, X = (Y$1) => Y$1.message) {
|
|
1664
|
+
let Y = {}, W = [];
|
|
1665
|
+
for (let q of J.issues) if (q.path.length > 0) Y[q.path[0]] = Y[q.path[0]] || [], Y[q.path[0]].push(X(q));
|
|
1666
|
+
else W.push(X(q));
|
|
1667
|
+
return {
|
|
1668
|
+
formErrors: W,
|
|
1669
|
+
fieldErrors: Y
|
|
1670
|
+
};
|
|
1671
|
+
}
|
|
1672
|
+
function c6(J, X = (Y$1) => Y$1.message) {
|
|
1673
|
+
let Y = { _errors: [] }, W = (q) => {
|
|
1674
|
+
for (let H of q.issues) if (H.code === "invalid_union" && H.errors.length) H.errors.map((B) => W({ issues: B }));
|
|
1675
|
+
else if (H.code === "invalid_key") W({ issues: H.issues });
|
|
1676
|
+
else if (H.code === "invalid_element") W({ issues: H.issues });
|
|
1677
|
+
else if (H.path.length === 0) Y._errors.push(X(H));
|
|
1678
|
+
else {
|
|
1679
|
+
let B = Y, Q = 0;
|
|
1680
|
+
while (Q < H.path.length) {
|
|
1681
|
+
let G = H.path[Q];
|
|
1682
|
+
if (Q !== H.path.length - 1) B[G] = B[G] || { _errors: [] };
|
|
1683
|
+
else B[G] = B[G] || { _errors: [] }, B[G]._errors.push(X(H));
|
|
1684
|
+
B = B[G], Q++;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
};
|
|
1688
|
+
return W(J), Y;
|
|
1689
|
+
}
|
|
1690
|
+
var r0 = (J) => (X, Y, W, q) => {
|
|
1691
|
+
let H = W ? Object.assign(W, { async: !1 }) : { async: !1 }, B = X._zod.run({
|
|
1692
|
+
value: Y,
|
|
1693
|
+
issues: []
|
|
1694
|
+
}, H);
|
|
1695
|
+
if (B instanceof Promise) throw new r();
|
|
1696
|
+
if (B.issues.length) {
|
|
1697
|
+
let Q = new (q?.Err ?? J)(B.issues.map((G) => m(G, H, v())));
|
|
1698
|
+
throw m0(Q, q?.callee), Q;
|
|
1699
|
+
}
|
|
1700
|
+
return B.value;
|
|
1701
|
+
};
|
|
1702
|
+
var l0 = (J) => async (X, Y, W, q) => {
|
|
1703
|
+
let H = W ? Object.assign(W, { async: !0 }) : { async: !0 }, B = X._zod.run({
|
|
1704
|
+
value: Y,
|
|
1705
|
+
issues: []
|
|
1706
|
+
}, H);
|
|
1707
|
+
if (B instanceof Promise) B = await B;
|
|
1708
|
+
if (B.issues.length) {
|
|
1709
|
+
let Q = new (q?.Err ?? J)(B.issues.map((G) => m(G, H, v())));
|
|
1710
|
+
throw m0(Q, q?.callee), Q;
|
|
1711
|
+
}
|
|
1712
|
+
return B.value;
|
|
1713
|
+
};
|
|
1714
|
+
var V0 = (J) => (X, Y, W) => {
|
|
1715
|
+
let q = W ? {
|
|
1716
|
+
...W,
|
|
1717
|
+
async: !1
|
|
1718
|
+
} : { async: !1 }, H = X._zod.run({
|
|
1719
|
+
value: Y,
|
|
1720
|
+
issues: []
|
|
1721
|
+
}, q);
|
|
1722
|
+
if (H instanceof Promise) throw new r();
|
|
1723
|
+
return H.issues.length ? {
|
|
1724
|
+
success: !1,
|
|
1725
|
+
error: new (J ?? o0)(H.issues.map((B) => m(B, q, v())))
|
|
1726
|
+
} : {
|
|
1727
|
+
success: !0,
|
|
1728
|
+
data: H.value
|
|
1729
|
+
};
|
|
1730
|
+
}, y6 = V0(F4), R0 = (J) => async (X, Y, W) => {
|
|
1731
|
+
let q = W ? Object.assign(W, { async: !0 }) : { async: !0 }, H = X._zod.run({
|
|
1732
|
+
value: Y,
|
|
1733
|
+
issues: []
|
|
1734
|
+
}, q);
|
|
1735
|
+
if (H instanceof Promise) H = await H;
|
|
1736
|
+
return H.issues.length ? {
|
|
1737
|
+
success: !1,
|
|
1738
|
+
error: new J(H.issues.map((B) => m(B, q, v())))
|
|
1739
|
+
} : {
|
|
1740
|
+
success: !0,
|
|
1741
|
+
data: H.value
|
|
1742
|
+
};
|
|
1743
|
+
}, m6 = R0(F4), f6 = (J) => (X, Y, W) => {
|
|
1744
|
+
let q = W ? Object.assign(W, { direction: "backward" }) : { direction: "backward" };
|
|
1745
|
+
return r0(J)(X, Y, q);
|
|
1746
|
+
};
|
|
1747
|
+
var o6 = (J) => (X, Y, W) => {
|
|
1748
|
+
return r0(J)(X, Y, W);
|
|
1749
|
+
};
|
|
1750
|
+
var r6 = (J) => async (X, Y, W) => {
|
|
1751
|
+
let q = W ? Object.assign(W, { direction: "backward" }) : { direction: "backward" };
|
|
1752
|
+
return l0(J)(X, Y, q);
|
|
1753
|
+
};
|
|
1754
|
+
var l6 = (J) => async (X, Y, W) => {
|
|
1755
|
+
return l0(J)(X, Y, W);
|
|
1756
|
+
};
|
|
1757
|
+
var p6 = (J) => (X, Y, W) => {
|
|
1758
|
+
let q = W ? Object.assign(W, { direction: "backward" }) : { direction: "backward" };
|
|
1759
|
+
return V0(J)(X, Y, q);
|
|
1760
|
+
};
|
|
1761
|
+
var d6 = (J) => (X, Y, W) => {
|
|
1762
|
+
return V0(J)(X, Y, W);
|
|
1763
|
+
};
|
|
1764
|
+
var n6 = (J) => async (X, Y, W) => {
|
|
1765
|
+
let q = W ? Object.assign(W, { direction: "backward" }) : { direction: "backward" };
|
|
1766
|
+
return R0(J)(X, Y, q);
|
|
1767
|
+
};
|
|
1768
|
+
var i6 = (J) => async (X, Y, W) => {
|
|
1769
|
+
return R0(J)(X, Y, W);
|
|
1770
|
+
};
|
|
1771
|
+
var t6 = /^[cC][^\s-]{8,}$/, a6 = /^[0-9a-z]+$/, s6 = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, e6 = /^[0-9a-vA-V]{20}$/, J1 = /^[A-Za-z0-9]{27}$/, X1 = /^[a-zA-Z0-9_-]{21}$/, Y1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
1772
|
+
var W1 = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, E4 = (J) => {
|
|
1773
|
+
if (!J) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
1774
|
+
return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${J}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
1775
|
+
};
|
|
1776
|
+
var q1 = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
1777
|
+
var EX = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1778
|
+
function H1() {
|
|
1779
|
+
return new RegExp(EX, "u");
|
|
1780
|
+
}
|
|
1781
|
+
var B1 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Q1 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
|
|
1782
|
+
var z1 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, G1 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, U1 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, $4 = /^[A-Za-z0-9_-]*$/;
|
|
1783
|
+
var I1 = /^\+(?:[0-9]){6,14}[0-9]$/, w1 = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", D1 = /* @__PURE__ */ new RegExp(`^${w1}$`);
|
|
1784
|
+
function P1(J) {
|
|
1785
|
+
return typeof J.precision === "number" ? J.precision === -1 ? "(?:[01]\\d|2[0-3]):[0-5]\\d" : J.precision === 0 ? "(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d" : `(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${J.precision}}` : "(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?";
|
|
1786
|
+
}
|
|
1787
|
+
function O1(J) {
|
|
1788
|
+
return /* @__PURE__ */ new RegExp(`^${P1(J)}$`);
|
|
1789
|
+
}
|
|
1790
|
+
function M1(J) {
|
|
1791
|
+
let X = P1({ precision: J.precision }), Y = ["Z"];
|
|
1792
|
+
if (J.local) Y.push("");
|
|
1793
|
+
if (J.offset) Y.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
1794
|
+
let W = `${X}(?:${Y.join("|")})`;
|
|
1795
|
+
return /* @__PURE__ */ new RegExp(`^${w1}T(?:${W})$`);
|
|
1796
|
+
}
|
|
1797
|
+
var A1 = (J) => {
|
|
1798
|
+
let X = J ? `[\\s\\S]{${J?.minimum ?? 0},${J?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
1799
|
+
return /* @__PURE__ */ new RegExp(`^${X}$`);
|
|
1800
|
+
}, F1 = /^-?\d+n?$/, E1 = /^-?\d+$/, $1 = /^-?\d+(?:\.\d+)?/, K1 = /^(?:true|false)$/i;
|
|
1801
|
+
var V1 = /^[^A-Z]*$/, R1 = /^[^a-z]*$/;
|
|
1802
|
+
var T = U("$ZodCheck", (J, X) => {
|
|
1803
|
+
var Y;
|
|
1804
|
+
J._zod ?? (J._zod = {}), J._zod.def = X, (Y = J._zod).onattach ?? (Y.onattach = []);
|
|
1805
|
+
}), N1 = {
|
|
1806
|
+
number: "number",
|
|
1807
|
+
bigint: "bigint",
|
|
1808
|
+
object: "date"
|
|
1809
|
+
}, K4 = U("$ZodCheckLessThan", (J, X) => {
|
|
1810
|
+
T.init(J, X);
|
|
1811
|
+
let Y = N1[typeof X.value];
|
|
1812
|
+
J._zod.onattach.push((W) => {
|
|
1813
|
+
let q = W._zod.bag, H = (X.inclusive ? q.maximum : q.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
1814
|
+
if (X.value < H) if (X.inclusive) q.maximum = X.value;
|
|
1815
|
+
else q.exclusiveMaximum = X.value;
|
|
1816
|
+
}), J._zod.check = (W) => {
|
|
1817
|
+
if (X.inclusive ? W.value <= X.value : W.value < X.value) return;
|
|
1818
|
+
W.issues.push({
|
|
1819
|
+
origin: Y,
|
|
1820
|
+
code: "too_big",
|
|
1821
|
+
maximum: X.value,
|
|
1822
|
+
input: W.value,
|
|
1823
|
+
inclusive: X.inclusive,
|
|
1824
|
+
inst: J,
|
|
1825
|
+
continue: !X.abort
|
|
1826
|
+
});
|
|
1827
|
+
};
|
|
1828
|
+
}), V4 = U("$ZodCheckGreaterThan", (J, X) => {
|
|
1829
|
+
T.init(J, X);
|
|
1830
|
+
let Y = N1[typeof X.value];
|
|
1831
|
+
J._zod.onattach.push((W) => {
|
|
1832
|
+
let q = W._zod.bag, H = (X.inclusive ? q.minimum : q.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
1833
|
+
if (X.value > H) if (X.inclusive) q.minimum = X.value;
|
|
1834
|
+
else q.exclusiveMinimum = X.value;
|
|
1835
|
+
}), J._zod.check = (W) => {
|
|
1836
|
+
if (X.inclusive ? W.value >= X.value : W.value > X.value) return;
|
|
1837
|
+
W.issues.push({
|
|
1838
|
+
origin: Y,
|
|
1839
|
+
code: "too_small",
|
|
1840
|
+
minimum: X.value,
|
|
1841
|
+
input: W.value,
|
|
1842
|
+
inclusive: X.inclusive,
|
|
1843
|
+
inst: J,
|
|
1844
|
+
continue: !X.abort
|
|
1845
|
+
});
|
|
1846
|
+
};
|
|
1847
|
+
}), S1 = U("$ZodCheckMultipleOf", (J, X) => {
|
|
1848
|
+
T.init(J, X), J._zod.onattach.push((Y) => {
|
|
1849
|
+
var W;
|
|
1850
|
+
(W = Y._zod.bag).multipleOf ?? (W.multipleOf = X.value);
|
|
1851
|
+
}), J._zod.check = (Y) => {
|
|
1852
|
+
if (typeof Y.value !== typeof X.value) throw Error("Cannot mix number and bigint in multiple_of check.");
|
|
1853
|
+
if (typeof Y.value === "bigint" ? Y.value % X.value === BigInt(0) : w4(Y.value, X.value) === 0) return;
|
|
1854
|
+
Y.issues.push({
|
|
1855
|
+
origin: typeof Y.value,
|
|
1856
|
+
code: "not_multiple_of",
|
|
1857
|
+
divisor: X.value,
|
|
1858
|
+
input: Y.value,
|
|
1859
|
+
inst: J,
|
|
1860
|
+
continue: !X.abort
|
|
1861
|
+
});
|
|
1862
|
+
};
|
|
1863
|
+
}), L1 = U("$ZodCheckNumberFormat", (J, X) => {
|
|
1864
|
+
T.init(J, X), X.format = X.format || "float64";
|
|
1865
|
+
let Y = X.format?.includes("int"), W = Y ? "int" : "number", [q, H] = A4[X.format];
|
|
1866
|
+
J._zod.onattach.push((B) => {
|
|
1867
|
+
let Q = B._zod.bag;
|
|
1868
|
+
if (Q.format = X.format, Q.minimum = q, Q.maximum = H, Y) Q.pattern = E1;
|
|
1869
|
+
}), J._zod.check = (B) => {
|
|
1870
|
+
let Q = B.value;
|
|
1871
|
+
if (Y) {
|
|
1872
|
+
if (!Number.isInteger(Q)) {
|
|
1873
|
+
B.issues.push({
|
|
1874
|
+
expected: W,
|
|
1875
|
+
format: X.format,
|
|
1876
|
+
code: "invalid_type",
|
|
1877
|
+
continue: !1,
|
|
1878
|
+
input: Q,
|
|
1879
|
+
inst: J
|
|
1880
|
+
});
|
|
1881
|
+
return;
|
|
1882
|
+
}
|
|
1883
|
+
if (!Number.isSafeInteger(Q)) {
|
|
1884
|
+
if (Q > 0) B.issues.push({
|
|
1885
|
+
input: Q,
|
|
1886
|
+
code: "too_big",
|
|
1887
|
+
maximum: Number.MAX_SAFE_INTEGER,
|
|
1888
|
+
note: "Integers must be within the safe integer range.",
|
|
1889
|
+
inst: J,
|
|
1890
|
+
origin: W,
|
|
1891
|
+
continue: !X.abort
|
|
1892
|
+
});
|
|
1893
|
+
else B.issues.push({
|
|
1894
|
+
input: Q,
|
|
1895
|
+
code: "too_small",
|
|
1896
|
+
minimum: Number.MIN_SAFE_INTEGER,
|
|
1897
|
+
note: "Integers must be within the safe integer range.",
|
|
1898
|
+
inst: J,
|
|
1899
|
+
origin: W,
|
|
1900
|
+
continue: !X.abort
|
|
1901
|
+
});
|
|
1902
|
+
return;
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
if (Q < q) B.issues.push({
|
|
1906
|
+
origin: "number",
|
|
1907
|
+
input: Q,
|
|
1908
|
+
code: "too_small",
|
|
1909
|
+
minimum: q,
|
|
1910
|
+
inclusive: !0,
|
|
1911
|
+
inst: J,
|
|
1912
|
+
continue: !X.abort
|
|
1913
|
+
});
|
|
1914
|
+
if (Q > H) B.issues.push({
|
|
1915
|
+
origin: "number",
|
|
1916
|
+
input: Q,
|
|
1917
|
+
code: "too_big",
|
|
1918
|
+
maximum: H,
|
|
1919
|
+
inst: J
|
|
1920
|
+
});
|
|
1921
|
+
};
|
|
1922
|
+
});
|
|
1923
|
+
var Z1 = U("$ZodCheckMaxLength", (J, X) => {
|
|
1924
|
+
var Y;
|
|
1925
|
+
T.init(J, X), (Y = J._zod.def).when ?? (Y.when = (W) => {
|
|
1926
|
+
let q = W.value;
|
|
1927
|
+
return !E0(q) && q.length !== void 0;
|
|
1928
|
+
}), J._zod.onattach.push((W) => {
|
|
1929
|
+
let q = W._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1930
|
+
if (X.maximum < q) W._zod.bag.maximum = X.maximum;
|
|
1931
|
+
}), J._zod.check = (W) => {
|
|
1932
|
+
let q = W.value;
|
|
1933
|
+
if (q.length <= X.maximum) return;
|
|
1934
|
+
let B = K0(q);
|
|
1935
|
+
W.issues.push({
|
|
1936
|
+
origin: B,
|
|
1937
|
+
code: "too_big",
|
|
1938
|
+
maximum: X.maximum,
|
|
1939
|
+
inclusive: !0,
|
|
1940
|
+
input: q,
|
|
1941
|
+
inst: J,
|
|
1942
|
+
continue: !X.abort
|
|
1943
|
+
});
|
|
1944
|
+
};
|
|
1945
|
+
}), _1 = U("$ZodCheckMinLength", (J, X) => {
|
|
1946
|
+
var Y;
|
|
1947
|
+
T.init(J, X), (Y = J._zod.def).when ?? (Y.when = (W) => {
|
|
1948
|
+
let q = W.value;
|
|
1949
|
+
return !E0(q) && q.length !== void 0;
|
|
1950
|
+
}), J._zod.onattach.push((W) => {
|
|
1951
|
+
let q = W._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1952
|
+
if (X.minimum > q) W._zod.bag.minimum = X.minimum;
|
|
1953
|
+
}), J._zod.check = (W) => {
|
|
1954
|
+
let q = W.value;
|
|
1955
|
+
if (q.length >= X.minimum) return;
|
|
1956
|
+
let B = K0(q);
|
|
1957
|
+
W.issues.push({
|
|
1958
|
+
origin: B,
|
|
1959
|
+
code: "too_small",
|
|
1960
|
+
minimum: X.minimum,
|
|
1961
|
+
inclusive: !0,
|
|
1962
|
+
input: q,
|
|
1963
|
+
inst: J,
|
|
1964
|
+
continue: !X.abort
|
|
1965
|
+
});
|
|
1966
|
+
};
|
|
1967
|
+
}), b1 = U("$ZodCheckLengthEquals", (J, X) => {
|
|
1968
|
+
var Y;
|
|
1969
|
+
T.init(J, X), (Y = J._zod.def).when ?? (Y.when = (W) => {
|
|
1970
|
+
let q = W.value;
|
|
1971
|
+
return !E0(q) && q.length !== void 0;
|
|
1972
|
+
}), J._zod.onattach.push((W) => {
|
|
1973
|
+
let q = W._zod.bag;
|
|
1974
|
+
q.minimum = X.length, q.maximum = X.length, q.length = X.length;
|
|
1975
|
+
}), J._zod.check = (W) => {
|
|
1976
|
+
let q = W.value, H = q.length;
|
|
1977
|
+
if (H === X.length) return;
|
|
1978
|
+
let B = K0(q), Q = H > X.length;
|
|
1979
|
+
W.issues.push({
|
|
1980
|
+
origin: B,
|
|
1981
|
+
...Q ? {
|
|
1982
|
+
code: "too_big",
|
|
1983
|
+
maximum: X.length
|
|
1984
|
+
} : {
|
|
1985
|
+
code: "too_small",
|
|
1986
|
+
minimum: X.length
|
|
1987
|
+
},
|
|
1988
|
+
inclusive: !0,
|
|
1989
|
+
exact: !0,
|
|
1990
|
+
input: W.value,
|
|
1991
|
+
inst: J,
|
|
1992
|
+
continue: !X.abort
|
|
1993
|
+
});
|
|
1994
|
+
};
|
|
1995
|
+
}), N0 = U("$ZodCheckStringFormat", (J, X) => {
|
|
1996
|
+
var Y, W;
|
|
1997
|
+
if (T.init(J, X), J._zod.onattach.push((q) => {
|
|
1998
|
+
let H = q._zod.bag;
|
|
1999
|
+
if (H.format = X.format, X.pattern) H.patterns ?? (H.patterns = /* @__PURE__ */ new Set()), H.patterns.add(X.pattern);
|
|
2000
|
+
}), X.pattern) (Y = J._zod).check ?? (Y.check = (q) => {
|
|
2001
|
+
if (X.pattern.lastIndex = 0, X.pattern.test(q.value)) return;
|
|
2002
|
+
q.issues.push({
|
|
2003
|
+
origin: "string",
|
|
2004
|
+
code: "invalid_format",
|
|
2005
|
+
format: X.format,
|
|
2006
|
+
input: q.value,
|
|
2007
|
+
...X.pattern ? { pattern: X.pattern.toString() } : {},
|
|
2008
|
+
inst: J,
|
|
2009
|
+
continue: !X.abort
|
|
2010
|
+
});
|
|
2011
|
+
});
|
|
2012
|
+
else (W = J._zod).check ?? (W.check = () => {});
|
|
2013
|
+
}), C1 = U("$ZodCheckRegex", (J, X) => {
|
|
2014
|
+
N0.init(J, X), J._zod.check = (Y) => {
|
|
2015
|
+
if (X.pattern.lastIndex = 0, X.pattern.test(Y.value)) return;
|
|
2016
|
+
Y.issues.push({
|
|
2017
|
+
origin: "string",
|
|
2018
|
+
code: "invalid_format",
|
|
2019
|
+
format: "regex",
|
|
2020
|
+
input: Y.value,
|
|
2021
|
+
pattern: X.pattern.toString(),
|
|
2022
|
+
inst: J,
|
|
2023
|
+
continue: !X.abort
|
|
2024
|
+
});
|
|
2025
|
+
};
|
|
2026
|
+
}), k1 = U("$ZodCheckLowerCase", (J, X) => {
|
|
2027
|
+
X.pattern ?? (X.pattern = V1), N0.init(J, X);
|
|
2028
|
+
}), T1 = U("$ZodCheckUpperCase", (J, X) => {
|
|
2029
|
+
X.pattern ?? (X.pattern = R1), N0.init(J, X);
|
|
2030
|
+
}), j1 = U("$ZodCheckIncludes", (J, X) => {
|
|
2031
|
+
T.init(J, X);
|
|
2032
|
+
let Y = J0(X.includes), W = new RegExp(typeof X.position === "number" ? `^.{${X.position}}${Y}` : Y);
|
|
2033
|
+
X.pattern = W, J._zod.onattach.push((q) => {
|
|
2034
|
+
let H = q._zod.bag;
|
|
2035
|
+
H.patterns ?? (H.patterns = /* @__PURE__ */ new Set()), H.patterns.add(W);
|
|
2036
|
+
}), J._zod.check = (q) => {
|
|
2037
|
+
if (q.value.includes(X.includes, X.position)) return;
|
|
2038
|
+
q.issues.push({
|
|
2039
|
+
origin: "string",
|
|
2040
|
+
code: "invalid_format",
|
|
2041
|
+
format: "includes",
|
|
2042
|
+
includes: X.includes,
|
|
2043
|
+
input: q.value,
|
|
2044
|
+
inst: J,
|
|
2045
|
+
continue: !X.abort
|
|
2046
|
+
});
|
|
2047
|
+
};
|
|
2048
|
+
}), h1 = U("$ZodCheckStartsWith", (J, X) => {
|
|
2049
|
+
T.init(J, X);
|
|
2050
|
+
let Y = /* @__PURE__ */ new RegExp(`^${J0(X.prefix)}.*`);
|
|
2051
|
+
X.pattern ?? (X.pattern = Y), J._zod.onattach.push((W) => {
|
|
2052
|
+
let q = W._zod.bag;
|
|
2053
|
+
q.patterns ?? (q.patterns = /* @__PURE__ */ new Set()), q.patterns.add(Y);
|
|
2054
|
+
}), J._zod.check = (W) => {
|
|
2055
|
+
if (W.value.startsWith(X.prefix)) return;
|
|
2056
|
+
W.issues.push({
|
|
2057
|
+
origin: "string",
|
|
2058
|
+
code: "invalid_format",
|
|
2059
|
+
format: "starts_with",
|
|
2060
|
+
prefix: X.prefix,
|
|
2061
|
+
input: W.value,
|
|
2062
|
+
inst: J,
|
|
2063
|
+
continue: !X.abort
|
|
2064
|
+
});
|
|
2065
|
+
};
|
|
2066
|
+
}), x1 = U("$ZodCheckEndsWith", (J, X) => {
|
|
2067
|
+
T.init(J, X);
|
|
2068
|
+
let Y = /* @__PURE__ */ new RegExp(`.*${J0(X.suffix)}$`);
|
|
2069
|
+
X.pattern ?? (X.pattern = Y), J._zod.onattach.push((W) => {
|
|
2070
|
+
let q = W._zod.bag;
|
|
2071
|
+
q.patterns ?? (q.patterns = /* @__PURE__ */ new Set()), q.patterns.add(Y);
|
|
2072
|
+
}), J._zod.check = (W) => {
|
|
2073
|
+
if (W.value.endsWith(X.suffix)) return;
|
|
2074
|
+
W.issues.push({
|
|
2075
|
+
origin: "string",
|
|
2076
|
+
code: "invalid_format",
|
|
2077
|
+
format: "ends_with",
|
|
2078
|
+
suffix: X.suffix,
|
|
2079
|
+
input: W.value,
|
|
2080
|
+
inst: J,
|
|
2081
|
+
continue: !X.abort
|
|
2082
|
+
});
|
|
2083
|
+
};
|
|
2084
|
+
});
|
|
2085
|
+
var v1 = U("$ZodCheckOverwrite", (J, X) => {
|
|
2086
|
+
T.init(J, X), J._zod.check = (Y) => {
|
|
2087
|
+
Y.value = X.tx(Y.value);
|
|
2088
|
+
};
|
|
2089
|
+
});
|
|
2090
|
+
var R4 = class {
|
|
2091
|
+
constructor(J = []) {
|
|
2092
|
+
if (this.content = [], this.indent = 0, this) this.args = J;
|
|
2093
|
+
}
|
|
2094
|
+
indented(J) {
|
|
2095
|
+
this.indent += 1, J(this), this.indent -= 1;
|
|
2096
|
+
}
|
|
2097
|
+
write(J) {
|
|
2098
|
+
if (typeof J === "function") {
|
|
2099
|
+
J(this, { execution: "sync" }), J(this, { execution: "async" });
|
|
2100
|
+
return;
|
|
2101
|
+
}
|
|
2102
|
+
let Y = J.split(`
|
|
2103
|
+
`).filter((H) => H), W = Math.min(...Y.map((H) => H.length - H.trimStart().length)), q = Y.map((H) => H.slice(W)).map((H) => " ".repeat(this.indent * 2) + H);
|
|
2104
|
+
for (let H of q) this.content.push(H);
|
|
2105
|
+
}
|
|
2106
|
+
compile() {
|
|
2107
|
+
let J = Function, X = this?.args, W = [...(this?.content ?? [""]).map((q) => ` ${q}`)];
|
|
2108
|
+
return new J(...X, W.join(`
|
|
2109
|
+
`));
|
|
2110
|
+
}
|
|
2111
|
+
};
|
|
2112
|
+
var u1 = {
|
|
2113
|
+
major: 4,
|
|
2114
|
+
minor: 2,
|
|
2115
|
+
patch: 1
|
|
2116
|
+
};
|
|
2117
|
+
var $ = U("$ZodType", (J, X) => {
|
|
2118
|
+
var Y;
|
|
2119
|
+
J ?? (J = {}), J._zod.def = X, J._zod.bag = J._zod.bag || {}, J._zod.version = u1;
|
|
2120
|
+
let W = [...J._zod.def.checks ?? []];
|
|
2121
|
+
if (J._zod.traits.has("$ZodCheck")) W.unshift(J);
|
|
2122
|
+
for (let q of W) for (let H of q._zod.onattach) H(J);
|
|
2123
|
+
if (W.length === 0) (Y = J._zod).deferred ?? (Y.deferred = []), J._zod.deferred?.push(() => {
|
|
2124
|
+
J._zod.run = J._zod.parse;
|
|
2125
|
+
});
|
|
2126
|
+
else {
|
|
2127
|
+
let q = (B, Q, G) => {
|
|
2128
|
+
let z = a(B), I;
|
|
2129
|
+
for (let w of Q) {
|
|
2130
|
+
if (w._zod.def.when) {
|
|
2131
|
+
if (!w._zod.def.when(B)) continue;
|
|
2132
|
+
} else if (z) continue;
|
|
2133
|
+
let M = B.issues.length, P = w._zod.check(B);
|
|
2134
|
+
if (P instanceof Promise && G?.async === !1) throw new r();
|
|
2135
|
+
if (I || P instanceof Promise) I = (I ?? Promise.resolve()).then(async () => {
|
|
2136
|
+
if (await P, B.issues.length === M) return;
|
|
2137
|
+
if (!z) z = a(B, M);
|
|
2138
|
+
});
|
|
2139
|
+
else {
|
|
2140
|
+
if (B.issues.length === M) continue;
|
|
2141
|
+
if (!z) z = a(B, M);
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
if (I) return I.then(() => {
|
|
2145
|
+
return B;
|
|
2146
|
+
});
|
|
2147
|
+
return B;
|
|
2148
|
+
}, H = (B, Q, G) => {
|
|
2149
|
+
if (a(B)) return B.aborted = !0, B;
|
|
2150
|
+
let z = q(Q, W, G);
|
|
2151
|
+
if (z instanceof Promise) {
|
|
2152
|
+
if (G.async === !1) throw new r();
|
|
2153
|
+
return z.then((I) => J._zod.parse(I, G));
|
|
2154
|
+
}
|
|
2155
|
+
return J._zod.parse(z, G);
|
|
2156
|
+
};
|
|
2157
|
+
J._zod.run = (B, Q) => {
|
|
2158
|
+
if (Q.skipChecks) return J._zod.parse(B, Q);
|
|
2159
|
+
if (Q.direction === "backward") {
|
|
2160
|
+
let z = J._zod.parse({
|
|
2161
|
+
value: B.value,
|
|
2162
|
+
issues: []
|
|
2163
|
+
}, {
|
|
2164
|
+
...Q,
|
|
2165
|
+
skipChecks: !0
|
|
2166
|
+
});
|
|
2167
|
+
if (z instanceof Promise) return z.then((I) => {
|
|
2168
|
+
return H(I, B, Q);
|
|
2169
|
+
});
|
|
2170
|
+
return H(z, B, Q);
|
|
2171
|
+
}
|
|
2172
|
+
let G = J._zod.parse(B, Q);
|
|
2173
|
+
if (G instanceof Promise) {
|
|
2174
|
+
if (Q.async === !1) throw new r();
|
|
2175
|
+
return G.then((z) => q(z, W, Q));
|
|
2176
|
+
}
|
|
2177
|
+
return q(G, W, Q);
|
|
2178
|
+
};
|
|
2179
|
+
}
|
|
2180
|
+
J["~standard"] = {
|
|
2181
|
+
validate: (q) => {
|
|
2182
|
+
try {
|
|
2183
|
+
let H = y6(J, q);
|
|
2184
|
+
return H.success ? { value: H.data } : { issues: H.error?.issues };
|
|
2185
|
+
} catch (H) {
|
|
2186
|
+
return m6(J, q).then((B) => B.success ? { value: B.data } : { issues: B.error?.issues });
|
|
2187
|
+
}
|
|
2188
|
+
},
|
|
2189
|
+
vendor: "zod",
|
|
2190
|
+
version: 1
|
|
2191
|
+
};
|
|
2192
|
+
}), i0 = U("$ZodString", (J, X) => {
|
|
2193
|
+
$.init(J, X), J._zod.pattern = [...J?._zod.bag?.patterns ?? []].pop() ?? A1(J._zod.bag), J._zod.parse = (Y, W) => {
|
|
2194
|
+
if (X.coerce) try {
|
|
2195
|
+
Y.value = String(Y.value);
|
|
2196
|
+
} catch (q) {}
|
|
2197
|
+
if (typeof Y.value === "string") return Y;
|
|
2198
|
+
return Y.issues.push({
|
|
2199
|
+
expected: "string",
|
|
2200
|
+
code: "invalid_type",
|
|
2201
|
+
input: Y.value,
|
|
2202
|
+
inst: J
|
|
2203
|
+
}), Y;
|
|
2204
|
+
};
|
|
2205
|
+
}), V = U("$ZodStringFormat", (J, X) => {
|
|
2206
|
+
N0.init(J, X), i0.init(J, X);
|
|
2207
|
+
}), d1 = U("$ZodGUID", (J, X) => {
|
|
2208
|
+
X.pattern ?? (X.pattern = W1), V.init(J, X);
|
|
2209
|
+
}), n1 = U("$ZodUUID", (J, X) => {
|
|
2210
|
+
if (X.version) {
|
|
2211
|
+
let W = {
|
|
2212
|
+
v1: 1,
|
|
2213
|
+
v2: 2,
|
|
2214
|
+
v3: 3,
|
|
2215
|
+
v4: 4,
|
|
2216
|
+
v5: 5,
|
|
2217
|
+
v6: 6,
|
|
2218
|
+
v7: 7,
|
|
2219
|
+
v8: 8
|
|
2220
|
+
}[X.version];
|
|
2221
|
+
if (W === void 0) throw Error(`Invalid UUID version: "${X.version}"`);
|
|
2222
|
+
X.pattern ?? (X.pattern = E4(W));
|
|
2223
|
+
} else X.pattern ?? (X.pattern = E4());
|
|
2224
|
+
V.init(J, X);
|
|
2225
|
+
}), i1 = U("$ZodEmail", (J, X) => {
|
|
2226
|
+
X.pattern ?? (X.pattern = q1), V.init(J, X);
|
|
2227
|
+
}), t1 = U("$ZodURL", (J, X) => {
|
|
2228
|
+
V.init(J, X), J._zod.check = (Y) => {
|
|
2229
|
+
try {
|
|
2230
|
+
let W = Y.value.trim(), q = new URL(W);
|
|
2231
|
+
if (X.hostname) {
|
|
2232
|
+
if (X.hostname.lastIndex = 0, !X.hostname.test(q.hostname)) Y.issues.push({
|
|
2233
|
+
code: "invalid_format",
|
|
2234
|
+
format: "url",
|
|
2235
|
+
note: "Invalid hostname",
|
|
2236
|
+
pattern: X.hostname.source,
|
|
2237
|
+
input: Y.value,
|
|
2238
|
+
inst: J,
|
|
2239
|
+
continue: !X.abort
|
|
2240
|
+
});
|
|
2241
|
+
}
|
|
2242
|
+
if (X.protocol) {
|
|
2243
|
+
if (X.protocol.lastIndex = 0, !X.protocol.test(q.protocol.endsWith(":") ? q.protocol.slice(0, -1) : q.protocol)) Y.issues.push({
|
|
2244
|
+
code: "invalid_format",
|
|
2245
|
+
format: "url",
|
|
2246
|
+
note: "Invalid protocol",
|
|
2247
|
+
pattern: X.protocol.source,
|
|
2248
|
+
input: Y.value,
|
|
2249
|
+
inst: J,
|
|
2250
|
+
continue: !X.abort
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
if (X.normalize) Y.value = q.href;
|
|
2254
|
+
else Y.value = W;
|
|
2255
|
+
return;
|
|
2256
|
+
} catch (W) {
|
|
2257
|
+
Y.issues.push({
|
|
2258
|
+
code: "invalid_format",
|
|
2259
|
+
format: "url",
|
|
2260
|
+
input: Y.value,
|
|
2261
|
+
inst: J,
|
|
2262
|
+
continue: !X.abort
|
|
2263
|
+
});
|
|
2264
|
+
}
|
|
2265
|
+
};
|
|
2266
|
+
}), a1 = U("$ZodEmoji", (J, X) => {
|
|
2267
|
+
X.pattern ?? (X.pattern = H1()), V.init(J, X);
|
|
2268
|
+
}), s1 = U("$ZodNanoID", (J, X) => {
|
|
2269
|
+
X.pattern ?? (X.pattern = X1), V.init(J, X);
|
|
2270
|
+
}), e1 = U("$ZodCUID", (J, X) => {
|
|
2271
|
+
X.pattern ?? (X.pattern = t6), V.init(J, X);
|
|
2272
|
+
}), JJ = U("$ZodCUID2", (J, X) => {
|
|
2273
|
+
X.pattern ?? (X.pattern = a6), V.init(J, X);
|
|
2274
|
+
}), XJ = U("$ZodULID", (J, X) => {
|
|
2275
|
+
X.pattern ?? (X.pattern = s6), V.init(J, X);
|
|
2276
|
+
}), YJ = U("$ZodXID", (J, X) => {
|
|
2277
|
+
X.pattern ?? (X.pattern = e6), V.init(J, X);
|
|
2278
|
+
}), WJ = U("$ZodKSUID", (J, X) => {
|
|
2279
|
+
X.pattern ?? (X.pattern = J1), V.init(J, X);
|
|
2280
|
+
}), qJ = U("$ZodISODateTime", (J, X) => {
|
|
2281
|
+
X.pattern ?? (X.pattern = M1(X)), V.init(J, X);
|
|
2282
|
+
}), HJ = U("$ZodISODate", (J, X) => {
|
|
2283
|
+
X.pattern ?? (X.pattern = D1), V.init(J, X);
|
|
2284
|
+
}), BJ = U("$ZodISOTime", (J, X) => {
|
|
2285
|
+
X.pattern ?? (X.pattern = O1(X)), V.init(J, X);
|
|
2286
|
+
}), QJ = U("$ZodISODuration", (J, X) => {
|
|
2287
|
+
X.pattern ?? (X.pattern = Y1), V.init(J, X);
|
|
2288
|
+
}), zJ = U("$ZodIPv4", (J, X) => {
|
|
2289
|
+
X.pattern ?? (X.pattern = B1), V.init(J, X), J._zod.bag.format = "ipv4";
|
|
2290
|
+
}), GJ = U("$ZodIPv6", (J, X) => {
|
|
2291
|
+
X.pattern ?? (X.pattern = Q1), V.init(J, X), J._zod.bag.format = "ipv6", J._zod.check = (Y) => {
|
|
2292
|
+
try {
|
|
2293
|
+
new URL(`http://[${Y.value}]`);
|
|
2294
|
+
} catch {
|
|
2295
|
+
Y.issues.push({
|
|
2296
|
+
code: "invalid_format",
|
|
2297
|
+
format: "ipv6",
|
|
2298
|
+
input: Y.value,
|
|
2299
|
+
inst: J,
|
|
2300
|
+
continue: !X.abort
|
|
2301
|
+
});
|
|
2302
|
+
}
|
|
2303
|
+
};
|
|
2304
|
+
});
|
|
2305
|
+
var UJ = U("$ZodCIDRv4", (J, X) => {
|
|
2306
|
+
X.pattern ?? (X.pattern = z1), V.init(J, X);
|
|
2307
|
+
}), IJ = U("$ZodCIDRv6", (J, X) => {
|
|
2308
|
+
X.pattern ?? (X.pattern = G1), V.init(J, X), J._zod.check = (Y) => {
|
|
2309
|
+
let W = Y.value.split("/");
|
|
2310
|
+
try {
|
|
2311
|
+
if (W.length !== 2) throw Error();
|
|
2312
|
+
let [q, H] = W;
|
|
2313
|
+
if (!H) throw Error();
|
|
2314
|
+
let B = Number(H);
|
|
2315
|
+
if (`${B}` !== H) throw Error();
|
|
2316
|
+
if (B < 0 || B > 128) throw Error();
|
|
2317
|
+
new URL(`http://[${q}]`);
|
|
2318
|
+
} catch {
|
|
2319
|
+
Y.issues.push({
|
|
2320
|
+
code: "invalid_format",
|
|
2321
|
+
format: "cidrv6",
|
|
2322
|
+
input: Y.value,
|
|
2323
|
+
inst: J,
|
|
2324
|
+
continue: !X.abort
|
|
2325
|
+
});
|
|
2326
|
+
}
|
|
2327
|
+
};
|
|
2328
|
+
});
|
|
2329
|
+
function wJ(J) {
|
|
2330
|
+
if (J === "") return !0;
|
|
2331
|
+
if (J.length % 4 !== 0) return !1;
|
|
2332
|
+
try {
|
|
2333
|
+
return atob(J), !0;
|
|
2334
|
+
} catch {
|
|
2335
|
+
return !1;
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
var DJ = U("$ZodBase64", (J, X) => {
|
|
2339
|
+
X.pattern ?? (X.pattern = U1), V.init(J, X), J._zod.bag.contentEncoding = "base64", J._zod.check = (Y) => {
|
|
2340
|
+
if (wJ(Y.value)) return;
|
|
2341
|
+
Y.issues.push({
|
|
2342
|
+
code: "invalid_format",
|
|
2343
|
+
format: "base64",
|
|
2344
|
+
input: Y.value,
|
|
2345
|
+
inst: J,
|
|
2346
|
+
continue: !X.abort
|
|
2347
|
+
});
|
|
2348
|
+
};
|
|
2349
|
+
});
|
|
2350
|
+
function $X(J) {
|
|
2351
|
+
if (!$4.test(J)) return !1;
|
|
2352
|
+
let X = J.replace(/[-_]/g, (W) => W === "-" ? "+" : "/");
|
|
2353
|
+
return wJ(X.padEnd(Math.ceil(X.length / 4) * 4, "="));
|
|
2354
|
+
}
|
|
2355
|
+
var PJ = U("$ZodBase64URL", (J, X) => {
|
|
2356
|
+
X.pattern ?? (X.pattern = $4), V.init(J, X), J._zod.bag.contentEncoding = "base64url", J._zod.check = (Y) => {
|
|
2357
|
+
if ($X(Y.value)) return;
|
|
2358
|
+
Y.issues.push({
|
|
2359
|
+
code: "invalid_format",
|
|
2360
|
+
format: "base64url",
|
|
2361
|
+
input: Y.value,
|
|
2362
|
+
inst: J,
|
|
2363
|
+
continue: !X.abort
|
|
2364
|
+
});
|
|
2365
|
+
};
|
|
2366
|
+
}), OJ = U("$ZodE164", (J, X) => {
|
|
2367
|
+
X.pattern ?? (X.pattern = I1), V.init(J, X);
|
|
2368
|
+
});
|
|
2369
|
+
function KX(J, X = null) {
|
|
2370
|
+
try {
|
|
2371
|
+
let Y = J.split(".");
|
|
2372
|
+
if (Y.length !== 3) return !1;
|
|
2373
|
+
let [W] = Y;
|
|
2374
|
+
if (!W) return !1;
|
|
2375
|
+
let q = JSON.parse(atob(W));
|
|
2376
|
+
if ("typ" in q && q?.typ !== "JWT") return !1;
|
|
2377
|
+
if (!q.alg) return !1;
|
|
2378
|
+
if (X && (!("alg" in q) || q.alg !== X)) return !1;
|
|
2379
|
+
return !0;
|
|
2380
|
+
} catch {
|
|
2381
|
+
return !1;
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
var MJ = U("$ZodJWT", (J, X) => {
|
|
2385
|
+
V.init(J, X), J._zod.check = (Y) => {
|
|
2386
|
+
if (KX(Y.value, X.alg)) return;
|
|
2387
|
+
Y.issues.push({
|
|
2388
|
+
code: "invalid_format",
|
|
2389
|
+
format: "jwt",
|
|
2390
|
+
input: Y.value,
|
|
2391
|
+
inst: J,
|
|
2392
|
+
continue: !X.abort
|
|
2393
|
+
});
|
|
2394
|
+
};
|
|
2395
|
+
});
|
|
2396
|
+
var S4 = U("$ZodNumber", (J, X) => {
|
|
2397
|
+
$.init(J, X), J._zod.pattern = J._zod.bag.pattern ?? $1, J._zod.parse = (Y, W) => {
|
|
2398
|
+
if (X.coerce) try {
|
|
2399
|
+
Y.value = Number(Y.value);
|
|
2400
|
+
} catch (B) {}
|
|
2401
|
+
let q = Y.value;
|
|
2402
|
+
if (typeof q === "number" && !Number.isNaN(q) && Number.isFinite(q)) return Y;
|
|
2403
|
+
let H = typeof q === "number" ? Number.isNaN(q) ? "NaN" : !Number.isFinite(q) ? "Infinity" : void 0 : void 0;
|
|
2404
|
+
return Y.issues.push({
|
|
2405
|
+
expected: "number",
|
|
2406
|
+
code: "invalid_type",
|
|
2407
|
+
input: q,
|
|
2408
|
+
inst: J,
|
|
2409
|
+
...H ? { received: H } : {}
|
|
2410
|
+
}), Y;
|
|
2411
|
+
};
|
|
2412
|
+
}), AJ = U("$ZodNumberFormat", (J, X) => {
|
|
2413
|
+
L1.init(J, X), S4.init(J, X);
|
|
2414
|
+
}), FJ = U("$ZodBoolean", (J, X) => {
|
|
2415
|
+
$.init(J, X), J._zod.pattern = K1, J._zod.parse = (Y, W) => {
|
|
2416
|
+
if (X.coerce) try {
|
|
2417
|
+
Y.value = Boolean(Y.value);
|
|
2418
|
+
} catch (H) {}
|
|
2419
|
+
let q = Y.value;
|
|
2420
|
+
if (typeof q === "boolean") return Y;
|
|
2421
|
+
return Y.issues.push({
|
|
2422
|
+
expected: "boolean",
|
|
2423
|
+
code: "invalid_type",
|
|
2424
|
+
input: q,
|
|
2425
|
+
inst: J
|
|
2426
|
+
}), Y;
|
|
2427
|
+
};
|
|
2428
|
+
}), EJ = U("$ZodBigInt", (J, X) => {
|
|
2429
|
+
$.init(J, X), J._zod.pattern = F1, J._zod.parse = (Y, W) => {
|
|
2430
|
+
if (X.coerce) try {
|
|
2431
|
+
Y.value = BigInt(Y.value);
|
|
2432
|
+
} catch (q) {}
|
|
2433
|
+
if (typeof Y.value === "bigint") return Y;
|
|
2434
|
+
return Y.issues.push({
|
|
2435
|
+
expected: "bigint",
|
|
2436
|
+
code: "invalid_type",
|
|
2437
|
+
input: Y.value,
|
|
2438
|
+
inst: J
|
|
2439
|
+
}), Y;
|
|
2440
|
+
};
|
|
2441
|
+
});
|
|
2442
|
+
var $J = U("$ZodAny", (J, X) => {
|
|
2443
|
+
$.init(J, X), J._zod.parse = (Y) => Y;
|
|
2444
|
+
}), KJ = U("$ZodUnknown", (J, X) => {
|
|
2445
|
+
$.init(J, X), J._zod.parse = (Y) => Y;
|
|
2446
|
+
}), VJ = U("$ZodNever", (J, X) => {
|
|
2447
|
+
$.init(J, X), J._zod.parse = (Y, W) => {
|
|
2448
|
+
return Y.issues.push({
|
|
2449
|
+
expected: "never",
|
|
2450
|
+
code: "invalid_type",
|
|
2451
|
+
input: Y.value,
|
|
2452
|
+
inst: J
|
|
2453
|
+
}), Y;
|
|
2454
|
+
};
|
|
2455
|
+
});
|
|
2456
|
+
var RJ = U("$ZodDate", (J, X) => {
|
|
2457
|
+
$.init(J, X), J._zod.parse = (Y, W) => {
|
|
2458
|
+
if (X.coerce) try {
|
|
2459
|
+
Y.value = new Date(Y.value);
|
|
2460
|
+
} catch (Q) {}
|
|
2461
|
+
let q = Y.value, H = q instanceof Date;
|
|
2462
|
+
if (H && !Number.isNaN(q.getTime())) return Y;
|
|
2463
|
+
return Y.issues.push({
|
|
2464
|
+
expected: "date",
|
|
2465
|
+
code: "invalid_type",
|
|
2466
|
+
input: q,
|
|
2467
|
+
...H ? { received: "Invalid Date" } : {},
|
|
2468
|
+
inst: J
|
|
2469
|
+
}), Y;
|
|
2470
|
+
};
|
|
2471
|
+
});
|
|
2472
|
+
function c1(J, X, Y) {
|
|
2473
|
+
if (J.issues.length) X.issues.push(...l(Y, J.issues));
|
|
2474
|
+
X.value[Y] = J.value;
|
|
2475
|
+
}
|
|
2476
|
+
var NJ = U("$ZodArray", (J, X) => {
|
|
2477
|
+
$.init(J, X), J._zod.parse = (Y, W) => {
|
|
2478
|
+
let q = Y.value;
|
|
2479
|
+
if (!Array.isArray(q)) return Y.issues.push({
|
|
2480
|
+
expected: "array",
|
|
2481
|
+
code: "invalid_type",
|
|
2482
|
+
input: q,
|
|
2483
|
+
inst: J
|
|
2484
|
+
}), Y;
|
|
2485
|
+
Y.value = Array(q.length);
|
|
2486
|
+
let H = [];
|
|
2487
|
+
for (let B = 0; B < q.length; B++) {
|
|
2488
|
+
let Q = q[B], G = X.element._zod.run({
|
|
2489
|
+
value: Q,
|
|
2490
|
+
issues: []
|
|
2491
|
+
}, W);
|
|
2492
|
+
if (G instanceof Promise) H.push(G.then((z) => c1(z, Y, B)));
|
|
2493
|
+
else c1(G, Y, B);
|
|
2494
|
+
}
|
|
2495
|
+
if (H.length) return Promise.all(H).then(() => Y);
|
|
2496
|
+
return Y;
|
|
2497
|
+
};
|
|
2498
|
+
});
|
|
2499
|
+
function n0(J, X, Y, W) {
|
|
2500
|
+
if (J.issues.length) X.issues.push(...l(Y, J.issues));
|
|
2501
|
+
if (J.value === void 0) {
|
|
2502
|
+
if (Y in W) X.value[Y] = void 0;
|
|
2503
|
+
} else X.value[Y] = J.value;
|
|
2504
|
+
}
|
|
2505
|
+
function SJ(J) {
|
|
2506
|
+
let X = Object.keys(J.shape);
|
|
2507
|
+
for (let W of X) if (!J.shape?.[W]?._zod?.traits?.has("$ZodType")) throw Error(`Invalid element at key "${W}": expected a Zod schema`);
|
|
2508
|
+
let Y = M4(J.shape);
|
|
2509
|
+
return {
|
|
2510
|
+
...J,
|
|
2511
|
+
keys: X,
|
|
2512
|
+
keySet: new Set(X),
|
|
2513
|
+
numKeys: X.length,
|
|
2514
|
+
optionalKeys: new Set(Y)
|
|
2515
|
+
};
|
|
2516
|
+
}
|
|
2517
|
+
function LJ(J, X, Y, W, q, H) {
|
|
2518
|
+
let B = [], Q = q.keySet, G = q.catchall._zod, z = G.def.type;
|
|
2519
|
+
for (let I in X) {
|
|
2520
|
+
if (Q.has(I)) continue;
|
|
2521
|
+
if (z === "never") {
|
|
2522
|
+
B.push(I);
|
|
2523
|
+
continue;
|
|
2524
|
+
}
|
|
2525
|
+
let w = G.run({
|
|
2526
|
+
value: X[I],
|
|
2527
|
+
issues: []
|
|
2528
|
+
}, W);
|
|
2529
|
+
if (w instanceof Promise) J.push(w.then((M) => n0(M, Y, I, X)));
|
|
2530
|
+
else n0(w, Y, I, X);
|
|
2531
|
+
}
|
|
2532
|
+
if (B.length) Y.issues.push({
|
|
2533
|
+
code: "unrecognized_keys",
|
|
2534
|
+
keys: B,
|
|
2535
|
+
input: X,
|
|
2536
|
+
inst: H
|
|
2537
|
+
});
|
|
2538
|
+
if (!J.length) return Y;
|
|
2539
|
+
return Promise.all(J).then(() => {
|
|
2540
|
+
return Y;
|
|
2541
|
+
});
|
|
2542
|
+
}
|
|
2543
|
+
var VX = U("$ZodObject", (J, X) => {
|
|
2544
|
+
if ($.init(J, X), !Object.getOwnPropertyDescriptor(X, "shape")?.get) {
|
|
2545
|
+
let Q = X.shape;
|
|
2546
|
+
Object.defineProperty(X, "shape", { get: () => {
|
|
2547
|
+
let G = { ...Q };
|
|
2548
|
+
return Object.defineProperty(X, "shape", { value: G }), G;
|
|
2549
|
+
} });
|
|
2550
|
+
}
|
|
2551
|
+
let W = F0(() => SJ(X));
|
|
2552
|
+
E(J._zod, "propValues", () => {
|
|
2553
|
+
let Q = X.shape, G = {};
|
|
2554
|
+
for (let z in Q) {
|
|
2555
|
+
let I = Q[z]._zod;
|
|
2556
|
+
if (I.values) {
|
|
2557
|
+
G[z] ?? (G[z] = /* @__PURE__ */ new Set());
|
|
2558
|
+
for (let w of I.values) G[z].add(w);
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
return G;
|
|
2562
|
+
});
|
|
2563
|
+
let q = q0, H = X.catchall, B;
|
|
2564
|
+
J._zod.parse = (Q, G) => {
|
|
2565
|
+
B ?? (B = W.value);
|
|
2566
|
+
let z = Q.value;
|
|
2567
|
+
if (!q(z)) return Q.issues.push({
|
|
2568
|
+
expected: "object",
|
|
2569
|
+
code: "invalid_type",
|
|
2570
|
+
input: z,
|
|
2571
|
+
inst: J
|
|
2572
|
+
}), Q;
|
|
2573
|
+
Q.value = {};
|
|
2574
|
+
let I = [], w = B.shape;
|
|
2575
|
+
for (let M of B.keys) {
|
|
2576
|
+
let N = w[M]._zod.run({
|
|
2577
|
+
value: z[M],
|
|
2578
|
+
issues: []
|
|
2579
|
+
}, G);
|
|
2580
|
+
if (N instanceof Promise) I.push(N.then((_) => n0(_, Q, M, z)));
|
|
2581
|
+
else n0(N, Q, M, z);
|
|
2582
|
+
}
|
|
2583
|
+
if (!H) return I.length ? Promise.all(I).then(() => Q) : Q;
|
|
2584
|
+
return LJ(I, z, Q, G, W.value, J);
|
|
2585
|
+
};
|
|
2586
|
+
}), ZJ = U("$ZodObjectJIT", (J, X) => {
|
|
2587
|
+
VX.init(J, X);
|
|
2588
|
+
let Y = J._zod.parse, W = F0(() => SJ(X)), q = (M) => {
|
|
2589
|
+
let P = new R4([
|
|
2590
|
+
"shape",
|
|
2591
|
+
"payload",
|
|
2592
|
+
"ctx"
|
|
2593
|
+
]), N = W.value, _ = (k) => {
|
|
2594
|
+
let C = y0(k);
|
|
2595
|
+
return `shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`;
|
|
2596
|
+
};
|
|
2597
|
+
P.write("const input = payload.value;");
|
|
2598
|
+
let d = Object.create(null), g = 0;
|
|
2599
|
+
for (let k of N.keys) d[k] = `key_${g++}`;
|
|
2600
|
+
P.write("const newResult = {};");
|
|
2601
|
+
for (let k of N.keys) {
|
|
2602
|
+
let C = d[k], o = y0(k);
|
|
2603
|
+
P.write(`const ${C} = ${_(k)};`), P.write(`
|
|
2604
|
+
if (${C}.issues.length) {
|
|
2605
|
+
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
2606
|
+
...iss,
|
|
2607
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
2608
|
+
})));
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
|
|
2612
|
+
if (${C}.value === undefined) {
|
|
2613
|
+
if (${o} in input) {
|
|
2614
|
+
newResult[${o}] = undefined;
|
|
2615
|
+
}
|
|
2616
|
+
} else {
|
|
2617
|
+
newResult[${o}] = ${C}.value;
|
|
2618
|
+
}
|
|
2619
|
+
|
|
2620
|
+
`);
|
|
2621
|
+
}
|
|
2622
|
+
P.write("payload.value = newResult;"), P.write("return payload;");
|
|
2623
|
+
let Z0 = P.compile();
|
|
2624
|
+
return (k, C) => Z0(M, k, C);
|
|
2625
|
+
}, H, B = q0, Q = !u0.jitless, z = Q && P4.value, I = X.catchall, w;
|
|
2626
|
+
J._zod.parse = (M, P) => {
|
|
2627
|
+
w ?? (w = W.value);
|
|
2628
|
+
let N = M.value;
|
|
2629
|
+
if (!B(N)) return M.issues.push({
|
|
2630
|
+
expected: "object",
|
|
2631
|
+
code: "invalid_type",
|
|
2632
|
+
input: N,
|
|
2633
|
+
inst: J
|
|
2634
|
+
}), M;
|
|
2635
|
+
if (Q && z && P?.async === !1 && P.jitless !== !0) {
|
|
2636
|
+
if (!H) H = q(X.shape);
|
|
2637
|
+
if (M = H(M, P), !I) return M;
|
|
2638
|
+
return LJ([], N, M, P, w, J);
|
|
2639
|
+
}
|
|
2640
|
+
return Y(M, P);
|
|
2641
|
+
};
|
|
2642
|
+
});
|
|
2643
|
+
function y1(J, X, Y, W) {
|
|
2644
|
+
for (let H of J) if (H.issues.length === 0) return X.value = H.value, X;
|
|
2645
|
+
let q = J.filter((H) => !a(H));
|
|
2646
|
+
if (q.length === 1) return X.value = q[0].value, q[0];
|
|
2647
|
+
return X.issues.push({
|
|
2648
|
+
code: "invalid_union",
|
|
2649
|
+
input: X.value,
|
|
2650
|
+
inst: Y,
|
|
2651
|
+
errors: J.map((H) => H.issues.map((B) => m(B, W, v())))
|
|
2652
|
+
}), X;
|
|
2653
|
+
}
|
|
2654
|
+
var _J = U("$ZodUnion", (J, X) => {
|
|
2655
|
+
$.init(J, X), E(J._zod, "optin", () => X.options.some((q) => q._zod.optin === "optional") ? "optional" : void 0), E(J._zod, "optout", () => X.options.some((q) => q._zod.optout === "optional") ? "optional" : void 0), E(J._zod, "values", () => {
|
|
2656
|
+
if (X.options.every((q) => q._zod.values)) return new Set(X.options.flatMap((q) => Array.from(q._zod.values)));
|
|
2657
|
+
}), E(J._zod, "pattern", () => {
|
|
2658
|
+
if (X.options.every((q) => q._zod.pattern)) {
|
|
2659
|
+
let q = X.options.map((H) => H._zod.pattern);
|
|
2660
|
+
return /* @__PURE__ */ new RegExp(`^(${q.map((H) => $0(H.source)).join("|")})$`);
|
|
2661
|
+
}
|
|
2662
|
+
});
|
|
2663
|
+
let Y = X.options.length === 1, W = X.options[0]._zod.run;
|
|
2664
|
+
J._zod.parse = (q, H) => {
|
|
2665
|
+
if (Y) return W(q, H);
|
|
2666
|
+
let B = !1, Q = [];
|
|
2667
|
+
for (let G of X.options) {
|
|
2668
|
+
let z = G._zod.run({
|
|
2669
|
+
value: q.value,
|
|
2670
|
+
issues: []
|
|
2671
|
+
}, H);
|
|
2672
|
+
if (z instanceof Promise) Q.push(z), B = !0;
|
|
2673
|
+
else {
|
|
2674
|
+
if (z.issues.length === 0) return z;
|
|
2675
|
+
Q.push(z);
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
if (!B) return y1(Q, q, J, H);
|
|
2679
|
+
return Promise.all(Q).then((G) => {
|
|
2680
|
+
return y1(G, q, J, H);
|
|
2681
|
+
});
|
|
2682
|
+
};
|
|
2683
|
+
});
|
|
2684
|
+
var bJ = U("$ZodIntersection", (J, X) => {
|
|
2685
|
+
$.init(J, X), J._zod.parse = (Y, W) => {
|
|
2686
|
+
let q = Y.value, H = X.left._zod.run({
|
|
2687
|
+
value: q,
|
|
2688
|
+
issues: []
|
|
2689
|
+
}, W), B = X.right._zod.run({
|
|
2690
|
+
value: q,
|
|
2691
|
+
issues: []
|
|
2692
|
+
}, W);
|
|
2693
|
+
if (H instanceof Promise || B instanceof Promise) return Promise.all([H, B]).then(([G, z]) => {
|
|
2694
|
+
return m1(Y, G, z);
|
|
2695
|
+
});
|
|
2696
|
+
return m1(Y, H, B);
|
|
2697
|
+
};
|
|
2698
|
+
});
|
|
2699
|
+
function N4(J, X) {
|
|
2700
|
+
if (J === X) return {
|
|
2701
|
+
valid: !0,
|
|
2702
|
+
data: J
|
|
2703
|
+
};
|
|
2704
|
+
if (J instanceof Date && X instanceof Date && +J === +X) return {
|
|
2705
|
+
valid: !0,
|
|
2706
|
+
data: J
|
|
2707
|
+
};
|
|
2708
|
+
if (t(J) && t(X)) {
|
|
2709
|
+
let Y = Object.keys(X), W = Object.keys(J).filter((H) => Y.indexOf(H) !== -1), q = {
|
|
2710
|
+
...J,
|
|
2711
|
+
...X
|
|
2712
|
+
};
|
|
2713
|
+
for (let H of W) {
|
|
2714
|
+
let B = N4(J[H], X[H]);
|
|
2715
|
+
if (!B.valid) return {
|
|
2716
|
+
valid: !1,
|
|
2717
|
+
mergeErrorPath: [H, ...B.mergeErrorPath]
|
|
2718
|
+
};
|
|
2719
|
+
q[H] = B.data;
|
|
2720
|
+
}
|
|
2721
|
+
return {
|
|
2722
|
+
valid: !0,
|
|
2723
|
+
data: q
|
|
2724
|
+
};
|
|
2725
|
+
}
|
|
2726
|
+
if (Array.isArray(J) && Array.isArray(X)) {
|
|
2727
|
+
if (J.length !== X.length) return {
|
|
2728
|
+
valid: !1,
|
|
2729
|
+
mergeErrorPath: []
|
|
2730
|
+
};
|
|
2731
|
+
let Y = [];
|
|
2732
|
+
for (let W = 0; W < J.length; W++) {
|
|
2733
|
+
let q = J[W], H = X[W], B = N4(q, H);
|
|
2734
|
+
if (!B.valid) return {
|
|
2735
|
+
valid: !1,
|
|
2736
|
+
mergeErrorPath: [W, ...B.mergeErrorPath]
|
|
2737
|
+
};
|
|
2738
|
+
Y.push(B.data);
|
|
2739
|
+
}
|
|
2740
|
+
return {
|
|
2741
|
+
valid: !0,
|
|
2742
|
+
data: Y
|
|
2743
|
+
};
|
|
2744
|
+
}
|
|
2745
|
+
return {
|
|
2746
|
+
valid: !1,
|
|
2747
|
+
mergeErrorPath: []
|
|
2748
|
+
};
|
|
2749
|
+
}
|
|
2750
|
+
function m1(J, X, Y) {
|
|
2751
|
+
if (X.issues.length) J.issues.push(...X.issues);
|
|
2752
|
+
if (Y.issues.length) J.issues.push(...Y.issues);
|
|
2753
|
+
if (a(J)) return J;
|
|
2754
|
+
let W = N4(X.value, Y.value);
|
|
2755
|
+
if (!W.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(W.mergeErrorPath)}`);
|
|
2756
|
+
return J.value = W.data, J;
|
|
2757
|
+
}
|
|
2758
|
+
var CJ = U("$ZodRecord", (J, X) => {
|
|
2759
|
+
$.init(J, X), J._zod.parse = (Y, W) => {
|
|
2760
|
+
let q = Y.value;
|
|
2761
|
+
if (!t(q)) return Y.issues.push({
|
|
2762
|
+
expected: "record",
|
|
2763
|
+
code: "invalid_type",
|
|
2764
|
+
input: q,
|
|
2765
|
+
inst: J
|
|
2766
|
+
}), Y;
|
|
2767
|
+
let H = [], B = X.keyType._zod.values;
|
|
2768
|
+
if (B) {
|
|
2769
|
+
Y.value = {};
|
|
2770
|
+
let Q = /* @__PURE__ */ new Set();
|
|
2771
|
+
for (let z of B) if (typeof z === "string" || typeof z === "number" || typeof z === "symbol") {
|
|
2772
|
+
Q.add(typeof z === "number" ? z.toString() : z);
|
|
2773
|
+
let I = X.valueType._zod.run({
|
|
2774
|
+
value: q[z],
|
|
2775
|
+
issues: []
|
|
2776
|
+
}, W);
|
|
2777
|
+
if (I instanceof Promise) H.push(I.then((w) => {
|
|
2778
|
+
if (w.issues.length) Y.issues.push(...l(z, w.issues));
|
|
2779
|
+
Y.value[z] = w.value;
|
|
2780
|
+
}));
|
|
2781
|
+
else {
|
|
2782
|
+
if (I.issues.length) Y.issues.push(...l(z, I.issues));
|
|
2783
|
+
Y.value[z] = I.value;
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
let G;
|
|
2787
|
+
for (let z in q) if (!Q.has(z)) G = G ?? [], G.push(z);
|
|
2788
|
+
if (G && G.length > 0) Y.issues.push({
|
|
2789
|
+
code: "unrecognized_keys",
|
|
2790
|
+
input: q,
|
|
2791
|
+
inst: J,
|
|
2792
|
+
keys: G
|
|
2793
|
+
});
|
|
2794
|
+
} else {
|
|
2795
|
+
Y.value = {};
|
|
2796
|
+
for (let Q of Reflect.ownKeys(q)) {
|
|
2797
|
+
if (Q === "__proto__") continue;
|
|
2798
|
+
let G = X.keyType._zod.run({
|
|
2799
|
+
value: Q,
|
|
2800
|
+
issues: []
|
|
2801
|
+
}, W);
|
|
2802
|
+
if (G instanceof Promise) throw Error("Async schemas not supported in object keys currently");
|
|
2803
|
+
if (G.issues.length) {
|
|
2804
|
+
if (X.mode === "loose") Y.value[Q] = q[Q];
|
|
2805
|
+
else Y.issues.push({
|
|
2806
|
+
code: "invalid_key",
|
|
2807
|
+
origin: "record",
|
|
2808
|
+
issues: G.issues.map((I) => m(I, W, v())),
|
|
2809
|
+
input: Q,
|
|
2810
|
+
path: [Q],
|
|
2811
|
+
inst: J
|
|
2812
|
+
});
|
|
2813
|
+
continue;
|
|
2814
|
+
}
|
|
2815
|
+
let z = X.valueType._zod.run({
|
|
2816
|
+
value: q[Q],
|
|
2817
|
+
issues: []
|
|
2818
|
+
}, W);
|
|
2819
|
+
if (z instanceof Promise) H.push(z.then((I) => {
|
|
2820
|
+
if (I.issues.length) Y.issues.push(...l(Q, I.issues));
|
|
2821
|
+
Y.value[G.value] = I.value;
|
|
2822
|
+
}));
|
|
2823
|
+
else {
|
|
2824
|
+
if (z.issues.length) Y.issues.push(...l(Q, z.issues));
|
|
2825
|
+
Y.value[G.value] = z.value;
|
|
2826
|
+
}
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
if (H.length) return Promise.all(H).then(() => Y);
|
|
2830
|
+
return Y;
|
|
2831
|
+
};
|
|
2832
|
+
});
|
|
2833
|
+
var kJ = U("$ZodEnum", (J, X) => {
|
|
2834
|
+
$.init(J, X);
|
|
2835
|
+
let Y = A0(X.entries), W = new Set(Y);
|
|
2836
|
+
J._zod.values = W, J._zod.pattern = /* @__PURE__ */ new RegExp(`^(${Y.filter((q) => O4.has(typeof q)).map((q) => typeof q === "string" ? J0(q) : q.toString()).join("|")})$`), J._zod.parse = (q, H) => {
|
|
2837
|
+
let B = q.value;
|
|
2838
|
+
if (W.has(B)) return q;
|
|
2839
|
+
return q.issues.push({
|
|
2840
|
+
code: "invalid_value",
|
|
2841
|
+
values: Y,
|
|
2842
|
+
input: B,
|
|
2843
|
+
inst: J
|
|
2844
|
+
}), q;
|
|
2845
|
+
};
|
|
2846
|
+
});
|
|
2847
|
+
var TJ = U("$ZodTransform", (J, X) => {
|
|
2848
|
+
$.init(J, X), J._zod.parse = (Y, W) => {
|
|
2849
|
+
if (W.direction === "backward") throw new O0(J.constructor.name);
|
|
2850
|
+
let q = X.transform(Y.value, Y);
|
|
2851
|
+
if (W.async) return (q instanceof Promise ? q : Promise.resolve(q)).then((B) => {
|
|
2852
|
+
return Y.value = B, Y;
|
|
2853
|
+
});
|
|
2854
|
+
if (q instanceof Promise) throw new r();
|
|
2855
|
+
return Y.value = q, Y;
|
|
2856
|
+
};
|
|
2857
|
+
});
|
|
2858
|
+
function f1(J, X) {
|
|
2859
|
+
if (J.issues.length && X === void 0) return {
|
|
2860
|
+
issues: [],
|
|
2861
|
+
value: void 0
|
|
2862
|
+
};
|
|
2863
|
+
return J;
|
|
2864
|
+
}
|
|
2865
|
+
var jJ = U("$ZodOptional", (J, X) => {
|
|
2866
|
+
$.init(J, X), J._zod.optin = "optional", J._zod.optout = "optional", E(J._zod, "values", () => {
|
|
2867
|
+
return X.innerType._zod.values ? new Set([...X.innerType._zod.values, void 0]) : void 0;
|
|
2868
|
+
}), E(J._zod, "pattern", () => {
|
|
2869
|
+
let Y = X.innerType._zod.pattern;
|
|
2870
|
+
return Y ? /* @__PURE__ */ new RegExp(`^(${$0(Y.source)})?$`) : void 0;
|
|
2871
|
+
}), J._zod.parse = (Y, W) => {
|
|
2872
|
+
if (X.innerType._zod.optin === "optional") {
|
|
2873
|
+
let q = X.innerType._zod.run(Y, W);
|
|
2874
|
+
if (q instanceof Promise) return q.then((H) => f1(H, Y.value));
|
|
2875
|
+
return f1(q, Y.value);
|
|
2876
|
+
}
|
|
2877
|
+
if (Y.value === void 0) return Y;
|
|
2878
|
+
return X.innerType._zod.run(Y, W);
|
|
2879
|
+
};
|
|
2880
|
+
}), hJ = U("$ZodNullable", (J, X) => {
|
|
2881
|
+
$.init(J, X), E(J._zod, "optin", () => X.innerType._zod.optin), E(J._zod, "optout", () => X.innerType._zod.optout), E(J._zod, "pattern", () => {
|
|
2882
|
+
let Y = X.innerType._zod.pattern;
|
|
2883
|
+
return Y ? /* @__PURE__ */ new RegExp(`^(${$0(Y.source)}|null)$`) : void 0;
|
|
2884
|
+
}), E(J._zod, "values", () => {
|
|
2885
|
+
return X.innerType._zod.values ? new Set([...X.innerType._zod.values, null]) : void 0;
|
|
2886
|
+
}), J._zod.parse = (Y, W) => {
|
|
2887
|
+
if (Y.value === null) return Y;
|
|
2888
|
+
return X.innerType._zod.run(Y, W);
|
|
2889
|
+
};
|
|
2890
|
+
}), xJ = U("$ZodDefault", (J, X) => {
|
|
2891
|
+
$.init(J, X), J._zod.optin = "optional", E(J._zod, "values", () => X.innerType._zod.values), J._zod.parse = (Y, W) => {
|
|
2892
|
+
if (W.direction === "backward") return X.innerType._zod.run(Y, W);
|
|
2893
|
+
if (Y.value === void 0) return Y.value = X.defaultValue, Y;
|
|
2894
|
+
let q = X.innerType._zod.run(Y, W);
|
|
2895
|
+
if (q instanceof Promise) return q.then((H) => o1(H, X));
|
|
2896
|
+
return o1(q, X);
|
|
2897
|
+
};
|
|
2898
|
+
});
|
|
2899
|
+
function o1(J, X) {
|
|
2900
|
+
if (J.value === void 0) J.value = X.defaultValue;
|
|
2901
|
+
return J;
|
|
2902
|
+
}
|
|
2903
|
+
var vJ = U("$ZodPrefault", (J, X) => {
|
|
2904
|
+
$.init(J, X), J._zod.optin = "optional", E(J._zod, "values", () => X.innerType._zod.values), J._zod.parse = (Y, W) => {
|
|
2905
|
+
if (W.direction === "backward") return X.innerType._zod.run(Y, W);
|
|
2906
|
+
if (Y.value === void 0) Y.value = X.defaultValue;
|
|
2907
|
+
return X.innerType._zod.run(Y, W);
|
|
2908
|
+
};
|
|
2909
|
+
}), gJ = U("$ZodNonOptional", (J, X) => {
|
|
2910
|
+
$.init(J, X), E(J._zod, "values", () => {
|
|
2911
|
+
let Y = X.innerType._zod.values;
|
|
2912
|
+
return Y ? new Set([...Y].filter((W) => W !== void 0)) : void 0;
|
|
2913
|
+
}), J._zod.parse = (Y, W) => {
|
|
2914
|
+
let q = X.innerType._zod.run(Y, W);
|
|
2915
|
+
if (q instanceof Promise) return q.then((H) => r1(H, J));
|
|
2916
|
+
return r1(q, J);
|
|
2917
|
+
};
|
|
2918
|
+
});
|
|
2919
|
+
function r1(J, X) {
|
|
2920
|
+
if (!J.issues.length && J.value === void 0) J.issues.push({
|
|
2921
|
+
code: "invalid_type",
|
|
2922
|
+
expected: "nonoptional",
|
|
2923
|
+
input: J.value,
|
|
2924
|
+
inst: X
|
|
2925
|
+
});
|
|
2926
|
+
return J;
|
|
2927
|
+
}
|
|
2928
|
+
var uJ = U("$ZodCatch", (J, X) => {
|
|
2929
|
+
$.init(J, X), E(J._zod, "optin", () => X.innerType._zod.optin), E(J._zod, "optout", () => X.innerType._zod.optout), E(J._zod, "values", () => X.innerType._zod.values), J._zod.parse = (Y, W) => {
|
|
2930
|
+
if (W.direction === "backward") return X.innerType._zod.run(Y, W);
|
|
2931
|
+
let q = X.innerType._zod.run(Y, W);
|
|
2932
|
+
if (q instanceof Promise) return q.then((H) => {
|
|
2933
|
+
if (Y.value = H.value, H.issues.length) Y.value = X.catchValue({
|
|
2934
|
+
...Y,
|
|
2935
|
+
error: { issues: H.issues.map((B) => m(B, W, v())) },
|
|
2936
|
+
input: Y.value
|
|
2937
|
+
}), Y.issues = [];
|
|
2938
|
+
return Y;
|
|
2939
|
+
});
|
|
2940
|
+
if (Y.value = q.value, q.issues.length) Y.value = X.catchValue({
|
|
2941
|
+
...Y,
|
|
2942
|
+
error: { issues: q.issues.map((H) => m(H, W, v())) },
|
|
2943
|
+
input: Y.value
|
|
2944
|
+
}), Y.issues = [];
|
|
2945
|
+
return Y;
|
|
2946
|
+
};
|
|
2947
|
+
});
|
|
2948
|
+
var cJ = U("$ZodPipe", (J, X) => {
|
|
2949
|
+
$.init(J, X), E(J._zod, "values", () => X.in._zod.values), E(J._zod, "optin", () => X.in._zod.optin), E(J._zod, "optout", () => X.out._zod.optout), E(J._zod, "propValues", () => X.in._zod.propValues), J._zod.parse = (Y, W) => {
|
|
2950
|
+
if (W.direction === "backward") {
|
|
2951
|
+
let H = X.out._zod.run(Y, W);
|
|
2952
|
+
if (H instanceof Promise) return H.then((B) => d0(B, X.in, W));
|
|
2953
|
+
return d0(H, X.in, W);
|
|
2954
|
+
}
|
|
2955
|
+
let q = X.in._zod.run(Y, W);
|
|
2956
|
+
if (q instanceof Promise) return q.then((H) => d0(H, X.out, W));
|
|
2957
|
+
return d0(q, X.out, W);
|
|
2958
|
+
};
|
|
2959
|
+
});
|
|
2960
|
+
function d0(J, X, Y) {
|
|
2961
|
+
if (J.issues.length) return J.aborted = !0, J;
|
|
2962
|
+
return X._zod.run({
|
|
2963
|
+
value: J.value,
|
|
2964
|
+
issues: J.issues
|
|
2965
|
+
}, Y);
|
|
2966
|
+
}
|
|
2967
|
+
var yJ = U("$ZodReadonly", (J, X) => {
|
|
2968
|
+
$.init(J, X), E(J._zod, "propValues", () => X.innerType._zod.propValues), E(J._zod, "values", () => X.innerType._zod.values), E(J._zod, "optin", () => X.innerType?._zod?.optin), E(J._zod, "optout", () => X.innerType?._zod?.optout), J._zod.parse = (Y, W) => {
|
|
2969
|
+
if (W.direction === "backward") return X.innerType._zod.run(Y, W);
|
|
2970
|
+
let q = X.innerType._zod.run(Y, W);
|
|
2971
|
+
if (q instanceof Promise) return q.then(l1);
|
|
2972
|
+
return l1(q);
|
|
2973
|
+
};
|
|
2974
|
+
});
|
|
2975
|
+
function l1(J) {
|
|
2976
|
+
return J.value = Object.freeze(J.value), J;
|
|
2977
|
+
}
|
|
2978
|
+
var mJ = U("$ZodCustom", (J, X) => {
|
|
2979
|
+
T.init(J, X), $.init(J, X), J._zod.parse = (Y, W) => {
|
|
2980
|
+
return Y;
|
|
2981
|
+
}, J._zod.check = (Y) => {
|
|
2982
|
+
let W = Y.value, q = X.fn(W);
|
|
2983
|
+
if (q instanceof Promise) return q.then((H) => p1(H, Y, W, J));
|
|
2984
|
+
p1(q, Y, W, J);
|
|
2985
|
+
};
|
|
2986
|
+
});
|
|
2987
|
+
function p1(J, X, Y, W) {
|
|
2988
|
+
if (!J) {
|
|
2989
|
+
let q = {
|
|
2990
|
+
code: "custom",
|
|
2991
|
+
input: Y,
|
|
2992
|
+
inst: W,
|
|
2993
|
+
path: [...W._zod.def.path ?? []],
|
|
2994
|
+
continue: !W._zod.def.abort
|
|
2995
|
+
};
|
|
2996
|
+
if (W._zod.def.params) q.params = W._zod.def.params;
|
|
2997
|
+
X.issues.push(B0(q));
|
|
2998
|
+
}
|
|
2999
|
+
}
|
|
3000
|
+
var RX = (J) => {
|
|
3001
|
+
let X = typeof J;
|
|
3002
|
+
switch (X) {
|
|
3003
|
+
case "number": return Number.isNaN(J) ? "NaN" : "number";
|
|
3004
|
+
case "object":
|
|
3005
|
+
if (Array.isArray(J)) return "array";
|
|
3006
|
+
if (J === null) return "null";
|
|
3007
|
+
if (Object.getPrototypeOf(J) !== Object.prototype && J.constructor) return J.constructor.name;
|
|
3008
|
+
}
|
|
3009
|
+
return X;
|
|
3010
|
+
}, NX = () => {
|
|
3011
|
+
let J = {
|
|
3012
|
+
string: {
|
|
3013
|
+
unit: "characters",
|
|
3014
|
+
verb: "to have"
|
|
3015
|
+
},
|
|
3016
|
+
file: {
|
|
3017
|
+
unit: "bytes",
|
|
3018
|
+
verb: "to have"
|
|
3019
|
+
},
|
|
3020
|
+
array: {
|
|
3021
|
+
unit: "items",
|
|
3022
|
+
verb: "to have"
|
|
3023
|
+
},
|
|
3024
|
+
set: {
|
|
3025
|
+
unit: "items",
|
|
3026
|
+
verb: "to have"
|
|
3027
|
+
}
|
|
3028
|
+
};
|
|
3029
|
+
function X(W) {
|
|
3030
|
+
return J[W] ?? null;
|
|
3031
|
+
}
|
|
3032
|
+
let Y = {
|
|
3033
|
+
regex: "input",
|
|
3034
|
+
email: "email address",
|
|
3035
|
+
url: "URL",
|
|
3036
|
+
emoji: "emoji",
|
|
3037
|
+
uuid: "UUID",
|
|
3038
|
+
uuidv4: "UUIDv4",
|
|
3039
|
+
uuidv6: "UUIDv6",
|
|
3040
|
+
nanoid: "nanoid",
|
|
3041
|
+
guid: "GUID",
|
|
3042
|
+
cuid: "cuid",
|
|
3043
|
+
cuid2: "cuid2",
|
|
3044
|
+
ulid: "ULID",
|
|
3045
|
+
xid: "XID",
|
|
3046
|
+
ksuid: "KSUID",
|
|
3047
|
+
datetime: "ISO datetime",
|
|
3048
|
+
date: "ISO date",
|
|
3049
|
+
time: "ISO time",
|
|
3050
|
+
duration: "ISO duration",
|
|
3051
|
+
ipv4: "IPv4 address",
|
|
3052
|
+
ipv6: "IPv6 address",
|
|
3053
|
+
mac: "MAC address",
|
|
3054
|
+
cidrv4: "IPv4 range",
|
|
3055
|
+
cidrv6: "IPv6 range",
|
|
3056
|
+
base64: "base64-encoded string",
|
|
3057
|
+
base64url: "base64url-encoded string",
|
|
3058
|
+
json_string: "JSON string",
|
|
3059
|
+
e164: "E.164 number",
|
|
3060
|
+
jwt: "JWT",
|
|
3061
|
+
template_literal: "input"
|
|
3062
|
+
};
|
|
3063
|
+
return (W) => {
|
|
3064
|
+
switch (W.code) {
|
|
3065
|
+
case "invalid_type": return `Invalid input: expected ${W.expected}, received ${RX(W.input)}`;
|
|
3066
|
+
case "invalid_value":
|
|
3067
|
+
if (W.values.length === 1) return `Invalid input: expected ${f0(W.values[0])}`;
|
|
3068
|
+
return `Invalid option: expected one of ${c0(W.values, "|")}`;
|
|
3069
|
+
case "too_big": {
|
|
3070
|
+
let q = W.inclusive ? "<=" : "<", H = X(W.origin);
|
|
3071
|
+
if (H) return `Too big: expected ${W.origin ?? "value"} to have ${q}${W.maximum.toString()} ${H.unit ?? "elements"}`;
|
|
3072
|
+
return `Too big: expected ${W.origin ?? "value"} to be ${q}${W.maximum.toString()}`;
|
|
3073
|
+
}
|
|
3074
|
+
case "too_small": {
|
|
3075
|
+
let q = W.inclusive ? ">=" : ">", H = X(W.origin);
|
|
3076
|
+
if (H) return `Too small: expected ${W.origin} to have ${q}${W.minimum.toString()} ${H.unit}`;
|
|
3077
|
+
return `Too small: expected ${W.origin} to be ${q}${W.minimum.toString()}`;
|
|
3078
|
+
}
|
|
3079
|
+
case "invalid_format": {
|
|
3080
|
+
let q = W;
|
|
3081
|
+
if (q.format === "starts_with") return `Invalid string: must start with "${q.prefix}"`;
|
|
3082
|
+
if (q.format === "ends_with") return `Invalid string: must end with "${q.suffix}"`;
|
|
3083
|
+
if (q.format === "includes") return `Invalid string: must include "${q.includes}"`;
|
|
3084
|
+
if (q.format === "regex") return `Invalid string: must match pattern ${q.pattern}`;
|
|
3085
|
+
return `Invalid ${Y[q.format] ?? W.format}`;
|
|
3086
|
+
}
|
|
3087
|
+
case "not_multiple_of": return `Invalid number: must be a multiple of ${W.divisor}`;
|
|
3088
|
+
case "unrecognized_keys": return `Unrecognized key${W.keys.length > 1 ? "s" : ""}: ${c0(W.keys, ", ")}`;
|
|
3089
|
+
case "invalid_key": return `Invalid key in ${W.origin}`;
|
|
3090
|
+
case "invalid_union": return "Invalid input";
|
|
3091
|
+
case "invalid_element": return `Invalid value in ${W.origin}`;
|
|
3092
|
+
default: return "Invalid input";
|
|
3093
|
+
}
|
|
3094
|
+
};
|
|
3095
|
+
};
|
|
3096
|
+
function L4() {
|
|
3097
|
+
return { localeError: NX() };
|
|
3098
|
+
}
|
|
3099
|
+
var fJ;
|
|
3100
|
+
var oJ = class {
|
|
3101
|
+
constructor() {
|
|
3102
|
+
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
3103
|
+
}
|
|
3104
|
+
add(J, ...X) {
|
|
3105
|
+
let Y = X[0];
|
|
3106
|
+
if (this._map.set(J, Y), Y && typeof Y === "object" && "id" in Y) {
|
|
3107
|
+
if (this._idmap.has(Y.id)) throw Error(`ID ${Y.id} already exists in the registry`);
|
|
3108
|
+
this._idmap.set(Y.id, J);
|
|
3109
|
+
}
|
|
3110
|
+
return this;
|
|
3111
|
+
}
|
|
3112
|
+
clear() {
|
|
3113
|
+
return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
|
|
3114
|
+
}
|
|
3115
|
+
remove(J) {
|
|
3116
|
+
let X = this._map.get(J);
|
|
3117
|
+
if (X && typeof X === "object" && "id" in X) this._idmap.delete(X.id);
|
|
3118
|
+
return this._map.delete(J), this;
|
|
3119
|
+
}
|
|
3120
|
+
get(J) {
|
|
3121
|
+
let X = J._zod.parent;
|
|
3122
|
+
if (X) {
|
|
3123
|
+
let Y = { ...this.get(X) ?? {} };
|
|
3124
|
+
delete Y.id;
|
|
3125
|
+
let W = {
|
|
3126
|
+
...Y,
|
|
3127
|
+
...this._map.get(J)
|
|
3128
|
+
};
|
|
3129
|
+
return Object.keys(W).length ? W : void 0;
|
|
3130
|
+
}
|
|
3131
|
+
return this._map.get(J);
|
|
3132
|
+
}
|
|
3133
|
+
has(J) {
|
|
3134
|
+
return this._map.has(J);
|
|
3135
|
+
}
|
|
3136
|
+
};
|
|
3137
|
+
function SX() {
|
|
3138
|
+
return new oJ();
|
|
3139
|
+
}
|
|
3140
|
+
(fJ = globalThis).__zod_globalRegistry ?? (fJ.__zod_globalRegistry = SX());
|
|
3141
|
+
var X0 = globalThis.__zod_globalRegistry;
|
|
3142
|
+
function rJ(J, X) {
|
|
3143
|
+
return new J({
|
|
3144
|
+
type: "string",
|
|
3145
|
+
...O(X)
|
|
3146
|
+
});
|
|
3147
|
+
}
|
|
3148
|
+
function lJ(J, X) {
|
|
3149
|
+
return new J({
|
|
3150
|
+
type: "string",
|
|
3151
|
+
coerce: !0,
|
|
3152
|
+
...O(X)
|
|
3153
|
+
});
|
|
3154
|
+
}
|
|
3155
|
+
function Z4(J, X) {
|
|
3156
|
+
return new J({
|
|
3157
|
+
type: "string",
|
|
3158
|
+
format: "email",
|
|
3159
|
+
check: "string_format",
|
|
3160
|
+
abort: !1,
|
|
3161
|
+
...O(X)
|
|
3162
|
+
});
|
|
3163
|
+
}
|
|
3164
|
+
function _4(J, X) {
|
|
3165
|
+
return new J({
|
|
3166
|
+
type: "string",
|
|
3167
|
+
format: "guid",
|
|
3168
|
+
check: "string_format",
|
|
3169
|
+
abort: !1,
|
|
3170
|
+
...O(X)
|
|
3171
|
+
});
|
|
3172
|
+
}
|
|
3173
|
+
function pJ(J, X) {
|
|
3174
|
+
return new J({
|
|
3175
|
+
type: "string",
|
|
3176
|
+
format: "uuid",
|
|
3177
|
+
check: "string_format",
|
|
3178
|
+
abort: !1,
|
|
3179
|
+
...O(X)
|
|
3180
|
+
});
|
|
3181
|
+
}
|
|
3182
|
+
function dJ(J, X) {
|
|
3183
|
+
return new J({
|
|
3184
|
+
type: "string",
|
|
3185
|
+
format: "uuid",
|
|
3186
|
+
check: "string_format",
|
|
3187
|
+
abort: !1,
|
|
3188
|
+
version: "v4",
|
|
3189
|
+
...O(X)
|
|
3190
|
+
});
|
|
3191
|
+
}
|
|
3192
|
+
function nJ(J, X) {
|
|
3193
|
+
return new J({
|
|
3194
|
+
type: "string",
|
|
3195
|
+
format: "uuid",
|
|
3196
|
+
check: "string_format",
|
|
3197
|
+
abort: !1,
|
|
3198
|
+
version: "v6",
|
|
3199
|
+
...O(X)
|
|
3200
|
+
});
|
|
3201
|
+
}
|
|
3202
|
+
function iJ(J, X) {
|
|
3203
|
+
return new J({
|
|
3204
|
+
type: "string",
|
|
3205
|
+
format: "uuid",
|
|
3206
|
+
check: "string_format",
|
|
3207
|
+
abort: !1,
|
|
3208
|
+
version: "v7",
|
|
3209
|
+
...O(X)
|
|
3210
|
+
});
|
|
3211
|
+
}
|
|
3212
|
+
function b4(J, X) {
|
|
3213
|
+
return new J({
|
|
3214
|
+
type: "string",
|
|
3215
|
+
format: "url",
|
|
3216
|
+
check: "string_format",
|
|
3217
|
+
abort: !1,
|
|
3218
|
+
...O(X)
|
|
3219
|
+
});
|
|
3220
|
+
}
|
|
3221
|
+
function tJ(J, X) {
|
|
3222
|
+
return new J({
|
|
3223
|
+
type: "string",
|
|
3224
|
+
format: "emoji",
|
|
3225
|
+
check: "string_format",
|
|
3226
|
+
abort: !1,
|
|
3227
|
+
...O(X)
|
|
3228
|
+
});
|
|
3229
|
+
}
|
|
3230
|
+
function aJ(J, X) {
|
|
3231
|
+
return new J({
|
|
3232
|
+
type: "string",
|
|
3233
|
+
format: "nanoid",
|
|
3234
|
+
check: "string_format",
|
|
3235
|
+
abort: !1,
|
|
3236
|
+
...O(X)
|
|
3237
|
+
});
|
|
3238
|
+
}
|
|
3239
|
+
function sJ(J, X) {
|
|
3240
|
+
return new J({
|
|
3241
|
+
type: "string",
|
|
3242
|
+
format: "cuid",
|
|
3243
|
+
check: "string_format",
|
|
3244
|
+
abort: !1,
|
|
3245
|
+
...O(X)
|
|
3246
|
+
});
|
|
3247
|
+
}
|
|
3248
|
+
function eJ(J, X) {
|
|
3249
|
+
return new J({
|
|
3250
|
+
type: "string",
|
|
3251
|
+
format: "cuid2",
|
|
3252
|
+
check: "string_format",
|
|
3253
|
+
abort: !1,
|
|
3254
|
+
...O(X)
|
|
3255
|
+
});
|
|
3256
|
+
}
|
|
3257
|
+
function J2(J, X) {
|
|
3258
|
+
return new J({
|
|
3259
|
+
type: "string",
|
|
3260
|
+
format: "ulid",
|
|
3261
|
+
check: "string_format",
|
|
3262
|
+
abort: !1,
|
|
3263
|
+
...O(X)
|
|
3264
|
+
});
|
|
3265
|
+
}
|
|
3266
|
+
function X2(J, X) {
|
|
3267
|
+
return new J({
|
|
3268
|
+
type: "string",
|
|
3269
|
+
format: "xid",
|
|
3270
|
+
check: "string_format",
|
|
3271
|
+
abort: !1,
|
|
3272
|
+
...O(X)
|
|
3273
|
+
});
|
|
3274
|
+
}
|
|
3275
|
+
function Y2(J, X) {
|
|
3276
|
+
return new J({
|
|
3277
|
+
type: "string",
|
|
3278
|
+
format: "ksuid",
|
|
3279
|
+
check: "string_format",
|
|
3280
|
+
abort: !1,
|
|
3281
|
+
...O(X)
|
|
3282
|
+
});
|
|
3283
|
+
}
|
|
3284
|
+
function W2(J, X) {
|
|
3285
|
+
return new J({
|
|
3286
|
+
type: "string",
|
|
3287
|
+
format: "ipv4",
|
|
3288
|
+
check: "string_format",
|
|
3289
|
+
abort: !1,
|
|
3290
|
+
...O(X)
|
|
3291
|
+
});
|
|
3292
|
+
}
|
|
3293
|
+
function q2(J, X) {
|
|
3294
|
+
return new J({
|
|
3295
|
+
type: "string",
|
|
3296
|
+
format: "ipv6",
|
|
3297
|
+
check: "string_format",
|
|
3298
|
+
abort: !1,
|
|
3299
|
+
...O(X)
|
|
3300
|
+
});
|
|
3301
|
+
}
|
|
3302
|
+
function H2(J, X) {
|
|
3303
|
+
return new J({
|
|
3304
|
+
type: "string",
|
|
3305
|
+
format: "cidrv4",
|
|
3306
|
+
check: "string_format",
|
|
3307
|
+
abort: !1,
|
|
3308
|
+
...O(X)
|
|
3309
|
+
});
|
|
3310
|
+
}
|
|
3311
|
+
function B2(J, X) {
|
|
3312
|
+
return new J({
|
|
3313
|
+
type: "string",
|
|
3314
|
+
format: "cidrv6",
|
|
3315
|
+
check: "string_format",
|
|
3316
|
+
abort: !1,
|
|
3317
|
+
...O(X)
|
|
3318
|
+
});
|
|
3319
|
+
}
|
|
3320
|
+
function Q2(J, X) {
|
|
3321
|
+
return new J({
|
|
3322
|
+
type: "string",
|
|
3323
|
+
format: "base64",
|
|
3324
|
+
check: "string_format",
|
|
3325
|
+
abort: !1,
|
|
3326
|
+
...O(X)
|
|
3327
|
+
});
|
|
3328
|
+
}
|
|
3329
|
+
function z2(J, X) {
|
|
3330
|
+
return new J({
|
|
3331
|
+
type: "string",
|
|
3332
|
+
format: "base64url",
|
|
3333
|
+
check: "string_format",
|
|
3334
|
+
abort: !1,
|
|
3335
|
+
...O(X)
|
|
3336
|
+
});
|
|
3337
|
+
}
|
|
3338
|
+
function G2(J, X) {
|
|
3339
|
+
return new J({
|
|
3340
|
+
type: "string",
|
|
3341
|
+
format: "e164",
|
|
3342
|
+
check: "string_format",
|
|
3343
|
+
abort: !1,
|
|
3344
|
+
...O(X)
|
|
3345
|
+
});
|
|
3346
|
+
}
|
|
3347
|
+
function U2(J, X) {
|
|
3348
|
+
return new J({
|
|
3349
|
+
type: "string",
|
|
3350
|
+
format: "jwt",
|
|
3351
|
+
check: "string_format",
|
|
3352
|
+
abort: !1,
|
|
3353
|
+
...O(X)
|
|
3354
|
+
});
|
|
3355
|
+
}
|
|
3356
|
+
function I2(J, X) {
|
|
3357
|
+
return new J({
|
|
3358
|
+
type: "string",
|
|
3359
|
+
format: "datetime",
|
|
3360
|
+
check: "string_format",
|
|
3361
|
+
offset: !1,
|
|
3362
|
+
local: !1,
|
|
3363
|
+
precision: null,
|
|
3364
|
+
...O(X)
|
|
3365
|
+
});
|
|
3366
|
+
}
|
|
3367
|
+
function w2(J, X) {
|
|
3368
|
+
return new J({
|
|
3369
|
+
type: "string",
|
|
3370
|
+
format: "date",
|
|
3371
|
+
check: "string_format",
|
|
3372
|
+
...O(X)
|
|
3373
|
+
});
|
|
3374
|
+
}
|
|
3375
|
+
function D2(J, X) {
|
|
3376
|
+
return new J({
|
|
3377
|
+
type: "string",
|
|
3378
|
+
format: "time",
|
|
3379
|
+
check: "string_format",
|
|
3380
|
+
precision: null,
|
|
3381
|
+
...O(X)
|
|
3382
|
+
});
|
|
3383
|
+
}
|
|
3384
|
+
function P2(J, X) {
|
|
3385
|
+
return new J({
|
|
3386
|
+
type: "string",
|
|
3387
|
+
format: "duration",
|
|
3388
|
+
check: "string_format",
|
|
3389
|
+
...O(X)
|
|
3390
|
+
});
|
|
3391
|
+
}
|
|
3392
|
+
function O2(J, X) {
|
|
3393
|
+
return new J({
|
|
3394
|
+
type: "number",
|
|
3395
|
+
checks: [],
|
|
3396
|
+
...O(X)
|
|
3397
|
+
});
|
|
3398
|
+
}
|
|
3399
|
+
function M2(J, X) {
|
|
3400
|
+
return new J({
|
|
3401
|
+
type: "number",
|
|
3402
|
+
coerce: !0,
|
|
3403
|
+
checks: [],
|
|
3404
|
+
...O(X)
|
|
3405
|
+
});
|
|
3406
|
+
}
|
|
3407
|
+
function A2(J, X) {
|
|
3408
|
+
return new J({
|
|
3409
|
+
type: "number",
|
|
3410
|
+
check: "number_format",
|
|
3411
|
+
abort: !1,
|
|
3412
|
+
format: "safeint",
|
|
3413
|
+
...O(X)
|
|
3414
|
+
});
|
|
3415
|
+
}
|
|
3416
|
+
function F2(J, X) {
|
|
3417
|
+
return new J({
|
|
3418
|
+
type: "boolean",
|
|
3419
|
+
...O(X)
|
|
3420
|
+
});
|
|
3421
|
+
}
|
|
3422
|
+
function E2(J, X) {
|
|
3423
|
+
return new J({
|
|
3424
|
+
type: "boolean",
|
|
3425
|
+
coerce: !0,
|
|
3426
|
+
...O(X)
|
|
3427
|
+
});
|
|
3428
|
+
}
|
|
3429
|
+
function $2(J, X) {
|
|
3430
|
+
return new J({
|
|
3431
|
+
type: "bigint",
|
|
3432
|
+
coerce: !0,
|
|
3433
|
+
...O(X)
|
|
3434
|
+
});
|
|
3435
|
+
}
|
|
3436
|
+
function K2(J) {
|
|
3437
|
+
return new J({ type: "any" });
|
|
3438
|
+
}
|
|
3439
|
+
function V2(J) {
|
|
3440
|
+
return new J({ type: "unknown" });
|
|
3441
|
+
}
|
|
3442
|
+
function R2(J, X) {
|
|
3443
|
+
return new J({
|
|
3444
|
+
type: "never",
|
|
3445
|
+
...O(X)
|
|
3446
|
+
});
|
|
3447
|
+
}
|
|
3448
|
+
function N2(J, X) {
|
|
3449
|
+
return new J({
|
|
3450
|
+
type: "date",
|
|
3451
|
+
...O(X)
|
|
3452
|
+
});
|
|
3453
|
+
}
|
|
3454
|
+
function S2(J, X) {
|
|
3455
|
+
return new J({
|
|
3456
|
+
type: "date",
|
|
3457
|
+
coerce: !0,
|
|
3458
|
+
...O(X)
|
|
3459
|
+
});
|
|
3460
|
+
}
|
|
3461
|
+
function Q0(J, X) {
|
|
3462
|
+
return new K4({
|
|
3463
|
+
check: "less_than",
|
|
3464
|
+
...O(X),
|
|
3465
|
+
value: J,
|
|
3466
|
+
inclusive: !1
|
|
3467
|
+
});
|
|
3468
|
+
}
|
|
3469
|
+
function p(J, X) {
|
|
3470
|
+
return new K4({
|
|
3471
|
+
check: "less_than",
|
|
3472
|
+
...O(X),
|
|
3473
|
+
value: J,
|
|
3474
|
+
inclusive: !0
|
|
3475
|
+
});
|
|
3476
|
+
}
|
|
3477
|
+
function z0(J, X) {
|
|
3478
|
+
return new V4({
|
|
3479
|
+
check: "greater_than",
|
|
3480
|
+
...O(X),
|
|
3481
|
+
value: J,
|
|
3482
|
+
inclusive: !1
|
|
3483
|
+
});
|
|
3484
|
+
}
|
|
3485
|
+
function f(J, X) {
|
|
3486
|
+
return new V4({
|
|
3487
|
+
check: "greater_than",
|
|
3488
|
+
...O(X),
|
|
3489
|
+
value: J,
|
|
3490
|
+
inclusive: !0
|
|
3491
|
+
});
|
|
3492
|
+
}
|
|
3493
|
+
function S0(J, X) {
|
|
3494
|
+
return new S1({
|
|
3495
|
+
check: "multiple_of",
|
|
3496
|
+
...O(X),
|
|
3497
|
+
value: J
|
|
3498
|
+
});
|
|
3499
|
+
}
|
|
3500
|
+
function t0(J, X) {
|
|
3501
|
+
return new Z1({
|
|
3502
|
+
check: "max_length",
|
|
3503
|
+
...O(X),
|
|
3504
|
+
maximum: J
|
|
3505
|
+
});
|
|
3506
|
+
}
|
|
3507
|
+
function G0(J, X) {
|
|
3508
|
+
return new _1({
|
|
3509
|
+
check: "min_length",
|
|
3510
|
+
...O(X),
|
|
3511
|
+
minimum: J
|
|
3512
|
+
});
|
|
3513
|
+
}
|
|
3514
|
+
function a0(J, X) {
|
|
3515
|
+
return new b1({
|
|
3516
|
+
check: "length_equals",
|
|
3517
|
+
...O(X),
|
|
3518
|
+
length: J
|
|
3519
|
+
});
|
|
3520
|
+
}
|
|
3521
|
+
function C4(J, X) {
|
|
3522
|
+
return new C1({
|
|
3523
|
+
check: "string_format",
|
|
3524
|
+
format: "regex",
|
|
3525
|
+
...O(X),
|
|
3526
|
+
pattern: J
|
|
3527
|
+
});
|
|
3528
|
+
}
|
|
3529
|
+
function k4(J) {
|
|
3530
|
+
return new k1({
|
|
3531
|
+
check: "string_format",
|
|
3532
|
+
format: "lowercase",
|
|
3533
|
+
...O(J)
|
|
3534
|
+
});
|
|
3535
|
+
}
|
|
3536
|
+
function T4(J) {
|
|
3537
|
+
return new T1({
|
|
3538
|
+
check: "string_format",
|
|
3539
|
+
format: "uppercase",
|
|
3540
|
+
...O(J)
|
|
3541
|
+
});
|
|
3542
|
+
}
|
|
3543
|
+
function j4(J, X) {
|
|
3544
|
+
return new j1({
|
|
3545
|
+
check: "string_format",
|
|
3546
|
+
format: "includes",
|
|
3547
|
+
...O(X),
|
|
3548
|
+
includes: J
|
|
3549
|
+
});
|
|
3550
|
+
}
|
|
3551
|
+
function h4(J, X) {
|
|
3552
|
+
return new h1({
|
|
3553
|
+
check: "string_format",
|
|
3554
|
+
format: "starts_with",
|
|
3555
|
+
...O(X),
|
|
3556
|
+
prefix: J
|
|
3557
|
+
});
|
|
3558
|
+
}
|
|
3559
|
+
function x4(J, X) {
|
|
3560
|
+
return new x1({
|
|
3561
|
+
check: "string_format",
|
|
3562
|
+
format: "ends_with",
|
|
3563
|
+
...O(X),
|
|
3564
|
+
suffix: J
|
|
3565
|
+
});
|
|
3566
|
+
}
|
|
3567
|
+
function s(J) {
|
|
3568
|
+
return new v1({
|
|
3569
|
+
check: "overwrite",
|
|
3570
|
+
tx: J
|
|
3571
|
+
});
|
|
3572
|
+
}
|
|
3573
|
+
function v4(J) {
|
|
3574
|
+
return s((X) => X.normalize(J));
|
|
3575
|
+
}
|
|
3576
|
+
function g4() {
|
|
3577
|
+
return s((J) => J.trim());
|
|
3578
|
+
}
|
|
3579
|
+
function u4() {
|
|
3580
|
+
return s((J) => J.toLowerCase());
|
|
3581
|
+
}
|
|
3582
|
+
function c4() {
|
|
3583
|
+
return s((J) => J.toUpperCase());
|
|
3584
|
+
}
|
|
3585
|
+
function y4() {
|
|
3586
|
+
return s((J) => D4(J));
|
|
3587
|
+
}
|
|
3588
|
+
function L2(J, X, Y) {
|
|
3589
|
+
return new J({
|
|
3590
|
+
type: "array",
|
|
3591
|
+
element: X,
|
|
3592
|
+
...O(Y)
|
|
3593
|
+
});
|
|
3594
|
+
}
|
|
3595
|
+
function Z2(J, X, Y) {
|
|
3596
|
+
return new J({
|
|
3597
|
+
type: "custom",
|
|
3598
|
+
check: "custom",
|
|
3599
|
+
fn: X,
|
|
3600
|
+
...O(Y)
|
|
3601
|
+
});
|
|
3602
|
+
}
|
|
3603
|
+
function _2(J) {
|
|
3604
|
+
let X = LX((Y) => {
|
|
3605
|
+
return Y.addIssue = (W) => {
|
|
3606
|
+
if (typeof W === "string") Y.issues.push(B0(W, Y.value, X._zod.def));
|
|
3607
|
+
else {
|
|
3608
|
+
let q = W;
|
|
3609
|
+
if (q.fatal) q.continue = !1;
|
|
3610
|
+
q.code ?? (q.code = "custom"), q.input ?? (q.input = Y.value), q.inst ?? (q.inst = X), q.continue ?? (q.continue = !X._zod.def.abort), Y.issues.push(B0(q));
|
|
3611
|
+
}
|
|
3612
|
+
}, J(Y.value, Y);
|
|
3613
|
+
});
|
|
3614
|
+
return X;
|
|
3615
|
+
}
|
|
3616
|
+
function LX(J, X) {
|
|
3617
|
+
let Y = new T({
|
|
3618
|
+
check: "custom",
|
|
3619
|
+
...O(X)
|
|
3620
|
+
});
|
|
3621
|
+
return Y._zod.check = J, Y;
|
|
3622
|
+
}
|
|
3623
|
+
function m4(J) {
|
|
3624
|
+
let X = J?.target ?? "draft-2020-12";
|
|
3625
|
+
if (X === "draft-4") X = "draft-04";
|
|
3626
|
+
if (X === "draft-7") X = "draft-07";
|
|
3627
|
+
return {
|
|
3628
|
+
processors: J.processors ?? {},
|
|
3629
|
+
metadataRegistry: J?.metadata ?? X0,
|
|
3630
|
+
target: X,
|
|
3631
|
+
unrepresentable: J?.unrepresentable ?? "throw",
|
|
3632
|
+
override: J?.override ?? (() => {}),
|
|
3633
|
+
io: J?.io ?? "output",
|
|
3634
|
+
counter: 0,
|
|
3635
|
+
seen: /* @__PURE__ */ new Map(),
|
|
3636
|
+
cycles: J?.cycles ?? "ref",
|
|
3637
|
+
reused: J?.reused ?? "inline",
|
|
3638
|
+
external: J?.external ?? void 0
|
|
3639
|
+
};
|
|
3640
|
+
}
|
|
3641
|
+
function b(J, X, Y = {
|
|
3642
|
+
path: [],
|
|
3643
|
+
schemaPath: []
|
|
3644
|
+
}) {
|
|
3645
|
+
var W;
|
|
3646
|
+
let q = J._zod.def, H = X.seen.get(J);
|
|
3647
|
+
if (H) {
|
|
3648
|
+
if (H.count++, Y.schemaPath.includes(J)) H.cycle = Y.path;
|
|
3649
|
+
return H.schema;
|
|
3650
|
+
}
|
|
3651
|
+
let B = {
|
|
3652
|
+
schema: {},
|
|
3653
|
+
count: 1,
|
|
3654
|
+
cycle: void 0,
|
|
3655
|
+
path: Y.path
|
|
3656
|
+
};
|
|
3657
|
+
X.seen.set(J, B);
|
|
3658
|
+
let Q = J._zod.toJSONSchema?.();
|
|
3659
|
+
if (Q) B.schema = Q;
|
|
3660
|
+
else {
|
|
3661
|
+
let I = {
|
|
3662
|
+
...Y,
|
|
3663
|
+
schemaPath: [...Y.schemaPath, J],
|
|
3664
|
+
path: Y.path
|
|
3665
|
+
}, w = J._zod.parent;
|
|
3666
|
+
if (w) B.ref = w, b(w, X, I), X.seen.get(w).isParent = !0;
|
|
3667
|
+
else if (J._zod.processJSONSchema) J._zod.processJSONSchema(X, B.schema, I);
|
|
3668
|
+
else {
|
|
3669
|
+
let M = B.schema, P = X.processors[q.type];
|
|
3670
|
+
if (!P) throw Error(`[toJSONSchema]: Non-representable type encountered: ${q.type}`);
|
|
3671
|
+
P(J, X, M, I);
|
|
3672
|
+
}
|
|
3673
|
+
}
|
|
3674
|
+
let G = X.metadataRegistry.get(J);
|
|
3675
|
+
if (G) Object.assign(B.schema, G);
|
|
3676
|
+
if (X.io === "input" && j(J)) delete B.schema.examples, delete B.schema.default;
|
|
3677
|
+
if (X.io === "input" && B.schema._prefault) (W = B.schema).default ?? (W.default = B.schema._prefault);
|
|
3678
|
+
return delete B.schema._prefault, X.seen.get(J).schema;
|
|
3679
|
+
}
|
|
3680
|
+
function f4(J, X) {
|
|
3681
|
+
let Y = J.seen.get(X);
|
|
3682
|
+
if (!Y) throw Error("Unprocessed schema. This is a bug in Zod.");
|
|
3683
|
+
let W = (H) => {
|
|
3684
|
+
let B = J.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
3685
|
+
if (J.external) {
|
|
3686
|
+
let I = J.external.registry.get(H[0])?.id, w = J.external.uri ?? ((P) => P);
|
|
3687
|
+
if (I) return { ref: w(I) };
|
|
3688
|
+
let M = H[1].defId ?? H[1].schema.id ?? `schema${J.counter++}`;
|
|
3689
|
+
return H[1].defId = M, {
|
|
3690
|
+
defId: M,
|
|
3691
|
+
ref: `${w("__shared")}#/${B}/${M}`
|
|
3692
|
+
};
|
|
3693
|
+
}
|
|
3694
|
+
if (H[1] === Y) return { ref: "#" };
|
|
3695
|
+
let G = `#/${B}/`, z = H[1].schema.id ?? `__schema${J.counter++}`;
|
|
3696
|
+
return {
|
|
3697
|
+
defId: z,
|
|
3698
|
+
ref: G + z
|
|
3699
|
+
};
|
|
3700
|
+
}, q = (H) => {
|
|
3701
|
+
if (H[1].schema.$ref) return;
|
|
3702
|
+
let B = H[1], { ref: Q, defId: G } = W(H);
|
|
3703
|
+
if (B.def = { ...B.schema }, G) B.defId = G;
|
|
3704
|
+
let z = B.schema;
|
|
3705
|
+
for (let I in z) delete z[I];
|
|
3706
|
+
z.$ref = Q;
|
|
3707
|
+
};
|
|
3708
|
+
if (J.cycles === "throw") for (let H of J.seen.entries()) {
|
|
3709
|
+
let B = H[1];
|
|
3710
|
+
if (B.cycle) throw Error(`Cycle detected: #/${B.cycle?.join("/")}/<root>
|
|
3711
|
+
|
|
3712
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
3713
|
+
}
|
|
3714
|
+
for (let H of J.seen.entries()) {
|
|
3715
|
+
let B = H[1];
|
|
3716
|
+
if (X === H[0]) {
|
|
3717
|
+
q(H);
|
|
3718
|
+
continue;
|
|
3719
|
+
}
|
|
3720
|
+
if (J.external) {
|
|
3721
|
+
let G = J.external.registry.get(H[0])?.id;
|
|
3722
|
+
if (X !== H[0] && G) {
|
|
3723
|
+
q(H);
|
|
3724
|
+
continue;
|
|
3725
|
+
}
|
|
3726
|
+
}
|
|
3727
|
+
if (J.metadataRegistry.get(H[0])?.id) {
|
|
3728
|
+
q(H);
|
|
3729
|
+
continue;
|
|
3730
|
+
}
|
|
3731
|
+
if (B.cycle) {
|
|
3732
|
+
q(H);
|
|
3733
|
+
continue;
|
|
3734
|
+
}
|
|
3735
|
+
if (B.count > 1) {
|
|
3736
|
+
if (J.reused === "ref") {
|
|
3737
|
+
q(H);
|
|
3738
|
+
continue;
|
|
3739
|
+
}
|
|
3740
|
+
}
|
|
3741
|
+
}
|
|
3742
|
+
}
|
|
3743
|
+
function o4(J, X) {
|
|
3744
|
+
let Y = J.seen.get(X);
|
|
3745
|
+
if (!Y) throw Error("Unprocessed schema. This is a bug in Zod.");
|
|
3746
|
+
let W = (B) => {
|
|
3747
|
+
let Q = J.seen.get(B), G = Q.def ?? Q.schema, z = { ...G };
|
|
3748
|
+
if (Q.ref === null) return;
|
|
3749
|
+
let I = Q.ref;
|
|
3750
|
+
if (Q.ref = null, I) {
|
|
3751
|
+
W(I);
|
|
3752
|
+
let w = J.seen.get(I).schema;
|
|
3753
|
+
if (w.$ref && (J.target === "draft-07" || J.target === "draft-04" || J.target === "openapi-3.0")) G.allOf = G.allOf ?? [], G.allOf.push(w);
|
|
3754
|
+
else Object.assign(G, w), Object.assign(G, z);
|
|
3755
|
+
}
|
|
3756
|
+
if (!Q.isParent) J.override({
|
|
3757
|
+
zodSchema: B,
|
|
3758
|
+
jsonSchema: G,
|
|
3759
|
+
path: Q.path ?? []
|
|
3760
|
+
});
|
|
3761
|
+
};
|
|
3762
|
+
for (let B of [...J.seen.entries()].reverse()) W(B[0]);
|
|
3763
|
+
let q = {};
|
|
3764
|
+
if (J.target === "draft-2020-12") q.$schema = "https://json-schema.org/draft/2020-12/schema";
|
|
3765
|
+
else if (J.target === "draft-07") q.$schema = "http://json-schema.org/draft-07/schema#";
|
|
3766
|
+
else if (J.target === "draft-04") q.$schema = "http://json-schema.org/draft-04/schema#";
|
|
3767
|
+
else if (J.target === "openapi-3.0");
|
|
3768
|
+
if (J.external?.uri) {
|
|
3769
|
+
let B = J.external.registry.get(X)?.id;
|
|
3770
|
+
if (!B) throw Error("Schema is missing an `id` property");
|
|
3771
|
+
q.$id = J.external.uri(B);
|
|
3772
|
+
}
|
|
3773
|
+
Object.assign(q, Y.def ?? Y.schema);
|
|
3774
|
+
let H = J.external?.defs ?? {};
|
|
3775
|
+
for (let B of J.seen.entries()) {
|
|
3776
|
+
let Q = B[1];
|
|
3777
|
+
if (Q.def && Q.defId) H[Q.defId] = Q.def;
|
|
3778
|
+
}
|
|
3779
|
+
if (J.external);
|
|
3780
|
+
else if (Object.keys(H).length > 0) if (J.target === "draft-2020-12") q.$defs = H;
|
|
3781
|
+
else q.definitions = H;
|
|
3782
|
+
try {
|
|
3783
|
+
let B = JSON.parse(JSON.stringify(q));
|
|
3784
|
+
return Object.defineProperty(B, "~standard", {
|
|
3785
|
+
value: {
|
|
3786
|
+
...X["~standard"],
|
|
3787
|
+
jsonSchema: {
|
|
3788
|
+
input: L0(X, "input"),
|
|
3789
|
+
output: L0(X, "output")
|
|
3790
|
+
}
|
|
3791
|
+
},
|
|
3792
|
+
enumerable: !1,
|
|
3793
|
+
writable: !1
|
|
3794
|
+
}), B;
|
|
3795
|
+
} catch (B) {
|
|
3796
|
+
throw Error("Error converting schema to JSON.");
|
|
3797
|
+
}
|
|
3798
|
+
}
|
|
3799
|
+
function j(J, X) {
|
|
3800
|
+
let Y = X ?? { seen: /* @__PURE__ */ new Set() };
|
|
3801
|
+
if (Y.seen.has(J)) return !1;
|
|
3802
|
+
Y.seen.add(J);
|
|
3803
|
+
let W = J._zod.def;
|
|
3804
|
+
if (W.type === "transform") return !0;
|
|
3805
|
+
if (W.type === "array") return j(W.element, Y);
|
|
3806
|
+
if (W.type === "set") return j(W.valueType, Y);
|
|
3807
|
+
if (W.type === "lazy") return j(W.getter(), Y);
|
|
3808
|
+
if (W.type === "promise" || W.type === "optional" || W.type === "nonoptional" || W.type === "nullable" || W.type === "readonly" || W.type === "default" || W.type === "prefault") return j(W.innerType, Y);
|
|
3809
|
+
if (W.type === "intersection") return j(W.left, Y) || j(W.right, Y);
|
|
3810
|
+
if (W.type === "record" || W.type === "map") return j(W.keyType, Y) || j(W.valueType, Y);
|
|
3811
|
+
if (W.type === "pipe") return j(W.in, Y) || j(W.out, Y);
|
|
3812
|
+
if (W.type === "object") {
|
|
3813
|
+
for (let q in W.shape) if (j(W.shape[q], Y)) return !0;
|
|
3814
|
+
return !1;
|
|
3815
|
+
}
|
|
3816
|
+
if (W.type === "union") {
|
|
3817
|
+
for (let q of W.options) if (j(q, Y)) return !0;
|
|
3818
|
+
return !1;
|
|
3819
|
+
}
|
|
3820
|
+
if (W.type === "tuple") {
|
|
3821
|
+
for (let q of W.items) if (j(q, Y)) return !0;
|
|
3822
|
+
if (W.rest && j(W.rest, Y)) return !0;
|
|
3823
|
+
return !1;
|
|
3824
|
+
}
|
|
3825
|
+
return !1;
|
|
3826
|
+
}
|
|
3827
|
+
var b2 = (J, X = {}) => (Y) => {
|
|
3828
|
+
let W = m4({
|
|
3829
|
+
...Y,
|
|
3830
|
+
processors: X
|
|
3831
|
+
});
|
|
3832
|
+
return b(J, W), f4(W, J), o4(W, J);
|
|
3833
|
+
}, L0 = (J, X) => (Y) => {
|
|
3834
|
+
let { libraryOptions: W, target: q } = Y ?? {}, H = m4({
|
|
3835
|
+
...W ?? {},
|
|
3836
|
+
target: q,
|
|
3837
|
+
io: X,
|
|
3838
|
+
processors: {}
|
|
3839
|
+
});
|
|
3840
|
+
return b(J, H), f4(H, J), o4(H, J);
|
|
3841
|
+
};
|
|
3842
|
+
var ZX = {
|
|
3843
|
+
guid: "uuid",
|
|
3844
|
+
url: "uri",
|
|
3845
|
+
datetime: "date-time",
|
|
3846
|
+
json_string: "json-string",
|
|
3847
|
+
regex: ""
|
|
3848
|
+
}, C2 = (J, X, Y, W) => {
|
|
3849
|
+
let q = Y;
|
|
3850
|
+
q.type = "string";
|
|
3851
|
+
let { minimum: H, maximum: B, format: Q, patterns: G, contentEncoding: z } = J._zod.bag;
|
|
3852
|
+
if (typeof H === "number") q.minLength = H;
|
|
3853
|
+
if (typeof B === "number") q.maxLength = B;
|
|
3854
|
+
if (Q) {
|
|
3855
|
+
if (q.format = ZX[Q] ?? Q, q.format === "") delete q.format;
|
|
3856
|
+
}
|
|
3857
|
+
if (z) q.contentEncoding = z;
|
|
3858
|
+
if (G && G.size > 0) {
|
|
3859
|
+
let I = [...G];
|
|
3860
|
+
if (I.length === 1) q.pattern = I[0].source;
|
|
3861
|
+
else if (I.length > 1) q.allOf = [...I.map((w) => ({
|
|
3862
|
+
...X.target === "draft-07" || X.target === "draft-04" || X.target === "openapi-3.0" ? { type: "string" } : {},
|
|
3863
|
+
pattern: w.source
|
|
3864
|
+
}))];
|
|
3865
|
+
}
|
|
3866
|
+
}, k2 = (J, X, Y, W) => {
|
|
3867
|
+
let q = Y, { minimum: H, maximum: B, format: Q, multipleOf: G, exclusiveMaximum: z, exclusiveMinimum: I } = J._zod.bag;
|
|
3868
|
+
if (typeof Q === "string" && Q.includes("int")) q.type = "integer";
|
|
3869
|
+
else q.type = "number";
|
|
3870
|
+
if (typeof I === "number") if (X.target === "draft-04" || X.target === "openapi-3.0") q.minimum = I, q.exclusiveMinimum = !0;
|
|
3871
|
+
else q.exclusiveMinimum = I;
|
|
3872
|
+
if (typeof H === "number") {
|
|
3873
|
+
if (q.minimum = H, typeof I === "number" && X.target !== "draft-04") if (I >= H) delete q.minimum;
|
|
3874
|
+
else delete q.exclusiveMinimum;
|
|
3875
|
+
}
|
|
3876
|
+
if (typeof z === "number") if (X.target === "draft-04" || X.target === "openapi-3.0") q.maximum = z, q.exclusiveMaximum = !0;
|
|
3877
|
+
else q.exclusiveMaximum = z;
|
|
3878
|
+
if (typeof B === "number") {
|
|
3879
|
+
if (q.maximum = B, typeof z === "number" && X.target !== "draft-04") if (z <= B) delete q.maximum;
|
|
3880
|
+
else delete q.exclusiveMaximum;
|
|
3881
|
+
}
|
|
3882
|
+
if (typeof G === "number") q.multipleOf = G;
|
|
3883
|
+
}, T2 = (J, X, Y, W) => {
|
|
3884
|
+
Y.type = "boolean";
|
|
3885
|
+
}, j2 = (J, X, Y, W) => {
|
|
3886
|
+
if (X.unrepresentable === "throw") throw Error("BigInt cannot be represented in JSON Schema");
|
|
3887
|
+
};
|
|
3888
|
+
var h2 = (J, X, Y, W) => {
|
|
3889
|
+
Y.not = {};
|
|
3890
|
+
}, x2 = (J, X, Y, W) => {}, v2 = (J, X, Y, W) => {}, g2 = (J, X, Y, W) => {
|
|
3891
|
+
if (X.unrepresentable === "throw") throw Error("Date cannot be represented in JSON Schema");
|
|
3892
|
+
}, u2 = (J, X, Y, W) => {
|
|
3893
|
+
let q = J._zod.def, H = A0(q.entries);
|
|
3894
|
+
if (H.every((B) => typeof B === "number")) Y.type = "number";
|
|
3895
|
+
if (H.every((B) => typeof B === "string")) Y.type = "string";
|
|
3896
|
+
Y.enum = H;
|
|
3897
|
+
};
|
|
3898
|
+
var c2 = (J, X, Y, W) => {
|
|
3899
|
+
if (X.unrepresentable === "throw") throw Error("Custom types cannot be represented in JSON Schema");
|
|
3900
|
+
};
|
|
3901
|
+
var y2 = (J, X, Y, W) => {
|
|
3902
|
+
if (X.unrepresentable === "throw") throw Error("Transforms cannot be represented in JSON Schema");
|
|
3903
|
+
};
|
|
3904
|
+
var m2 = (J, X, Y, W) => {
|
|
3905
|
+
let q = Y, H = J._zod.def, { minimum: B, maximum: Q } = J._zod.bag;
|
|
3906
|
+
if (typeof B === "number") q.minItems = B;
|
|
3907
|
+
if (typeof Q === "number") q.maxItems = Q;
|
|
3908
|
+
q.type = "array", q.items = b(H.element, X, {
|
|
3909
|
+
...W,
|
|
3910
|
+
path: [...W.path, "items"]
|
|
3911
|
+
});
|
|
3912
|
+
}, f2 = (J, X, Y, W) => {
|
|
3913
|
+
let q = Y, H = J._zod.def;
|
|
3914
|
+
q.type = "object", q.properties = {};
|
|
3915
|
+
let B = H.shape;
|
|
3916
|
+
for (let z in B) q.properties[z] = b(B[z], X, {
|
|
3917
|
+
...W,
|
|
3918
|
+
path: [
|
|
3919
|
+
...W.path,
|
|
3920
|
+
"properties",
|
|
3921
|
+
z
|
|
3922
|
+
]
|
|
3923
|
+
});
|
|
3924
|
+
let Q = new Set(Object.keys(B)), G = new Set([...Q].filter((z) => {
|
|
3925
|
+
let I = H.shape[z]._zod;
|
|
3926
|
+
if (X.io === "input") return I.optin === void 0;
|
|
3927
|
+
else return I.optout === void 0;
|
|
3928
|
+
}));
|
|
3929
|
+
if (G.size > 0) q.required = Array.from(G);
|
|
3930
|
+
if (H.catchall?._zod.def.type === "never") q.additionalProperties = !1;
|
|
3931
|
+
else if (!H.catchall) {
|
|
3932
|
+
if (X.io === "output") q.additionalProperties = !1;
|
|
3933
|
+
} else if (H.catchall) q.additionalProperties = b(H.catchall, X, {
|
|
3934
|
+
...W,
|
|
3935
|
+
path: [...W.path, "additionalProperties"]
|
|
3936
|
+
});
|
|
3937
|
+
}, o2 = (J, X, Y, W) => {
|
|
3938
|
+
let q = J._zod.def, H = q.inclusive === !1, B = q.options.map((Q, G) => b(Q, X, {
|
|
3939
|
+
...W,
|
|
3940
|
+
path: [
|
|
3941
|
+
...W.path,
|
|
3942
|
+
H ? "oneOf" : "anyOf",
|
|
3943
|
+
G
|
|
3944
|
+
]
|
|
3945
|
+
}));
|
|
3946
|
+
if (H) Y.oneOf = B;
|
|
3947
|
+
else Y.anyOf = B;
|
|
3948
|
+
}, r2 = (J, X, Y, W) => {
|
|
3949
|
+
let q = J._zod.def, H = b(q.left, X, {
|
|
3950
|
+
...W,
|
|
3951
|
+
path: [
|
|
3952
|
+
...W.path,
|
|
3953
|
+
"allOf",
|
|
3954
|
+
0
|
|
3955
|
+
]
|
|
3956
|
+
}), B = b(q.right, X, {
|
|
3957
|
+
...W,
|
|
3958
|
+
path: [
|
|
3959
|
+
...W.path,
|
|
3960
|
+
"allOf",
|
|
3961
|
+
1
|
|
3962
|
+
]
|
|
3963
|
+
}), Q = (z) => "allOf" in z && Object.keys(z).length === 1;
|
|
3964
|
+
Y.allOf = [...Q(H) ? H.allOf : [H], ...Q(B) ? B.allOf : [B]];
|
|
3965
|
+
};
|
|
3966
|
+
var l2 = (J, X, Y, W) => {
|
|
3967
|
+
let q = Y, H = J._zod.def;
|
|
3968
|
+
if (q.type = "object", X.target === "draft-07" || X.target === "draft-2020-12") q.propertyNames = b(H.keyType, X, {
|
|
3969
|
+
...W,
|
|
3970
|
+
path: [...W.path, "propertyNames"]
|
|
3971
|
+
});
|
|
3972
|
+
q.additionalProperties = b(H.valueType, X, {
|
|
3973
|
+
...W,
|
|
3974
|
+
path: [...W.path, "additionalProperties"]
|
|
3975
|
+
});
|
|
3976
|
+
}, p2 = (J, X, Y, W) => {
|
|
3977
|
+
let q = J._zod.def, H = b(q.innerType, X, W), B = X.seen.get(J);
|
|
3978
|
+
if (X.target === "openapi-3.0") B.ref = q.innerType, Y.nullable = !0;
|
|
3979
|
+
else Y.anyOf = [H, { type: "null" }];
|
|
3980
|
+
}, d2 = (J, X, Y, W) => {
|
|
3981
|
+
let q = J._zod.def;
|
|
3982
|
+
b(q.innerType, X, W);
|
|
3983
|
+
let H = X.seen.get(J);
|
|
3984
|
+
H.ref = q.innerType;
|
|
3985
|
+
}, n2 = (J, X, Y, W) => {
|
|
3986
|
+
let q = J._zod.def;
|
|
3987
|
+
b(q.innerType, X, W);
|
|
3988
|
+
let H = X.seen.get(J);
|
|
3989
|
+
H.ref = q.innerType, Y.default = JSON.parse(JSON.stringify(q.defaultValue));
|
|
3990
|
+
}, i2 = (J, X, Y, W) => {
|
|
3991
|
+
let q = J._zod.def;
|
|
3992
|
+
b(q.innerType, X, W);
|
|
3993
|
+
let H = X.seen.get(J);
|
|
3994
|
+
if (H.ref = q.innerType, X.io === "input") Y._prefault = JSON.parse(JSON.stringify(q.defaultValue));
|
|
3995
|
+
}, t2 = (J, X, Y, W) => {
|
|
3996
|
+
let q = J._zod.def;
|
|
3997
|
+
b(q.innerType, X, W);
|
|
3998
|
+
let H = X.seen.get(J);
|
|
3999
|
+
H.ref = q.innerType;
|
|
4000
|
+
let B;
|
|
4001
|
+
try {
|
|
4002
|
+
B = q.catchValue(void 0);
|
|
4003
|
+
} catch {
|
|
4004
|
+
throw Error("Dynamic catch values are not supported in JSON Schema");
|
|
4005
|
+
}
|
|
4006
|
+
Y.default = B;
|
|
4007
|
+
}, a2 = (J, X, Y, W) => {
|
|
4008
|
+
let q = J._zod.def, H = X.io === "input" ? q.in._zod.def.type === "transform" ? q.out : q.in : q.out;
|
|
4009
|
+
b(H, X, W);
|
|
4010
|
+
let B = X.seen.get(J);
|
|
4011
|
+
B.ref = H;
|
|
4012
|
+
}, s2 = (J, X, Y, W) => {
|
|
4013
|
+
let q = J._zod.def;
|
|
4014
|
+
b(q.innerType, X, W);
|
|
4015
|
+
let H = X.seen.get(J);
|
|
4016
|
+
H.ref = q.innerType, Y.readOnly = !0;
|
|
4017
|
+
};
|
|
4018
|
+
var e2 = (J, X, Y, W) => {
|
|
4019
|
+
let q = J._zod.def;
|
|
4020
|
+
b(q.innerType, X, W);
|
|
4021
|
+
let H = X.seen.get(J);
|
|
4022
|
+
H.ref = q.innerType;
|
|
4023
|
+
};
|
|
4024
|
+
var xX = U("ZodISODateTime", (J, X) => {
|
|
4025
|
+
qJ.init(J, X), S.init(J, X);
|
|
4026
|
+
});
|
|
4027
|
+
function J8(J) {
|
|
4028
|
+
return I2(xX, J);
|
|
4029
|
+
}
|
|
4030
|
+
var vX = U("ZodISODate", (J, X) => {
|
|
4031
|
+
HJ.init(J, X), S.init(J, X);
|
|
4032
|
+
});
|
|
4033
|
+
function X8(J) {
|
|
4034
|
+
return w2(vX, J);
|
|
4035
|
+
}
|
|
4036
|
+
var gX = U("ZodISOTime", (J, X) => {
|
|
4037
|
+
BJ.init(J, X), S.init(J, X);
|
|
4038
|
+
});
|
|
4039
|
+
function Y8(J) {
|
|
4040
|
+
return D2(gX, J);
|
|
4041
|
+
}
|
|
4042
|
+
var uX = U("ZodISODuration", (J, X) => {
|
|
4043
|
+
QJ.init(J, X), S.init(J, X);
|
|
4044
|
+
});
|
|
4045
|
+
function W8(J) {
|
|
4046
|
+
return P2(uX, J);
|
|
4047
|
+
}
|
|
4048
|
+
var B8 = (J, X) => {
|
|
4049
|
+
o0.init(J, X), J.name = "ZodError", Object.defineProperties(J, {
|
|
4050
|
+
format: { value: (Y) => c6(J, Y) },
|
|
4051
|
+
flatten: { value: (Y) => u6(J, Y) },
|
|
4052
|
+
addIssue: { value: (Y) => {
|
|
4053
|
+
J.issues.push(Y), J.message = JSON.stringify(J.issues, H0, 2);
|
|
4054
|
+
} },
|
|
4055
|
+
addIssues: { value: (Y) => {
|
|
4056
|
+
J.issues.push(...Y), J.message = JSON.stringify(J.issues, H0, 2);
|
|
4057
|
+
} },
|
|
4058
|
+
isEmpty: { get() {
|
|
4059
|
+
return J.issues.length === 0;
|
|
4060
|
+
} }
|
|
4061
|
+
});
|
|
4062
|
+
};
|
|
4063
|
+
U("ZodError", B8);
|
|
4064
|
+
var x = U("ZodError", B8, { Parent: Error });
|
|
4065
|
+
var Q8 = r0(x), z8 = l0(x), G8 = V0(x), U8 = R0(x), I8 = f6(x), w8 = o6(x), D8 = r6(x), P8 = l6(x), O8 = p6(x), M8 = d6(x), A8 = n6(x), F8 = i6(x);
|
|
4066
|
+
var L = U("ZodType", (J, X) => {
|
|
4067
|
+
return $.init(J, X), Object.assign(J["~standard"], { jsonSchema: {
|
|
4068
|
+
input: L0(J, "input"),
|
|
4069
|
+
output: L0(J, "output")
|
|
4070
|
+
} }), J.toJSONSchema = b2(J, {}), J.def = X, J.type = X.type, Object.defineProperty(J, "_def", { value: X }), J.check = (...Y) => {
|
|
4071
|
+
return J.clone(F.mergeDefs(X, { checks: [...X.checks ?? [], ...Y.map((W) => typeof W === "function" ? { _zod: {
|
|
4072
|
+
check: W,
|
|
4073
|
+
def: { check: "custom" },
|
|
4074
|
+
onattach: []
|
|
4075
|
+
} } : W)] }));
|
|
4076
|
+
}, J.clone = (Y, W) => y(J, Y, W), J.brand = () => J, J.register = (Y, W) => {
|
|
4077
|
+
return Y.add(J, W), J;
|
|
4078
|
+
}, J.parse = (Y, W) => Q8(J, Y, W, { callee: J.parse }), J.safeParse = (Y, W) => G8(J, Y, W), J.parseAsync = async (Y, W) => z8(J, Y, W, { callee: J.parseAsync }), J.safeParseAsync = async (Y, W) => U8(J, Y, W), J.spa = J.safeParseAsync, J.encode = (Y, W) => I8(J, Y, W), J.decode = (Y, W) => w8(J, Y, W), J.encodeAsync = async (Y, W) => D8(J, Y, W), J.decodeAsync = async (Y, W) => P8(J, Y, W), J.safeEncode = (Y, W) => O8(J, Y, W), J.safeDecode = (Y, W) => M8(J, Y, W), J.safeEncodeAsync = async (Y, W) => A8(J, Y, W), J.safeDecodeAsync = async (Y, W) => F8(J, Y, W), J.refine = (Y, W) => J.check(ZY(Y, W)), J.superRefine = (Y) => J.check(_Y(Y)), J.overwrite = (Y) => J.check(s(Y)), J.optional = () => V8(J), J.nullable = () => R8(J), J.nullish = () => V8(R8(J)), J.nonoptional = (Y) => $Y(J, Y), J.array = () => i4(J), J.or = (Y) => GY([J, Y]), J.and = (Y) => IY(J, Y), J.transform = (Y) => N8(J, PY(Y)), J.default = (Y) => AY(J, Y), J.prefault = (Y) => EY(J, Y), J.catch = (Y) => VY(J, Y), J.pipe = (Y) => N8(J, Y), J.readonly = () => SY(J), J.describe = (Y) => {
|
|
4079
|
+
let W = J.clone();
|
|
4080
|
+
return X0.add(W, { description: Y }), W;
|
|
4081
|
+
}, Object.defineProperty(J, "description", {
|
|
4082
|
+
get() {
|
|
4083
|
+
return X0.get(J)?.description;
|
|
4084
|
+
},
|
|
4085
|
+
configurable: !0
|
|
4086
|
+
}), J.meta = (...Y) => {
|
|
4087
|
+
if (Y.length === 0) return X0.get(J);
|
|
4088
|
+
let W = J.clone();
|
|
4089
|
+
return X0.add(W, Y[0]), W;
|
|
4090
|
+
}, J.isOptional = () => J.safeParse(void 0).success, J.isNullable = () => J.safeParse(null).success, J;
|
|
4091
|
+
}), S8 = U("_ZodString", (J, X) => {
|
|
4092
|
+
i0.init(J, X), L.init(J, X), J._zod.processJSONSchema = (W, q, H) => C2(J, W, q, H);
|
|
4093
|
+
let Y = J._zod.bag;
|
|
4094
|
+
J.format = Y.format ?? null, J.minLength = Y.minimum ?? null, J.maxLength = Y.maximum ?? null, J.regex = (...W) => J.check(C4(...W)), J.includes = (...W) => J.check(j4(...W)), J.startsWith = (...W) => J.check(h4(...W)), J.endsWith = (...W) => J.check(x4(...W)), J.min = (...W) => J.check(G0(...W)), J.max = (...W) => J.check(t0(...W)), J.length = (...W) => J.check(a0(...W)), J.nonempty = (...W) => J.check(G0(1, ...W)), J.lowercase = (W) => J.check(k4(W)), J.uppercase = (W) => J.check(T4(W)), J.trim = () => J.check(g4()), J.normalize = (...W) => J.check(v4(...W)), J.toLowerCase = () => J.check(u4()), J.toUpperCase = () => J.check(c4()), J.slugify = () => J.check(y4());
|
|
4095
|
+
}), l4 = U("ZodString", (J, X) => {
|
|
4096
|
+
i0.init(J, X), S8.init(J, X), J.email = (Y) => J.check(Z4(L8, Y)), J.url = (Y) => J.check(b4(_8, Y)), J.jwt = (Y) => J.check(U2(JY, Y)), J.emoji = (Y) => J.check(tJ(yX, Y)), J.guid = (Y) => J.check(_4(E8, Y)), J.uuid = (Y) => J.check(pJ(s0, Y)), J.uuidv4 = (Y) => J.check(dJ(s0, Y)), J.uuidv6 = (Y) => J.check(nJ(s0, Y)), J.uuidv7 = (Y) => J.check(iJ(s0, Y)), J.nanoid = (Y) => J.check(aJ(mX, Y)), J.guid = (Y) => J.check(_4(E8, Y)), J.cuid = (Y) => J.check(sJ(fX, Y)), J.cuid2 = (Y) => J.check(eJ(oX, Y)), J.ulid = (Y) => J.check(J2(rX, Y)), J.base64 = (Y) => J.check(Q2(aX, Y)), J.base64url = (Y) => J.check(z2(sX, Y)), J.xid = (Y) => J.check(X2(lX, Y)), J.ksuid = (Y) => J.check(Y2(pX, Y)), J.ipv4 = (Y) => J.check(W2(dX, Y)), J.ipv6 = (Y) => J.check(q2(nX, Y)), J.cidrv4 = (Y) => J.check(H2(iX, Y)), J.cidrv6 = (Y) => J.check(B2(tX, Y)), J.e164 = (Y) => J.check(G2(eX, Y)), J.datetime = (Y) => J.check(J8(Y)), J.date = (Y) => J.check(X8(Y)), J.time = (Y) => J.check(Y8(Y)), J.duration = (Y) => J.check(W8(Y));
|
|
4097
|
+
});
|
|
4098
|
+
function R(J) {
|
|
4099
|
+
return rJ(l4, J);
|
|
4100
|
+
}
|
|
4101
|
+
var S = U("ZodStringFormat", (J, X) => {
|
|
4102
|
+
V.init(J, X), S8.init(J, X);
|
|
4103
|
+
}), L8 = U("ZodEmail", (J, X) => {
|
|
4104
|
+
i1.init(J, X), S.init(J, X);
|
|
4105
|
+
});
|
|
4106
|
+
var E8 = U("ZodGUID", (J, X) => {
|
|
4107
|
+
d1.init(J, X), S.init(J, X);
|
|
4108
|
+
});
|
|
4109
|
+
var s0 = U("ZodUUID", (J, X) => {
|
|
4110
|
+
n1.init(J, X), S.init(J, X);
|
|
4111
|
+
});
|
|
4112
|
+
var _8 = U("ZodURL", (J, X) => {
|
|
4113
|
+
t1.init(J, X), S.init(J, X);
|
|
4114
|
+
});
|
|
4115
|
+
var yX = U("ZodEmoji", (J, X) => {
|
|
4116
|
+
a1.init(J, X), S.init(J, X);
|
|
4117
|
+
});
|
|
4118
|
+
var mX = U("ZodNanoID", (J, X) => {
|
|
4119
|
+
s1.init(J, X), S.init(J, X);
|
|
4120
|
+
});
|
|
4121
|
+
var fX = U("ZodCUID", (J, X) => {
|
|
4122
|
+
e1.init(J, X), S.init(J, X);
|
|
4123
|
+
});
|
|
4124
|
+
var oX = U("ZodCUID2", (J, X) => {
|
|
4125
|
+
JJ.init(J, X), S.init(J, X);
|
|
4126
|
+
});
|
|
4127
|
+
var rX = U("ZodULID", (J, X) => {
|
|
4128
|
+
XJ.init(J, X), S.init(J, X);
|
|
4129
|
+
});
|
|
4130
|
+
var lX = U("ZodXID", (J, X) => {
|
|
4131
|
+
YJ.init(J, X), S.init(J, X);
|
|
4132
|
+
});
|
|
4133
|
+
var pX = U("ZodKSUID", (J, X) => {
|
|
4134
|
+
WJ.init(J, X), S.init(J, X);
|
|
4135
|
+
});
|
|
4136
|
+
var dX = U("ZodIPv4", (J, X) => {
|
|
4137
|
+
zJ.init(J, X), S.init(J, X);
|
|
4138
|
+
});
|
|
4139
|
+
var nX = U("ZodIPv6", (J, X) => {
|
|
4140
|
+
GJ.init(J, X), S.init(J, X);
|
|
4141
|
+
});
|
|
4142
|
+
var iX = U("ZodCIDRv4", (J, X) => {
|
|
4143
|
+
UJ.init(J, X), S.init(J, X);
|
|
4144
|
+
});
|
|
4145
|
+
var tX = U("ZodCIDRv6", (J, X) => {
|
|
4146
|
+
IJ.init(J, X), S.init(J, X);
|
|
4147
|
+
});
|
|
4148
|
+
var aX = U("ZodBase64", (J, X) => {
|
|
4149
|
+
DJ.init(J, X), S.init(J, X);
|
|
4150
|
+
});
|
|
4151
|
+
var sX = U("ZodBase64URL", (J, X) => {
|
|
4152
|
+
PJ.init(J, X), S.init(J, X);
|
|
4153
|
+
});
|
|
4154
|
+
var eX = U("ZodE164", (J, X) => {
|
|
4155
|
+
OJ.init(J, X), S.init(J, X);
|
|
4156
|
+
});
|
|
4157
|
+
var JY = U("ZodJWT", (J, X) => {
|
|
4158
|
+
MJ.init(J, X), S.init(J, X);
|
|
4159
|
+
});
|
|
4160
|
+
var e0 = U("ZodNumber", (J, X) => {
|
|
4161
|
+
S4.init(J, X), L.init(J, X), J._zod.processJSONSchema = (W, q, H) => k2(J, W, q, H), J.gt = (W, q) => J.check(z0(W, q)), J.gte = (W, q) => J.check(f(W, q)), J.min = (W, q) => J.check(f(W, q)), J.lt = (W, q) => J.check(Q0(W, q)), J.lte = (W, q) => J.check(p(W, q)), J.max = (W, q) => J.check(p(W, q)), J.int = (W) => J.check($8(W)), J.safe = (W) => J.check($8(W)), J.positive = (W) => J.check(z0(0, W)), J.nonnegative = (W) => J.check(f(0, W)), J.negative = (W) => J.check(Q0(0, W)), J.nonpositive = (W) => J.check(p(0, W)), J.multipleOf = (W, q) => J.check(S0(W, q)), J.step = (W, q) => J.check(S0(W, q)), J.finite = () => J;
|
|
4162
|
+
let Y = J._zod.bag;
|
|
4163
|
+
J.minValue = Math.max(Y.minimum ?? Number.NEGATIVE_INFINITY, Y.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, J.maxValue = Math.min(Y.maximum ?? Number.POSITIVE_INFINITY, Y.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, J.isInt = (Y.format ?? "").includes("int") || Number.isSafeInteger(Y.multipleOf ?? .5), J.isFinite = !0, J.format = Y.format ?? null;
|
|
4164
|
+
});
|
|
4165
|
+
function Y0(J) {
|
|
4166
|
+
return O2(e0, J);
|
|
4167
|
+
}
|
|
4168
|
+
var XY = U("ZodNumberFormat", (J, X) => {
|
|
4169
|
+
AJ.init(J, X), e0.init(J, X);
|
|
4170
|
+
});
|
|
4171
|
+
function $8(J) {
|
|
4172
|
+
return A2(XY, J);
|
|
4173
|
+
}
|
|
4174
|
+
var p4 = U("ZodBoolean", (J, X) => {
|
|
4175
|
+
FJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => T2(J, Y, W, q);
|
|
4176
|
+
});
|
|
4177
|
+
function C8(J) {
|
|
4178
|
+
return F2(p4, J);
|
|
4179
|
+
}
|
|
4180
|
+
var k8 = U("ZodBigInt", (J, X) => {
|
|
4181
|
+
EJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (W, q, H) => j2(J, W, q, H), J.gte = (W, q) => J.check(f(W, q)), J.min = (W, q) => J.check(f(W, q)), J.gt = (W, q) => J.check(z0(W, q)), J.gte = (W, q) => J.check(f(W, q)), J.min = (W, q) => J.check(f(W, q)), J.lt = (W, q) => J.check(Q0(W, q)), J.lte = (W, q) => J.check(p(W, q)), J.max = (W, q) => J.check(p(W, q)), J.positive = (W) => J.check(z0(BigInt(0), W)), J.negative = (W) => J.check(Q0(BigInt(0), W)), J.nonpositive = (W) => J.check(p(BigInt(0), W)), J.nonnegative = (W) => J.check(f(BigInt(0), W)), J.multipleOf = (W, q) => J.check(S0(W, q));
|
|
4182
|
+
let Y = J._zod.bag;
|
|
4183
|
+
J.minValue = Y.minimum ?? null, J.maxValue = Y.maximum ?? null, J.format = Y.format ?? null;
|
|
4184
|
+
});
|
|
4185
|
+
var YY = U("ZodAny", (J, X) => {
|
|
4186
|
+
$J.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => x2(J, Y, W, q);
|
|
4187
|
+
});
|
|
4188
|
+
function J4() {
|
|
4189
|
+
return K2(YY);
|
|
4190
|
+
}
|
|
4191
|
+
var WY = U("ZodUnknown", (J, X) => {
|
|
4192
|
+
KJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => v2(J, Y, W, q);
|
|
4193
|
+
});
|
|
4194
|
+
function K8() {
|
|
4195
|
+
return V2(WY);
|
|
4196
|
+
}
|
|
4197
|
+
var qY = U("ZodNever", (J, X) => {
|
|
4198
|
+
VJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => h2(J, Y, W, q);
|
|
4199
|
+
});
|
|
4200
|
+
function HY(J) {
|
|
4201
|
+
return R2(qY, J);
|
|
4202
|
+
}
|
|
4203
|
+
var d4 = U("ZodDate", (J, X) => {
|
|
4204
|
+
RJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (W, q, H) => g2(J, W, q, H), J.min = (W, q) => J.check(f(W, q)), J.max = (W, q) => J.check(p(W, q));
|
|
4205
|
+
let Y = J._zod.bag;
|
|
4206
|
+
J.minDate = Y.minimum ? new Date(Y.minimum) : null, J.maxDate = Y.maximum ? new Date(Y.maximum) : null;
|
|
4207
|
+
});
|
|
4208
|
+
function n4(J) {
|
|
4209
|
+
return N2(d4, J);
|
|
4210
|
+
}
|
|
4211
|
+
var BY = U("ZodArray", (J, X) => {
|
|
4212
|
+
NJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => m2(J, Y, W, q), J.element = X.element, J.min = (Y, W) => J.check(G0(Y, W)), J.nonempty = (Y) => J.check(G0(1, Y)), J.max = (Y, W) => J.check(t0(Y, W)), J.length = (Y, W) => J.check(a0(Y, W)), J.unwrap = () => J.element;
|
|
4213
|
+
});
|
|
4214
|
+
function i4(J, X) {
|
|
4215
|
+
return L2(BY, J, X);
|
|
4216
|
+
}
|
|
4217
|
+
var QY = U("ZodObject", (J, X) => {
|
|
4218
|
+
ZJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => f2(J, Y, W, q), F.defineLazy(J, "shape", () => {
|
|
4219
|
+
return X.shape;
|
|
4220
|
+
}), J.keyof = () => a4(Object.keys(J._zod.def.shape)), J.catchall = (Y) => J.clone({
|
|
4221
|
+
...J._zod.def,
|
|
4222
|
+
catchall: Y
|
|
4223
|
+
}), J.passthrough = () => J.clone({
|
|
4224
|
+
...J._zod.def,
|
|
4225
|
+
catchall: K8()
|
|
4226
|
+
}), J.loose = () => J.clone({
|
|
4227
|
+
...J._zod.def,
|
|
4228
|
+
catchall: K8()
|
|
4229
|
+
}), J.strict = () => J.clone({
|
|
4230
|
+
...J._zod.def,
|
|
4231
|
+
catchall: HY()
|
|
4232
|
+
}), J.strip = () => J.clone({
|
|
4233
|
+
...J._zod.def,
|
|
4234
|
+
catchall: void 0
|
|
4235
|
+
}), J.extend = (Y) => {
|
|
4236
|
+
return F.extend(J, Y);
|
|
4237
|
+
}, J.safeExtend = (Y) => {
|
|
4238
|
+
return F.safeExtend(J, Y);
|
|
4239
|
+
}, J.merge = (Y) => F.merge(J, Y), J.pick = (Y) => F.pick(J, Y), J.omit = (Y) => F.omit(J, Y), J.partial = (...Y) => F.partial(j8, J, Y[0]), J.required = (...Y) => F.required(h8, J, Y[0]);
|
|
4240
|
+
});
|
|
4241
|
+
function T8(J, X) {
|
|
4242
|
+
return new QY({
|
|
4243
|
+
type: "object",
|
|
4244
|
+
shape: J ?? {},
|
|
4245
|
+
...F.normalizeParams(X)
|
|
4246
|
+
});
|
|
4247
|
+
}
|
|
4248
|
+
var zY = U("ZodUnion", (J, X) => {
|
|
4249
|
+
_J.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => o2(J, Y, W, q), J.options = X.options;
|
|
4250
|
+
});
|
|
4251
|
+
function GY(J, X) {
|
|
4252
|
+
return new zY({
|
|
4253
|
+
type: "union",
|
|
4254
|
+
options: J,
|
|
4255
|
+
...F.normalizeParams(X)
|
|
4256
|
+
});
|
|
4257
|
+
}
|
|
4258
|
+
var UY = U("ZodIntersection", (J, X) => {
|
|
4259
|
+
bJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => r2(J, Y, W, q);
|
|
4260
|
+
});
|
|
4261
|
+
function IY(J, X) {
|
|
4262
|
+
return new UY({
|
|
4263
|
+
type: "intersection",
|
|
4264
|
+
left: J,
|
|
4265
|
+
right: X
|
|
4266
|
+
});
|
|
4267
|
+
}
|
|
4268
|
+
var wY = U("ZodRecord", (J, X) => {
|
|
4269
|
+
CJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => l2(J, Y, W, q), J.keyType = X.keyType, J.valueType = X.valueType;
|
|
4270
|
+
});
|
|
4271
|
+
function t4(J, X, Y) {
|
|
4272
|
+
return new wY({
|
|
4273
|
+
type: "record",
|
|
4274
|
+
keyType: J,
|
|
4275
|
+
valueType: X,
|
|
4276
|
+
...F.normalizeParams(Y)
|
|
4277
|
+
});
|
|
4278
|
+
}
|
|
4279
|
+
var r4 = U("ZodEnum", (J, X) => {
|
|
4280
|
+
kJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (W, q, H) => u2(J, W, q, H), J.enum = X.entries, J.options = Object.values(X.entries);
|
|
4281
|
+
let Y = new Set(Object.keys(X.entries));
|
|
4282
|
+
J.extract = (W, q) => {
|
|
4283
|
+
let H = {};
|
|
4284
|
+
for (let B of W) if (Y.has(B)) H[B] = X.entries[B];
|
|
4285
|
+
else throw Error(`Key ${B} not found in enum`);
|
|
4286
|
+
return new r4({
|
|
4287
|
+
...X,
|
|
4288
|
+
checks: [],
|
|
4289
|
+
...F.normalizeParams(q),
|
|
4290
|
+
entries: H
|
|
4291
|
+
});
|
|
4292
|
+
}, J.exclude = (W, q) => {
|
|
4293
|
+
let H = { ...X.entries };
|
|
4294
|
+
for (let B of W) if (Y.has(B)) delete H[B];
|
|
4295
|
+
else throw Error(`Key ${B} not found in enum`);
|
|
4296
|
+
return new r4({
|
|
4297
|
+
...X,
|
|
4298
|
+
checks: [],
|
|
4299
|
+
...F.normalizeParams(q),
|
|
4300
|
+
entries: H
|
|
4301
|
+
});
|
|
4302
|
+
};
|
|
4303
|
+
});
|
|
4304
|
+
function a4(J, X) {
|
|
4305
|
+
return new r4({
|
|
4306
|
+
type: "enum",
|
|
4307
|
+
entries: Array.isArray(J) ? Object.fromEntries(J.map((W) => [W, W])) : J,
|
|
4308
|
+
...F.normalizeParams(X)
|
|
4309
|
+
});
|
|
4310
|
+
}
|
|
4311
|
+
var DY = U("ZodTransform", (J, X) => {
|
|
4312
|
+
TJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => y2(J, Y, W, q), J._zod.parse = (Y, W) => {
|
|
4313
|
+
if (W.direction === "backward") throw new O0(J.constructor.name);
|
|
4314
|
+
Y.addIssue = (H) => {
|
|
4315
|
+
if (typeof H === "string") Y.issues.push(F.issue(H, Y.value, X));
|
|
4316
|
+
else {
|
|
4317
|
+
let B = H;
|
|
4318
|
+
if (B.fatal) B.continue = !1;
|
|
4319
|
+
B.code ?? (B.code = "custom"), B.input ?? (B.input = Y.value), B.inst ?? (B.inst = J), Y.issues.push(F.issue(B));
|
|
4320
|
+
}
|
|
4321
|
+
};
|
|
4322
|
+
let q = X.transform(Y.value, Y);
|
|
4323
|
+
if (q instanceof Promise) return q.then((H) => {
|
|
4324
|
+
return Y.value = H, Y;
|
|
4325
|
+
});
|
|
4326
|
+
return Y.value = q, Y;
|
|
4327
|
+
};
|
|
4328
|
+
});
|
|
4329
|
+
function PY(J) {
|
|
4330
|
+
return new DY({
|
|
4331
|
+
type: "transform",
|
|
4332
|
+
transform: J
|
|
4333
|
+
});
|
|
4334
|
+
}
|
|
4335
|
+
var j8 = U("ZodOptional", (J, X) => {
|
|
4336
|
+
jJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => e2(J, Y, W, q), J.unwrap = () => J._zod.def.innerType;
|
|
4337
|
+
});
|
|
4338
|
+
function V8(J) {
|
|
4339
|
+
return new j8({
|
|
4340
|
+
type: "optional",
|
|
4341
|
+
innerType: J
|
|
4342
|
+
});
|
|
4343
|
+
}
|
|
4344
|
+
var OY = U("ZodNullable", (J, X) => {
|
|
4345
|
+
hJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => p2(J, Y, W, q), J.unwrap = () => J._zod.def.innerType;
|
|
4346
|
+
});
|
|
4347
|
+
function R8(J) {
|
|
4348
|
+
return new OY({
|
|
4349
|
+
type: "nullable",
|
|
4350
|
+
innerType: J
|
|
4351
|
+
});
|
|
4352
|
+
}
|
|
4353
|
+
var MY = U("ZodDefault", (J, X) => {
|
|
4354
|
+
xJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => n2(J, Y, W, q), J.unwrap = () => J._zod.def.innerType, J.removeDefault = J.unwrap;
|
|
4355
|
+
});
|
|
4356
|
+
function AY(J, X) {
|
|
4357
|
+
return new MY({
|
|
4358
|
+
type: "default",
|
|
4359
|
+
innerType: J,
|
|
4360
|
+
get defaultValue() {
|
|
4361
|
+
return typeof X === "function" ? X() : F.shallowClone(X);
|
|
4362
|
+
}
|
|
4363
|
+
});
|
|
4364
|
+
}
|
|
4365
|
+
var FY = U("ZodPrefault", (J, X) => {
|
|
4366
|
+
vJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => i2(J, Y, W, q), J.unwrap = () => J._zod.def.innerType;
|
|
4367
|
+
});
|
|
4368
|
+
function EY(J, X) {
|
|
4369
|
+
return new FY({
|
|
4370
|
+
type: "prefault",
|
|
4371
|
+
innerType: J,
|
|
4372
|
+
get defaultValue() {
|
|
4373
|
+
return typeof X === "function" ? X() : F.shallowClone(X);
|
|
4374
|
+
}
|
|
4375
|
+
});
|
|
4376
|
+
}
|
|
4377
|
+
var h8 = U("ZodNonOptional", (J, X) => {
|
|
4378
|
+
gJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => d2(J, Y, W, q), J.unwrap = () => J._zod.def.innerType;
|
|
4379
|
+
});
|
|
4380
|
+
function $Y(J, X) {
|
|
4381
|
+
return new h8({
|
|
4382
|
+
type: "nonoptional",
|
|
4383
|
+
innerType: J,
|
|
4384
|
+
...F.normalizeParams(X)
|
|
4385
|
+
});
|
|
4386
|
+
}
|
|
4387
|
+
var KY = U("ZodCatch", (J, X) => {
|
|
4388
|
+
uJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => t2(J, Y, W, q), J.unwrap = () => J._zod.def.innerType, J.removeCatch = J.unwrap;
|
|
4389
|
+
});
|
|
4390
|
+
function VY(J, X) {
|
|
4391
|
+
return new KY({
|
|
4392
|
+
type: "catch",
|
|
4393
|
+
innerType: J,
|
|
4394
|
+
catchValue: typeof X === "function" ? X : () => X
|
|
4395
|
+
});
|
|
4396
|
+
}
|
|
4397
|
+
var RY = U("ZodPipe", (J, X) => {
|
|
4398
|
+
cJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => a2(J, Y, W, q), J.in = X.in, J.out = X.out;
|
|
4399
|
+
});
|
|
4400
|
+
function N8(J, X) {
|
|
4401
|
+
return new RY({
|
|
4402
|
+
type: "pipe",
|
|
4403
|
+
in: J,
|
|
4404
|
+
out: X
|
|
4405
|
+
});
|
|
4406
|
+
}
|
|
4407
|
+
var NY = U("ZodReadonly", (J, X) => {
|
|
4408
|
+
yJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => s2(J, Y, W, q), J.unwrap = () => J._zod.def.innerType;
|
|
4409
|
+
});
|
|
4410
|
+
function SY(J) {
|
|
4411
|
+
return new NY({
|
|
4412
|
+
type: "readonly",
|
|
4413
|
+
innerType: J
|
|
4414
|
+
});
|
|
4415
|
+
}
|
|
4416
|
+
var LY = U("ZodCustom", (J, X) => {
|
|
4417
|
+
mJ.init(J, X), L.init(J, X), J._zod.processJSONSchema = (Y, W, q) => c2(J, Y, W, q);
|
|
4418
|
+
});
|
|
4419
|
+
function ZY(J, X = {}) {
|
|
4420
|
+
return Z2(LY, J, X);
|
|
4421
|
+
}
|
|
4422
|
+
function _Y(J) {
|
|
4423
|
+
return _2(J);
|
|
4424
|
+
}
|
|
4425
|
+
var I0 = {};
|
|
4426
|
+
U6(I0, {
|
|
4427
|
+
string: () => bY,
|
|
4428
|
+
number: () => CY,
|
|
4429
|
+
date: () => jY,
|
|
4430
|
+
boolean: () => kY,
|
|
4431
|
+
bigint: () => TY
|
|
4432
|
+
});
|
|
4433
|
+
function bY(J) {
|
|
4434
|
+
return lJ(l4, J);
|
|
4435
|
+
}
|
|
4436
|
+
function CY(J) {
|
|
4437
|
+
return M2(e0, J);
|
|
4438
|
+
}
|
|
4439
|
+
function kY(J) {
|
|
4440
|
+
return E2(p4, J);
|
|
4441
|
+
}
|
|
4442
|
+
function TY(J) {
|
|
4443
|
+
return $2(k8, J);
|
|
4444
|
+
}
|
|
4445
|
+
function jY(J) {
|
|
4446
|
+
return S2(d4, J);
|
|
4447
|
+
}
|
|
4448
|
+
v(L4());
|
|
4449
|
+
var s4 = /^[A-Za-z]{2}(?:-[A-Za-z0-9]{2,8})*$/, e4 = /^(?:UTC|[A-Za-z_]+\/[A-Za-z_]+)$/, J6 = /^[+]?\d[\d\s().-]{3,}$/, X6 = /^[A-Z]{3}$/, Y6 = /^[A-Z]{2}$/, W6 = -90, q6 = 90, H6 = -180, B6 = 180, E5 = {
|
|
4450
|
+
String_unsecure: () => new Z({
|
|
4451
|
+
name: "String_unsecure",
|
|
4452
|
+
description: "Unvalidated string scalar",
|
|
4453
|
+
zod: R(),
|
|
4454
|
+
parseValue: (J) => R().parse(J),
|
|
4455
|
+
serialize: (J) => String(J),
|
|
4456
|
+
parseLiteral: (J) => {
|
|
4457
|
+
if (J.kind !== K.STRING) throw TypeError("Invalid literal");
|
|
4458
|
+
return J.value;
|
|
4459
|
+
},
|
|
4460
|
+
jsonSchema: { type: "string" }
|
|
4461
|
+
}),
|
|
4462
|
+
Int_unsecure: () => new Z({
|
|
4463
|
+
name: "Int_unsecure",
|
|
4464
|
+
description: "Unvalidated integer scalar",
|
|
4465
|
+
zod: Y0().int(),
|
|
4466
|
+
parseValue: (J) => {
|
|
4467
|
+
let X = typeof J === "number" ? J : Number(J);
|
|
4468
|
+
return Y0().int().parse(X);
|
|
4469
|
+
},
|
|
4470
|
+
serialize: (J) => Math.trunc(typeof J === "number" ? J : Number(J)),
|
|
4471
|
+
parseLiteral: (J) => {
|
|
4472
|
+
if (J.kind !== K.INT) throw TypeError("Invalid literal");
|
|
4473
|
+
return Number(J.value);
|
|
4474
|
+
},
|
|
4475
|
+
jsonSchema: { type: "integer" }
|
|
4476
|
+
}),
|
|
4477
|
+
Float_unsecure: () => new Z({
|
|
4478
|
+
name: "Float_unsecure",
|
|
4479
|
+
description: "Unvalidated float scalar",
|
|
4480
|
+
zod: Y0(),
|
|
4481
|
+
parseValue: (J) => {
|
|
4482
|
+
let X = typeof J === "number" ? J : Number(J);
|
|
4483
|
+
return Y0().parse(X);
|
|
4484
|
+
},
|
|
4485
|
+
serialize: (J) => Number(J),
|
|
4486
|
+
parseLiteral: (J) => {
|
|
4487
|
+
if (J.kind !== K.FLOAT && J.kind !== K.INT) throw TypeError("Invalid literal");
|
|
4488
|
+
return Number(J.value);
|
|
4489
|
+
},
|
|
4490
|
+
jsonSchema: { type: "number" }
|
|
4491
|
+
}),
|
|
4492
|
+
Boolean: () => new Z({
|
|
4493
|
+
name: "Boolean",
|
|
4494
|
+
description: "Unvalidated boolean scalar",
|
|
4495
|
+
zod: C8(),
|
|
4496
|
+
parseValue: (J) => I0.boolean().parse(J),
|
|
4497
|
+
serialize: (J) => Boolean(J),
|
|
4498
|
+
parseLiteral: (J) => {
|
|
4499
|
+
if (J.kind !== K.BOOLEAN) throw TypeError("Invalid literal");
|
|
4500
|
+
return J.value;
|
|
4501
|
+
},
|
|
4502
|
+
jsonSchema: { type: "boolean" }
|
|
4503
|
+
}),
|
|
4504
|
+
ID: () => new Z({
|
|
4505
|
+
name: "ID",
|
|
4506
|
+
description: "Unvalidated id scalar",
|
|
4507
|
+
zod: R(),
|
|
4508
|
+
parseValue: (J) => R().parse(J),
|
|
4509
|
+
serialize: (J) => String(J),
|
|
4510
|
+
parseLiteral: (J) => {
|
|
4511
|
+
if (J.kind !== K.STRING) throw TypeError("Invalid literal");
|
|
4512
|
+
return J.value;
|
|
4513
|
+
},
|
|
4514
|
+
jsonSchema: { type: "string" }
|
|
4515
|
+
}),
|
|
4516
|
+
JSON: () => new Z({
|
|
4517
|
+
name: "JSON",
|
|
4518
|
+
zod: J4(),
|
|
4519
|
+
parseValue: (J) => J,
|
|
4520
|
+
serialize: (J) => J,
|
|
4521
|
+
jsonSchema: {}
|
|
4522
|
+
}),
|
|
4523
|
+
JSONObject: () => new Z({
|
|
4524
|
+
name: "JSONObject",
|
|
4525
|
+
zod: t4(R(), J4()),
|
|
4526
|
+
parseValue: (J) => t4(R(), J4()).parse(J),
|
|
4527
|
+
serialize: (J) => J ?? {},
|
|
4528
|
+
jsonSchema: { type: "object" }
|
|
4529
|
+
}),
|
|
4530
|
+
Date: () => new Z({
|
|
4531
|
+
name: "Date",
|
|
4532
|
+
zod: n4(),
|
|
4533
|
+
parseValue: (J) => J instanceof Date ? J : new Date(String(J)),
|
|
4534
|
+
serialize: (J) => J instanceof Date ? J.toISOString().split("T")[0] : String(J),
|
|
4535
|
+
jsonSchema: {
|
|
4536
|
+
type: "string",
|
|
4537
|
+
format: "date"
|
|
4538
|
+
}
|
|
4539
|
+
}),
|
|
4540
|
+
DateTime: () => new Z({
|
|
4541
|
+
name: "DateTime",
|
|
4542
|
+
zod: n4(),
|
|
4543
|
+
parseValue: (J) => J instanceof Date ? J : new Date(String(J)),
|
|
4544
|
+
serialize: (J) => {
|
|
4545
|
+
return J instanceof Date ? J.toISOString() : String(J);
|
|
4546
|
+
},
|
|
4547
|
+
jsonSchema: {
|
|
4548
|
+
type: "string",
|
|
4549
|
+
format: "date-time"
|
|
4550
|
+
}
|
|
4551
|
+
}),
|
|
4552
|
+
Time: () => new Z({
|
|
4553
|
+
name: "Time",
|
|
4554
|
+
zod: R().regex(/^\d{2}:\d{2}(:\d{2})?$/),
|
|
4555
|
+
parseValue: (J) => R().regex(/^\d{2}:\d{2}(:\d{2})?$/).parse(J),
|
|
4556
|
+
serialize: (J) => String(J),
|
|
4557
|
+
jsonSchema: {
|
|
4558
|
+
type: "string",
|
|
4559
|
+
pattern: "^\\d{2}:\\d{2}(:\\d{2})?$"
|
|
4560
|
+
}
|
|
4561
|
+
}),
|
|
4562
|
+
EmailAddress: () => new Z({
|
|
4563
|
+
name: "EmailAddress",
|
|
4564
|
+
zod: R().email(),
|
|
4565
|
+
parseValue: (J) => R().email().parse(J),
|
|
4566
|
+
serialize: (J) => String(J),
|
|
4567
|
+
jsonSchema: {
|
|
4568
|
+
type: "string",
|
|
4569
|
+
format: "email"
|
|
4570
|
+
}
|
|
4571
|
+
}),
|
|
4572
|
+
URL: () => new Z({
|
|
4573
|
+
name: "URL",
|
|
4574
|
+
zod: R().url(),
|
|
4575
|
+
parseValue: (J) => R().url().parse(J),
|
|
4576
|
+
serialize: (J) => String(J),
|
|
4577
|
+
jsonSchema: {
|
|
4578
|
+
type: "string",
|
|
4579
|
+
format: "uri"
|
|
4580
|
+
}
|
|
4581
|
+
}),
|
|
4582
|
+
PhoneNumber: () => new Z({
|
|
4583
|
+
name: "PhoneNumber",
|
|
4584
|
+
zod: R().regex(J6),
|
|
4585
|
+
parseValue: (J) => R().regex(J6).parse(J),
|
|
4586
|
+
serialize: (J) => String(J),
|
|
4587
|
+
jsonSchema: {
|
|
4588
|
+
type: "string",
|
|
4589
|
+
pattern: J6.source
|
|
4590
|
+
}
|
|
4591
|
+
}),
|
|
4592
|
+
NonEmptyString: () => new Z({
|
|
4593
|
+
name: "NonEmptyString",
|
|
4594
|
+
zod: R().min(1),
|
|
4595
|
+
parseValue: (J) => R().min(1).parse(J),
|
|
4596
|
+
serialize: (J) => String(J),
|
|
4597
|
+
jsonSchema: {
|
|
4598
|
+
type: "string",
|
|
4599
|
+
minLength: 1
|
|
4600
|
+
}
|
|
4601
|
+
}),
|
|
4602
|
+
Locale: () => new Z({
|
|
4603
|
+
name: "Locale",
|
|
4604
|
+
zod: R().regex(s4),
|
|
4605
|
+
parseValue: (J) => R().regex(s4).parse(J),
|
|
4606
|
+
serialize: (J) => String(J),
|
|
4607
|
+
jsonSchema: {
|
|
4608
|
+
type: "string",
|
|
4609
|
+
pattern: s4.source
|
|
4610
|
+
}
|
|
4611
|
+
}),
|
|
4612
|
+
TimeZone: () => new Z({
|
|
4613
|
+
name: "TimeZone",
|
|
4614
|
+
zod: R().regex(e4),
|
|
4615
|
+
parseValue: (J) => R().regex(e4).parse(J),
|
|
4616
|
+
serialize: (J) => String(J),
|
|
4617
|
+
jsonSchema: {
|
|
4618
|
+
type: "string",
|
|
4619
|
+
pattern: e4.source
|
|
4620
|
+
}
|
|
4621
|
+
}),
|
|
4622
|
+
Latitude: () => new Z({
|
|
4623
|
+
name: "Latitude",
|
|
4624
|
+
zod: Y0().min(W6).max(q6),
|
|
4625
|
+
parseValue: (J) => I0.number().min(W6).max(q6).parse(J),
|
|
4626
|
+
serialize: (J) => Number(J),
|
|
4627
|
+
jsonSchema: {
|
|
4628
|
+
type: "number",
|
|
4629
|
+
minimum: W6,
|
|
4630
|
+
maximum: q6
|
|
4631
|
+
}
|
|
4632
|
+
}),
|
|
4633
|
+
Longitude: () => new Z({
|
|
4634
|
+
name: "Longitude",
|
|
4635
|
+
zod: Y0().min(H6).max(B6),
|
|
4636
|
+
parseValue: (J) => I0.number().min(H6).max(B6).parse(J),
|
|
4637
|
+
serialize: (J) => Number(J),
|
|
4638
|
+
jsonSchema: {
|
|
4639
|
+
type: "number",
|
|
4640
|
+
minimum: H6,
|
|
4641
|
+
maximum: B6
|
|
4642
|
+
}
|
|
4643
|
+
}),
|
|
4644
|
+
Currency: () => new Z({
|
|
4645
|
+
name: "Currency",
|
|
4646
|
+
zod: R().regex(X6),
|
|
4647
|
+
parseValue: (J) => R().regex(X6).parse(J),
|
|
4648
|
+
serialize: (J) => String(J),
|
|
4649
|
+
jsonSchema: {
|
|
4650
|
+
type: "string",
|
|
4651
|
+
pattern: X6.source
|
|
4652
|
+
}
|
|
4653
|
+
}),
|
|
4654
|
+
CountryCode: () => new Z({
|
|
4655
|
+
name: "CountryCode",
|
|
4656
|
+
zod: R().regex(Y6),
|
|
4657
|
+
parseValue: (J) => R().regex(Y6).parse(J),
|
|
4658
|
+
serialize: (J) => String(J),
|
|
4659
|
+
jsonSchema: {
|
|
4660
|
+
type: "string",
|
|
4661
|
+
pattern: Y6.source
|
|
4662
|
+
}
|
|
4663
|
+
})
|
|
4664
|
+
};
|
|
4665
|
+
var x8 = class {
|
|
4666
|
+
config;
|
|
4667
|
+
constructor(J) {
|
|
4668
|
+
this.config = J;
|
|
4669
|
+
}
|
|
4670
|
+
getZod() {
|
|
4671
|
+
return T8(Object.entries(this.config.fields).reduce((X, [Y, W]) => {
|
|
4672
|
+
let q = W.type.getZod(), H = W.isArray ? i4(q) : q;
|
|
4673
|
+
return X[Y] = W.isOptional ? H.optional() : H, X;
|
|
4674
|
+
}, {}));
|
|
4675
|
+
}
|
|
4676
|
+
getPothosInput() {
|
|
4677
|
+
return this.config.name;
|
|
4678
|
+
}
|
|
4679
|
+
};
|
|
4680
|
+
var K5 = (J) => new x8(J);
|
|
4681
|
+
|
|
4682
|
+
//#endregion
|
|
4683
|
+
export { E5, K5 };
|
|
4684
|
+
//# sourceMappingURL=index.js.map
|