zod-compiler 1.23.2 → 1.23.4
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/README.md +10 -5
- package/dist/core/codegen/build-path.d.ts.map +1 -1
- package/dist/core/codegen/build-path.js +36 -9
- package/dist/core/codegen/build-path.js.map +1 -1
- package/dist/core/codegen/dedupe.js +1 -0
- package/dist/core/codegen/dedupe.js.map +1 -1
- package/dist/core/codegen/fast-path.d.ts.map +1 -1
- package/dist/core/codegen/fast-path.js +2 -0
- package/dist/core/codegen/fast-path.js.map +1 -1
- package/dist/core/codegen/fast-size.d.ts.map +1 -1
- package/dist/core/codegen/fast-size.js +2 -0
- package/dist/core/codegen/fast-size.js.map +1 -1
- package/dist/core/codegen/issue-decls.d.ts +7 -1
- package/dist/core/codegen/issue-decls.d.ts.map +1 -1
- package/dist/core/codegen/issue-decls.js +8 -1
- package/dist/core/codegen/issue-decls.js.map +1 -1
- package/dist/core/codegen/schemas/custom.d.ts +10 -0
- package/dist/core/codegen/schemas/custom.d.ts.map +1 -0
- package/dist/core/codegen/schemas/custom.js +17 -0
- package/dist/core/codegen/schemas/custom.js.map +1 -0
- package/dist/core/codegen/schemas/fallback.d.ts +3 -1
- package/dist/core/codegen/schemas/fallback.d.ts.map +1 -1
- package/dist/core/codegen/schemas/fallback.js +23 -20
- package/dist/core/codegen/schemas/fallback.js.map +1 -1
- package/dist/core/codegen/schemas/string-bool.d.ts +5 -2
- package/dist/core/codegen/schemas/string-bool.d.ts.map +1 -1
- package/dist/core/codegen/schemas/string-bool.js +18 -9
- package/dist/core/codegen/schemas/string-bool.js.map +1 -1
- package/dist/core/codegen/slow-path.d.ts.map +1 -1
- package/dist/core/codegen/slow-path.js +3 -1
- package/dist/core/codegen/slow-path.js.map +1 -1
- package/dist/core/extract/extractors/custom.d.ts +12 -0
- package/dist/core/extract/extractors/custom.d.ts.map +1 -0
- package/dist/core/extract/extractors/custom.js +35 -0
- package/dist/core/extract/extractors/custom.js.map +1 -0
- package/dist/core/extract/registry.d.ts +2 -0
- package/dist/core/extract/registry.d.ts.map +1 -1
- package/dist/core/extract/registry.js +2 -0
- package/dist/core/extract/registry.js.map +1 -1
- package/dist/core/extract/types.d.ts +7 -1
- package/dist/core/extract/types.d.ts.map +1 -1
- package/dist/core/iife.d.ts +3 -4
- package/dist/core/iife.d.ts.map +1 -1
- package/dist/core/iife.js +3 -4
- package/dist/core/iife.js.map +1 -1
- package/dist/core/types.d.ts +17 -2
- package/dist/core/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","names":["schema"],"sources":["../../../src/core/extract/registry.ts"],"sourcesContent":["import type { FallbackIR, SchemaIR } from \"../types.js\";\nimport { resolveCheckMessage } from \"./checks.js\";\nimport { extractAny } from \"./extractors/any.js\";\nimport { extractArray } from \"./extractors/array.js\";\nimport { extractBigint } from \"./extractors/bigint.js\";\nimport { extractBoolean } from \"./extractors/boolean.js\";\nimport { extractCatch } from \"./extractors/catch.js\";\nimport { extractDate } from \"./extractors/date.js\";\nimport { extractDefault } from \"./extractors/default.js\";\nimport { extractEnum } from \"./extractors/enum.js\";\nimport { extractFile } from \"./extractors/file.js\";\nimport { extractIntersection } from \"./extractors/intersection.js\";\nimport { extractLazy } from \"./extractors/lazy.js\";\nimport { extractLiteral } from \"./extractors/literal.js\";\nimport { extractMap } from \"./extractors/map.js\";\nimport { extractNan } from \"./extractors/nan.js\";\nimport { extractNever } from \"./extractors/never.js\";\nimport { extractNull } from \"./extractors/null.js\";\nimport { extractNullable } from \"./extractors/nullable.js\";\nimport { extractNumber } from \"./extractors/number.js\";\nimport { extractObject } from \"./extractors/object.js\";\nimport { extractOptional } from \"./extractors/optional.js\";\nimport { extractPipe } from \"./extractors/pipe.js\";\nimport { extractReadonly } from \"./extractors/readonly.js\";\nimport { extractRecord } from \"./extractors/record.js\";\nimport { extractSet } from \"./extractors/set.js\";\nimport { extractString } from \"./extractors/string.js\";\nimport { extractSymbol } from \"./extractors/symbol.js\";\nimport { extractTemplateLiteral } from \"./extractors/template-literal.js\";\nimport { extractTuple } from \"./extractors/tuple.js\";\nimport { extractUndefined } from \"./extractors/undefined.js\";\nimport { extractUnion } from \"./extractors/union.js\";\nimport { extractUnknown } from \"./extractors/unknown.js\";\nimport { extractVoid } from \"./extractors/void.js\";\nimport { makeFallback } from \"./fallback.js\";\nimport type {\n Extractor,\n ExtractorContext,\n RecursionState,\n RefEntry,\n SupportedZodDefType,\n ZodSchema,\n} from \"./types.js\";\n\n// ─── Typed registry ─────────────────────────────────────────────────────────\n// Adding a new SupportedZodDefType without registering an extractor here causes\n// a compile error, preventing silent-missing-case bugs.\n//\n// Note: SupportedZodDefType covers Zod's def.type values, not SchemaIR types.\n// SchemaIR types like discriminatedUnion, recursiveRef, effect, and fallback are\n// produced by extractors (e.g. union emits discriminatedUnion, lazy emits\n// recursiveRef) but have no corresponding Zod def.type.\n\nexport const extractRegistry = {\n // Primitives (order follows SupportedZodDefType union in types.ts)\n boolean: extractBoolean,\n null: extractNull,\n undefined: extractUndefined,\n any: extractAny,\n unknown: extractUnknown,\n symbol: extractSymbol,\n void: extractVoid,\n nan: extractNan,\n never: extractNever,\n literal: extractLiteral,\n enum: extractEnum,\n optional: extractOptional,\n nullable: extractNullable,\n readonly: extractReadonly,\n intersection: extractIntersection,\n // Complex extractors\n string: extractString,\n number: extractNumber,\n bigint: extractBigint,\n date: extractDate,\n object: extractObject,\n array: extractArray,\n tuple: extractTuple,\n record: extractRecord,\n set: extractSet,\n map: extractMap,\n union: extractUnion,\n default: extractDefault,\n pipe: extractPipe,\n lazy: extractLazy,\n catch: extractCatch,\n template_literal: extractTemplateLiteral,\n file: extractFile,\n} satisfies Record<SupportedZodDefType, Extractor>;\n\n// ─── Factory ────────────────────────────────────────────────────────────────\n// Lives here (not in types.ts) to avoid circular imports:\n// visit() → dispatch() → imports from types.ts\n\nfunction createExtractorContext(\n schema: unknown,\n path: string,\n refs: RefEntry[] | undefined,\n visiting: Set<unknown>,\n recursion: RecursionState,\n): ExtractorContext {\n return {\n schema,\n path,\n refs,\n visiting,\n recursion,\n visit(childSchema: unknown, pathSuffix?: string): SchemaIR {\n const childPath = pathSuffix ? `${path}${pathSuffix}` : path;\n return dispatch(childSchema, childPath, refs, visiting, recursion);\n },\n fallback(reason: FallbackIR[\"reason\"]) {\n return makeFallback(reason, schema, refs, path);\n },\n };\n}\n\n// ─── Dispatch ───────────────────────────────────────────────────────────────\n\n/**\n * def.type values whose extractors consume `def.checks`. In Zod v4, `.refine()`\n * (and `.check()`) appends to the checks array of WHATEVER schema type it is\n * called on — z.string().nullable().refine(...) puts the check on the nullable.\n * For every other type, checks present on the def would be silently dropped by\n * extraction, so dispatch() forces a Zod fallback instead (validation hole\n * otherwise: compiled output accepts input Zod rejects).\n */\nconst CHECKS_AWARE_TYPES: ReadonlySet<string> = new Set([\n \"string\",\n \"number\",\n \"bigint\",\n \"date\",\n \"object\",\n \"array\",\n \"set\",\n \"file\",\n]);\n\n/**\n * Central dispatch — replaces extractSchemaInner().\n * visit() and dispatch() form a mutually recursive pair, both in this file.\n */\nexport function dispatch(\n zodSchema: unknown,\n path: string,\n refs: RefEntry[] | undefined,\n visiting: Set<unknown>,\n recursion: RecursionState,\n): SchemaIR {\n const schema = zodSchema as ZodSchema;\n const def = schema._zod.def;\n\n visiting.add(zodSchema);\n try {\n const extractor = extractRegistry[def.type as SupportedZodDefType];\n const ctx = createExtractorContext(zodSchema, path, refs, visiting, recursion);\n let ir = extractor ? extractor(def, ctx) : makeFallback(\"unsupported\", zodSchema, refs, path);\n if (ir.type === \"fallback\") return ir;\n\n // Safety net: checks attached to a type whose extractor ignores them.\n if (def.checks && def.checks.length > 0 && !CHECKS_AWARE_TYPES.has(def.type)) {\n return makeFallback(\"refine\", zodSchema, refs, path);\n }\n\n // Schema-level custom error (z.string({ error: \"...\" })): bake static\n // messages as the node's default issue message; dynamic error maps can't\n // be compiled — delegate to Zod so messages stay exact.\n if (def.error !== undefined) {\n const resolved = resolveCheckMessage(def.error);\n if (resolved.kind === \"dynamic\") {\n return makeFallback(\"refine\", zodSchema, refs, path);\n }\n if (resolved.kind === \"static\") {\n ir = { ...ir, typeMessage: resolved.message };\n }\n }\n\n // This schema is the target of a non-root recursive cycle (a `recursiveRef`\n // with refId ≥ 1 was emitted for it deeper in the walk): wrap its IR as the\n // OUTERMOST transformation so codegen hosts it as a standalone validator.\n // Done last — after the fallback post-processing above — so a target that\n // delegates to Zod returns its fallback leaf, discarding the whole subtree\n // (including the inner `recursiveRef`) instead of leaving a dangling ref.\n // The root target (refId 0) is the schema's own function and is never\n // wrapped.\n const refId = recursion.targets.get(zodSchema);\n if (refId !== undefined) {\n return { type: \"recursionTarget\", refId, inner: ir };\n }\n return ir;\n } finally {\n visiting.delete(zodSchema);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.js","names":["schema"],"sources":["../../../src/core/extract/registry.ts"],"sourcesContent":["import type { FallbackIR, SchemaIR } from \"../types.js\";\nimport { resolveCheckMessage } from \"./checks.js\";\nimport { extractAny } from \"./extractors/any.js\";\nimport { extractArray } from \"./extractors/array.js\";\nimport { extractBigint } from \"./extractors/bigint.js\";\nimport { extractBoolean } from \"./extractors/boolean.js\";\nimport { extractCatch } from \"./extractors/catch.js\";\nimport { extractCustom } from \"./extractors/custom.js\";\nimport { extractDate } from \"./extractors/date.js\";\nimport { extractDefault } from \"./extractors/default.js\";\nimport { extractEnum } from \"./extractors/enum.js\";\nimport { extractFile } from \"./extractors/file.js\";\nimport { extractIntersection } from \"./extractors/intersection.js\";\nimport { extractLazy } from \"./extractors/lazy.js\";\nimport { extractLiteral } from \"./extractors/literal.js\";\nimport { extractMap } from \"./extractors/map.js\";\nimport { extractNan } from \"./extractors/nan.js\";\nimport { extractNever } from \"./extractors/never.js\";\nimport { extractNull } from \"./extractors/null.js\";\nimport { extractNullable } from \"./extractors/nullable.js\";\nimport { extractNumber } from \"./extractors/number.js\";\nimport { extractObject } from \"./extractors/object.js\";\nimport { extractOptional } from \"./extractors/optional.js\";\nimport { extractPipe } from \"./extractors/pipe.js\";\nimport { extractReadonly } from \"./extractors/readonly.js\";\nimport { extractRecord } from \"./extractors/record.js\";\nimport { extractSet } from \"./extractors/set.js\";\nimport { extractString } from \"./extractors/string.js\";\nimport { extractSymbol } from \"./extractors/symbol.js\";\nimport { extractTemplateLiteral } from \"./extractors/template-literal.js\";\nimport { extractTuple } from \"./extractors/tuple.js\";\nimport { extractUndefined } from \"./extractors/undefined.js\";\nimport { extractUnion } from \"./extractors/union.js\";\nimport { extractUnknown } from \"./extractors/unknown.js\";\nimport { extractVoid } from \"./extractors/void.js\";\nimport { makeFallback } from \"./fallback.js\";\nimport type {\n Extractor,\n ExtractorContext,\n RecursionState,\n RefEntry,\n SupportedZodDefType,\n ZodSchema,\n} from \"./types.js\";\n\n// ─── Typed registry ─────────────────────────────────────────────────────────\n// Adding a new SupportedZodDefType without registering an extractor here causes\n// a compile error, preventing silent-missing-case bugs.\n//\n// Note: SupportedZodDefType covers Zod's def.type values, not SchemaIR types.\n// SchemaIR types like discriminatedUnion, recursiveRef, effect, and fallback are\n// produced by extractors (e.g. union emits discriminatedUnion, lazy emits\n// recursiveRef) but have no corresponding Zod def.type.\n\nexport const extractRegistry = {\n // Primitives (order follows SupportedZodDefType union in types.ts)\n boolean: extractBoolean,\n null: extractNull,\n undefined: extractUndefined,\n any: extractAny,\n unknown: extractUnknown,\n symbol: extractSymbol,\n void: extractVoid,\n nan: extractNan,\n never: extractNever,\n literal: extractLiteral,\n enum: extractEnum,\n optional: extractOptional,\n nullable: extractNullable,\n readonly: extractReadonly,\n intersection: extractIntersection,\n custom: extractCustom,\n // Complex extractors\n string: extractString,\n number: extractNumber,\n bigint: extractBigint,\n date: extractDate,\n object: extractObject,\n array: extractArray,\n tuple: extractTuple,\n record: extractRecord,\n set: extractSet,\n map: extractMap,\n union: extractUnion,\n default: extractDefault,\n pipe: extractPipe,\n lazy: extractLazy,\n catch: extractCatch,\n template_literal: extractTemplateLiteral,\n file: extractFile,\n} satisfies Record<SupportedZodDefType, Extractor>;\n\n// ─── Factory ────────────────────────────────────────────────────────────────\n// Lives here (not in types.ts) to avoid circular imports:\n// visit() → dispatch() → imports from types.ts\n\nfunction createExtractorContext(\n schema: unknown,\n path: string,\n refs: RefEntry[] | undefined,\n visiting: Set<unknown>,\n recursion: RecursionState,\n): ExtractorContext {\n return {\n schema,\n path,\n refs,\n visiting,\n recursion,\n visit(childSchema: unknown, pathSuffix?: string): SchemaIR {\n const childPath = pathSuffix ? `${path}${pathSuffix}` : path;\n return dispatch(childSchema, childPath, refs, visiting, recursion);\n },\n fallback(reason: FallbackIR[\"reason\"]) {\n return makeFallback(reason, schema, refs, path);\n },\n };\n}\n\n// ─── Dispatch ───────────────────────────────────────────────────────────────\n\n/**\n * def.type values whose extractors consume `def.checks`. In Zod v4, `.refine()`\n * (and `.check()`) appends to the checks array of WHATEVER schema type it is\n * called on — z.string().nullable().refine(...) puts the check on the nullable.\n * For every other type, checks present on the def would be silently dropped by\n * extraction, so dispatch() forces a Zod fallback instead (validation hole\n * otherwise: compiled output accepts input Zod rejects).\n */\nconst CHECKS_AWARE_TYPES: ReadonlySet<string> = new Set([\n \"string\",\n \"number\",\n \"bigint\",\n \"date\",\n \"object\",\n \"array\",\n \"set\",\n \"file\",\n]);\n\n/**\n * Central dispatch — replaces extractSchemaInner().\n * visit() and dispatch() form a mutually recursive pair, both in this file.\n */\nexport function dispatch(\n zodSchema: unknown,\n path: string,\n refs: RefEntry[] | undefined,\n visiting: Set<unknown>,\n recursion: RecursionState,\n): SchemaIR {\n const schema = zodSchema as ZodSchema;\n const def = schema._zod.def;\n\n visiting.add(zodSchema);\n try {\n const extractor = extractRegistry[def.type as SupportedZodDefType];\n const ctx = createExtractorContext(zodSchema, path, refs, visiting, recursion);\n let ir = extractor ? extractor(def, ctx) : makeFallback(\"unsupported\", zodSchema, refs, path);\n if (ir.type === \"fallback\") return ir;\n\n // Safety net: checks attached to a type whose extractor ignores them.\n if (def.checks && def.checks.length > 0 && !CHECKS_AWARE_TYPES.has(def.type)) {\n return makeFallback(\"refine\", zodSchema, refs, path);\n }\n\n // Schema-level custom error (z.string({ error: \"...\" })): bake static\n // messages as the node's default issue message; dynamic error maps can't\n // be compiled — delegate to Zod so messages stay exact.\n if (def.error !== undefined) {\n const resolved = resolveCheckMessage(def.error);\n if (resolved.kind === \"dynamic\") {\n return makeFallback(\"refine\", zodSchema, refs, path);\n }\n if (resolved.kind === \"static\") {\n ir = { ...ir, typeMessage: resolved.message };\n }\n }\n\n // This schema is the target of a non-root recursive cycle (a `recursiveRef`\n // with refId ≥ 1 was emitted for it deeper in the walk): wrap its IR as the\n // OUTERMOST transformation so codegen hosts it as a standalone validator.\n // Done last — after the fallback post-processing above — so a target that\n // delegates to Zod returns its fallback leaf, discarding the whole subtree\n // (including the inner `recursiveRef`) instead of leaving a dangling ref.\n // The root target (refId 0) is the schema's own function and is never\n // wrapped.\n const refId = recursion.targets.get(zodSchema);\n if (refId !== undefined) {\n return { type: \"recursionTarget\", refId, inner: ir };\n }\n return ir;\n } finally {\n visiting.delete(zodSchema);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAa,kBAAkB;CAE7B,SAAS;CACT,MAAM;CACN,WAAW;CACX,KAAK;CACL,SAAS;CACT,QAAQ;CACR,MAAM;CACN,KAAK;CACL,OAAO;CACP,SAAS;CACT,MAAM;CACN,UAAU;CACV,UAAU;CACV,UAAU;CACV,cAAc;CACd,QAAQ;CAER,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,OAAO;CACP,OAAO;CACP,QAAQ;CACR,KAAK;CACL,KAAK;CACL,OAAO;CACP,SAAS;CACT,MAAM;CACN,MAAM;CACN,OAAO;CACP,kBAAkB;CAClB,MAAM;AACR;AAMA,SAAS,uBACP,QACA,MACA,MACA,UACA,WACkB;CAClB,OAAO;EACL;EACA;EACA;EACA;EACA;EACA,MAAM,aAAsB,YAA+B;GAEzD,OAAO,SAAS,aADE,aAAa,GAAG,OAAO,eAAe,MAChB,MAAM,UAAU,SAAS;EACnE;EACA,SAAS,QAA8B;GACrC,OAAO,aAAa,QAAQ,QAAQ,MAAM,IAAI;EAChD;CACF;AACF;;;;;;;;;AAYA,MAAM,qCAA0C,IAAI,IAAI;CACtD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;AAMD,SAAgB,SACd,WACA,MACA,MACA,UACA,WACU;CAEV,MAAM,MAAMA,UAAO,KAAK;CAExB,SAAS,IAAI,SAAS;CACtB,IAAI;EACF,MAAM,YAAY,gBAAgB,IAAI;EACtC,MAAM,MAAM,uBAAuB,WAAW,MAAM,MAAM,UAAU,SAAS;EAC7E,IAAI,KAAK,YAAY,UAAU,KAAK,GAAG,IAAI,aAAa,eAAe,WAAW,MAAM,IAAI;EAC5F,IAAI,GAAG,SAAS,YAAY,OAAO;EAGnC,IAAI,IAAI,UAAU,IAAI,OAAO,SAAS,KAAK,CAAC,mBAAmB,IAAI,IAAI,IAAI,GACzE,OAAO,aAAa,UAAU,WAAW,MAAM,IAAI;EAMrD,IAAI,IAAI,UAAU,KAAA,GAAW;GAC3B,MAAM,WAAW,oBAAoB,IAAI,KAAK;GAC9C,IAAI,SAAS,SAAS,WACpB,OAAO,aAAa,UAAU,WAAW,MAAM,IAAI;GAErD,IAAI,SAAS,SAAS,UACpB,KAAK;IAAE,GAAG;IAAI,aAAa,SAAS;GAAQ;EAEhD;EAUA,MAAM,QAAQ,UAAU,QAAQ,IAAI,SAAS;EAC7C,IAAI,UAAU,KAAA,GACZ,OAAO;GAAE,MAAM;GAAmB;GAAO,OAAO;EAAG;EAErD,OAAO;CACT,UAAU;EACR,SAAS,OAAO,SAAS;CAC3B;AACF"}
|
|
@@ -44,6 +44,12 @@ interface ZodCheckSchema {
|
|
|
44
44
|
}
|
|
45
45
|
interface ZodDef {
|
|
46
46
|
type: string;
|
|
47
|
+
/** Predicate function on z.custom() / z.instanceof(). */
|
|
48
|
+
fn?: unknown;
|
|
49
|
+
/** Whether a failing custom schema aborts its containing union option. */
|
|
50
|
+
abort?: boolean;
|
|
51
|
+
/** Custom issue path suffix on z.custom(). */
|
|
52
|
+
path?: unknown;
|
|
47
53
|
checks: ZodCheckSchema[];
|
|
48
54
|
check: string;
|
|
49
55
|
format: string;
|
|
@@ -103,7 +109,7 @@ interface RefEntry {
|
|
|
103
109
|
accessPath: string;
|
|
104
110
|
}
|
|
105
111
|
/** All Zod v4 def.type values that zod-compiler supports. */
|
|
106
|
-
type SupportedZodDefType = "boolean" | "null" | "undefined" | "any" | "unknown" | "symbol" | "void" | "nan" | "never" | "literal" | "enum" | "optional" | "nullable" | "readonly" | "intersection" | "string" | "number" | "bigint" | "date" | "object" | "array" | "tuple" | "record" | "set" | "map" | "union" | "default" | "pipe" | "lazy" | "catch" | "template_literal" | "file";
|
|
112
|
+
type SupportedZodDefType = "boolean" | "null" | "undefined" | "any" | "unknown" | "symbol" | "void" | "nan" | "never" | "literal" | "enum" | "optional" | "nullable" | "readonly" | "intersection" | "custom" | "string" | "number" | "bigint" | "date" | "object" | "array" | "tuple" | "record" | "set" | "map" | "union" | "default" | "pipe" | "lazy" | "catch" | "template_literal" | "file";
|
|
107
113
|
/**
|
|
108
114
|
* Shared, mutable recursion-target bookkeeping for one {@link extractSchema}
|
|
109
115
|
* call. Lazy cycle detection assigns each NON-root recursion target a stable
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/core/extract/types.ts"],"mappings":";;UAAiB;EACf;EACA;EACA;EACA,SAAS;EACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;EACA;;EAEA,WAAW;EACX,WAAW;EACX;EACA;;UAGe;EACf;IACE,KAAK;;;;;;IAML;;;UAIa;EACf;EACA,QAAQ;EACR;EACA;EACA,SAAS;;EAET;;EAEA,WAAW;EACX,OAAO,eAAe;EACtB,SAAS;EACT,SAAS;EACT,WAAW;EACX;EACA,SAAS;EACT,IAAI;EACJ,KAAK;EACL,OAAO;EACP,MAAM;EACN,SAAS;EACT,WAAW;EACX,MAAM;EACN,OAAO;EACP;;EAEA;EACA;EACA;EACA,cAAc;;EAEd;;EAEA;;UAGe;EACf;IACE,KAAK;IACL,MAAM;;IAEN,YAAY;;IAEZ,UAAU;;IAEV,SAAS;;IAET,SAAS;;IAET;;IAEA,aAAa,eAAe;;;;UAKf;;EAEf;;EAEA;;;KAMU;;;;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/core/extract/types.ts"],"mappings":";;UAAiB;EACf;EACA;EACA;EACA,SAAS;EACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;EACA;;EAEA,WAAW;EACX,WAAW;EACX;EACA;;UAGe;EACf;IACE,KAAK;;;;;;IAML;;;UAIa;EACf;;EAEA;;EAEA;;EAEA;EACA,QAAQ;EACR;EACA;EACA,SAAS;;EAET;;EAEA,WAAW;EACX,OAAO,eAAe;EACtB,SAAS;EACT,SAAS;EACT,WAAW;EACX;EACA,SAAS;EACT,IAAI;EACJ,KAAK;EACL,OAAO;EACP,MAAM;EACN,SAAS;EACT,WAAW;EACX,MAAM;EACN,OAAO;EACP;;EAEA;EACA;EACA;EACA,cAAc;;EAEd;;EAEA;;UAGe;EACf;IACE,KAAK;IACL,MAAM;;IAEN,YAAY;;IAEZ,UAAU;;IAEV,SAAS;;IAET,SAAS;;IAET;;IAEA,aAAa,eAAe;;;;UAKf;;EAEf;;EAEA;;;KAMU;;;;;;;;UA4CK;;WAEN;;WAEA,SAAS;;EAElB;;;UAMe;;WAEN;;WAEA;;WAEA,MAAM;;WAEN,UAAU;;WAEV,WAAW;;EAGpB,MAAM,sBAAsB,sBAHR;;EAMpB,SAAS,QAH+D,uBAGjC;;;KAI7B,aAAa,KAAK,QAAQ,KAAK,qBAAA"}
|
package/dist/core/iife.d.ts
CHANGED
|
@@ -2,10 +2,9 @@ import { CompiledSchemaInfo } from "./pipeline.js";
|
|
|
2
2
|
//#region src/core/iife.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Import statement required by generateIIFE output (references
|
|
5
|
-
* __zodCompilerConfig). `core` is bound for $ZodAsyncError:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* parse raises (see ZC_SR_DECL).
|
|
5
|
+
* __zodCompilerConfig). `core` is bound for $ZodAsyncError: superRefine and
|
|
6
|
+
* custom callbacks may only reveal that they are async through the promise
|
|
7
|
+
* they return, at which point zod's own synchronous parse raises.
|
|
9
8
|
*/
|
|
10
9
|
declare const ZOD_CONFIG_IMPORT = "import { config as __zodCompilerConfig, core as __zcCore, ZodRealError as __zcZodError } from \"zod\";";
|
|
11
10
|
/**
|
package/dist/core/iife.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iife.d.ts","names":[],"sources":["../../src/core/iife.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"iife.d.ts","names":[],"sources":["../../src/core/iife.ts"],"mappings":";;;;;;;;cAaa;;;;;;;;;;;;;;;;;;;;cAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCA;;;cAUA;;;;;;;;;;;;;;;;;;;;;;;cAyBA;;;;;;;;;;;;;;;;;;;;;;;cAwBA;;cAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAyDA;;;;;;;;;iBAsBG,aACd,oBACA,QAAQ,oBACR;EAAY"}
|
package/dist/core/iife.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
//#region src/core/iife.ts
|
|
2
2
|
/**
|
|
3
3
|
* Import statement required by generateIIFE output (references
|
|
4
|
-
* __zodCompilerConfig). `core` is bound for $ZodAsyncError:
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* parse raises (see ZC_SR_DECL).
|
|
4
|
+
* __zodCompilerConfig). `core` is bound for $ZodAsyncError: superRefine and
|
|
5
|
+
* custom callbacks may only reveal that they are async through the promise
|
|
6
|
+
* they return, at which point zod's own synchronous parse raises.
|
|
8
7
|
*/
|
|
9
8
|
const ZOD_CONFIG_IMPORT = "import { config as __zodCompilerConfig, core as __zcCore, ZodRealError as __zcZodError } from \"zod\";";
|
|
10
9
|
/**
|
package/dist/core/iife.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iife.js","names":[],"sources":["../../src/core/iife.ts"],"sourcesContent":["/**\n * Shared CompiledSchema<T> IIFE generation.\n * Used by both CLI emitter and unplugin transform.\n */\n\nimport type { CompiledSchemaInfo } from \"./pipeline.js\";\n\n/**\n * Import statement required by generateIIFE output (references\n * __zodCompilerConfig). `core` is bound for $ZodAsyncError: a superRefine\n * callback is reached through zod's wrapper, so an async one is only\n * detectable by the promise it returns, at which point zod's own synchronous\n * parse raises (see ZC_SR_DECL).\n */\nexport const ZOD_CONFIG_IMPORT =\n 'import { config as __zodCompilerConfig, core as __zcCore, ZodRealError as __zcZodError } from \"zod\";';\n\n/**\n * File-level `__zcMsg` declaration (must appear once after ZOD_CONFIG_IMPORT):\n * the message an issue gets when nothing was baked into it at build time.\n *\n * Resolves zod's tail of `finalizeIssue` — `config.customError` then\n * `config.localeError` then \"Invalid input\" — and does it PER CALL, because the\n * config is mutable: `z.config({ localeError })` in an entry point runs after\n * the schema modules it imports, so a value snapshotted at module init misses\n * it. Reading a captured `localeError` alone also dropped `customError`\n * outright, silently ignoring the global map most i18n setups install.\n *\n * The head of zod's chain — the schema's own `error` option — is baked into the\n * issue at build time and short-circuits this. The one link that cannot be\n * reproduced is a per-CALL `ctx.error`, which would have to travel through\n * `safeParse`; that entry point sits at V8's inlining budget, where even an\n * unused extra parameter measured ~12% on every parse.\n *\n * Only ever called while building an error, never on a successful parse.\n */\nexport const ZOD_MSG_DECLARATION =\n 'function __zcUw(m){return typeof m===\"string\"?m:(m===undefined||m===null?undefined:m.message);}' +\n \"var __zcMsg=function(iss){var c=__zodCompilerConfig(),m;\" +\n \"if(c.customError){m=__zcUw(c.customError(iss));if(m!==undefined&&m!==null)return m;}\" +\n \"if(c.localeError){m=__zcUw(c.localeError(iss));if(m!==undefined&&m!==null)return m;}\" +\n 'return \"Invalid input\";};';\n\n/**\n * Shared failure-result for __zcFin / __zcFinD. Inline mode (CLI emitter)\n * declares it once per compiled file; lean mode (all unplugin bundlers) declares\n * it once per bundle in the plugin-materialized runtime module (module-local —\n * generated code only ever references __zcFin/__zcFinD, never __ZcFail).\n *\n * Why a prototype getter and not `{success:false, get error(){...}}`: an object\n * literal with an inline accessor forces V8 down its slow accessor-defining\n * allocation path — ~110ns per failure, measured — which dominates the entire\n * invalid-input cost whenever callers never read `.error`. Hosting `error` on\n * the prototype turns each failure into a plain field-only instantiation (~2ns,\n * ~13x), with the lazy-cache semantics intact. (Trade-off: `error` is a\n * prototype accessor, so it no longer shows up in `Object.keys(result)` / spread\n * / JSON.stringify of the result wrapper — `.success`/`.error`/`.data` access,\n * destructuring, and `in` are unaffected.)\n *\n * One class serves both finalizers, so the instances share one hidden class:\n * __zcFin passes pre-collected issues in `_e` (with `_f===null`); __zcFinD\n * passes the hosted slow-walk in `_f` plus the input in `_i`, and the getter\n * runs the walk on first `.error` read. The whole finalization — locale fill\n * (__zcMsg applied ONLY when an issue carries no message, never overwriting a\n * baked-in custom/fallback message), input strip, and ZodError construction\n * (zod v4 JSON.stringifies every issue into `message` and captures a stack\n * trace) — stays deferred inside the cached accessor exactly as before, since\n * the issues array is observable solely through `.error`.\n */\nexport const FAIL_CLASS_DECL =\n \"function __ZcFail(e,f,i){this.success=false;this._e=e;this._f=f;this._i=i;this._c=undefined;}\" +\n 'Object.defineProperty(__ZcFail.prototype,\"error\",{configurable:true,get:function(){' +\n \"if(this._c)return this._c;\" +\n \"var e=this._f!==null?this._f(this._i):this._e;\" +\n 'for(var i=0;i<e.length;i++){if(e[i].message===undefined&&typeof __zcMsg===\"function\")e[i].message=__zcMsg(e[i]);e[i].input=undefined;}' +\n \"return this._c=new __zcZodError(e);}});\";\n\n/** Eager finalizer (mutation / partial-fast-path schemas): issues already\n * collected in `e`; success short-circuits to a plain result literal. */\nexport const FIN_DECL =\n \"function __zcFin(e,d){if(!e.length)return{success:true,data:d};return new __ZcFail(e,null,null);}\";\n\n/**\n * Deferred-collection finalizer for Fast-Path-eligible schemas. When the\n * fast check fails, the ENTIRE slow path (the issue-collecting re-walk) is\n * pushed into the cached `.error` accessor instead of running eagerly:\n * fast-eligible schemas never mutate, so the walk's only output is the\n * issues array, which is observable solely through `.error` — one step\n * further along the same lazy boundary `__zcFin` already established (locale\n * fill, input strip, ZodError construction). A failed safeParse whose\n * `.error` is never read costs the fast check alone.\n *\n * Takes the schema's HOSTED slow-walk function plus the input — NOT a\n * per-call closure: `__zcFinD(__sw_N, input)` allocates only the result\n * object, where `__zcFinD(function(){...})` paid a closure environment and\n * function object per failure. Hosting the walk also shrinks safeParse to\n * two statements, within V8's inlining budget (the success-path result\n * literal becomes escape-analyzable at monomorphic call sites).\n *\n * The walk re-reads `input` at `.error`-read time; a caller that mutates\n * the input between safeParse and reading `.error` sees issues for the\n * mutated value (zod materializes at parse time). Same caveat class as the\n * documented __zcFin deferral.\n */\nexport const FIN_DEFERRED_DECL = \"function __zcFinD(f,inp){return new __ZcFail(null,f,inp);}\";\n\n/**\n * Compact-mode failure class — a lazy failure that delegates error reporting to\n * the ORIGINAL Zod schema's `safeParse`. Used by `output: \"compact\"`, where the\n * compiled slow walk is dropped entirely: a mutation-free schema's fast check\n * is the only generated validation, and on a fast-check failure the cold error\n * path is produced by the retained Zod schema itself (`zod` is the source of\n * truth, so the issues are byte-identical — no second validation engine).\n *\n * `_z` is the schema's PRISTINE bound safeParse (`__rf[N].safeParse.bind(...)`,\n * captured pre-`__zcMkv` by emitRfDelegate — see context.ts — so it is zod's\n * own implementation, never the compiled delegate, avoiding infinite\n * recursion). The zod parse is deferred until `.error` is read and cached, so\n * the common `safeParse(x).success`/`.is(x)` checks on invalid input cost only\n * the fast check (zod never runs) — the same deferral boundary `__zcFinD`\n * establishes for the compiled slow walk. Sound because compact mode is gated\n * on a TOTAL fast path: `fc(input) === false` ⟹ zod rejects, so `success:false`\n * holds without consulting zod.\n *\n * The getter returns zod's OWN ZodError verbatim (no locale fill / input strip /\n * re-wrap — zod already finalized it), so a delegated failure is exactly what\n * the unaltered schema would have produced.\n */\nexport const FAILZ_CLASS_DECL =\n \"function __ZcFailZ(z,i){this.success=false;this._z=z;this._i=i;this._c=undefined;}\" +\n 'Object.defineProperty(__ZcFailZ.prototype,\"error\",{configurable:true,get:function(){' +\n \"return this._c||(this._c=this._z(this._i).error);}});\";\n\n/** Compact-mode finalizer: wrap a pristine bound safeParse + input into a lazy delegated failure. */\nexport const FINZ_DECL = \"function __zcFinZ(z,i){return new __ZcFailZ(z,i);}\";\n\n/**\n * Validator factory. Inline mode (CLI emitter) declares it once per compiled\n * file; lean mode (all unplugin bundlers) exports it once per bundle from the\n * plugin-materialized runtime module — generated code never imports it from\n * the zod-compiler package itself, so zod-compiler stays a devDependency and\n * the helper set is always version-locked to the codegen that calls it.\n * Wraps a safeParse function into the CompiledSchema interface.\n *\n * IDENTITY-PRESERVING: with zodCompat (schema != null) the compiled\n * parse/safeParse/parseAsync/safeParseAsync are installed as OWN properties\n * on the original schema object, which is returned as-is. zod v4 keys\n * several APIs on object identity — toJSONSchema's ctx.seen registers the\n * object it is handed while each processor closure captures the original\n * inst (a wrapper crashes `optionalProcessor` with \"Cannot set properties\n * of undefined (setting 'ref')\" the moment a compiled schema is composed\n * into another schema), and globalRegistry/.meta() is a WeakMap keyed by\n * the schema instance (a wrapper silently loses OpenAPI titles/ids). An\n * Object.create wrapper breaks both; mutating the original breaks neither\n * (zod's internal parsing flows through _zod.run, never the public\n * methods, and derived schemas — .optional(), .extend() — are fresh\n * instances that fall back to plain zod). schema=null (zodCompat: false)\n * still produces a plain method-bag object.\n *\n * fc is the schema's hosted fast-check boolean function (null when no Fast\n * Path exists). parse()/parseAsync() try it first and return the input\n * directly on success: fc is small enough for V8 to inline, so the hot parse\n * path runs with zero allocations — calling fn would allocate an intermediate\n * SafeParseResult that escape analysis cannot remove (fn never inlines).\n * Fast-path-eligible schemas never mutate, so fc(input) ⟹ data === input.\n *\n * is is the TOTAL fast-check predicate (fc when the fast path is total, else\n * null). Installed as `.is()` — a zero-allocation boolean type guard. When\n * null (partial fast path or none) `.is()` derives from fn(input).success: a\n * partial fc can pass-through valid input but its `false` does not imply\n * rejection (a default/catch may still succeed), so it would be unsound as a\n * standalone guard.\n *\n * `~standard` is REPLACED, not merely preserved. Zod builds it lazily as\n * `validate: (v) => safeParse(inst, v)` — the core FUNCTION, which goes straight\n * to `inst._zod.run`. It never reads the schema's own `safeParse` property, so\n * installing the compiled one leaves this route entirely uncompiled: measured\n * 271.7 ns against the compiled 26.6 ns on the same schema, i.e. Standard Schema\n * consumers (tRPC, Hono, TanStack) were getting plain Zod.\n *\n * Zod's own validate is captured first and kept as the throw path: it catches a\n * synchronous throw and retries through `safeParseAsync`, which is how an async\n * refinement resolves and how a throwing check surfaces as a rejected promise\n * rather than a synchronous throw. The compiled validator cannot reproduce that\n * (async schemas delegate to Zod anyway), so deferring to the original is both\n * simpler and exact.\n *\n * Installed with defineProperty rather than assignment: Zod's lazy setter\n * redefines the slot as non-writable, so a second `__zcMkv` on the same schema\n * object — two exports aliasing one schema — would throw under ESM strict mode.\n */\nexport const MK_VALIDATOR_DECL =\n \"function __zcMkv(fn,schema,fc,is){var w=schema||{};w.parse=fc?function(input){if(fc(input))return input;var r=fn(input);if(r.success)return r.data;throw r.error;}:function(input){var r=fn(input);if(r.success)return r.data;throw r.error;};w.safeParse=fn;w.safeParseAsync=function(input){return Promise.resolve(fn(input));};w.parseAsync=fc?function(input){if(fc(input))return Promise.resolve(input);var r=fn(input);if(r.success)return Promise.resolve(r.data);return Promise.reject(r.error);}:function(input){var r=fn(input);if(r.success)return Promise.resolve(r.data);return Promise.reject(r.error);};w.is=is||function(input){return fn(input).success;};\" +\n 'var s=w[\"~standard\"],zv=s&&s.validate;' +\n 'Object.defineProperty(w,\"~standard\",{configurable:true,value:{version:1,vendor:(s&&s.vendor)||\"zod\",validate:function(input){var r;try{if(fc&&fc(input))return{value:input};r=fn(input);}catch(e){if(zv)return zv(input);throw e;}return r.success?{value:r.data}:{issues:r.error.issues};}}});' +\n \"return w;}\";\n\nfunction extractFunctionName(functionDef: string): string {\n const match = /^function\\s+(\\w+)\\s*\\(/.exec(functionDef);\n if (!match?.[1]) {\n throw new Error(\"Cannot extract function name from generated code\");\n }\n return match[1];\n}\n\n/**\n * Generate a `/* @__PURE__ * /` IIFE wrapping a compiled validator.\n *\n * @param schemaExpr - Expression resolving to the original Zod schema\n * (e.g. `\"UserSchema\"` in unplugin, `\"(__src_X as any).schema\"` in CLI)\n * @param schema\n * @param options\n */\nexport function generateIIFE(\n schemaExpr: string,\n schema: CompiledSchemaInfo,\n options?: { zodCompat?: boolean | undefined },\n): string {\n const { codegenResult, refEntries } = schema;\n const fnName = extractFunctionName(codegenResult.functionDef);\n const zodCompat = options?.zodCompat !== false;\n const schemaArg = zodCompat ? schemaExpr : \"null\";\n const fcArg = codegenResult.fastFnName ?? \"null\";\n // `.is()` gets the fast-check directly only when it is a total predicate;\n // partial/none falls back to safeParse().success inside __zcMkv. A rebuilding\n // schema has no by-reference `fc` but still names its predicate separately.\n const isArg = codegenResult.isFnName ?? (codegenResult.fastTotal ? fcArg : \"null\");\n\n return [\n \"/* @__PURE__ */ (() => {\",\n ...(refEntries.length > 0\n ? [`var __rf=[${refEntries.map((fb) => `${schemaExpr}${fb.accessPath}`).join(\",\")}];`]\n : []),\n ...codegenResult.code\n .split(\"\\n\")\n .filter((l) => l.trim() !== \"\" && l.trim() !== \"/* zod-compiler */\"),\n codegenResult.functionDef,\n `return __zcMkv(${fnName},${schemaArg},${fcArg},${isArg});`,\n \"})()\",\n ].join(\"\\n\");\n}\n"],"mappings":";;;;;;;;AAcA,MAAa,oBACX;;;;;;;;;;;;;;;;;;;;AAqBF,MAAa,sBACX;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCF,MAAa,kBACX;;;AASF,MAAa,WACX;;;;;;;;;;;;;;;;;;;;;;;AAwBF,MAAa,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;AAwBjC,MAAa,mBACX;;AAKF,MAAa,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDzB,MAAa,oBACX;AAKF,SAAS,oBAAoB,aAA6B;CACxD,MAAM,QAAQ,yBAAyB,KAAK,WAAW;CACvD,IAAI,CAAC,QAAQ,IACX,MAAM,IAAI,MAAM,kDAAkD;CAEpE,OAAO,MAAM;AACf;;;;;;;;;AAUA,SAAgB,aACd,YACA,QACA,SACQ;CACR,MAAM,EAAE,eAAe,eAAe;CACtC,MAAM,SAAS,oBAAoB,cAAc,WAAW;CAE5D,MAAM,YADY,SAAS,cAAc,QACX,aAAa;CAC3C,MAAM,QAAQ,cAAc,cAAc;CAI1C,MAAM,QAAQ,cAAc,aAAa,cAAc,YAAY,QAAQ;CAE3E,OAAO;EACL;EACA,GAAI,WAAW,SAAS,IACpB,CAAC,aAAa,WAAW,KAAK,OAAO,GAAG,aAAa,GAAG,YAAY,CAAC,CAAC,KAAK,GAAG,EAAE,GAAG,IACnF,CAAC;EACL,GAAG,cAAc,KACd,MAAM,IAAI,CAAC,CACX,QAAQ,MAAM,EAAE,KAAK,MAAM,MAAM,EAAE,KAAK,MAAM,oBAAoB;EACrE,cAAc;EACd,kBAAkB,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM;EACxD;CACF,CAAC,CAAC,KAAK,IAAI;AACb"}
|
|
1
|
+
{"version":3,"file":"iife.js","names":[],"sources":["../../src/core/iife.ts"],"sourcesContent":["/**\n * Shared CompiledSchema<T> IIFE generation.\n * Used by both CLI emitter and unplugin transform.\n */\n\nimport type { CompiledSchemaInfo } from \"./pipeline.js\";\n\n/**\n * Import statement required by generateIIFE output (references\n * __zodCompilerConfig). `core` is bound for $ZodAsyncError: superRefine and\n * custom callbacks may only reveal that they are async through the promise\n * they return, at which point zod's own synchronous parse raises.\n */\nexport const ZOD_CONFIG_IMPORT =\n 'import { config as __zodCompilerConfig, core as __zcCore, ZodRealError as __zcZodError } from \"zod\";';\n\n/**\n * File-level `__zcMsg` declaration (must appear once after ZOD_CONFIG_IMPORT):\n * the message an issue gets when nothing was baked into it at build time.\n *\n * Resolves zod's tail of `finalizeIssue` — `config.customError` then\n * `config.localeError` then \"Invalid input\" — and does it PER CALL, because the\n * config is mutable: `z.config({ localeError })` in an entry point runs after\n * the schema modules it imports, so a value snapshotted at module init misses\n * it. Reading a captured `localeError` alone also dropped `customError`\n * outright, silently ignoring the global map most i18n setups install.\n *\n * The head of zod's chain — the schema's own `error` option — is baked into the\n * issue at build time and short-circuits this. The one link that cannot be\n * reproduced is a per-CALL `ctx.error`, which would have to travel through\n * `safeParse`; that entry point sits at V8's inlining budget, where even an\n * unused extra parameter measured ~12% on every parse.\n *\n * Only ever called while building an error, never on a successful parse.\n */\nexport const ZOD_MSG_DECLARATION =\n 'function __zcUw(m){return typeof m===\"string\"?m:(m===undefined||m===null?undefined:m.message);}' +\n \"var __zcMsg=function(iss){var c=__zodCompilerConfig(),m;\" +\n \"if(c.customError){m=__zcUw(c.customError(iss));if(m!==undefined&&m!==null)return m;}\" +\n \"if(c.localeError){m=__zcUw(c.localeError(iss));if(m!==undefined&&m!==null)return m;}\" +\n 'return \"Invalid input\";};';\n\n/**\n * Shared failure-result for __zcFin / __zcFinD. Inline mode (CLI emitter)\n * declares it once per compiled file; lean mode (all unplugin bundlers) declares\n * it once per bundle in the plugin-materialized runtime module (module-local —\n * generated code only ever references __zcFin/__zcFinD, never __ZcFail).\n *\n * Why a prototype getter and not `{success:false, get error(){...}}`: an object\n * literal with an inline accessor forces V8 down its slow accessor-defining\n * allocation path — ~110ns per failure, measured — which dominates the entire\n * invalid-input cost whenever callers never read `.error`. Hosting `error` on\n * the prototype turns each failure into a plain field-only instantiation (~2ns,\n * ~13x), with the lazy-cache semantics intact. (Trade-off: `error` is a\n * prototype accessor, so it no longer shows up in `Object.keys(result)` / spread\n * / JSON.stringify of the result wrapper — `.success`/`.error`/`.data` access,\n * destructuring, and `in` are unaffected.)\n *\n * One class serves both finalizers, so the instances share one hidden class:\n * __zcFin passes pre-collected issues in `_e` (with `_f===null`); __zcFinD\n * passes the hosted slow-walk in `_f` plus the input in `_i`, and the getter\n * runs the walk on first `.error` read. The whole finalization — locale fill\n * (__zcMsg applied ONLY when an issue carries no message, never overwriting a\n * baked-in custom/fallback message), input strip, and ZodError construction\n * (zod v4 JSON.stringifies every issue into `message` and captures a stack\n * trace) — stays deferred inside the cached accessor exactly as before, since\n * the issues array is observable solely through `.error`.\n */\nexport const FAIL_CLASS_DECL =\n \"function __ZcFail(e,f,i){this.success=false;this._e=e;this._f=f;this._i=i;this._c=undefined;}\" +\n 'Object.defineProperty(__ZcFail.prototype,\"error\",{configurable:true,get:function(){' +\n \"if(this._c)return this._c;\" +\n \"var e=this._f!==null?this._f(this._i):this._e;\" +\n 'for(var i=0;i<e.length;i++){if(e[i].message===undefined&&typeof __zcMsg===\"function\")e[i].message=__zcMsg(e[i]);e[i].input=undefined;}' +\n \"return this._c=new __zcZodError(e);}});\";\n\n/** Eager finalizer (mutation / partial-fast-path schemas): issues already\n * collected in `e`; success short-circuits to a plain result literal. */\nexport const FIN_DECL =\n \"function __zcFin(e,d){if(!e.length)return{success:true,data:d};return new __ZcFail(e,null,null);}\";\n\n/**\n * Deferred-collection finalizer for Fast-Path-eligible schemas. When the\n * fast check fails, the ENTIRE slow path (the issue-collecting re-walk) is\n * pushed into the cached `.error` accessor instead of running eagerly:\n * fast-eligible schemas never mutate, so the walk's only output is the\n * issues array, which is observable solely through `.error` — one step\n * further along the same lazy boundary `__zcFin` already established (locale\n * fill, input strip, ZodError construction). A failed safeParse whose\n * `.error` is never read costs the fast check alone.\n *\n * Takes the schema's HOSTED slow-walk function plus the input — NOT a\n * per-call closure: `__zcFinD(__sw_N, input)` allocates only the result\n * object, where `__zcFinD(function(){...})` paid a closure environment and\n * function object per failure. Hosting the walk also shrinks safeParse to\n * two statements, within V8's inlining budget (the success-path result\n * literal becomes escape-analyzable at monomorphic call sites).\n *\n * The walk re-reads `input` at `.error`-read time; a caller that mutates\n * the input between safeParse and reading `.error` sees issues for the\n * mutated value (zod materializes at parse time). Same caveat class as the\n * documented __zcFin deferral.\n */\nexport const FIN_DEFERRED_DECL = \"function __zcFinD(f,inp){return new __ZcFail(null,f,inp);}\";\n\n/**\n * Compact-mode failure class — a lazy failure that delegates error reporting to\n * the ORIGINAL Zod schema's `safeParse`. Used by `output: \"compact\"`, where the\n * compiled slow walk is dropped entirely: a mutation-free schema's fast check\n * is the only generated validation, and on a fast-check failure the cold error\n * path is produced by the retained Zod schema itself (`zod` is the source of\n * truth, so the issues are byte-identical — no second validation engine).\n *\n * `_z` is the schema's PRISTINE bound safeParse (`__rf[N].safeParse.bind(...)`,\n * captured pre-`__zcMkv` by emitRfDelegate — see context.ts — so it is zod's\n * own implementation, never the compiled delegate, avoiding infinite\n * recursion). The zod parse is deferred until `.error` is read and cached, so\n * the common `safeParse(x).success`/`.is(x)` checks on invalid input cost only\n * the fast check (zod never runs) — the same deferral boundary `__zcFinD`\n * establishes for the compiled slow walk. Sound because compact mode is gated\n * on a TOTAL fast path: `fc(input) === false` ⟹ zod rejects, so `success:false`\n * holds without consulting zod.\n *\n * The getter returns zod's OWN ZodError verbatim (no locale fill / input strip /\n * re-wrap — zod already finalized it), so a delegated failure is exactly what\n * the unaltered schema would have produced.\n */\nexport const FAILZ_CLASS_DECL =\n \"function __ZcFailZ(z,i){this.success=false;this._z=z;this._i=i;this._c=undefined;}\" +\n 'Object.defineProperty(__ZcFailZ.prototype,\"error\",{configurable:true,get:function(){' +\n \"return this._c||(this._c=this._z(this._i).error);}});\";\n\n/** Compact-mode finalizer: wrap a pristine bound safeParse + input into a lazy delegated failure. */\nexport const FINZ_DECL = \"function __zcFinZ(z,i){return new __ZcFailZ(z,i);}\";\n\n/**\n * Validator factory. Inline mode (CLI emitter) declares it once per compiled\n * file; lean mode (all unplugin bundlers) exports it once per bundle from the\n * plugin-materialized runtime module — generated code never imports it from\n * the zod-compiler package itself, so zod-compiler stays a devDependency and\n * the helper set is always version-locked to the codegen that calls it.\n * Wraps a safeParse function into the CompiledSchema interface.\n *\n * IDENTITY-PRESERVING: with zodCompat (schema != null) the compiled\n * parse/safeParse/parseAsync/safeParseAsync are installed as OWN properties\n * on the original schema object, which is returned as-is. zod v4 keys\n * several APIs on object identity — toJSONSchema's ctx.seen registers the\n * object it is handed while each processor closure captures the original\n * inst (a wrapper crashes `optionalProcessor` with \"Cannot set properties\n * of undefined (setting 'ref')\" the moment a compiled schema is composed\n * into another schema), and globalRegistry/.meta() is a WeakMap keyed by\n * the schema instance (a wrapper silently loses OpenAPI titles/ids). An\n * Object.create wrapper breaks both; mutating the original breaks neither\n * (zod's internal parsing flows through _zod.run, never the public\n * methods, and derived schemas — .optional(), .extend() — are fresh\n * instances that fall back to plain zod). schema=null (zodCompat: false)\n * still produces a plain method-bag object.\n *\n * fc is the schema's hosted fast-check boolean function (null when no Fast\n * Path exists). parse()/parseAsync() try it first and return the input\n * directly on success: fc is small enough for V8 to inline, so the hot parse\n * path runs with zero allocations — calling fn would allocate an intermediate\n * SafeParseResult that escape analysis cannot remove (fn never inlines).\n * Fast-path-eligible schemas never mutate, so fc(input) ⟹ data === input.\n *\n * is is the TOTAL fast-check predicate (fc when the fast path is total, else\n * null). Installed as `.is()` — a zero-allocation boolean type guard. When\n * null (partial fast path or none) `.is()` derives from fn(input).success: a\n * partial fc can pass-through valid input but its `false` does not imply\n * rejection (a default/catch may still succeed), so it would be unsound as a\n * standalone guard.\n *\n * `~standard` is REPLACED, not merely preserved. Zod builds it lazily as\n * `validate: (v) => safeParse(inst, v)` — the core FUNCTION, which goes straight\n * to `inst._zod.run`. It never reads the schema's own `safeParse` property, so\n * installing the compiled one leaves this route entirely uncompiled: measured\n * 271.7 ns against the compiled 26.6 ns on the same schema, i.e. Standard Schema\n * consumers (tRPC, Hono, TanStack) were getting plain Zod.\n *\n * Zod's own validate is captured first and kept as the throw path: it catches a\n * synchronous throw and retries through `safeParseAsync`, which is how an async\n * refinement resolves and how a throwing check surfaces as a rejected promise\n * rather than a synchronous throw. The compiled validator cannot reproduce that\n * (async schemas delegate to Zod anyway), so deferring to the original is both\n * simpler and exact.\n *\n * Installed with defineProperty rather than assignment: Zod's lazy setter\n * redefines the slot as non-writable, so a second `__zcMkv` on the same schema\n * object — two exports aliasing one schema — would throw under ESM strict mode.\n */\nexport const MK_VALIDATOR_DECL =\n \"function __zcMkv(fn,schema,fc,is){var w=schema||{};w.parse=fc?function(input){if(fc(input))return input;var r=fn(input);if(r.success)return r.data;throw r.error;}:function(input){var r=fn(input);if(r.success)return r.data;throw r.error;};w.safeParse=fn;w.safeParseAsync=function(input){return Promise.resolve(fn(input));};w.parseAsync=fc?function(input){if(fc(input))return Promise.resolve(input);var r=fn(input);if(r.success)return Promise.resolve(r.data);return Promise.reject(r.error);}:function(input){var r=fn(input);if(r.success)return Promise.resolve(r.data);return Promise.reject(r.error);};w.is=is||function(input){return fn(input).success;};\" +\n 'var s=w[\"~standard\"],zv=s&&s.validate;' +\n 'Object.defineProperty(w,\"~standard\",{configurable:true,value:{version:1,vendor:(s&&s.vendor)||\"zod\",validate:function(input){var r;try{if(fc&&fc(input))return{value:input};r=fn(input);}catch(e){if(zv)return zv(input);throw e;}return r.success?{value:r.data}:{issues:r.error.issues};}}});' +\n \"return w;}\";\n\nfunction extractFunctionName(functionDef: string): string {\n const match = /^function\\s+(\\w+)\\s*\\(/.exec(functionDef);\n if (!match?.[1]) {\n throw new Error(\"Cannot extract function name from generated code\");\n }\n return match[1];\n}\n\n/**\n * Generate a `/* @__PURE__ * /` IIFE wrapping a compiled validator.\n *\n * @param schemaExpr - Expression resolving to the original Zod schema\n * (e.g. `\"UserSchema\"` in unplugin, `\"(__src_X as any).schema\"` in CLI)\n * @param schema\n * @param options\n */\nexport function generateIIFE(\n schemaExpr: string,\n schema: CompiledSchemaInfo,\n options?: { zodCompat?: boolean | undefined },\n): string {\n const { codegenResult, refEntries } = schema;\n const fnName = extractFunctionName(codegenResult.functionDef);\n const zodCompat = options?.zodCompat !== false;\n const schemaArg = zodCompat ? schemaExpr : \"null\";\n const fcArg = codegenResult.fastFnName ?? \"null\";\n // `.is()` gets the fast-check directly only when it is a total predicate;\n // partial/none falls back to safeParse().success inside __zcMkv. A rebuilding\n // schema has no by-reference `fc` but still names its predicate separately.\n const isArg = codegenResult.isFnName ?? (codegenResult.fastTotal ? fcArg : \"null\");\n\n return [\n \"/* @__PURE__ */ (() => {\",\n ...(refEntries.length > 0\n ? [`var __rf=[${refEntries.map((fb) => `${schemaExpr}${fb.accessPath}`).join(\",\")}];`]\n : []),\n ...codegenResult.code\n .split(\"\\n\")\n .filter((l) => l.trim() !== \"\" && l.trim() !== \"/* zod-compiler */\"),\n codegenResult.functionDef,\n `return __zcMkv(${fnName},${schemaArg},${fcArg},${isArg});`,\n \"})()\",\n ].join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAaA,MAAa,oBACX;;;;;;;;;;;;;;;;;;;;AAqBF,MAAa,sBACX;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCF,MAAa,kBACX;;;AASF,MAAa,WACX;;;;;;;;;;;;;;;;;;;;;;;AAwBF,MAAa,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;AAwBjC,MAAa,mBACX;;AAKF,MAAa,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDzB,MAAa,oBACX;AAKF,SAAS,oBAAoB,aAA6B;CACxD,MAAM,QAAQ,yBAAyB,KAAK,WAAW;CACvD,IAAI,CAAC,QAAQ,IACX,MAAM,IAAI,MAAM,kDAAkD;CAEpE,OAAO,MAAM;AACf;;;;;;;;;AAUA,SAAgB,aACd,YACA,QACA,SACQ;CACR,MAAM,EAAE,eAAe,eAAe;CACtC,MAAM,SAAS,oBAAoB,cAAc,WAAW;CAE5D,MAAM,YADY,SAAS,cAAc,QACX,aAAa;CAC3C,MAAM,QAAQ,cAAc,cAAc;CAI1C,MAAM,QAAQ,cAAc,aAAa,cAAc,YAAY,QAAQ;CAE3E,OAAO;EACL;EACA,GAAI,WAAW,SAAS,IACpB,CAAC,aAAa,WAAW,KAAK,OAAO,GAAG,aAAa,GAAG,YAAY,CAAC,CAAC,KAAK,GAAG,EAAE,GAAG,IACnF,CAAC;EACL,GAAG,cAAc,KACd,MAAM,IAAI,CAAC,CACX,QAAQ,MAAM,EAAE,KAAK,MAAM,MAAM,EAAE,KAAK,MAAM,oBAAoB;EACrE,cAAc;EACd,kBAAkB,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM;EACxD;CACF,CAAC,CAAC,KAAK,IAAI;AACb"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -372,6 +372,21 @@ interface TransformEffectIR {
|
|
|
372
372
|
/** The input schema to validate before applying the transform */
|
|
373
373
|
inner: SchemaIR;
|
|
374
374
|
}
|
|
375
|
+
/**
|
|
376
|
+
* z.custom() / z.instanceof(): call the predicate on the hot path and retain
|
|
377
|
+
* the original schema solely for exact, cold-path issue production.
|
|
378
|
+
*/
|
|
379
|
+
interface CustomIR {
|
|
380
|
+
type: "custom";
|
|
381
|
+
/** Zero-capture predicate source, mutually exclusive with refIndex. */
|
|
382
|
+
source?: string;
|
|
383
|
+
/** __rf[] index of a captured predicate, mutually exclusive with source. */
|
|
384
|
+
refIndex?: number;
|
|
385
|
+
/** __rf[] index of the pristine Zod schema used by the slow error walk. */
|
|
386
|
+
schemaRefIndex: number;
|
|
387
|
+
/** z.custom() defaults to aborting a failed union option. */
|
|
388
|
+
abort: boolean;
|
|
389
|
+
}
|
|
375
390
|
interface FallbackIR {
|
|
376
391
|
type: "fallback";
|
|
377
392
|
reason: "transform" | "refine" | "superRefine" | "custom" | "lazy" | "unsupported" | "coalesced";
|
|
@@ -429,7 +444,7 @@ interface StringBoolIR {
|
|
|
429
444
|
interface TypeMessageCarrier {
|
|
430
445
|
typeMessage?: string;
|
|
431
446
|
}
|
|
432
|
-
type SchemaIR = TypeMessageCarrier & (StringIR | NumberIR | BooleanIR | BigIntIR | DateIR | SymbolIR | NullIR | UndefinedIR | VoidIR | NanIR | NeverIR | AnyIR | UnknownIR | LiteralIR | EnumIR | ObjectIR | ArrayIR | TupleIR | RecordIR | SetIR | MapIR | FileIR | UnionIR | DiscriminatedUnionIR | IntersectionIR | OptionalIR | NullableIR | ReadonlyIR | DefaultIR | PipeIR | TransformEffectIR | TemplateLiteralIR | CatchIR | FallbackIR | RecursiveRefIR | RecursionTargetIR | StringBoolIR);
|
|
447
|
+
type SchemaIR = TypeMessageCarrier & (StringIR | NumberIR | BooleanIR | BigIntIR | DateIR | SymbolIR | NullIR | UndefinedIR | VoidIR | NanIR | NeverIR | AnyIR | UnknownIR | LiteralIR | EnumIR | ObjectIR | ArrayIR | TupleIR | RecordIR | SetIR | MapIR | FileIR | UnionIR | DiscriminatedUnionIR | IntersectionIR | OptionalIR | NullableIR | ReadonlyIR | DefaultIR | PipeIR | TransformEffectIR | CustomIR | TemplateLiteralIR | CatchIR | FallbackIR | RecursiveRefIR | RecursionTargetIR | StringBoolIR);
|
|
433
448
|
interface SafeParseSuccess<T> {
|
|
434
449
|
success: true;
|
|
435
450
|
data: T;
|
|
@@ -469,5 +484,5 @@ interface CompiledSchema<T> {
|
|
|
469
484
|
is(input: unknown): input is T;
|
|
470
485
|
}
|
|
471
486
|
//#endregion
|
|
472
|
-
export { AnyIR, ArrayIR, BigIntCheckIR, BigIntIR, BooleanIR, CatchIR, CheckBase, CheckBigIntGreaterThan, CheckBigIntLessThan, CheckBigIntMultipleOf, CheckDateGreaterThan, CheckDateLessThan, CheckEndsWith, CheckGreaterThan, CheckIR, CheckIncludes, CheckLengthEquals, CheckLessThan, CheckMaxLength, CheckMaxSize, CheckMimeType, CheckMinLength, CheckMinSize, CheckMultipleOf, CheckNumberFormat, CheckOrEffectIR, CheckSizeEquals, CheckStartsWith, CheckStringFormat, CompiledSchema, DateCheckIR, DateIR, DefaultIR, DiscoveredSchema, DiscriminatedUnionIR, EnumIR, FallbackIR, FileCheckIR, FileIR, IntersectionIR, LiteralIR, MapIR, NanIR, NeverIR, NullIR, NullableIR, NumberIR, ObjectIR, OptionalIR, OverwriteEffectCheckIR, PipeIR, ReadonlyIR, RecordIR, RecursionTargetIR, RecursiveRefIR, RefineEffectCheckIR, SafeParseError, SafeParseResult, SafeParseSuccess, SchemaIR, SetCheckIR, SetIR, StringBoolIR, StringIR, SuperRefineEffectCheckIR, SymbolIR, TemplateLiteralIR, TransformEffectIR, TupleIR, TypeMessageCarrier, UndefinedIR, UnionIR, UnknownIR, VoidIR, ZodErrorLike, ZodIssueLike };
|
|
487
|
+
export { AnyIR, ArrayIR, BigIntCheckIR, BigIntIR, BooleanIR, CatchIR, CheckBase, CheckBigIntGreaterThan, CheckBigIntLessThan, CheckBigIntMultipleOf, CheckDateGreaterThan, CheckDateLessThan, CheckEndsWith, CheckGreaterThan, CheckIR, CheckIncludes, CheckLengthEquals, CheckLessThan, CheckMaxLength, CheckMaxSize, CheckMimeType, CheckMinLength, CheckMinSize, CheckMultipleOf, CheckNumberFormat, CheckOrEffectIR, CheckSizeEquals, CheckStartsWith, CheckStringFormat, CompiledSchema, CustomIR, DateCheckIR, DateIR, DefaultIR, DiscoveredSchema, DiscriminatedUnionIR, EnumIR, FallbackIR, FileCheckIR, FileIR, IntersectionIR, LiteralIR, MapIR, NanIR, NeverIR, NullIR, NullableIR, NumberIR, ObjectIR, OptionalIR, OverwriteEffectCheckIR, PipeIR, ReadonlyIR, RecordIR, RecursionTargetIR, RecursiveRefIR, RefineEffectCheckIR, SafeParseError, SafeParseResult, SafeParseSuccess, SchemaIR, SetCheckIR, SetIR, StringBoolIR, StringIR, SuperRefineEffectCheckIR, SymbolIR, TemplateLiteralIR, TransformEffectIR, TupleIR, TypeMessageCarrier, UndefinedIR, UnionIR, UnknownIR, VoidIR, ZodErrorLike, ZodIssueLike };
|
|
473
488
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/core/types.ts"],"mappings":";;;;;;UAQiB;;EAEf;;UAGe,uBAAuB;EACtC;EACA;;UAGe,uBAAuB;EACtC;EACA;;UAGe,0BAA0B;EACzC;EACA;;UAGe,yBAAyB;EACxC;EACA;EACA;;UAGe,sBAAsB;EACrC;EACA;EACA;;UAGe,wBAAwB;EACvC;EACA;;UAGe,0BAA0B;EACzC;EACA;;UAGe,0BAA0B;EACzC;EACA;EACA;;EAEA;;EAEA;EACA;;EAEA;EACA;;EAEA;;UAGe,sBAAsB;EACrC;EACA;EACA;;UAGe,wBAAwB;EACvC;EACA;;UAGe,sBAAsB;EACrC;EACA;;KAGU,UACR,iBACA,iBACA,oBACA,mBACA,gBACA,kBACA,oBACA,oBACA,gBACA,kBACA;UAMa;EACf;;;;;;EAMA;;;;;;;;;EASA;;EAEA;;;;;;EAMA;;;;;;;;;;;;;UAce;EACf;;EAEA;;;;;;UAOe;EACf;;EAEA;;;KAIU,kBACR,UACA,sBACA,2BACA;UAIa,6BAA6B;EAC5C;EACA;EACA;EACA;;UAGe,0BAA0B;EACzC;EACA;EACA;EACA;;KAGU,cAAc,uBAAuB;UAIhC,+BAA+B;EAC9C;;EAEA;EACA;;UAGe,4BAA4B;EAC3C;;EAEA;EACA;;UAGe,8BAA8B;EAC7C;;EAEA;;KAGU,gBAAgB,yBAAyB,sBAAsB;UAI1D,qBAAqB;EACpC;EACA;;UAGe,qBAAqB;EACpC;EACA;;UAGe,wBAAwB;EACvC;EACA;;KAGU,aAAa,eAAe,eAAe;UAItC,sBAAsB;EACrC;EACA;;KAGU,cAAc,eAAe,eAAe;UAIvC;EACf;EACA,QAAQ;EACR;;UAGe;EACf;EACA,QAAQ;EACR;;UAGe;EACf;EACA;;UAGe;EACf;EACA,QAAQ;EACR;;UAGe;EACf;EACA,QAAQ;EACR;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;EACA;;UAGe;EACf;;EAEA;;UAKe;EACf;EACA,YAAY,eAAe;;;;;;;;;;EAU3B;;;;;;;;;;;;;EAaA;;EAEA,UAAU,sBAAsB;;;;;;;EAOhC,WAAW;;;;;;;EAOX;;UAGe;EACf;EACA,SAAS;EACT,QAAQ;;UAGO;EACf;EACA,OAAO;EACP,MAAM;;UAGS;EACf;EACA,SAAS;EACT,WAAW;;UAGI;EACf;EACA,WAAW;EACX,SAAS;;UAGM;EACf;EACA,SAAS;EACT,WAAW;;UAGI;EACf;EACA,SAAS;;UAKM;EACf;EACA,SAAS;;UAGM;EACf;EACA;EACA,SAAS;;;;;;EAMT;IAAS;IAA8D;;;UAGxD;EACf;EACA,MAAM;EACN,OAAO;;UAKQ;EACf;EACA,OAAO;;UAGQ;EACf;EACA,OAAO;;UAGQ;EACf;EACA,OAAO;;UAGQ;EACf;EACA,OAAO;EACP;;;;;;;;;;;EAWA;;UAGe;EACf;EACA,IAAI;EACJ,KAAK;;UAKU;EACf;EACA;;;;;EAKA;;;;;;;EAOA;;EAEA,OAAO;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/core/types.ts"],"mappings":";;;;;;UAQiB;;EAEf;;UAGe,uBAAuB;EACtC;EACA;;UAGe,uBAAuB;EACtC;EACA;;UAGe,0BAA0B;EACzC;EACA;;UAGe,yBAAyB;EACxC;EACA;EACA;;UAGe,sBAAsB;EACrC;EACA;EACA;;UAGe,wBAAwB;EACvC;EACA;;UAGe,0BAA0B;EACzC;EACA;;UAGe,0BAA0B;EACzC;EACA;EACA;;EAEA;;EAEA;EACA;;EAEA;EACA;;EAEA;;UAGe,sBAAsB;EACrC;EACA;EACA;;UAGe,wBAAwB;EACvC;EACA;;UAGe,sBAAsB;EACrC;EACA;;KAGU,UACR,iBACA,iBACA,oBACA,mBACA,gBACA,kBACA,oBACA,oBACA,gBACA,kBACA;UAMa;EACf;;;;;;EAMA;;;;;;;;;EASA;;EAEA;;;;;;EAMA;;;;;;;;;;;;;UAce;EACf;;EAEA;;;;;;UAOe;EACf;;EAEA;;;KAIU,kBACR,UACA,sBACA,2BACA;UAIa,6BAA6B;EAC5C;EACA;EACA;EACA;;UAGe,0BAA0B;EACzC;EACA;EACA;EACA;;KAGU,cAAc,uBAAuB;UAIhC,+BAA+B;EAC9C;;EAEA;EACA;;UAGe,4BAA4B;EAC3C;;EAEA;EACA;;UAGe,8BAA8B;EAC7C;;EAEA;;KAGU,gBAAgB,yBAAyB,sBAAsB;UAI1D,qBAAqB;EACpC;EACA;;UAGe,qBAAqB;EACpC;EACA;;UAGe,wBAAwB;EACvC;EACA;;KAGU,aAAa,eAAe,eAAe;UAItC,sBAAsB;EACrC;EACA;;KAGU,cAAc,eAAe,eAAe;UAIvC;EACf;EACA,QAAQ;EACR;;UAGe;EACf;EACA,QAAQ;EACR;;UAGe;EACf;EACA;;UAGe;EACf;EACA,QAAQ;EACR;;UAGe;EACf;EACA,QAAQ;EACR;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;EACA;;UAGe;EACf;;EAEA;;UAKe;EACf;EACA,YAAY,eAAe;;;;;;;;;;EAU3B;;;;;;;;;;;;;EAaA;;EAEA,UAAU,sBAAsB;;;;;;;EAOhC,WAAW;;;;;;;EAOX;;UAGe;EACf;EACA,SAAS;EACT,QAAQ;;UAGO;EACf;EACA,OAAO;EACP,MAAM;;UAGS;EACf;EACA,SAAS;EACT,WAAW;;UAGI;EACf;EACA,WAAW;EACX,SAAS;;UAGM;EACf;EACA,SAAS;EACT,WAAW;;UAGI;EACf;EACA,SAAS;;UAKM;EACf;EACA,SAAS;;UAGM;EACf;EACA;EACA,SAAS;;;;;;EAMT;IAAS;IAA8D;;;UAGxD;EACf;EACA,MAAM;EACN,OAAO;;UAKQ;EACf;EACA,OAAO;;UAGQ;EACf;EACA,OAAO;;UAGQ;EACf;EACA,OAAO;;UAGQ;EACf;EACA,OAAO;EACP;;;;;;;;;;;EAWA;;UAGe;EACf;EACA,IAAI;EACJ,KAAK;;UAKU;EACf;EACA;;;;;EAKA;;;;;;;EAOA;;EAEA,OAAO;;;;;;UASQ;EACf;;EAEA;;EAEA;;EAEA;;EAEA;;UAGe;EACf;EACA;;EAEA;;UAGe;EACf;EACA;;UAGe;EACf;EACA,OAAO;;EAEP;;UAGe;EACf;;;;;;;;;EASA;;;;;;;;;;UAWe;EACf;EACA;EACA,OAAO;;UAGQ;EACf;EACA;EACA;EACA;;;;;;;;;UAYe;EACf;;KAGU,WAAW,sBAGjB,WACA,WACA,YACA,WACA,SACA,WACA,SACA,cACA,SACA,QACA,UACA,QACA,YACA,YACA,SAEA,WACA,UACA,UACA,WACA,QACA,QACA,SAEA,UACA,uBACA,iBAEA,aACA,aACA,aACA,YACA,SAEA,oBAEA,WACA,oBACA,UACA,aACA,iBACA,oBACA;UAKW,iBAAiB;EAChC;EACA,MAAM;;UAGS;EACf;EACA,OAAO;;KAGG,gBAAgB,KAAK,iBAAiB,KAAK;UAEtC;EACf;EACA;EACA;GAEC;;UAGc;EACf,QAAQ;;UAGO;EACf;EACA;;UAGe,eAAe;EAC9B,MAAM,iBAAiB;EACvB,WAAW,iBAAiB,QAAQ;EACpC,UAAU,iBAAiB,gBAAgB;EAC3C,eAAe,iBAAiB,QAAQ,gBAAgB;;;;;;;;;;EAUxD,GAAG,iBAAiB,SAAS"}
|