@prisma/orm-framework 8.0.0-rc.9-dev.5 → 8.0.0-rc.9-dev.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +1 -1
  2. package/dist/{apply-specifier-default-control-policy-yxEeh3lJ.d.mts → apply-specifier-default-control-policy-C2Njpc_G.d.mts} +2 -2
  3. package/dist/apply-specifier-default-control-policy-C2Njpc_G.d.mts.map +1 -0
  4. package/dist/{assertions-Cz-GWH8P.mjs → assertions-Dw1lZz_Q.mjs} +2 -2
  5. package/dist/{assertions-Cz-GWH8P.mjs.map → assertions-Dw1lZz_Q.mjs.map} +1 -1
  6. package/dist/{canonicalization-uZb7Sjk2-Dx6ifIWL.d.mts → canonicalization-BAvRuZ2i-IwsqxGme.d.mts} +3 -3
  7. package/dist/{canonicalization-uZb7Sjk2-Dx6ifIWL.d.mts.map → canonicalization-BAvRuZ2i-IwsqxGme.d.mts.map} +1 -1
  8. package/dist/{codec-BuNywPrz.mjs → codec-G-sce0J8.mjs} +2 -2
  9. package/dist/{codec-BuNywPrz.mjs.map → codec-G-sce0J8.mjs.map} +1 -1
  10. package/dist/components.d.mts +3 -3
  11. package/dist/components.mjs +4 -4
  12. package/dist/components__authoring.mjs +1 -1
  13. package/dist/components__codec.mjs +1 -1
  14. package/dist/components__control.d.mts +1 -1
  15. package/dist/components__control.mjs +1 -1
  16. package/dist/components__emission.d.mts +2 -2
  17. package/dist/components__ir.mjs +1 -1
  18. package/dist/{config-types-udmMgDBA.d.mts → config-types-CeduUYkY.d.mts} +4 -4
  19. package/dist/{config-types-udmMgDBA.d.mts.map → config-types-CeduUYkY.d.mts.map} +1 -1
  20. package/dist/config.d.mts +1 -1
  21. package/dist/config__config-types.d.mts +1 -1
  22. package/dist/contract-authoring.mjs +1 -1
  23. package/dist/{contract-types-HCUyPohe-CuimQxo_.d.mts → contract-types-Bje5yT4f-0D1Z41Lq.d.mts} +6 -6
  24. package/dist/{contract-types-HCUyPohe-CuimQxo_.d.mts.map → contract-types-Bje5yT4f-0D1Z41Lq.d.mts.map} +1 -1
  25. package/dist/contract.d.mts +6 -6
  26. package/dist/contract__apply-specifier-default-control-policy.d.mts +1 -1
  27. package/dist/contract__enum-accessor.d.mts +1 -1
  28. package/dist/contract__hashing-utils.d.mts +1 -1
  29. package/dist/contract__hashing.d.mts +2 -2
  30. package/dist/contract__types.d.mts +1 -1
  31. package/dist/{control-B85tHWHg.mjs → control-BQNAs06v.mjs} +3 -3
  32. package/dist/{control-B85tHWHg.mjs.map → control-BQNAs06v.mjs.map} +1 -1
  33. package/dist/{control-B32e7diK.d.mts → control-eH2MIHqA.d.mts} +4 -4
  34. package/dist/{control-B32e7diK.d.mts.map → control-eH2MIHqA.d.mts.map} +1 -1
  35. package/dist/{dist-CYHrKNWw.mjs → dist-DUlexZHp.mjs} +2 -2
  36. package/dist/{dist-CYHrKNWw.mjs.map → dist-DUlexZHp.mjs.map} +1 -1
  37. package/dist/{emission-Cd3DfQdp.d.mts → emission-BWD6Z6w9.d.mts} +1 -1
  38. package/dist/{emission-types-BoSJNKfQ-D0NRnZiA.d.mts → emission-types-BoSJNKfQ-B_19ILPP.d.mts} +2 -2
  39. package/dist/{emission-types-BoSJNKfQ-D0NRnZiA.d.mts.map → emission-types-BoSJNKfQ-B_19ILPP.d.mts.map} +1 -1
  40. package/dist/{enum-accessor-Gr9UcG-r.d.mts → enum-accessor-PSFq-BB1.d.mts} +2 -2
  41. package/dist/{enum-accessor-Gr9UcG-r.d.mts.map → enum-accessor-PSFq-BB1.d.mts.map} +1 -1
  42. package/dist/errors.d.mts +1 -1
  43. package/dist/errors.mjs +1 -1
  44. package/dist/errors__execution.d.mts +1 -1
  45. package/dist/errors__execution.mjs +1 -1
  46. package/dist/{execution-Dejx90fO.mjs → execution-BEVehm0I.mjs} +2 -2
  47. package/dist/execution-BEVehm0I.mjs.map +1 -0
  48. package/dist/{execution-CdhoM1OQ.d.mts → execution-BpT2YjbZ.d.mts} +2 -2
  49. package/dist/{execution-CdhoM1OQ.d.mts.map → execution-BpT2YjbZ.d.mts.map} +1 -1
  50. package/dist/{framework-authoring-BvxZnsPY-ZPMm8wzu.mjs → framework-authoring-BvxZnsPY-DlD1nwU5.mjs} +3 -3
  51. package/dist/{framework-authoring-BvxZnsPY-ZPMm8wzu.mjs.map → framework-authoring-BvxZnsPY-DlD1nwU5.mjs.map} +1 -1
  52. package/dist/{hashing-D9wV2IJu.d.mts → hashing-BTx0s6Zw.d.mts} +2 -2
  53. package/dist/{hashing-D9wV2IJu.d.mts.map → hashing-BTx0s6Zw.d.mts.map} +1 -1
  54. package/dist/{hashing-utils-Bp0ZYY57.d.mts → hashing-utils-Bh9PVd4J.d.mts} +2 -2
  55. package/dist/{hashing-utils-Bp0ZYY57.d.mts.map → hashing-utils-Bh9PVd4J.d.mts.map} +1 -1
  56. package/dist/ids__runtime.mjs +1 -1
  57. package/dist/{internal-error-kK8QvlDE.d.mts → internal-error-2fJ9fcZX.d.mts} +2 -2
  58. package/dist/{internal-error-kK8QvlDE.d.mts.map → internal-error-2fJ9fcZX.d.mts.map} +1 -1
  59. package/dist/{internal-error-BIc-ehme-ouBQPoEL.mjs → internal-error-ChGYPVpq-DhUD05u0.mjs} +3 -3
  60. package/dist/internal-error-ChGYPVpq-DhUD05u0.mjs.map +1 -0
  61. package/dist/{ir-ChmSSAhX.mjs → ir-CV5d1FJ0.mjs} +2 -2
  62. package/dist/{ir-ChmSSAhX.mjs.map → ir-CV5d1FJ0.mjs.map} +1 -1
  63. package/dist/{parse-GbZGfMUj-BFSrD2AN.mjs → parse-GbZGfMUj-C9tHGn-6.mjs} +2 -2
  64. package/dist/{parse-GbZGfMUj-BFSrD2AN.mjs.map → parse-GbZGfMUj-C9tHGn-6.mjs.map} +1 -1
  65. package/dist/psl-parser.d.mts +1 -1
  66. package/dist/psl-parser.mjs +3 -3
  67. package/dist/psl-parser__format.mjs +1 -1
  68. package/dist/psl-parser__interpret.d.mts +2 -2
  69. package/dist/psl-parser__interpret.mjs +1 -1
  70. package/dist/psl-parser__syntax.mjs +1 -1
  71. package/dist/psl-printer.mjs +1 -1
  72. package/dist/{result-CBZ8X9mU.mjs → result-C0NUq1Ok.mjs} +2 -2
  73. package/dist/{result-CBZ8X9mU.mjs.map → result-C0NUq1Ok.mjs.map} +1 -1
  74. package/dist/ts-render.mjs +1 -1
  75. package/dist/utils.d.mts +1 -1
  76. package/dist/utils.mjs +3 -3
  77. package/dist/utils__assertions.mjs +1 -1
  78. package/dist/utils__internal-error.d.mts +1 -1
  79. package/dist/utils__internal-error.mjs +1 -1
  80. package/dist/utils__result.mjs +1 -1
  81. package/package.json +16 -16
  82. package/dist/apply-specifier-default-control-policy-yxEeh3lJ.d.mts.map +0 -1
  83. package/dist/execution-Dejx90fO.mjs.map +0 -1
  84. package/dist/internal-error-BIc-ehme-ouBQPoEL.mjs.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
2
2
  import { t as ifDefined } from "./defined-BQWA85QH-BRSBMULx.mjs";
3
3
  import { l as isColumnDefaultLiteralInputValue, u as isExecutionMutationDefaultValue } from "./types-DG4qHrT8.mjs";
4
- import { t as InternalError } from "./internal-error-BIc-ehme-ouBQPoEL.mjs";
5
- import { n as invariant } from "./assertions-Cz-GWH8P.mjs";
4
+ import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
5
+ import { n as invariant } from "./assertions-Dw1lZz_Q.mjs";
6
6
  import { n as runtimeError } from "./runtime-error-BA9d7XjZ-BlT8t6LB.mjs";
7
7
  //#region ../../../1-framework/1-core/framework-components/dist/framework-authoring-BvxZnsPY.mjs
8
8
  const AUTHORING_WARNING_BATCH_THRESHOLD = 5;
@@ -710,4 +710,4 @@ function instantiateAuthoringFieldPreset(descriptor, args) {
710
710
  //#endregion
711
711
  export { mergeAuthoringAttributeSpecs as _, collectScalarTypeConstructors as a, resolveEnumCodecId as b, instantiateAuthoringEntityType as c, isAuthoringArgRef as d, isAuthoringEntityTypeDescriptor as f, isAuthoringTypeConstructorDescriptor as g, isAuthoringPslBlockDescriptor as h, collectContributedDescriptorPaths as i, instantiateAuthoringFieldPreset as l, isAuthoringModelAttributeDescriptor as m, assertResolvableTypeConstructorTemplates as n, flushAuthoringWarnings as o, isAuthoringFieldPresetDescriptor as p, classifyEnumMemberType as r, hasRegisteredFieldNamespace as s, assertNoCrossRegistryCollisions as t, instantiateAuthoringTypeConstructor as u, mergeAuthoringNamespaces as v, validateAuthoringHelperArguments as x, resolveAuthoringTemplateValue as y };
712
712
 
713
- //# sourceMappingURL=framework-authoring-BvxZnsPY-ZPMm8wzu.mjs.map
713
+ //# sourceMappingURL=framework-authoring-BvxZnsPY-DlD1nwU5.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"framework-authoring-BvxZnsPY-ZPMm8wzu.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/framework-authoring-BvxZnsPY.mjs"],"sourcesContent":["import { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { isColumnDefaultLiteralInputValue, isExecutionMutationDefaultValue } from \"@internal/contract/types\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/shared/framework-authoring.ts\nconst AUTHORING_WARNING_BATCH_THRESHOLD = 5;\n/**\n* Emits collected authoring warnings once per build, grouped by `code`:\n* a group at or below the threshold itemizes every `message`; above it,\n* one summary — `\"<count> <summary>\"` followed by the `item` lines — so\n* a build with many hits of one kind does not wall-of-text, and warnings\n* of different codes never batch into each other's summary.\n*/\nfunction flushAuthoringWarnings(warnings) {\n\tconst groups = /* @__PURE__ */ new Map();\n\tfor (const warning of warnings) {\n\t\tconst key = `${warning.code}\\u0000${warning.summary}`;\n\t\tconst group = groups.get(key) ?? [];\n\t\tgroup.push(warning);\n\t\tgroups.set(key, group);\n\t}\n\tfor (const group of groups.values()) {\n\t\tconst first = group[0];\n\t\tif (first === void 0) continue;\n\t\tif (group.length <= AUTHORING_WARNING_BATCH_THRESHOLD) {\n\t\t\tfor (const warning of group) process.emitWarning(warning.message, { code: warning.code });\n\t\t\tcontinue;\n\t\t}\n\t\tprocess.emitWarning(`${group.length} ${first.summary}\\n${group.map((w) => ` - ${w.item}`).join(\"\\n\")}`, { code: first.code });\n\t}\n}\n/**\n* Classifies an `enum` block's members (before codec decoding, which needs\n* the codec chosen first) into which default codec an omitted `@@type`\n* should resolve to:\n*\n* - every member is `bare`, or a `value` whose raw JSON is a string → `'text'`\n* - every member is a `value` whose raw JSON is an integer → `'int'`\n* - anything else (float, bigint, boolean, mixed, or a `ref`/`option`/`list`\n* parameter) → `null`, meaning the caller must require an explicit `@@type`.\n*/\nfunction classifyEnumMemberType(block) {\n\tlet sawText = false;\n\tlet sawInt = false;\n\tfor (const paramValue of Object.values(block.parameters)) {\n\t\tif (paramValue.kind === \"bare\") {\n\t\t\tsawText = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (paramValue.kind !== \"value\") return null;\n\t\tlet jsonValue;\n\t\ttry {\n\t\t\tjsonValue = JSON.parse(paramValue.raw);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t\tif (typeof jsonValue === \"string\") sawText = true;\n\t\telse if (typeof jsonValue === \"number\" && Number.isInteger(jsonValue)) sawInt = true;\n\t\telse return null;\n\t}\n\tif (sawText && sawInt) return null;\n\tif (sawText) return \"text\";\n\tif (sawInt) return \"int\";\n\treturn null;\n}\n/**\n* Resolves the codec id for an `enum` block. When `@@type` is absent, the codec\n* is inferred from the members via {@link classifyEnumMemberType}; otherwise the\n* explicit `@@type(\"codec\")` argument is parsed. Pushes the appropriate\n* diagnostic and returns `undefined` when neither yields a codec. `codecSpan` is\n* the span downstream codec-validation diagnostics should anchor to. Shared by\n* every family's enum factory so inference and the explicit path stay identical.\n*/\nfunction resolveEnumCodecId(block, ctx) {\n\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\tconst typeAttr = block.attributes[\"type\"];\n\tif (typeAttr === void 0) {\n\t\tconst inferredKind = classifyEnumMemberType(block);\n\t\tif (inferredKind === null || ctx.enumInferenceCodecs === void 0) {\n\t\t\tctx.diagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_CANNOT_INFER_TYPE\",\n\t\t\t\tmessage: `cannot infer @@type for enum \"${block.name}\"; add an explicit @@type(...)`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.span\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\treturn {\n\t\t\tcodecId: ctx.enumInferenceCodecs[inferredKind],\n\t\t\tcodecSpan: block.span\n\t\t};\n\t}\n\tconst codecId = typeAttr.args[\"codecId\"];\n\tinvariant(typeof codecId === \"string\", \"@@type on an enum block parses one string argument\");\n\treturn {\n\t\tcodecId,\n\t\tcodecSpan: typeAttr.span\n\t};\n}\nfunction isAuthoringArgRef(value) {\n\tif (typeof value !== \"object\" || value === null || value.kind !== \"arg\") return false;\n\tconst { index, path } = value;\n\tif (typeof index !== \"number\" || !Number.isInteger(index) || index < 0) return false;\n\tif (path !== void 0 && (!Array.isArray(path) || path.some((s) => typeof s !== \"string\"))) return false;\n\treturn true;\n}\nfunction isAuthoringSelectRef(value) {\n\tif (!isAuthoringTemplateRecord(value) || value[\"kind\"] !== \"select\") return false;\n\tconst index = value[\"index\"];\n\tconst path = value[\"path\"];\n\tconst cases = value[\"cases\"];\n\tif (typeof index !== \"number\" || !Number.isInteger(index) || index < 0) return false;\n\tif (path !== void 0 && (!Array.isArray(path) || path.some((s) => typeof s !== \"string\"))) return false;\n\treturn typeof cases === \"object\" && cases !== null && !Array.isArray(cases);\n}\nfunction isAuthoringTemplateRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction readTemplateArgumentValue(args, index, path) {\n\tlet value = args[index];\n\tfor (const segment of path ?? []) {\n\t\tif (!isAuthoringTemplateRecord(value) || !Object.hasOwn(value, segment)) return;\n\t\tvalue = value[segment];\n\t}\n\treturn value;\n}\nfunction isAuthoringTypeConstructorDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"typeConstructor\";\n}\nfunction isAuthoringFieldPresetDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"fieldPreset\";\n}\nfunction isAuthoringEntityTypeDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"entity\";\n}\nfunction isAuthoringPslBlockDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"pslBlock\";\n}\nfunction isAuthoringModelAttributeDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"modelAttribute\";\n}\n/**\n* Returns true when `namespace` is a non-leaf key in `contributions.field`.\n*\n* `AuthoringFieldNamespace` permits a leaf descriptor at any depth — including\n* the root — so a top-level `field: { Foo: { kind: 'fieldPreset', ... } }`\n* registration must NOT be treated as a \"namespace\" with sub-paths. Callers\n* use this predicate to gate dot-namespaced lookups (e.g. PSL `@Foo.bar`).\n*/\nfunction hasRegisteredFieldNamespace(contributions, namespace) {\n\tif (contributions?.field === void 0 || !Object.hasOwn(contributions.field, namespace)) return false;\n\tconst value = contributions.field[namespace];\n\treturn value !== void 0 && !isAuthoringFieldPresetDescriptor(value);\n}\nfunction isCopyableNamespaceObject(value) {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n\tconst proto = Object.getPrototypeOf(value);\n\treturn proto === Object.prototype || proto === null;\n}\n/**\n* Deep structural check run only at the composition boundary (the merge and\n* collect walkers) to classify a raw namespace-tree node as a leaf descriptor.\n* A node counts as a leaf iff its `kind` matches `descriptorKind` AND it\n* carries that kind's required fields.\n*\n* This is boundary validation over `unknown`, NOT a type-predicate: the four\n* exported `isAuthoring*Descriptor` predicates deliberately narrow on `kind`\n* alone and trust the static types. The walkers, by contrast, also receive\n* type-bypassing packs (`as unknown as never` in tests, untyped JS at runtime)\n* whose descriptor-shaped-but-incomplete nodes must be rejected rather than\n* silently treated as sub-namespaces — so the well-formedness check lives here.\n*/\nfunction isWellFormedDescriptor(value, descriptorKind) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (!(\"kind\" in value) || value.kind !== descriptorKind) return false;\n\tswitch (descriptorKind) {\n\t\tcase \"typeConstructor\":\n\t\tcase \"fieldPreset\": {\n\t\t\tif (!(\"output\" in value)) return false;\n\t\t\tconst output = value.output;\n\t\t\treturn typeof output === \"object\" && output !== null;\n\t\t}\n\t\tcase \"entity\": {\n\t\t\tif (!(\"discriminator\" in value) || typeof value.discriminator !== \"string\") return false;\n\t\t\tif (value.discriminator.length === 0) return false;\n\t\t\tif (!(\"output\" in value)) return false;\n\t\t\tconst output = value.output;\n\t\t\tif (typeof output !== \"object\" || output === null) return false;\n\t\t\tconst factory = \"factory\" in output ? output.factory : void 0;\n\t\t\tconst template = \"template\" in output ? output.template : void 0;\n\t\t\treturn typeof factory === \"function\" || template !== void 0;\n\t\t}\n\t\tcase \"pslBlock\": {\n\t\t\tif (!(\"keyword\" in value) || typeof value.keyword !== \"string\" || value.keyword.length === 0) return false;\n\t\t\tif (!(\"discriminator\" in value) || typeof value.discriminator !== \"string\" || value.discriminator.length === 0) return false;\n\t\t\tif (!(\"name\" in value)) return false;\n\t\t\tconst name = value.name;\n\t\t\tif (typeof name !== \"object\" || name === null) return false;\n\t\t\tif (!(\"required\" in name) || typeof name.required !== \"boolean\") return false;\n\t\t\tif (!(\"parameters\" in value)) return false;\n\t\t\tconst parameters = value.parameters;\n\t\t\tif (typeof parameters !== \"object\" || parameters === null || Array.isArray(parameters)) return false;\n\t\t\tif (!(\"attributes\" in value) || value.attributes === void 0) return true;\n\t\t\tconst attributes = value.attributes;\n\t\t\tif (typeof attributes !== \"object\" || attributes === null || Array.isArray(attributes)) return false;\n\t\t\treturn Object.values(attributes).every((factory) => typeof factory === \"function\");\n\t\t}\n\t\tcase \"modelAttribute\":\n\t\t\tif (!(\"attribute\" in value) || typeof value.attribute !== \"string\" || value.attribute.length === 0) return false;\n\t\t\tif (!(\"spec\" in value)) return false;\n\t\t\treturn \"lower\" in value && typeof value.lower === \"function\";\n\t\tdefault: return false;\n\t}\n}\nfunction deepCopyNamespace(source, descriptorKind) {\n\tconst copy = {};\n\tfor (const [key, value] of Object.entries(source)) copy[key] = isCopyableNamespaceObject(value) && !isWellFormedDescriptor(value, descriptorKind) ? deepCopyNamespace(value, descriptorKind) : value;\n\treturn copy;\n}\n/**\n* Merges `source` into `target` recursively at the descriptor-namespace\n* level. `descriptorKind` is the `kind` value ('typeConstructor',\n* 'fieldPreset', 'entity', or 'pslBlock') that identifies a descriptor\n* (terminal merge point; same-path registrations across components are\n* reported as duplicates) as opposed to a sub-namespace (recursion target).\n*\n* Path segments are validated against prototype-pollution names\n* (`__proto__`, `constructor`, `prototype`). A value that is neither a\n* recognized leaf nor a plain object — e.g. a malformed descriptor\n* where the canonical leaf guard rejected it for missing `output` —\n* is reported as an invalid contribution rather than recursed into,\n* which would either silently mangle state or infinite-loop on\n* primitive properties.\n*\n* Within-registry duplicate detection is this walker's job;\n* cross-registry detection runs separately via\n* `assertNoCrossRegistryCollisions` after merging completes.\n*/\nfunction mergeAuthoringNamespaces(target, source, path, descriptorKind, label) {\n\tconst assertSafePath = (currentPath) => {\n\t\tconst blockedSegment = currentPath.find((segment) => segment === \"__proto__\" || segment === \"constructor\" || segment === \"prototype\");\n\t\tif (blockedSegment) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Invalid authoring ${label} helper \"${currentPath.join(\".\")}\". Helper path segments must not use \"${blockedSegment}\".`);\n\t};\n\tfor (const [key, sourceValue] of Object.entries(source)) {\n\t\tconst currentPath = [...path, key];\n\t\tassertSafePath(currentPath);\n\t\tconst hasExistingValue = Object.hasOwn(target, key);\n\t\tconst existingValue = hasExistingValue ? target[key] : void 0;\n\t\tif (!hasExistingValue) {\n\t\t\ttarget[key] = isCopyableNamespaceObject(sourceValue) && !isWellFormedDescriptor(sourceValue, descriptorKind) ? deepCopyNamespace(sourceValue, descriptorKind) : sourceValue;\n\t\t\tcontinue;\n\t\t}\n\t\tconst existingIsLeaf = isWellFormedDescriptor(existingValue, descriptorKind);\n\t\tconst sourceIsLeaf = isWellFormedDescriptor(sourceValue, descriptorKind);\n\t\tif (existingIsLeaf || sourceIsLeaf) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Duplicate authoring ${label} helper \"${currentPath.join(\".\")}\". Helper names must be unique across composed packs.`);\n\t\tif (!isCopyableNamespaceObject(existingValue) || !isCopyableNamespaceObject(sourceValue)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Invalid authoring ${label} helper \"${currentPath.join(\".\")}\". Expected a sub-namespace object or a recognized descriptor; received a malformed value.`);\n\t\tmergeAuthoringNamespaces(existingValue, sourceValue, currentPath, descriptorKind, label);\n\t}\n}\nconst ATTRIBUTE_SPEC_LEVELS = [\"model\", \"field\"];\nfunction mergeAuthoringAttributeSpecs(target, source, contributedBy, owners) {\n\tconst invalidContribution = (detail) => runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Invalid authoring attributeSpecs contribution from descriptor \"${contributedBy}\". ${detail}`);\n\tif (!isCopyableNamespaceObject(source)) throw invalidContribution(\"Expected a record carrying a \\\"model\\\" and a \\\"field\\\" level.\");\n\tfor (const level of ATTRIBUTE_SPEC_LEVELS) {\n\t\tconst contributed = source[level];\n\t\tif (!isCopyableNamespaceObject(contributed)) throw invalidContribution(`The \"${level}\" level must be a record of spec factories keyed by attribute name.`);\n\t\tfor (const [attribute, factory] of Object.entries(contributed)) {\n\t\t\tconst entryPath = `${level}.${attribute}`;\n\t\t\tconst invalidEntry = (detail) => runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Invalid authoring attributeSpecs entry \"${entryPath}\" contributed by descriptor \"${contributedBy}\". ${detail}`);\n\t\t\tif (attribute === \"__proto__\" || attribute === \"constructor\" || attribute === \"prototype\") throw invalidEntry(`Attribute names must not use \"${attribute}\".`);\n\t\t\tif (typeof factory !== \"function\") throw invalidEntry(\"Each entry must be a spec factory function.\");\n\t\t\tconst existingOwner = owners.get(entryPath);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Duplicate authoring attributeSpecs entry \"${entryPath}\". Descriptor \"${contributedBy}\" conflicts with \"${existingOwner}\". Each attribute name may be claimed once per level.`);\n\t\t\towners.set(entryPath, contributedBy);\n\t\t\ttarget[level][attribute] = factory;\n\t\t}\n\t}\n}\n/**\n* Collects the full dotted paths of every well-formed descriptor of\n* `descriptorKind` in a raw contribution tree, using the same boundary\n* classification as {@link mergeAuthoringNamespaces}. Lets assembly-level\n* callers attribute each contributed path to its contributing component\n* before merging, so a same-path collision can be reported naming both\n* contributors.\n*/\nfunction collectContributedDescriptorPaths(namespace, descriptorKind, path = []) {\n\tconst paths = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isWellFormedDescriptor(value, descriptorKind)) {\n\t\t\tpaths.push(currentPath.join(\".\"));\n\t\t\tcontinue;\n\t\t}\n\t\tif (isCopyableNamespaceObject(value)) paths.push(...collectContributedDescriptorPaths(value, descriptorKind, currentPath));\n\t}\n\treturn paths;\n}\n/**\n* Derives the scalar view of an assembled authoring type namespace: every\n* **top-level** type constructor that is instantiable with an empty argument\n* list — all declared args optional and no entity-ref argument. A bare type\n* name `T` in a schema is semantically the zero-arg instantiation `T()`, so\n* each entry is exactly what that call produces (defaulted template values\n* applied, absent optional-arg typeParams keys omitted). Constructors\n* registered under a namespace segment, constructors with required args, and\n* entity-ref constructors are not scalars and are excluded.\n*\n* Eligibility needs no template inspection: templates that cannot resolve\n* for their legal call shapes are rejected at the composition boundary by\n* {@link assertResolvableTypeConstructorTemplates}, so the zero-arg\n* instantiation below cannot fail for an eligible constructor.\n*/\nfunction collectScalarTypeConstructors(namespace) {\n\tconst result = /* @__PURE__ */ new Map();\n\tfor (const [name, value] of Object.entries(namespace)) {\n\t\tif (!isAuthoringTypeConstructorDescriptor(value)) continue;\n\t\tif (value.entityRefArg !== void 0) continue;\n\t\tif (value.args?.some((arg) => arg.optional !== true)) continue;\n\t\tresult.set(name, instantiateAuthoringTypeConstructor(value, []));\n\t}\n\treturn result;\n}\nfunction visitTemplateArgRefs(template, visit) {\n\tif (template === void 0) return;\n\tif (isAuthoringArgRef(template)) {\n\t\tvisit(template);\n\t\tvisitTemplateArgRefs(template.default, visit);\n\t\treturn;\n\t}\n\tif (Array.isArray(template)) {\n\t\tfor (const value of template) visitTemplateArgRefs(value, visit);\n\t\treturn;\n\t}\n\tif (typeof template === \"object\" && template !== null) for (const value of Object.values(template)) visitTemplateArgRefs(value, visit);\n}\n/**\n* Boundary validation for a contributed authoring type namespace, called\n* per contributing component at assembly (which supplies `contributedBy`\n* for attribution). Rejects what the types cannot express — entity-ref\n* constructors are skipped (their output derives from the referenced\n* entity): a plain constructor must declare its output storage type name,\n* and every `typeParams` arg-ref (including refs inside arg-ref defaults)\n* must point at a declared argument index.\n*/\nfunction assertResolvableTypeConstructorTemplates(namespace, contributedBy, path = []) {\n\tfor (const [name, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, name];\n\t\tif (!isAuthoringTypeConstructorDescriptor(value)) {\n\t\t\tassertResolvableTypeConstructorTemplates(value, contributedBy, currentPath);\n\t\t\tcontinue;\n\t\t}\n\t\tif (value.entityRefArg !== void 0) continue;\n\t\tconst args = value.args ?? [];\n\t\tconst invalid = (detail) => /* @__PURE__ */ new Error(`Invalid authoring type constructor \"${currentPath.join(\".\")}\" contributed by descriptor \"${contributedBy}\". ${detail}`);\n\t\tif (value.output.nativeType === void 0) throw invalid(\"The output declares no storage type template and no entityRefArg; a plain constructor must declare one.\");\n\t\tfor (const [key, template] of Object.entries(value.output.typeParams ?? {})) visitTemplateArgRefs(template, (ref) => {\n\t\t\tif (args[ref.index] === void 0) throw invalid(`output.typeParams.${key} references argument ${ref.index}, but the constructor declares ${args.length} argument(s). Declare the argument or correct the reference index.`);\n\t\t});\n\t}\n}\nfunction collectDescriptorPaths(namespace, isLeaf, path = []) {\n\tconst paths = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isLeaf(value)) {\n\t\t\tpaths.push(currentPath.join(\".\"));\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) paths.push(...collectDescriptorPaths(value, isLeaf, currentPath));\n\t}\n\treturn paths;\n}\nfunction collectDescriptorEntries(namespace, isLeaf, descriptorKind, label, path = []) {\n\tconst entries = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isLeaf(value)) {\n\t\t\tif (!isWellFormedDescriptor(value, descriptorKind)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring ${label} contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/keyword/discriminator) but does not satisfy the ${label} descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tif (value.discriminator.length > 0) entries.push({\n\t\t\t\tpath: currentPath.join(\".\"),\n\t\t\t\tdiscriminator: value.discriminator\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) {\n\t\t\tconst record = blindCast(value);\n\t\t\tif ((record[\"kind\"] !== void 0 || record[\"keyword\"] !== void 0 || record[\"discriminator\"] !== void 0) && !isLeaf(value)) {\n\t\t\t\tconst hasKind = record[\"kind\"] === \"pslBlock\";\n\t\t\t\tconst hasKeyword = typeof record[\"keyword\"] === \"string\";\n\t\t\t\tconst hasDiscriminator = typeof record[\"discriminator\"] === \"string\";\n\t\t\t\tif (hasKind || hasKeyword && hasDiscriminator) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring ${label} contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/keyword/discriminator) but does not satisfy the ${label} descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\t}\n\t\t\tentries.push(...collectDescriptorEntries(value, isLeaf, descriptorKind, label, currentPath));\n\t\t}\n\t}\n\treturn entries;\n}\n/**\n* Throws when two or more entries in the same namespace share a key. A\n* duplicate key makes dispatch ambiguous — the caller's lookup dispatches by\n* this key, so one entry would silently shadow the other. Catch duplicates\n* before building any dispatch map.\n*\n* `label` (e.g. `'pslBlock'`, `'entityType'`) names which namespace the\n* duplicate was found in and is carried in the structured error metadata;\n* the key itself is always called `key` in both the message and the\n* metadata, since what it semantically represents (a discriminator for\n* `entityType`, the parser's dispatch keyword for `pslBlock`) is the\n* caller's concern, not this function's.\n*/\nfunction assertUniqueDiscriminators(entries, label) {\n\tconst seen = /* @__PURE__ */ new Map();\n\tfor (const { path, discriminator: key } of entries) {\n\t\tconst existing = seen.get(key);\n\t\tif (existing !== void 0) throw runtimeError(\"RUNTIME.DUPLICATE_AUTHORING_DISCRIMINATOR\", `Duplicate ${label} key \"${key}\" registered at both \"${existing}\" and \"${path}\". Each ${label} contribution must use a unique key.`, {\n\t\t\tlabel,\n\t\t\tkey,\n\t\t\texistingPath: existing,\n\t\t\tpath\n\t\t});\n\t\tseen.set(key, path);\n\t}\n}\nfunction collectPslBlockDescriptorEntries(namespace, path = []) {\n\tconst entries = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isAuthoringPslBlockDescriptor(value)) {\n\t\t\tif (!isWellFormedDescriptor(value, \"pslBlock\")) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring pslBlock contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/keyword/discriminator) but does not satisfy the pslBlock descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tentries.push({\n\t\t\t\tpath: currentPath.join(\".\"),\n\t\t\t\tdiscriminator: value.discriminator,\n\t\t\t\tkeyword: value.keyword\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) {\n\t\t\tconst record = blindCast(value);\n\t\t\tconst hasKind = record[\"kind\"] === \"pslBlock\";\n\t\t\tconst hasKeyword = typeof record[\"keyword\"] === \"string\";\n\t\t\tconst hasDiscriminator = typeof record[\"discriminator\"] === \"string\";\n\t\t\tif (hasKind || hasKeyword && hasDiscriminator) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring pslBlock contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/keyword/discriminator) but does not satisfy the pslBlock descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tentries.push(...collectPslBlockDescriptorEntries(value, currentPath));\n\t\t}\n\t}\n\treturn entries;\n}\n/**\n* Every `pslBlockDescriptors` entry requires a matching `entityTypes` factory\n* with the same discriminator. An `entityTypes` factory may stand alone (e.g.\n* `enum`, reachable from the TypeScript builder without any PSL block).\n*\n* Uniqueness for pslBlock entries is keyed on **keyword**, not discriminator:\n* several keywords (e.g. `policy_select`/`policy_insert`) may legitimately\n* share one discriminator, routing to the same `entityTypes` factory and the\n* same `entries[discriminator]` slot — that N:1 shape is exactly what lets\n* one entity kind be authored through several PSL keywords. What must stay\n* unique is the keyword itself, since that's what the parser dispatches on.\n*/\nfunction assertPslBlocksHaveFactories(entityTypeNamespace, pslBlockNamespace) {\n\tconst blockEntries = collectPslBlockDescriptorEntries(pslBlockNamespace);\n\tconst entityEntries = collectDescriptorEntries(entityTypeNamespace, isAuthoringEntityTypeDescriptor, \"entity\", \"entityType\");\n\tassertUniqueDiscriminators(blockEntries.map((entry) => ({\n\t\tpath: entry.path,\n\t\tdiscriminator: entry.keyword\n\t})), \"pslBlock\");\n\tassertUniqueDiscriminators(entityEntries, \"entityType\");\n\tconst entityDiscriminators = new Set(entityEntries.map((entry) => entry.discriminator));\n\tfor (const block of blockEntries) if (!entityDiscriminators.has(block.discriminator)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Incomplete extension contribution: pslBlock helper \"${block.path}\" registers discriminator \"${block.discriminator}\" but no entityType contribution shares that discriminator. An extension-contributed PSL block requires a matching entityType factory so the parsed AST node can lower to an IR class instance; add an entityType helper with discriminator \"${block.discriminator}\".`);\n}\nfunction collectModelAttributeEntries(namespace, path = []) {\n\tconst entries = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isAuthoringModelAttributeDescriptor(value)) {\n\t\t\tif (!isWellFormedDescriptor(value, \"modelAttribute\")) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring modelAttribute contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/attribute) but does not satisfy the modelAttribute descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tentries.push({\n\t\t\t\tpath: currentPath.join(\".\"),\n\t\t\t\tdiscriminator: value.attribute\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) {\n\t\t\tconst record = blindCast(value);\n\t\t\tif (typeof record[\"attribute\"] === \"string\" && \"spec\" in record) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring modelAttribute contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/attribute) but does not satisfy the modelAttribute descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tentries.push(...collectModelAttributeEntries(value, currentPath));\n\t\t}\n\t}\n\treturn entries;\n}\n/**\n* Throws when two modelAttribute contributions — at any paths, even\n* different ones — claim the same bare `@@` attribute name. The family\n* interpreter dispatches by attribute name, not by registration path, so\n* two descriptors claiming the same name would have one silently shadow\n* the other.\n*/\nfunction assertUniqueModelAttributeNames(entries) {\n\tconst seen = /* @__PURE__ */ new Map();\n\tfor (const { path, discriminator: attribute } of entries) {\n\t\tconst existing = seen.get(attribute);\n\t\tif (existing !== void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Duplicate modelAttribute \"${attribute}\" registered at both \"${existing}\" and \"${path}\". Each modelAttribute contribution must claim a unique attribute name.`);\n\t\tseen.set(attribute, path);\n\t}\n}\nfunction assertNoCrossRegistryCollisions(typeNamespace, fieldNamespace, entityTypeNamespace = {}, pslBlockNamespace = {}, modelAttributeNamespace = {}) {\n\tconst typePaths = new Set(collectDescriptorPaths(typeNamespace, isAuthoringTypeConstructorDescriptor));\n\tconst fieldPaths = new Set(collectDescriptorPaths(fieldNamespace, isAuthoringFieldPresetDescriptor));\n\tconst entityPaths = new Set(collectDescriptorPaths(entityTypeNamespace, isAuthoringEntityTypeDescriptor));\n\tconst ambiguityHint = \"Register each path in only one of authoringContributions.field / authoringContributions.type / authoringContributions.entityTypes.\";\n\tfor (const fieldPath of fieldPaths) if (typePaths.has(fieldPath)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Ambiguous authoring registry path \"${fieldPath}\". The same path is registered as both a type constructor and a field preset; PSL resolution would be ambiguous. ${ambiguityHint}`);\n\tfor (const entityPath of entityPaths) if (typePaths.has(entityPath) || fieldPaths.has(entityPath)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Ambiguous authoring registry path \"${entityPath}\". The same path is registered as an entity contribution AND as a type constructor or field preset; PSL resolution would be ambiguous. ${ambiguityHint}`);\n\tassertPslBlocksHaveFactories(entityTypeNamespace, pslBlockNamespace);\n\tassertUniqueModelAttributeNames(collectModelAttributeEntries(modelAttributeNamespace));\n\tassertSelectTemplatesMatchOptionArgs(typeNamespace, fieldNamespace, entityTypeNamespace);\n}\nfunction collectDescriptorNodes(namespace, isLeaf, path = []) {\n\tconst nodes = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isLeaf(value)) {\n\t\t\tnodes.push([currentPath.join(\".\"), value]);\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) nodes.push(...collectDescriptorNodes(value, isLeaf, currentPath));\n\t}\n\treturn nodes;\n}\nfunction collectSelectRefs(value, found) {\n\tif (typeof value !== \"object\" || value === null) return;\n\tif (isAuthoringSelectRef(value)) {\n\t\tfound.push(value);\n\t\tfor (const caseTemplate of Object.values(value.cases)) collectSelectRefs(caseTemplate, found);\n\t\treturn;\n\t}\n\tif (isAuthoringArgRef(value)) {\n\t\tcollectSelectRefs(value.default, found);\n\t\treturn;\n\t}\n\tif (Array.isArray(value)) {\n\t\tfor (const entry of value) collectSelectRefs(entry, found);\n\t\treturn;\n\t}\n\tfor (const entry of Object.values(value)) collectSelectRefs(entry, found);\n}\nfunction validateSelectRefsAgainstArgs(label, helperPath, args, templateRoot) {\n\tconst selects = [];\n\tcollectSelectRefs(templateRoot, selects);\n\tfor (const select of selects) {\n\t\tconst position = `#${select.index + 1}`;\n\t\tlet descriptor = args?.[select.index];\n\t\tif (descriptor === void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" select template references argument ${position}, but the helper declares no argument at that position.`);\n\t\tfor (const segment of select.path ?? []) {\n\t\t\tdescriptor = descriptor.kind === \"object\" ? descriptor.properties[segment] : void 0;\n\t\t\tif (descriptor === void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" select template references argument ${position} at path \"${(select.path ?? []).join(\".\")}\", which does not resolve to a declared argument property.`);\n\t\t}\n\t\tif (descriptor.kind !== \"option\") throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" select template references argument ${position}, which is kind \"${descriptor.kind}\"; select requires an option argument.`);\n\t\tconst argumentLabel = descriptor.name !== void 0 ? `\"${descriptor.name}\"` : position;\n\t\tconst missing = descriptor.values.filter((value) => !Object.hasOwn(select.cases, value));\n\t\tif (missing.length > 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" option argument ${argumentLabel} allows [${descriptor.values.join(\", \")}] but the select template has no case for: ${missing.join(\", \")}.`);\n\t\tconst values = descriptor.values;\n\t\tconst unreachable = Object.keys(select.cases).filter((key) => !values.includes(key));\n\t\tif (unreachable.length > 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" select template has case(s) not allowed by option argument ${argumentLabel}: ${unreachable.join(\", \")}. Allowed values: [${values.join(\", \")}].`);\n\t}\n}\n/**\n* Every `select` template node must target an option argument whose `values`\n* exactly cover the node's `cases` — a legal token with no case and a case no\n* token can reach are both declaration bugs, caught here at pack-registration\n* time rather than at first resolution.\n*/\nfunction assertSelectTemplatesMatchOptionArgs(typeNamespace, fieldNamespace, entityTypeNamespace) {\n\tfor (const [helperPath, descriptor] of collectDescriptorNodes(fieldNamespace, isAuthoringFieldPresetDescriptor)) validateSelectRefsAgainstArgs(\"field\", helperPath, descriptor.args, descriptor.output);\n\tfor (const [helperPath, descriptor] of collectDescriptorNodes(typeNamespace, isAuthoringTypeConstructorDescriptor)) validateSelectRefsAgainstArgs(\"type\", helperPath, descriptor.args, descriptor.output);\n\tfor (const [helperPath, descriptor] of collectDescriptorNodes(entityTypeNamespace, isAuthoringEntityTypeDescriptor)) if (\"template\" in descriptor.output) validateSelectRefsAgainstArgs(\"entityType\", helperPath, descriptor.args, descriptor.output.template);\n}\nfunction resolveAuthoringTemplateValue(template, args) {\n\tif (template === void 0) return;\n\tif (isAuthoringArgRef(template)) {\n\t\tconst value = readTemplateArgumentValue(args, template.index, template.path);\n\t\tif (value === void 0 && template.default !== void 0) return resolveAuthoringTemplateValue(template.default, args);\n\t\treturn value;\n\t}\n\tif (isAuthoringSelectRef(template)) {\n\t\tconst value = readTemplateArgumentValue(args, template.index, template.path);\n\t\tif (value === void 0) return;\n\t\tif (typeof value !== \"string\" || !Object.hasOwn(template.cases, value)) throw new InternalError(`Authoring template select has no case for value \"${String(value)}\"`);\n\t\treturn resolveAuthoringTemplateValue(template.cases[value], args);\n\t}\n\tif (Array.isArray(template)) return template.map((value) => resolveAuthoringTemplateValue(value, args));\n\tif (typeof template === \"object\" && template !== null) {\n\t\tconst resolved = {};\n\t\tfor (const [key, value] of Object.entries(template)) {\n\t\t\tconst resolvedValue = resolveAuthoringTemplateValue(value, args);\n\t\t\tif (resolvedValue !== void 0) resolved[key] = resolvedValue;\n\t\t}\n\t\treturn resolved;\n\t}\n\treturn template;\n}\nfunction validateAuthoringArgument(descriptor, value, path) {\n\tif (value === void 0) {\n\t\tif (descriptor.optional) return;\n\t\tthrow runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Missing required authoring helper argument at ${path}`);\n\t}\n\tif (descriptor.kind === \"string\") {\n\t\tif (typeof value !== \"string\") throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be a string`);\n\t\treturn;\n\t}\n\tif (descriptor.kind === \"boolean\") {\n\t\tif (typeof value !== \"boolean\") throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be a boolean`);\n\t\treturn;\n\t}\n\tif (descriptor.kind === \"stringArray\") {\n\t\tif (!Array.isArray(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be an array of strings`);\n\t\tfor (const entry of value) if (typeof entry !== \"string\") throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be an array of strings`);\n\t\treturn;\n\t}\n\tif (descriptor.kind === \"object\") {\n\t\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be an object`);\n\t\tconst input = value;\n\t\tconst expectedKeys = new Set(Object.keys(descriptor.properties));\n\t\tfor (const key of Object.keys(input)) if (!expectedKeys.has(key)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} contains unknown property \"${key}\"`);\n\t\tfor (const [key, propertyDescriptor] of Object.entries(descriptor.properties)) validateAuthoringArgument(propertyDescriptor, input[key], `${path}.${key}`);\n\t\treturn;\n\t}\n\tif (descriptor.kind === \"option\") {\n\t\tif (typeof value !== \"string\" || !descriptor.values.includes(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be one of: ${descriptor.values.join(\", \")}`);\n\t\treturn;\n\t}\n\tif (typeof value !== \"number\" || Number.isNaN(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be a number`);\n\tif (descriptor.integer && !Number.isInteger(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be an integer`);\n\tif (descriptor.minimum !== void 0 && value < descriptor.minimum) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be >= ${descriptor.minimum}, received ${value}`);\n\tif (descriptor.maximum !== void 0 && value > descriptor.maximum) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be <= ${descriptor.maximum}, received ${value}`);\n}\nfunction validateAuthoringHelperArguments(helperPath, descriptors, args) {\n\tconst expected = descriptors ?? [];\n\tconst minimumArgs = expected.reduce((count, descriptor, index) => descriptor.optional ? count : index + 1, 0);\n\tif (args.length < minimumArgs || args.length > expected.length) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${helperPath} expects ${minimumArgs === expected.length ? expected.length : `${minimumArgs}-${expected.length}`} argument(s), received ${args.length}`);\n\texpected.forEach((descriptor, index) => {\n\t\tvalidateAuthoringArgument(descriptor, args[index], `${helperPath}[${index}]`);\n\t});\n}\nfunction resolveAuthoringStorageTypeTemplate(template, args) {\n\tconst nativeType = template.nativeType;\n\tif (nativeType === void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring output template for codec \"${template.codecId}\" declares no nativeType; only entity-ref constructors may omit it`);\n\tconst typeParams = template.typeParams === void 0 ? void 0 : resolveAuthoringTemplateValue(template.typeParams, args);\n\tif (typeParams !== void 0 && !isAuthoringTemplateRecord(typeParams)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Resolved authoring typeParams must be an object for codec \"${template.codecId}\", received ${String(typeParams)}`);\n\tconst normalizedTypeParams = typeParams !== void 0 && Object.keys(typeParams).length === 0 ? void 0 : typeParams;\n\treturn {\n\t\tcodecId: template.codecId,\n\t\tnativeType,\n\t\t...ifDefined(\"typeParams\", normalizedTypeParams)\n\t};\n}\nfunction resolveAuthoringColumnDefaultTemplate(template, args) {\n\tif (template.kind === \"literal\") {\n\t\tconst value = resolveAuthoringTemplateValue(template.value, args);\n\t\tif (value === void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", \"Resolved authoring literal default must not be undefined\");\n\t\tif (!isColumnDefaultLiteralInputValue(value)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Resolved authoring literal default must be a JSON-serializable value or Date, received ${String(value)}`);\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue\n\t\t};\n\t}\n\tconst expression = resolveAuthoringTemplateValue(template.expression, args);\n\tif (expression === void 0 || typeof expression === \"object\" && expression !== null) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Resolved authoring function default expression must resolve to a primitive, received ${String(expression)}`);\n\treturn {\n\t\tkind: \"function\",\n\t\texpression: String(expression)\n\t};\n}\nfunction resolveExecutionMutationDefaultPhase(phase, template, args) {\n\tconst value = resolveAuthoringTemplateValue(template, args);\n\tif (value === void 0) return;\n\tif (!isExecutionMutationDefaultValue(value)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring preset executionDefaults.${phase} did not resolve to a valid generator descriptor (kind: 'generator', id: string).`);\n\treturn value;\n}\nfunction resolveAuthoringExecutionDefaultsTemplate(template, args) {\n\tconst phases = {\n\t\t...ifDefined(\"onCreate\", template.onCreate !== void 0 ? resolveExecutionMutationDefaultPhase(\"onCreate\", template.onCreate, args) : void 0),\n\t\t...ifDefined(\"onUpdate\", template.onUpdate !== void 0 ? resolveExecutionMutationDefaultPhase(\"onUpdate\", template.onUpdate, args) : void 0)\n\t};\n\treturn Object.keys(phases).length === 0 ? void 0 : phases;\n}\nfunction instantiateAuthoringTypeConstructor(descriptor, args) {\n\treturn resolveAuthoringStorageTypeTemplate(descriptor.output, args);\n}\nfunction instantiateAuthoringEntityType(helperPath, descriptor, args, ctx) {\n\tif (\"factory\" in descriptor.output) {\n\t\tconst input = args[0];\n\t\treturn blindCast(descriptor.output.factory)(input, ctx);\n\t}\n\tvalidateAuthoringHelperArguments(helperPath, descriptor.args, args);\n\treturn blindCast(resolveAuthoringTemplateValue(descriptor.output.template, args));\n}\nfunction instantiateAuthoringFieldPreset(descriptor, args) {\n\treturn {\n\t\tdescriptor: resolveAuthoringStorageTypeTemplate(descriptor.output, args),\n\t\tnullable: descriptor.output.nullable ?? false,\n\t\t...ifDefined(\"default\", descriptor.output.default !== void 0 ? resolveAuthoringColumnDefaultTemplate(descriptor.output.default, args) : void 0),\n\t\t...ifDefined(\"executionDefaults\", descriptor.output.executionDefaults !== void 0 ? resolveAuthoringExecutionDefaultsTemplate(descriptor.output.executionDefaults, args) : void 0),\n\t\tid: descriptor.output.id ?? false,\n\t\tunique: descriptor.output.unique ?? false\n\t};\n}\n//#endregion\nexport { mergeAuthoringAttributeSpecs as _, collectScalarTypeConstructors as a, resolveEnumCodecId as b, instantiateAuthoringEntityType as c, isAuthoringArgRef as d, isAuthoringEntityTypeDescriptor as f, isAuthoringTypeConstructorDescriptor as g, isAuthoringPslBlockDescriptor as h, collectContributedDescriptorPaths as i, instantiateAuthoringFieldPreset as l, isAuthoringModelAttributeDescriptor as m, assertResolvableTypeConstructorTemplates as n, flushAuthoringWarnings as o, isAuthoringFieldPresetDescriptor as p, classifyEnumMemberType as r, hasRegisteredFieldNamespace as s, assertNoCrossRegistryCollisions as t, instantiateAuthoringTypeConstructor as u, mergeAuthoringNamespaces as v, validateAuthoringHelperArguments as x, resolveAuthoringTemplateValue as y };\n\n//# sourceMappingURL=framework-authoring-BvxZnsPY.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,oCAAoC;;;;;;;;AAQ1C,SAAS,uBAAuB,UAAU;CACzC,MAAM,yBAAyB,IAAI,IAAI;CACvC,KAAK,MAAM,WAAW,UAAU;EAC/B,MAAM,MAAM,GAAG,QAAQ,KAAK,QAAQ,QAAQ;EAC5C,MAAM,QAAQ,OAAO,IAAI,GAAG,KAAK,CAAC;EAClC,MAAM,KAAK,OAAO;EAClB,OAAO,IAAI,KAAK,KAAK;CACtB;CACA,KAAK,MAAM,SAAS,OAAO,OAAO,GAAG;EACpC,MAAM,QAAQ,MAAM;EACpB,IAAI,UAAU,KAAK,GAAG;EACtB,IAAI,MAAM,UAAU,mCAAmC;GACtD,KAAK,MAAM,WAAW,OAAO,QAAQ,YAAY,QAAQ,SAAS,EAAE,MAAM,QAAQ,KAAK,CAAC;GACxF;EACD;EACA,QAAQ,YAAY,GAAG,MAAM,OAAO,GAAG,MAAM,QAAQ,IAAI,MAAM,KAAK,MAAM,OAAO,EAAE,MAAM,CAAC,CAAC,KAAK,IAAI,KAAK,EAAE,MAAM,MAAM,KAAK,CAAC;CAC9H;AACD;;;;;;;;;;;AAWA,SAAS,uBAAuB,OAAO;CACtC,IAAI,UAAU;CACd,IAAI,SAAS;CACb,KAAK,MAAM,cAAc,OAAO,OAAO,MAAM,UAAU,GAAG;EACzD,IAAI,WAAW,SAAS,QAAQ;GAC/B,UA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IAAI,IAAI,KAAK,CAAC;EAChL,IAAI,WAAW,OAAO,MAAM;EAC5B,QAAQ,WAAW,OAAO,UAAU;CACrC;AACD"}
1
+ {"version":3,"file":"framework-authoring-BvxZnsPY-DlD1nwU5.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/framework-authoring-BvxZnsPY.mjs"],"sourcesContent":["import { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { isColumnDefaultLiteralInputValue, isExecutionMutationDefaultValue } from \"@internal/contract/types\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/shared/framework-authoring.ts\nconst AUTHORING_WARNING_BATCH_THRESHOLD = 5;\n/**\n* Emits collected authoring warnings once per build, grouped by `code`:\n* a group at or below the threshold itemizes every `message`; above it,\n* one summary — `\"<count> <summary>\"` followed by the `item` lines — so\n* a build with many hits of one kind does not wall-of-text, and warnings\n* of different codes never batch into each other's summary.\n*/\nfunction flushAuthoringWarnings(warnings) {\n\tconst groups = /* @__PURE__ */ new Map();\n\tfor (const warning of warnings) {\n\t\tconst key = `${warning.code}\\u0000${warning.summary}`;\n\t\tconst group = groups.get(key) ?? [];\n\t\tgroup.push(warning);\n\t\tgroups.set(key, group);\n\t}\n\tfor (const group of groups.values()) {\n\t\tconst first = group[0];\n\t\tif (first === void 0) continue;\n\t\tif (group.length <= AUTHORING_WARNING_BATCH_THRESHOLD) {\n\t\t\tfor (const warning of group) process.emitWarning(warning.message, { code: warning.code });\n\t\t\tcontinue;\n\t\t}\n\t\tprocess.emitWarning(`${group.length} ${first.summary}\\n${group.map((w) => ` - ${w.item}`).join(\"\\n\")}`, { code: first.code });\n\t}\n}\n/**\n* Classifies an `enum` block's members (before codec decoding, which needs\n* the codec chosen first) into which default codec an omitted `@@type`\n* should resolve to:\n*\n* - every member is `bare`, or a `value` whose raw JSON is a string → `'text'`\n* - every member is a `value` whose raw JSON is an integer → `'int'`\n* - anything else (float, bigint, boolean, mixed, or a `ref`/`option`/`list`\n* parameter) → `null`, meaning the caller must require an explicit `@@type`.\n*/\nfunction classifyEnumMemberType(block) {\n\tlet sawText = false;\n\tlet sawInt = false;\n\tfor (const paramValue of Object.values(block.parameters)) {\n\t\tif (paramValue.kind === \"bare\") {\n\t\t\tsawText = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (paramValue.kind !== \"value\") return null;\n\t\tlet jsonValue;\n\t\ttry {\n\t\t\tjsonValue = JSON.parse(paramValue.raw);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t\tif (typeof jsonValue === \"string\") sawText = true;\n\t\telse if (typeof jsonValue === \"number\" && Number.isInteger(jsonValue)) sawInt = true;\n\t\telse return null;\n\t}\n\tif (sawText && sawInt) return null;\n\tif (sawText) return \"text\";\n\tif (sawInt) return \"int\";\n\treturn null;\n}\n/**\n* Resolves the codec id for an `enum` block. When `@@type` is absent, the codec\n* is inferred from the members via {@link classifyEnumMemberType}; otherwise the\n* explicit `@@type(\"codec\")` argument is parsed. Pushes the appropriate\n* diagnostic and returns `undefined` when neither yields a codec. `codecSpan` is\n* the span downstream codec-validation diagnostics should anchor to. Shared by\n* every family's enum factory so inference and the explicit path stay identical.\n*/\nfunction resolveEnumCodecId(block, ctx) {\n\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\tconst typeAttr = block.attributes[\"type\"];\n\tif (typeAttr === void 0) {\n\t\tconst inferredKind = classifyEnumMemberType(block);\n\t\tif (inferredKind === null || ctx.enumInferenceCodecs === void 0) {\n\t\t\tctx.diagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_CANNOT_INFER_TYPE\",\n\t\t\t\tmessage: `cannot infer @@type for enum \"${block.name}\"; add an explicit @@type(...)`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.span\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\treturn {\n\t\t\tcodecId: ctx.enumInferenceCodecs[inferredKind],\n\t\t\tcodecSpan: block.span\n\t\t};\n\t}\n\tconst codecId = typeAttr.args[\"codecId\"];\n\tinvariant(typeof codecId === \"string\", \"@@type on an enum block parses one string argument\");\n\treturn {\n\t\tcodecId,\n\t\tcodecSpan: typeAttr.span\n\t};\n}\nfunction isAuthoringArgRef(value) {\n\tif (typeof value !== \"object\" || value === null || value.kind !== \"arg\") return false;\n\tconst { index, path } = value;\n\tif (typeof index !== \"number\" || !Number.isInteger(index) || index < 0) return false;\n\tif (path !== void 0 && (!Array.isArray(path) || path.some((s) => typeof s !== \"string\"))) return false;\n\treturn true;\n}\nfunction isAuthoringSelectRef(value) {\n\tif (!isAuthoringTemplateRecord(value) || value[\"kind\"] !== \"select\") return false;\n\tconst index = value[\"index\"];\n\tconst path = value[\"path\"];\n\tconst cases = value[\"cases\"];\n\tif (typeof index !== \"number\" || !Number.isInteger(index) || index < 0) return false;\n\tif (path !== void 0 && (!Array.isArray(path) || path.some((s) => typeof s !== \"string\"))) return false;\n\treturn typeof cases === \"object\" && cases !== null && !Array.isArray(cases);\n}\nfunction isAuthoringTemplateRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction readTemplateArgumentValue(args, index, path) {\n\tlet value = args[index];\n\tfor (const segment of path ?? []) {\n\t\tif (!isAuthoringTemplateRecord(value) || !Object.hasOwn(value, segment)) return;\n\t\tvalue = value[segment];\n\t}\n\treturn value;\n}\nfunction isAuthoringTypeConstructorDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"typeConstructor\";\n}\nfunction isAuthoringFieldPresetDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"fieldPreset\";\n}\nfunction isAuthoringEntityTypeDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"entity\";\n}\nfunction isAuthoringPslBlockDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"pslBlock\";\n}\nfunction isAuthoringModelAttributeDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"modelAttribute\";\n}\n/**\n* Returns true when `namespace` is a non-leaf key in `contributions.field`.\n*\n* `AuthoringFieldNamespace` permits a leaf descriptor at any depth — including\n* the root — so a top-level `field: { Foo: { kind: 'fieldPreset', ... } }`\n* registration must NOT be treated as a \"namespace\" with sub-paths. Callers\n* use this predicate to gate dot-namespaced lookups (e.g. PSL `@Foo.bar`).\n*/\nfunction hasRegisteredFieldNamespace(contributions, namespace) {\n\tif (contributions?.field === void 0 || !Object.hasOwn(contributions.field, namespace)) return false;\n\tconst value = contributions.field[namespace];\n\treturn value !== void 0 && !isAuthoringFieldPresetDescriptor(value);\n}\nfunction isCopyableNamespaceObject(value) {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n\tconst proto = Object.getPrototypeOf(value);\n\treturn proto === Object.prototype || proto === null;\n}\n/**\n* Deep structural check run only at the composition boundary (the merge and\n* collect walkers) to classify a raw namespace-tree node as a leaf descriptor.\n* A node counts as a leaf iff its `kind` matches `descriptorKind` AND it\n* carries that kind's required fields.\n*\n* This is boundary validation over `unknown`, NOT a type-predicate: the four\n* exported `isAuthoring*Descriptor` predicates deliberately narrow on `kind`\n* alone and trust the static types. The walkers, by contrast, also receive\n* type-bypassing packs (`as unknown as never` in tests, untyped JS at runtime)\n* whose descriptor-shaped-but-incomplete nodes must be rejected rather than\n* silently treated as sub-namespaces — so the well-formedness check lives here.\n*/\nfunction isWellFormedDescriptor(value, descriptorKind) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (!(\"kind\" in value) || value.kind !== descriptorKind) return false;\n\tswitch (descriptorKind) {\n\t\tcase \"typeConstructor\":\n\t\tcase \"fieldPreset\": {\n\t\t\tif (!(\"output\" in value)) return false;\n\t\t\tconst output = value.output;\n\t\t\treturn typeof output === \"object\" && output !== null;\n\t\t}\n\t\tcase \"entity\": {\n\t\t\tif (!(\"discriminator\" in value) || typeof value.discriminator !== \"string\") return false;\n\t\t\tif (value.discriminator.length === 0) return false;\n\t\t\tif (!(\"output\" in value)) return false;\n\t\t\tconst output = value.output;\n\t\t\tif (typeof output !== \"object\" || output === null) return false;\n\t\t\tconst factory = \"factory\" in output ? output.factory : void 0;\n\t\t\tconst template = \"template\" in output ? output.template : void 0;\n\t\t\treturn typeof factory === \"function\" || template !== void 0;\n\t\t}\n\t\tcase \"pslBlock\": {\n\t\t\tif (!(\"keyword\" in value) || typeof value.keyword !== \"string\" || value.keyword.length === 0) return false;\n\t\t\tif (!(\"discriminator\" in value) || typeof value.discriminator !== \"string\" || value.discriminator.length === 0) return false;\n\t\t\tif (!(\"name\" in value)) return false;\n\t\t\tconst name = value.name;\n\t\t\tif (typeof name !== \"object\" || name === null) return false;\n\t\t\tif (!(\"required\" in name) || typeof name.required !== \"boolean\") return false;\n\t\t\tif (!(\"parameters\" in value)) return false;\n\t\t\tconst parameters = value.parameters;\n\t\t\tif (typeof parameters !== \"object\" || parameters === null || Array.isArray(parameters)) return false;\n\t\t\tif (!(\"attributes\" in value) || value.attributes === void 0) return true;\n\t\t\tconst attributes = value.attributes;\n\t\t\tif (typeof attributes !== \"object\" || attributes === null || Array.isArray(attributes)) return false;\n\t\t\treturn Object.values(attributes).every((factory) => typeof factory === \"function\");\n\t\t}\n\t\tcase \"modelAttribute\":\n\t\t\tif (!(\"attribute\" in value) || typeof value.attribute !== \"string\" || value.attribute.length === 0) return false;\n\t\t\tif (!(\"spec\" in value)) return false;\n\t\t\treturn \"lower\" in value && typeof value.lower === \"function\";\n\t\tdefault: return false;\n\t}\n}\nfunction deepCopyNamespace(source, descriptorKind) {\n\tconst copy = {};\n\tfor (const [key, value] of Object.entries(source)) copy[key] = isCopyableNamespaceObject(value) && !isWellFormedDescriptor(value, descriptorKind) ? deepCopyNamespace(value, descriptorKind) : value;\n\treturn copy;\n}\n/**\n* Merges `source` into `target` recursively at the descriptor-namespace\n* level. `descriptorKind` is the `kind` value ('typeConstructor',\n* 'fieldPreset', 'entity', or 'pslBlock') that identifies a descriptor\n* (terminal merge point; same-path registrations across components are\n* reported as duplicates) as opposed to a sub-namespace (recursion target).\n*\n* Path segments are validated against prototype-pollution names\n* (`__proto__`, `constructor`, `prototype`). A value that is neither a\n* recognized leaf nor a plain object — e.g. a malformed descriptor\n* where the canonical leaf guard rejected it for missing `output` —\n* is reported as an invalid contribution rather than recursed into,\n* which would either silently mangle state or infinite-loop on\n* primitive properties.\n*\n* Within-registry duplicate detection is this walker's job;\n* cross-registry detection runs separately via\n* `assertNoCrossRegistryCollisions` after merging completes.\n*/\nfunction mergeAuthoringNamespaces(target, source, path, descriptorKind, label) {\n\tconst assertSafePath = (currentPath) => {\n\t\tconst blockedSegment = currentPath.find((segment) => segment === \"__proto__\" || segment === \"constructor\" || segment === \"prototype\");\n\t\tif (blockedSegment) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Invalid authoring ${label} helper \"${currentPath.join(\".\")}\". Helper path segments must not use \"${blockedSegment}\".`);\n\t};\n\tfor (const [key, sourceValue] of Object.entries(source)) {\n\t\tconst currentPath = [...path, key];\n\t\tassertSafePath(currentPath);\n\t\tconst hasExistingValue = Object.hasOwn(target, key);\n\t\tconst existingValue = hasExistingValue ? target[key] : void 0;\n\t\tif (!hasExistingValue) {\n\t\t\ttarget[key] = isCopyableNamespaceObject(sourceValue) && !isWellFormedDescriptor(sourceValue, descriptorKind) ? deepCopyNamespace(sourceValue, descriptorKind) : sourceValue;\n\t\t\tcontinue;\n\t\t}\n\t\tconst existingIsLeaf = isWellFormedDescriptor(existingValue, descriptorKind);\n\t\tconst sourceIsLeaf = isWellFormedDescriptor(sourceValue, descriptorKind);\n\t\tif (existingIsLeaf || sourceIsLeaf) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Duplicate authoring ${label} helper \"${currentPath.join(\".\")}\". Helper names must be unique across composed packs.`);\n\t\tif (!isCopyableNamespaceObject(existingValue) || !isCopyableNamespaceObject(sourceValue)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Invalid authoring ${label} helper \"${currentPath.join(\".\")}\". Expected a sub-namespace object or a recognized descriptor; received a malformed value.`);\n\t\tmergeAuthoringNamespaces(existingValue, sourceValue, currentPath, descriptorKind, label);\n\t}\n}\nconst ATTRIBUTE_SPEC_LEVELS = [\"model\", \"field\"];\nfunction mergeAuthoringAttributeSpecs(target, source, contributedBy, owners) {\n\tconst invalidContribution = (detail) => runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Invalid authoring attributeSpecs contribution from descriptor \"${contributedBy}\". ${detail}`);\n\tif (!isCopyableNamespaceObject(source)) throw invalidContribution(\"Expected a record carrying a \\\"model\\\" and a \\\"field\\\" level.\");\n\tfor (const level of ATTRIBUTE_SPEC_LEVELS) {\n\t\tconst contributed = source[level];\n\t\tif (!isCopyableNamespaceObject(contributed)) throw invalidContribution(`The \"${level}\" level must be a record of spec factories keyed by attribute name.`);\n\t\tfor (const [attribute, factory] of Object.entries(contributed)) {\n\t\t\tconst entryPath = `${level}.${attribute}`;\n\t\t\tconst invalidEntry = (detail) => runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Invalid authoring attributeSpecs entry \"${entryPath}\" contributed by descriptor \"${contributedBy}\". ${detail}`);\n\t\t\tif (attribute === \"__proto__\" || attribute === \"constructor\" || attribute === \"prototype\") throw invalidEntry(`Attribute names must not use \"${attribute}\".`);\n\t\t\tif (typeof factory !== \"function\") throw invalidEntry(\"Each entry must be a spec factory function.\");\n\t\t\tconst existingOwner = owners.get(entryPath);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Duplicate authoring attributeSpecs entry \"${entryPath}\". Descriptor \"${contributedBy}\" conflicts with \"${existingOwner}\". Each attribute name may be claimed once per level.`);\n\t\t\towners.set(entryPath, contributedBy);\n\t\t\ttarget[level][attribute] = factory;\n\t\t}\n\t}\n}\n/**\n* Collects the full dotted paths of every well-formed descriptor of\n* `descriptorKind` in a raw contribution tree, using the same boundary\n* classification as {@link mergeAuthoringNamespaces}. Lets assembly-level\n* callers attribute each contributed path to its contributing component\n* before merging, so a same-path collision can be reported naming both\n* contributors.\n*/\nfunction collectContributedDescriptorPaths(namespace, descriptorKind, path = []) {\n\tconst paths = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isWellFormedDescriptor(value, descriptorKind)) {\n\t\t\tpaths.push(currentPath.join(\".\"));\n\t\t\tcontinue;\n\t\t}\n\t\tif (isCopyableNamespaceObject(value)) paths.push(...collectContributedDescriptorPaths(value, descriptorKind, currentPath));\n\t}\n\treturn paths;\n}\n/**\n* Derives the scalar view of an assembled authoring type namespace: every\n* **top-level** type constructor that is instantiable with an empty argument\n* list — all declared args optional and no entity-ref argument. A bare type\n* name `T` in a schema is semantically the zero-arg instantiation `T()`, so\n* each entry is exactly what that call produces (defaulted template values\n* applied, absent optional-arg typeParams keys omitted). Constructors\n* registered under a namespace segment, constructors with required args, and\n* entity-ref constructors are not scalars and are excluded.\n*\n* Eligibility needs no template inspection: templates that cannot resolve\n* for their legal call shapes are rejected at the composition boundary by\n* {@link assertResolvableTypeConstructorTemplates}, so the zero-arg\n* instantiation below cannot fail for an eligible constructor.\n*/\nfunction collectScalarTypeConstructors(namespace) {\n\tconst result = /* @__PURE__ */ new Map();\n\tfor (const [name, value] of Object.entries(namespace)) {\n\t\tif (!isAuthoringTypeConstructorDescriptor(value)) continue;\n\t\tif (value.entityRefArg !== void 0) continue;\n\t\tif (value.args?.some((arg) => arg.optional !== true)) continue;\n\t\tresult.set(name, instantiateAuthoringTypeConstructor(value, []));\n\t}\n\treturn result;\n}\nfunction visitTemplateArgRefs(template, visit) {\n\tif (template === void 0) return;\n\tif (isAuthoringArgRef(template)) {\n\t\tvisit(template);\n\t\tvisitTemplateArgRefs(template.default, visit);\n\t\treturn;\n\t}\n\tif (Array.isArray(template)) {\n\t\tfor (const value of template) visitTemplateArgRefs(value, visit);\n\t\treturn;\n\t}\n\tif (typeof template === \"object\" && template !== null) for (const value of Object.values(template)) visitTemplateArgRefs(value, visit);\n}\n/**\n* Boundary validation for a contributed authoring type namespace, called\n* per contributing component at assembly (which supplies `contributedBy`\n* for attribution). Rejects what the types cannot express — entity-ref\n* constructors are skipped (their output derives from the referenced\n* entity): a plain constructor must declare its output storage type name,\n* and every `typeParams` arg-ref (including refs inside arg-ref defaults)\n* must point at a declared argument index.\n*/\nfunction assertResolvableTypeConstructorTemplates(namespace, contributedBy, path = []) {\n\tfor (const [name, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, name];\n\t\tif (!isAuthoringTypeConstructorDescriptor(value)) {\n\t\t\tassertResolvableTypeConstructorTemplates(value, contributedBy, currentPath);\n\t\t\tcontinue;\n\t\t}\n\t\tif (value.entityRefArg !== void 0) continue;\n\t\tconst args = value.args ?? [];\n\t\tconst invalid = (detail) => /* @__PURE__ */ new Error(`Invalid authoring type constructor \"${currentPath.join(\".\")}\" contributed by descriptor \"${contributedBy}\". ${detail}`);\n\t\tif (value.output.nativeType === void 0) throw invalid(\"The output declares no storage type template and no entityRefArg; a plain constructor must declare one.\");\n\t\tfor (const [key, template] of Object.entries(value.output.typeParams ?? {})) visitTemplateArgRefs(template, (ref) => {\n\t\t\tif (args[ref.index] === void 0) throw invalid(`output.typeParams.${key} references argument ${ref.index}, but the constructor declares ${args.length} argument(s). Declare the argument or correct the reference index.`);\n\t\t});\n\t}\n}\nfunction collectDescriptorPaths(namespace, isLeaf, path = []) {\n\tconst paths = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isLeaf(value)) {\n\t\t\tpaths.push(currentPath.join(\".\"));\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) paths.push(...collectDescriptorPaths(value, isLeaf, currentPath));\n\t}\n\treturn paths;\n}\nfunction collectDescriptorEntries(namespace, isLeaf, descriptorKind, label, path = []) {\n\tconst entries = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isLeaf(value)) {\n\t\t\tif (!isWellFormedDescriptor(value, descriptorKind)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring ${label} contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/keyword/discriminator) but does not satisfy the ${label} descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tif (value.discriminator.length > 0) entries.push({\n\t\t\t\tpath: currentPath.join(\".\"),\n\t\t\t\tdiscriminator: value.discriminator\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) {\n\t\t\tconst record = blindCast(value);\n\t\t\tif ((record[\"kind\"] !== void 0 || record[\"keyword\"] !== void 0 || record[\"discriminator\"] !== void 0) && !isLeaf(value)) {\n\t\t\t\tconst hasKind = record[\"kind\"] === \"pslBlock\";\n\t\t\t\tconst hasKeyword = typeof record[\"keyword\"] === \"string\";\n\t\t\t\tconst hasDiscriminator = typeof record[\"discriminator\"] === \"string\";\n\t\t\t\tif (hasKind || hasKeyword && hasDiscriminator) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring ${label} contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/keyword/discriminator) but does not satisfy the ${label} descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\t}\n\t\t\tentries.push(...collectDescriptorEntries(value, isLeaf, descriptorKind, label, currentPath));\n\t\t}\n\t}\n\treturn entries;\n}\n/**\n* Throws when two or more entries in the same namespace share a key. A\n* duplicate key makes dispatch ambiguous — the caller's lookup dispatches by\n* this key, so one entry would silently shadow the other. Catch duplicates\n* before building any dispatch map.\n*\n* `label` (e.g. `'pslBlock'`, `'entityType'`) names which namespace the\n* duplicate was found in and is carried in the structured error metadata;\n* the key itself is always called `key` in both the message and the\n* metadata, since what it semantically represents (a discriminator for\n* `entityType`, the parser's dispatch keyword for `pslBlock`) is the\n* caller's concern, not this function's.\n*/\nfunction assertUniqueDiscriminators(entries, label) {\n\tconst seen = /* @__PURE__ */ new Map();\n\tfor (const { path, discriminator: key } of entries) {\n\t\tconst existing = seen.get(key);\n\t\tif (existing !== void 0) throw runtimeError(\"RUNTIME.DUPLICATE_AUTHORING_DISCRIMINATOR\", `Duplicate ${label} key \"${key}\" registered at both \"${existing}\" and \"${path}\". Each ${label} contribution must use a unique key.`, {\n\t\t\tlabel,\n\t\t\tkey,\n\t\t\texistingPath: existing,\n\t\t\tpath\n\t\t});\n\t\tseen.set(key, path);\n\t}\n}\nfunction collectPslBlockDescriptorEntries(namespace, path = []) {\n\tconst entries = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isAuthoringPslBlockDescriptor(value)) {\n\t\t\tif (!isWellFormedDescriptor(value, \"pslBlock\")) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring pslBlock contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/keyword/discriminator) but does not satisfy the pslBlock descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tentries.push({\n\t\t\t\tpath: currentPath.join(\".\"),\n\t\t\t\tdiscriminator: value.discriminator,\n\t\t\t\tkeyword: value.keyword\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) {\n\t\t\tconst record = blindCast(value);\n\t\t\tconst hasKind = record[\"kind\"] === \"pslBlock\";\n\t\t\tconst hasKeyword = typeof record[\"keyword\"] === \"string\";\n\t\t\tconst hasDiscriminator = typeof record[\"discriminator\"] === \"string\";\n\t\t\tif (hasKind || hasKeyword && hasDiscriminator) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring pslBlock contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/keyword/discriminator) but does not satisfy the pslBlock descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tentries.push(...collectPslBlockDescriptorEntries(value, currentPath));\n\t\t}\n\t}\n\treturn entries;\n}\n/**\n* Every `pslBlockDescriptors` entry requires a matching `entityTypes` factory\n* with the same discriminator. An `entityTypes` factory may stand alone (e.g.\n* `enum`, reachable from the TypeScript builder without any PSL block).\n*\n* Uniqueness for pslBlock entries is keyed on **keyword**, not discriminator:\n* several keywords (e.g. `policy_select`/`policy_insert`) may legitimately\n* share one discriminator, routing to the same `entityTypes` factory and the\n* same `entries[discriminator]` slot — that N:1 shape is exactly what lets\n* one entity kind be authored through several PSL keywords. What must stay\n* unique is the keyword itself, since that's what the parser dispatches on.\n*/\nfunction assertPslBlocksHaveFactories(entityTypeNamespace, pslBlockNamespace) {\n\tconst blockEntries = collectPslBlockDescriptorEntries(pslBlockNamespace);\n\tconst entityEntries = collectDescriptorEntries(entityTypeNamespace, isAuthoringEntityTypeDescriptor, \"entity\", \"entityType\");\n\tassertUniqueDiscriminators(blockEntries.map((entry) => ({\n\t\tpath: entry.path,\n\t\tdiscriminator: entry.keyword\n\t})), \"pslBlock\");\n\tassertUniqueDiscriminators(entityEntries, \"entityType\");\n\tconst entityDiscriminators = new Set(entityEntries.map((entry) => entry.discriminator));\n\tfor (const block of blockEntries) if (!entityDiscriminators.has(block.discriminator)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Incomplete extension contribution: pslBlock helper \"${block.path}\" registers discriminator \"${block.discriminator}\" but no entityType contribution shares that discriminator. An extension-contributed PSL block requires a matching entityType factory so the parsed AST node can lower to an IR class instance; add an entityType helper with discriminator \"${block.discriminator}\".`);\n}\nfunction collectModelAttributeEntries(namespace, path = []) {\n\tconst entries = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isAuthoringModelAttributeDescriptor(value)) {\n\t\t\tif (!isWellFormedDescriptor(value, \"modelAttribute\")) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring modelAttribute contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/attribute) but does not satisfy the modelAttribute descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tentries.push({\n\t\t\t\tpath: currentPath.join(\".\"),\n\t\t\t\tdiscriminator: value.attribute\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) {\n\t\t\tconst record = blindCast(value);\n\t\t\tif (typeof record[\"attribute\"] === \"string\" && \"spec\" in record) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring modelAttribute contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/attribute) but does not satisfy the modelAttribute descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tentries.push(...collectModelAttributeEntries(value, currentPath));\n\t\t}\n\t}\n\treturn entries;\n}\n/**\n* Throws when two modelAttribute contributions — at any paths, even\n* different ones — claim the same bare `@@` attribute name. The family\n* interpreter dispatches by attribute name, not by registration path, so\n* two descriptors claiming the same name would have one silently shadow\n* the other.\n*/\nfunction assertUniqueModelAttributeNames(entries) {\n\tconst seen = /* @__PURE__ */ new Map();\n\tfor (const { path, discriminator: attribute } of entries) {\n\t\tconst existing = seen.get(attribute);\n\t\tif (existing !== void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Duplicate modelAttribute \"${attribute}\" registered at both \"${existing}\" and \"${path}\". Each modelAttribute contribution must claim a unique attribute name.`);\n\t\tseen.set(attribute, path);\n\t}\n}\nfunction assertNoCrossRegistryCollisions(typeNamespace, fieldNamespace, entityTypeNamespace = {}, pslBlockNamespace = {}, modelAttributeNamespace = {}) {\n\tconst typePaths = new Set(collectDescriptorPaths(typeNamespace, isAuthoringTypeConstructorDescriptor));\n\tconst fieldPaths = new Set(collectDescriptorPaths(fieldNamespace, isAuthoringFieldPresetDescriptor));\n\tconst entityPaths = new Set(collectDescriptorPaths(entityTypeNamespace, isAuthoringEntityTypeDescriptor));\n\tconst ambiguityHint = \"Register each path in only one of authoringContributions.field / authoringContributions.type / authoringContributions.entityTypes.\";\n\tfor (const fieldPath of fieldPaths) if (typePaths.has(fieldPath)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Ambiguous authoring registry path \"${fieldPath}\". The same path is registered as both a type constructor and a field preset; PSL resolution would be ambiguous. ${ambiguityHint}`);\n\tfor (const entityPath of entityPaths) if (typePaths.has(entityPath) || fieldPaths.has(entityPath)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Ambiguous authoring registry path \"${entityPath}\". The same path is registered as an entity contribution AND as a type constructor or field preset; PSL resolution would be ambiguous. ${ambiguityHint}`);\n\tassertPslBlocksHaveFactories(entityTypeNamespace, pslBlockNamespace);\n\tassertUniqueModelAttributeNames(collectModelAttributeEntries(modelAttributeNamespace));\n\tassertSelectTemplatesMatchOptionArgs(typeNamespace, fieldNamespace, entityTypeNamespace);\n}\nfunction collectDescriptorNodes(namespace, isLeaf, path = []) {\n\tconst nodes = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isLeaf(value)) {\n\t\t\tnodes.push([currentPath.join(\".\"), value]);\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) nodes.push(...collectDescriptorNodes(value, isLeaf, currentPath));\n\t}\n\treturn nodes;\n}\nfunction collectSelectRefs(value, found) {\n\tif (typeof value !== \"object\" || value === null) return;\n\tif (isAuthoringSelectRef(value)) {\n\t\tfound.push(value);\n\t\tfor (const caseTemplate of Object.values(value.cases)) collectSelectRefs(caseTemplate, found);\n\t\treturn;\n\t}\n\tif (isAuthoringArgRef(value)) {\n\t\tcollectSelectRefs(value.default, found);\n\t\treturn;\n\t}\n\tif (Array.isArray(value)) {\n\t\tfor (const entry of value) collectSelectRefs(entry, found);\n\t\treturn;\n\t}\n\tfor (const entry of Object.values(value)) collectSelectRefs(entry, found);\n}\nfunction validateSelectRefsAgainstArgs(label, helperPath, args, templateRoot) {\n\tconst selects = [];\n\tcollectSelectRefs(templateRoot, selects);\n\tfor (const select of selects) {\n\t\tconst position = `#${select.index + 1}`;\n\t\tlet descriptor = args?.[select.index];\n\t\tif (descriptor === void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" select template references argument ${position}, but the helper declares no argument at that position.`);\n\t\tfor (const segment of select.path ?? []) {\n\t\t\tdescriptor = descriptor.kind === \"object\" ? descriptor.properties[segment] : void 0;\n\t\t\tif (descriptor === void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" select template references argument ${position} at path \"${(select.path ?? []).join(\".\")}\", which does not resolve to a declared argument property.`);\n\t\t}\n\t\tif (descriptor.kind !== \"option\") throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" select template references argument ${position}, which is kind \"${descriptor.kind}\"; select requires an option argument.`);\n\t\tconst argumentLabel = descriptor.name !== void 0 ? `\"${descriptor.name}\"` : position;\n\t\tconst missing = descriptor.values.filter((value) => !Object.hasOwn(select.cases, value));\n\t\tif (missing.length > 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" option argument ${argumentLabel} allows [${descriptor.values.join(\", \")}] but the select template has no case for: ${missing.join(\", \")}.`);\n\t\tconst values = descriptor.values;\n\t\tconst unreachable = Object.keys(select.cases).filter((key) => !values.includes(key));\n\t\tif (unreachable.length > 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" select template has case(s) not allowed by option argument ${argumentLabel}: ${unreachable.join(\", \")}. Allowed values: [${values.join(\", \")}].`);\n\t}\n}\n/**\n* Every `select` template node must target an option argument whose `values`\n* exactly cover the node's `cases` — a legal token with no case and a case no\n* token can reach are both declaration bugs, caught here at pack-registration\n* time rather than at first resolution.\n*/\nfunction assertSelectTemplatesMatchOptionArgs(typeNamespace, fieldNamespace, entityTypeNamespace) {\n\tfor (const [helperPath, descriptor] of collectDescriptorNodes(fieldNamespace, isAuthoringFieldPresetDescriptor)) validateSelectRefsAgainstArgs(\"field\", helperPath, descriptor.args, descriptor.output);\n\tfor (const [helperPath, descriptor] of collectDescriptorNodes(typeNamespace, isAuthoringTypeConstructorDescriptor)) validateSelectRefsAgainstArgs(\"type\", helperPath, descriptor.args, descriptor.output);\n\tfor (const [helperPath, descriptor] of collectDescriptorNodes(entityTypeNamespace, isAuthoringEntityTypeDescriptor)) if (\"template\" in descriptor.output) validateSelectRefsAgainstArgs(\"entityType\", helperPath, descriptor.args, descriptor.output.template);\n}\nfunction resolveAuthoringTemplateValue(template, args) {\n\tif (template === void 0) return;\n\tif (isAuthoringArgRef(template)) {\n\t\tconst value = readTemplateArgumentValue(args, template.index, template.path);\n\t\tif (value === void 0 && template.default !== void 0) return resolveAuthoringTemplateValue(template.default, args);\n\t\treturn value;\n\t}\n\tif (isAuthoringSelectRef(template)) {\n\t\tconst value = readTemplateArgumentValue(args, template.index, template.path);\n\t\tif (value === void 0) return;\n\t\tif (typeof value !== \"string\" || !Object.hasOwn(template.cases, value)) throw new InternalError(`Authoring template select has no case for value \"${String(value)}\"`);\n\t\treturn resolveAuthoringTemplateValue(template.cases[value], args);\n\t}\n\tif (Array.isArray(template)) return template.map((value) => resolveAuthoringTemplateValue(value, args));\n\tif (typeof template === \"object\" && template !== null) {\n\t\tconst resolved = {};\n\t\tfor (const [key, value] of Object.entries(template)) {\n\t\t\tconst resolvedValue = resolveAuthoringTemplateValue(value, args);\n\t\t\tif (resolvedValue !== void 0) resolved[key] = resolvedValue;\n\t\t}\n\t\treturn resolved;\n\t}\n\treturn template;\n}\nfunction validateAuthoringArgument(descriptor, value, path) {\n\tif (value === void 0) {\n\t\tif (descriptor.optional) return;\n\t\tthrow runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Missing required authoring helper argument at ${path}`);\n\t}\n\tif (descriptor.kind === \"string\") {\n\t\tif (typeof value !== \"string\") throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be a string`);\n\t\treturn;\n\t}\n\tif (descriptor.kind === \"boolean\") {\n\t\tif (typeof value !== \"boolean\") throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be a boolean`);\n\t\treturn;\n\t}\n\tif (descriptor.kind === \"stringArray\") {\n\t\tif (!Array.isArray(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be an array of strings`);\n\t\tfor (const entry of value) if (typeof entry !== \"string\") throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be an array of strings`);\n\t\treturn;\n\t}\n\tif (descriptor.kind === \"object\") {\n\t\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be an object`);\n\t\tconst input = value;\n\t\tconst expectedKeys = new Set(Object.keys(descriptor.properties));\n\t\tfor (const key of Object.keys(input)) if (!expectedKeys.has(key)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} contains unknown property \"${key}\"`);\n\t\tfor (const [key, propertyDescriptor] of Object.entries(descriptor.properties)) validateAuthoringArgument(propertyDescriptor, input[key], `${path}.${key}`);\n\t\treturn;\n\t}\n\tif (descriptor.kind === \"option\") {\n\t\tif (typeof value !== \"string\" || !descriptor.values.includes(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be one of: ${descriptor.values.join(\", \")}`);\n\t\treturn;\n\t}\n\tif (typeof value !== \"number\" || Number.isNaN(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be a number`);\n\tif (descriptor.integer && !Number.isInteger(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be an integer`);\n\tif (descriptor.minimum !== void 0 && value < descriptor.minimum) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be >= ${descriptor.minimum}, received ${value}`);\n\tif (descriptor.maximum !== void 0 && value > descriptor.maximum) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `Authoring helper argument at ${path} must be <= ${descriptor.maximum}, received ${value}`);\n}\nfunction validateAuthoringHelperArguments(helperPath, descriptors, args) {\n\tconst expected = descriptors ?? [];\n\tconst minimumArgs = expected.reduce((count, descriptor, index) => descriptor.optional ? count : index + 1, 0);\n\tif (args.length < minimumArgs || args.length > expected.length) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${helperPath} expects ${minimumArgs === expected.length ? expected.length : `${minimumArgs}-${expected.length}`} argument(s), received ${args.length}`);\n\texpected.forEach((descriptor, index) => {\n\t\tvalidateAuthoringArgument(descriptor, args[index], `${helperPath}[${index}]`);\n\t});\n}\nfunction resolveAuthoringStorageTypeTemplate(template, args) {\n\tconst nativeType = template.nativeType;\n\tif (nativeType === void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring output template for codec \"${template.codecId}\" declares no nativeType; only entity-ref constructors may omit it`);\n\tconst typeParams = template.typeParams === void 0 ? void 0 : resolveAuthoringTemplateValue(template.typeParams, args);\n\tif (typeParams !== void 0 && !isAuthoringTemplateRecord(typeParams)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Resolved authoring typeParams must be an object for codec \"${template.codecId}\", received ${String(typeParams)}`);\n\tconst normalizedTypeParams = typeParams !== void 0 && Object.keys(typeParams).length === 0 ? void 0 : typeParams;\n\treturn {\n\t\tcodecId: template.codecId,\n\t\tnativeType,\n\t\t...ifDefined(\"typeParams\", normalizedTypeParams)\n\t};\n}\nfunction resolveAuthoringColumnDefaultTemplate(template, args) {\n\tif (template.kind === \"literal\") {\n\t\tconst value = resolveAuthoringTemplateValue(template.value, args);\n\t\tif (value === void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", \"Resolved authoring literal default must not be undefined\");\n\t\tif (!isColumnDefaultLiteralInputValue(value)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Resolved authoring literal default must be a JSON-serializable value or Date, received ${String(value)}`);\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue\n\t\t};\n\t}\n\tconst expression = resolveAuthoringTemplateValue(template.expression, args);\n\tif (expression === void 0 || typeof expression === \"object\" && expression !== null) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Resolved authoring function default expression must resolve to a primitive, received ${String(expression)}`);\n\treturn {\n\t\tkind: \"function\",\n\t\texpression: String(expression)\n\t};\n}\nfunction resolveExecutionMutationDefaultPhase(phase, template, args) {\n\tconst value = resolveAuthoringTemplateValue(template, args);\n\tif (value === void 0) return;\n\tif (!isExecutionMutationDefaultValue(value)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring preset executionDefaults.${phase} did not resolve to a valid generator descriptor (kind: 'generator', id: string).`);\n\treturn value;\n}\nfunction resolveAuthoringExecutionDefaultsTemplate(template, args) {\n\tconst phases = {\n\t\t...ifDefined(\"onCreate\", template.onCreate !== void 0 ? resolveExecutionMutationDefaultPhase(\"onCreate\", template.onCreate, args) : void 0),\n\t\t...ifDefined(\"onUpdate\", template.onUpdate !== void 0 ? resolveExecutionMutationDefaultPhase(\"onUpdate\", template.onUpdate, args) : void 0)\n\t};\n\treturn Object.keys(phases).length === 0 ? void 0 : phases;\n}\nfunction instantiateAuthoringTypeConstructor(descriptor, args) {\n\treturn resolveAuthoringStorageTypeTemplate(descriptor.output, args);\n}\nfunction instantiateAuthoringEntityType(helperPath, descriptor, args, ctx) {\n\tif (\"factory\" in descriptor.output) {\n\t\tconst input = args[0];\n\t\treturn blindCast(descriptor.output.factory)(input, ctx);\n\t}\n\tvalidateAuthoringHelperArguments(helperPath, descriptor.args, args);\n\treturn blindCast(resolveAuthoringTemplateValue(descriptor.output.template, args));\n}\nfunction instantiateAuthoringFieldPreset(descriptor, args) {\n\treturn {\n\t\tdescriptor: resolveAuthoringStorageTypeTemplate(descriptor.output, args),\n\t\tnullable: descriptor.output.nullable ?? false,\n\t\t...ifDefined(\"default\", descriptor.output.default !== void 0 ? resolveAuthoringColumnDefaultTemplate(descriptor.output.default, args) : void 0),\n\t\t...ifDefined(\"executionDefaults\", descriptor.output.executionDefaults !== void 0 ? resolveAuthoringExecutionDefaultsTemplate(descriptor.output.executionDefaults, args) : void 0),\n\t\tid: descriptor.output.id ?? false,\n\t\tunique: descriptor.output.unique ?? false\n\t};\n}\n//#endregion\nexport { mergeAuthoringAttributeSpecs as _, collectScalarTypeConstructors as a, resolveEnumCodecId as b, instantiateAuthoringEntityType as c, isAuthoringArgRef as d, isAuthoringEntityTypeDescriptor as f, isAuthoringTypeConstructorDescriptor as g, isAuthoringPslBlockDescriptor as h, collectContributedDescriptorPaths as i, instantiateAuthoringFieldPreset as l, isAuthoringModelAttributeDescriptor as m, assertResolvableTypeConstructorTemplates as n, flushAuthoringWarnings as o, isAuthoringFieldPresetDescriptor as p, classifyEnumMemberType as r, hasRegisteredFieldNamespace as s, assertNoCrossRegistryCollisions as t, instantiateAuthoringTypeConstructor as u, mergeAuthoringNamespaces as v, validateAuthoringHelperArguments as x, resolveAuthoringTemplateValue as y };\n\n//# sourceMappingURL=framework-authoring-BvxZnsPY.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,oCAAoC;;;;;;;;AAQ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AU,YAAY,SAAS,aAAa,KAAK,IAAI,qCAAqC,YAAY,SAAS,UAAU,IAAI,IAAI,KAAK,CAAC;CAC3I;CACA,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,WAAW,IAAI,KAAK,IAAI;AACpD;AACA,SAAS,oCAAoC,YAAY,MAAM;CAC9D,OAAO,oCAAoC,WAAW,QAAQ,IAAI;AACnE;AACA,SAAS,+BAA+B,YAAY,YAAY,MAAM,KAAK;CAC1E,IAAI,aAAa,WAAW,QAAQ;EACnC,MAAM,QAAQ,KAAK;EACnB,OAAO,UAAU,WAAW,OAAO,OAAO,CAAC,CAAC,OAAO,GAAG;CACvD;CACA,iCAAiC,YAAY,WAAW,MAAM,IAAI;CAClE,OAAO,UAAU,8BAA8B,WAAW,OAAO,UAAU,IAAI,CAAC;AACjF;AACA,SAAS,gCAAgC,YAAY,MAAM;CAC1D,OAAO;EACN,YAAY,oCAAoC,WAAW,QAAQ,IAAI;EACvE,UAAU,WAAW,OAAO,YAAY;EACxC,GAAG,UAAU,WAAW,WAAW,OAAO,YAAY,KAAK,IAAI,sCAAsC,WAAW,OAAO,SAAS,IAAI,IAAI,KAAK,CAAC;EAC9I,GAAG,UAAU,qBAAqB,WAAW,OAAO,sBAAsB,KAAK,IAAI,0CAA0C,WAAW,OAAO,mBAAmB,IAAI,IAAI,KAAK,CAAC;EAChL,IAAI,WAAW,OAAO,MAAM;EAC5B,QAAQ,WAAW,OAAO,UAAU;CACrC;AACD"}
@@ -1,5 +1,5 @@
1
1
  import { K as ProfileHashBase, M as ExecutionHashBase, Q as StorageHashBase } from "./domain-envelope-CENjHN4U-BIIt9bl4.mjs";
2
- import { i as StorageSort, n as PreserveEmptyPredicate } from "./canonicalization-uZb7Sjk2-Dx6ifIWL.mjs";
2
+ import { i as StorageSort, n as PreserveEmptyPredicate } from "./canonicalization-BAvRuZ2i-IwsqxGme.mjs";
3
3
  //#region ../../../1-framework/0-foundation/contract/dist/hashing.d.mts
4
4
  //#region src/hashing.d.ts
5
5
  type ComputeStorageHashArgs = {
@@ -22,4 +22,4 @@ declare function computeProfileHash(args: {
22
22
  }): ProfileHashBase<string>;
23
23
  //#endregion
24
24
  export { computeProfileHash as n, computeStorageHash as r, computeExecutionHash as t };
25
- //# sourceMappingURL=hashing-D9wV2IJu.d.mts.map
25
+ //# sourceMappingURL=hashing-BTx0s6Zw.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hashing-D9wV2IJu.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/hashing.d.mts"],"mappings":";;;;KAGK;EACH;EACA;EACA,SAAS;WACA,sBAAsB;WACtB,cAAc;;iBAER,mBAAmB,MAAM,yBAAyB;iBAClD,qBAAqB;EACpC;EACA;EACA,WAAW;IACT;iBACa,mBAAmB;EAClC;EACA;EACA,cAAc,eAAe;IAC3B"}
1
+ {"version":3,"file":"hashing-BTx0s6Zw.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/hashing.d.mts"],"mappings":";;;;KAGK;EACH;EACA;EACA,SAAS;WACA,sBAAsB;WACtB,cAAc;;iBAER,mBAAmB,MAAM,yBAAyB;iBAClD,qBAAqB;EACpC;EACA;EACA,WAAW;IACT;iBACa,mBAAmB;EAClC;EACA;EACA,cAAc,eAAe;IAC3B"}
@@ -1,4 +1,4 @@
1
- import { i as StorageSort, n as PreserveEmptyPredicate } from "./canonicalization-uZb7Sjk2-Dx6ifIWL.mjs";
1
+ import { i as StorageSort, n as PreserveEmptyPredicate } from "./canonicalization-BAvRuZ2i-IwsqxGme.mjs";
2
2
  //#region ../../../1-framework/0-foundation/contract/dist/hashing-utils.d.mts
3
3
  //#region src/canonicalization-path-match.d.ts
4
4
  type PathSegment = string | '*' | readonly string[];
@@ -16,4 +16,4 @@ declare function compareByNameProperty(a: unknown, b: unknown): number;
16
16
  declare function createStorageSort(targets: readonly NamedArraySortTarget[], compare?: (a: unknown, b: unknown) => number): StorageSort;
17
17
  //#endregion
18
18
  export { compareByNameProperty as a, matchesPathPattern as c, PathSegment$1 as i, PathPattern as n, createPreserveEmptyPredicate as o, PathSegment as r, createStorageSort as s, NamedArraySortTarget as t };
19
- //# sourceMappingURL=hashing-utils-Bp0ZYY57.d.mts.map
19
+ //# sourceMappingURL=hashing-utils-Bh9PVd4J.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hashing-utils-Bp0ZYY57.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/hashing-utils.d.mts"],"mappings":";;;KAEK;KACA,uBAAuB;iBACX,mBAAmB,yBAAyB,SAAS;iBACrD,6BAA6B,mBAAmB,gBAAgB;;;KAG5E;UACK;WACC,eAAe;WACf;;iBAEM,sBAAsB,YAAY;iBAClC,kBAAkB,kBAAkB,wBAAwB,WAAW,YAAY,wBAAwB"}
1
+ {"version":3,"file":"hashing-utils-Bh9PVd4J.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/hashing-utils.d.mts"],"mappings":";;;KAEK;KACA,uBAAuB;iBACX,mBAAmB,yBAAyB,SAAS;iBACrD,6BAA6B,mBAAmB,gBAAgB;;;KAG5E;UACK;WACC,eAAe;WACf;;iBAEM,sBAAsB,YAAY;iBAClC,kBAAkB,kBAAkB,wBAAwB,WAAW,YAAY,wBAAwB"}
@@ -1,4 +1,4 @@
1
- import { t as InternalError } from "./internal-error-BIc-ehme-ouBQPoEL.mjs";
1
+ import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
2
2
  import { cuid2 } from "uniku/cuid2";
3
3
  import { ksuid } from "uniku/ksuid";
4
4
  import { nanoid } from "uniku/nanoid";
@@ -1,7 +1,7 @@
1
1
  //#region ../../../1-framework/0-foundation/utils/dist/internal-error.d.mts
2
2
  //#region src/internal-error.d.ts
3
3
  /**
4
- * A bug in Prisma Next, not a user error. Never catch this except at the
4
+ * A bug in Prisma 8, not a user error. Never catch this except at the
5
5
  * outermost boundary for crash reporting — an InternalError means an invariant
6
6
  * broke and the process cannot reliably continue. User-facing failures use
7
7
  * `structuredError` with a dotted code instead.
@@ -16,4 +16,4 @@ declare function isInternalError(e: unknown): e is InternalError;
16
16
  declare function assertNever(value: never, message?: string): never;
17
17
  //#endregion
18
18
  export { assertNever as n, isInternalError as r, InternalError as t };
19
- //# sourceMappingURL=internal-error-kK8QvlDE.d.mts.map
19
+ //# sourceMappingURL=internal-error-2fJ9fcZX.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal-error-kK8QvlDE.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/internal-error.d.mts"],"mappings":";;;;;;;;cAOc,sBAAsB;WACzB;EACT,YAAY,iBAAiB;aAClB;;;iBAGI,gBAAgB,aAAa,KAAK;iBAClC,YAAY,cAAc"}
1
+ {"version":3,"file":"internal-error-2fJ9fcZX.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/internal-error.d.mts"],"mappings":";;;;;;;;cAOc,sBAAsB;WACzB;EACT,YAAY,iBAAiB;aAClB;;;iBAGI,gBAAgB,aAAa,KAAK;iBAClC,YAAY,cAAc"}
@@ -1,6 +1,6 @@
1
- //#region ../../../1-framework/0-foundation/utils/dist/internal-error-BIc-ehme.mjs
1
+ //#region ../../../1-framework/0-foundation/utils/dist/internal-error-ChGYPVpq.mjs
2
2
  /**
3
- * A bug in Prisma Next, not a user error. Never catch this except at the
3
+ * A bug in Prisma 8, not a user error. Never catch this except at the
4
4
  * outermost boundary for crash reporting — an InternalError means an invariant
5
5
  * broke and the process cannot reliably continue. User-facing failures use
6
6
  * `structuredError` with a dotted code instead.
@@ -21,4 +21,4 @@ function assertNever(value, message) {
21
21
  //#endregion
22
22
  export { assertNever as n, isInternalError as r, InternalError as t };
23
23
 
24
- //# sourceMappingURL=internal-error-BIc-ehme-ouBQPoEL.mjs.map
24
+ //# sourceMappingURL=internal-error-ChGYPVpq-DhUD05u0.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-error-ChGYPVpq-DhUD05u0.mjs","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/internal-error-ChGYPVpq.mjs"],"sourcesContent":["//#region src/internal-error.ts\n/**\n* A bug in Prisma 8, not a user error. Never catch this except at the\n* outermost boundary for crash reporting — an InternalError means an invariant\n* broke and the process cannot reliably continue. User-facing failures use\n* `structuredError` with a dotted code instead.\n*/\nvar InternalError = class extends Error {\n\tisPrismaInternalError = true;\n\tconstructor(message, options) {\n\t\tsuper(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"InternalError\";\n\t}\n};\nfunction isInternalError(e) {\n\treturn typeof e === \"object\" && e !== null && \"isPrismaInternalError\" in e && e.isPrismaInternalError === true;\n}\nfunction assertNever(value, message) {\n\tthrow new InternalError(message ?? `Unreachable: unexpected value ${String(value)}`);\n}\n//#endregion\nexport { assertNever as n, isInternalError as r, InternalError as t };\n\n//# sourceMappingURL=internal-error-ChGYPVpq.mjs.map"],"mappings":";;;;;;;AAOA,IAAI,gBAAgB,cAAc,MAAM;CACvC,wBAAwB;CACxB,YAAY,SAAS,SAAS;EAC7B,MAAM,SAAS,SAAS,UAAU,KAAK,IAAI,EAAE,OAAO,QAAQ,MAAM,IAAI,KAAK,CAAC;EAC5E,KAAK,OAAO;CACb;AACD;AACA,SAAS,gBAAgB,GAAG;CAC3B,OAAO,OAAO,MAAM,YAAY,MAAM,QAAQ,2BAA2B,KAAK,EAAE,0BAA0B;AAC3G;AACA,SAAS,YAAY,OAAO,SAAS;CACpC,MAAM,IAAI,cAAc,WAAW,iCAAiC,OAAO,KAAK,GAAG;AACpF"}
@@ -1,6 +1,6 @@
1
1
  import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
2
2
  import { t as isPlainRecord } from "./is-plain-record-CUofyVQ7-DWEzdhIx.mjs";
3
- import { t as InternalError } from "./internal-error-BIc-ehme-ouBQPoEL.mjs";
3
+ import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
4
4
  import { n as runtimeError } from "./runtime-error-BA9d7XjZ-BlT8t6LB.mjs";
5
5
  //#region ../../../1-framework/1-core/framework-components/dist/ir.mjs
6
6
  var IRNodeBase = class {};
@@ -197,4 +197,4 @@ function entityAt(storage, coord) {
197
197
  //#endregion
198
198
  export { buildSingleNamespaceView as a, elementCoordinates as c, hydrateNamespaceEntities as d, promoteBuiltinKinds as f, buildNamespacedEntities as i, entityAt as l, NamespaceBase as n, coordinateKey as o, UNBOUND_NAMESPACE_ID as r, domainElementCoordinates as s, IRNodeBase as t, freezeNode as u };
199
199
 
200
- //# sourceMappingURL=ir-ChmSSAhX.mjs.map
200
+ //# sourceMappingURL=ir-CV5d1FJ0.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ir-ChmSSAhX.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/ir.mjs"],"sourcesContent":["import { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { isPlainRecord } from \"@internal/contract/is-plain-record\";\n//#region src/ir/ir-node.ts\nvar IRNodeBase = class {};\n/**\n* Seal an IR class instance after its constructor has assigned all\n* fields. The free-helper form (rather than a `protected freeze()`\n* instance method) keeps the class type structurally narrow so emitted\n* contract literal types remain assignable to their class types.\n*\n* The helper name stays `freezeNode` — it operates on IR nodes\n* regardless of root naming.\n*/\nfunction freezeNode(node) {\n\tObject.freeze(node);\n\treturn node;\n}\n//#endregion\n//#region src/ir/namespace.ts\n/**\n* Reserved sentinel namespace id for the late-bound storage slot —\n* the slot whose binding the target resolves at connection time\n* rather than at authoring time. Postgres uses it for `search_path`\n* late binding; SQLite uses it for the trivial singleton; Mongo uses\n* it for the connection's `db` binding.\n*\n* Materialised target-side as a singleton subclass of the target's\n* `NamespaceBase` concretion that overrides the namespace's\n* qualifier-emission methods to elide the prefix entirely. Call sites\n* stay polymorphic and never branch on `id === UNBOUND_NAMESPACE_ID`\n* — the singleton's overrides drop the qualifier so emitted SQL / Mongo\n* commands look unqualified.\n*\n* The double-underscore decoration marks the id as a framework-reserved\n* coordinate when it appears in a JSON envelope (cold-read-as-reserved\n* — no realistic collision with user-declared namespace names).\n*\n* Encoded as an exported const (rather than scattered string literals)\n* so the sentinel-id invariant is single-sourced: any production-source\n* site that constructs an unbound-namespace singleton imports this\n* constant.\n*/\nconst UNBOUND_NAMESPACE_ID = \"__unbound__\";\nvar NamespaceBase = class extends IRNodeBase {\n\t/**\n\t* Answers \"am I the unbound namespace\" as node behavior, so consumers\n\t* never compare ids against the sentinel. This getter is the single\n\t* encapsulated place the {@link UNBOUND_NAMESPACE_ID} comparison lives.\n\t*/\n\tget isUnbound() {\n\t\treturn this.id === UNBOUND_NAMESPACE_ID;\n\t}\n};\n//#endregion\n//#region src/ir/contract-view.ts\n/**\n* Projects one namespace's `entries` into the view shape: each built-in kind\n* becomes a top-level slot (materialized empty if absent), and the remaining\n* pack-contributed kinds sit under `.entries`. Shared by the single-namespace\n* builder and the namespace-map builder.\n*/\nfunction promoteBuiltinKinds(entries, builtinKinds) {\n\tconst view = {};\n\tconst rest = {};\n\tfor (const [kind, kindMap] of Object.entries(entries)) if (builtinKinds.includes(kind)) view[kind] = kindMap;\n\telse rest[kind] = kindMap;\n\tfor (const kind of builtinKinds) if (!(kind in view)) view[kind] = {};\n\tview[\"entries\"] = rest;\n\treturn blindCast(view);\n}\n/**\n* Builds one namespace's entity view: promotes the given built-in kind slots to\n* top-level for the default (`UNBOUND_NAMESPACE_ID`) namespace. Single-namespace\n* targets (Mongo, SQLite) use this to unwrap their sole namespace to the root.\n*\n* Throws if the contract has no default (`UNBOUND_NAMESPACE_ID`) namespace.\n*/\nfunction buildSingleNamespaceView(storage, builtinKinds) {\n\tconst defaultNs = storage.namespaces[UNBOUND_NAMESPACE_ID];\n\tif (defaultNs === void 0) throw new InternalError(`ContractView: contract has no default namespace (${UNBOUND_NAMESPACE_ID})`);\n\treturn promoteBuiltinKinds(blindCast(defaultNs.entries), builtinKinds);\n}\n/**\n* Builds the namespace-keyed entity-view map (`{ <nsId>: SingleNamespaceView }`)\n* for every namespace in the storage, keyed by raw namespace id. Mirrors\n* `buildNamespacedEnums(domain)` — the storage-side twin.\n*/\nfunction buildNamespacedEntities(storage, builtinKinds) {\n\tconst out = {};\n\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) out[nsId] = promoteBuiltinKinds(blindCast(ns.entries), builtinKinds);\n\treturn blindCast(out);\n}\n//#endregion\n//#region src/ir/domain.ts\n/**\n* Lazy walk over every named domain entity in a {@link ApplicationDomain},\n* yielded as {@link EntityCoordinate} tuples with `plane: 'domain'`.\n*\n* Same structural rules as {@link elementCoordinates} over storage: skip\n* scalar `id`; each other object-valued property is an entity-kind slot.\n*/\nfunction* domainElementCoordinates(domain) {\n\tfor (const [namespaceId, ns] of Object.entries(domain.namespaces)) for (const [entityKind, slot] of Object.entries(ns)) {\n\t\tif (entityKind === \"id\") continue;\n\t\tif (slot === null || typeof slot !== \"object\") continue;\n\t\tfor (const entityName of Object.keys(slot)) yield {\n\t\t\tplane: \"domain\",\n\t\t\tnamespaceId,\n\t\t\tentityKind,\n\t\t\tentityName\n\t\t};\n\t}\n}\n//#endregion\n//#region src/ir/entity-kind.ts\n/**\n* Hydrates a namespace's entities from raw JSON maps into IR class instances.\n*\n* For each kind in `entries`: if the descriptor map has a descriptor,\n* construct each inner-map value; otherwise freeze-and-carry (`'carry'`)\n* or throw naming the kind and nsId (`'fail'`).\n*\n* The single boundary cast hands `value` to `descriptor.construct` as its\n* `Input`. The value satisfies the kind's `Input` either by the\n* entries-input contract at authoring time or by prior `validateStorage`\n* validation at hydration time.\n*/\nfunction hydrateNamespaceEntities(entries, kinds, onUnknown, nsId) {\n\tconst result = {};\n\tfor (const [kind, rawMap] of Object.entries(entries)) {\n\t\tconst descriptor = kinds.get(kind);\n\t\tif (descriptor !== void 0) {\n\t\t\tconst built = {};\n\t\t\tfor (const [name, value] of Object.entries(rawMap)) built[name] = descriptor.construct(blindCast(value));\n\t\t\tresult[kind] = Object.freeze(built);\n\t\t} else if (onUnknown === \"carry\") result[kind] = Object.freeze(rawMap);\n\t\telse throw runtimeError(\"CONTRACT.ENTITY_KIND_UNKNOWN\", `Unknown entries key \"${kind}\" in namespace \"${nsId ?? \"?\"}\"; no hydration factory registered for this entity kind`);\n\t}\n\treturn result;\n}\n//#endregion\n//#region src/ir/storage.ts\n/**\n* Lazy walk over every named storage entity in a `Storage`-shaped\n* value, yielded as {@link EntityCoordinate} tuples with\n* `plane: 'storage'` (the parameter type binds the plane).\n*\n* Iterates each namespace's `entries` kind maps structurally. Skips\n* non-object `entries`; `id` and `kind` are not walked (`kind` is\n* non-enumerable on concretions). For every entity-kind key under\n* `entries` whose value is a non-null object, yields one coordinate per\n* entity name in that map. No family-specific kind vocabulary is required.\n*/\nfunction* elementCoordinates(storage) {\n\tfor (const [namespaceId, ns] of Object.entries(storage.namespaces)) {\n\t\tconst entries = ns.entries;\n\t\tif (entries === null || typeof entries !== \"object\") continue;\n\t\tfor (const [entityKind, kindMap] of Object.entries(entries)) {\n\t\t\tif (kindMap === null || typeof kindMap !== \"object\") continue;\n\t\t\tfor (const entityName of Object.keys(kindMap)) yield {\n\t\t\t\tplane: \"storage\",\n\t\t\t\tnamespaceId,\n\t\t\t\tentityKind,\n\t\t\t\tentityName\n\t\t\t};\n\t\t}\n\t}\n}\n/**\n* Canonical, collision-safe key for an {@link EntityCoordinate}. Encodes each\n* axis individually with `JSON.stringify` before joining with `-`, so no\n* namespace id, entity kind, or entity name can forge a collision by\n* embedding the delimiter itself (e.g. a delimiter of `:` would let\n* `('a', 'b:c', 'd')` collide with `('a:b', 'c', 'd')`) — each component is\n* quoted, and any `-` or `\"` inside it is escaped or safely inside those\n* quotes.\n*\n* The single shared key every coordinate-driven ownership/omission/collision\n* check should use — `contract infer`'s pack-described-element omission and\n* the migration tools' cross-space disjointness check both key on this.\n*/\nfunction coordinateKey(coordinate) {\n\treturn [\n\t\tcoordinate.namespaceId,\n\t\tcoordinate.entityKind,\n\t\tcoordinate.entityName\n\t].map((value) => JSON.stringify(value)).join(\"-\");\n}\n/**\n* Looks up a single entity in a `Storage`-shaped value by its full coordinate.\n* Returns `undefined` if the namespace, entity kind, or entity name is absent.\n* The type parameter is a caller assertion — the walk itself is structural\n* and cannot verify the entity's shape.\n*/\nfunction entityAt(storage, coord) {\n\tconst ns = storage.namespaces[coord.namespaceId];\n\tif (ns === void 0) return void 0;\n\tconst entries = ns.entries;\n\tif (!isPlainRecord(entries)) return void 0;\n\tconst kindMap = entries[coord.entityKind];\n\tif (!isPlainRecord(kindMap)) return void 0;\n\tif (!Object.hasOwn(kindMap, coord.entityName)) return void 0;\n\treturn blindCast(kindMap[coord.entityName]);\n}\n//#endregion\nexport { IRNodeBase, NamespaceBase, UNBOUND_NAMESPACE_ID, buildNamespacedEntities, buildSingleNamespaceView, coordinateKey, domainElementCoordinates, elementCoordinates, entityAt, freezeNode, hydrateNamespaceEntities, isPlainRecord, promoteBuiltinKinds };\n\n//# sourceMappingURL=ir.mjs.map"],"mappings":";;;;;AAKA,IAAI,aAAa,MAAM,CAAC;;;;;;;;;;AAUxB,SAAS,WAAW,MAAM;CACzB,OAAO,OAAO,IAAI;CAClB,OAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,uBAAuB;AAC7B,IAAI,gBAAgB,cAAc,WAAW;;;;;;CAM5C,IAAI,YAAY;EACf,OAAO,KAAK,OAAO;CACpB;AACD;;;;;;;AASA,SAAS,oBAAoB,SAAS,cAAc;CACnD,MAAM,OAAO,CAAC;CACd,MAAM,OAAO,CAAC;CACd,KAAK,MAAM,CAAC,MAAM,YAAY,OAAO,QAAQ,OAAO,GAAG,IAAI,aAAa,SAAS,IAAI,GAAG,KAAK,QAAQ;MAChG,KAAK,QAAQ;CAClB,KAAK,MAAM,QAAQ,cAAc,IAAI,EAAE,QAAQ,OAAO,KAAK,QAAQ,CAAC;CACpE,KAAK,aAAa;CAClB,OAAO,UAA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BAAkB,QAAQ,IAAI,wDAAwD;CAC5K;CACA,OAAO;AACR;;;;;;;;;;;;AAcA,UAAU,mBAAmB,SAAS;CACrC,KAAK,MAAM,CAAC,aAAa,OAAO,OAAO,QAAQ,QAAQ,UAAU,GAAG;EACnE,MAAM,UAAU,GAAG;EACnB,IAAI,YAAY,QAAQ,OAAO,YAAY,UAAU;EACrD,KAAK,MAAM,CAAC,YAAY,YAAY,OAAO,QAAQ,OAAO,GAAG;GAC5D,IAAI,YAAY,QAAQ,OAAO,YAAY,UAAU;GACrD,KAAK,MAAM,cAAc,OAAO,KAAK,OAAO,GAAG,MAAM;IACpD,OAAO;IACP;IACA;IACA;GACD;EACD;CACD;AACD;;;;;;;;;;;;;;AAcA,SAAS,cAAc,YAAY;CAClC,OAAO;EACN,WAAW;EACX,WAAW;EACX,WAAW;CACZ,CAAC,CAAC,KAAK,UAAU,KAAK,UAAU,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG;AACjD;;;;;;;AAOA,SAAS,SAAS,SAAS,OAAO;CACjC,MAAM,KAAK,QAAQ,WAAW,MAAM;CACpC,IAAI,OAAO,KAAK,GAAG,OAAO,KAAK;CAC/B,MAAM,UAAU,GAAG;CACnB,IAAI,CAAC,cAAc,OAAO,GAAG,OAAO,KAAK;CACzC,MAAM,UAAU,QAAQ,MAAM;CAC9B,IAAI,CAAC,cAAc,OAAO,GAAG,OAAO,KAAK;CACzC,IAAI,CAAC,OAAO,OAAO,SAAS,MAAM,UAAU,GAAG,OAAO,KAAK;CAC3D,OAAO,UAAU,QAAQ,MAAM,WAAW;AAC3C"}
1
+ {"version":3,"file":"ir-CV5d1FJ0.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/ir.mjs"],"sourcesContent":["import { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { isPlainRecord } from \"@internal/contract/is-plain-record\";\n//#region src/ir/ir-node.ts\nvar IRNodeBase = class {};\n/**\n* Seal an IR class instance after its constructor has assigned all\n* fields. The free-helper form (rather than a `protected freeze()`\n* instance method) keeps the class type structurally narrow so emitted\n* contract literal types remain assignable to their class types.\n*\n* The helper name stays `freezeNode` — it operates on IR nodes\n* regardless of root naming.\n*/\nfunction freezeNode(node) {\n\tObject.freeze(node);\n\treturn node;\n}\n//#endregion\n//#region src/ir/namespace.ts\n/**\n* Reserved sentinel namespace id for the late-bound storage slot —\n* the slot whose binding the target resolves at connection time\n* rather than at authoring time. Postgres uses it for `search_path`\n* late binding; SQLite uses it for the trivial singleton; Mongo uses\n* it for the connection's `db` binding.\n*\n* Materialised target-side as a singleton subclass of the target's\n* `NamespaceBase` concretion that overrides the namespace's\n* qualifier-emission methods to elide the prefix entirely. Call sites\n* stay polymorphic and never branch on `id === UNBOUND_NAMESPACE_ID`\n* — the singleton's overrides drop the qualifier so emitted SQL / Mongo\n* commands look unqualified.\n*\n* The double-underscore decoration marks the id as a framework-reserved\n* coordinate when it appears in a JSON envelope (cold-read-as-reserved\n* — no realistic collision with user-declared namespace names).\n*\n* Encoded as an exported const (rather than scattered string literals)\n* so the sentinel-id invariant is single-sourced: any production-source\n* site that constructs an unbound-namespace singleton imports this\n* constant.\n*/\nconst UNBOUND_NAMESPACE_ID = \"__unbound__\";\nvar NamespaceBase = class extends IRNodeBase {\n\t/**\n\t* Answers \"am I the unbound namespace\" as node behavior, so consumers\n\t* never compare ids against the sentinel. This getter is the single\n\t* encapsulated place the {@link UNBOUND_NAMESPACE_ID} comparison lives.\n\t*/\n\tget isUnbound() {\n\t\treturn this.id === UNBOUND_NAMESPACE_ID;\n\t}\n};\n//#endregion\n//#region src/ir/contract-view.ts\n/**\n* Projects one namespace's `entries` into the view shape: each built-in kind\n* becomes a top-level slot (materialized empty if absent), and the remaining\n* pack-contributed kinds sit under `.entries`. Shared by the single-namespace\n* builder and the namespace-map builder.\n*/\nfunction promoteBuiltinKinds(entries, builtinKinds) {\n\tconst view = {};\n\tconst rest = {};\n\tfor (const [kind, kindMap] of Object.entries(entries)) if (builtinKinds.includes(kind)) view[kind] = kindMap;\n\telse rest[kind] = kindMap;\n\tfor (const kind of builtinKinds) if (!(kind in view)) view[kind] = {};\n\tview[\"entries\"] = rest;\n\treturn blindCast(view);\n}\n/**\n* Builds one namespace's entity view: promotes the given built-in kind slots to\n* top-level for the default (`UNBOUND_NAMESPACE_ID`) namespace. Single-namespace\n* targets (Mongo, SQLite) use this to unwrap their sole namespace to the root.\n*\n* Throws if the contract has no default (`UNBOUND_NAMESPACE_ID`) namespace.\n*/\nfunction buildSingleNamespaceView(storage, builtinKinds) {\n\tconst defaultNs = storage.namespaces[UNBOUND_NAMESPACE_ID];\n\tif (defaultNs === void 0) throw new InternalError(`ContractView: contract has no default namespace (${UNBOUND_NAMESPACE_ID})`);\n\treturn promoteBuiltinKinds(blindCast(defaultNs.entries), builtinKinds);\n}\n/**\n* Builds the namespace-keyed entity-view map (`{ <nsId>: SingleNamespaceView }`)\n* for every namespace in the storage, keyed by raw namespace id. Mirrors\n* `buildNamespacedEnums(domain)` — the storage-side twin.\n*/\nfunction buildNamespacedEntities(storage, builtinKinds) {\n\tconst out = {};\n\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) out[nsId] = promoteBuiltinKinds(blindCast(ns.entries), builtinKinds);\n\treturn blindCast(out);\n}\n//#endregion\n//#region src/ir/domain.ts\n/**\n* Lazy walk over every named domain entity in a {@link ApplicationDomain},\n* yielded as {@link EntityCoordinate} tuples with `plane: 'domain'`.\n*\n* Same structural rules as {@link elementCoordinates} over storage: skip\n* scalar `id`; each other object-valued property is an entity-kind slot.\n*/\nfunction* domainElementCoordinates(domain) {\n\tfor (const [namespaceId, ns] of Object.entries(domain.namespaces)) for (const [entityKind, slot] of Object.entries(ns)) {\n\t\tif (entityKind === \"id\") continue;\n\t\tif (slot === null || typeof slot !== \"object\") continue;\n\t\tfor (const entityName of Object.keys(slot)) yield {\n\t\t\tplane: \"domain\",\n\t\t\tnamespaceId,\n\t\t\tentityKind,\n\t\t\tentityName\n\t\t};\n\t}\n}\n//#endregion\n//#region src/ir/entity-kind.ts\n/**\n* Hydrates a namespace's entities from raw JSON maps into IR class instances.\n*\n* For each kind in `entries`: if the descriptor map has a descriptor,\n* construct each inner-map value; otherwise freeze-and-carry (`'carry'`)\n* or throw naming the kind and nsId (`'fail'`).\n*\n* The single boundary cast hands `value` to `descriptor.construct` as its\n* `Input`. The value satisfies the kind's `Input` either by the\n* entries-input contract at authoring time or by prior `validateStorage`\n* validation at hydration time.\n*/\nfunction hydrateNamespaceEntities(entries, kinds, onUnknown, nsId) {\n\tconst result = {};\n\tfor (const [kind, rawMap] of Object.entries(entries)) {\n\t\tconst descriptor = kinds.get(kind);\n\t\tif (descriptor !== void 0) {\n\t\t\tconst built = {};\n\t\t\tfor (const [name, value] of Object.entries(rawMap)) built[name] = descriptor.construct(blindCast(value));\n\t\t\tresult[kind] = Object.freeze(built);\n\t\t} else if (onUnknown === \"carry\") result[kind] = Object.freeze(rawMap);\n\t\telse throw runtimeError(\"CONTRACT.ENTITY_KIND_UNKNOWN\", `Unknown entries key \"${kind}\" in namespace \"${nsId ?? \"?\"}\"; no hydration factory registered for this entity kind`);\n\t}\n\treturn result;\n}\n//#endregion\n//#region src/ir/storage.ts\n/**\n* Lazy walk over every named storage entity in a `Storage`-shaped\n* value, yielded as {@link EntityCoordinate} tuples with\n* `plane: 'storage'` (the parameter type binds the plane).\n*\n* Iterates each namespace's `entries` kind maps structurally. Skips\n* non-object `entries`; `id` and `kind` are not walked (`kind` is\n* non-enumerable on concretions). For every entity-kind key under\n* `entries` whose value is a non-null object, yields one coordinate per\n* entity name in that map. No family-specific kind vocabulary is required.\n*/\nfunction* elementCoordinates(storage) {\n\tfor (const [namespaceId, ns] of Object.entries(storage.namespaces)) {\n\t\tconst entries = ns.entries;\n\t\tif (entries === null || typeof entries !== \"object\") continue;\n\t\tfor (const [entityKind, kindMap] of Object.entries(entries)) {\n\t\t\tif (kindMap === null || typeof kindMap !== \"object\") continue;\n\t\t\tfor (const entityName of Object.keys(kindMap)) yield {\n\t\t\t\tplane: \"storage\",\n\t\t\t\tnamespaceId,\n\t\t\t\tentityKind,\n\t\t\t\tentityName\n\t\t\t};\n\t\t}\n\t}\n}\n/**\n* Canonical, collision-safe key for an {@link EntityCoordinate}. Encodes each\n* axis individually with `JSON.stringify` before joining with `-`, so no\n* namespace id, entity kind, or entity name can forge a collision by\n* embedding the delimiter itself (e.g. a delimiter of `:` would let\n* `('a', 'b:c', 'd')` collide with `('a:b', 'c', 'd')`) — each component is\n* quoted, and any `-` or `\"` inside it is escaped or safely inside those\n* quotes.\n*\n* The single shared key every coordinate-driven ownership/omission/collision\n* check should use — `contract infer`'s pack-described-element omission and\n* the migration tools' cross-space disjointness check both key on this.\n*/\nfunction coordinateKey(coordinate) {\n\treturn [\n\t\tcoordinate.namespaceId,\n\t\tcoordinate.entityKind,\n\t\tcoordinate.entityName\n\t].map((value) => JSON.stringify(value)).join(\"-\");\n}\n/**\n* Looks up a single entity in a `Storage`-shaped value by its full coordinate.\n* Returns `undefined` if the namespace, entity kind, or entity name is absent.\n* The type parameter is a caller assertion — the walk itself is structural\n* and cannot verify the entity's shape.\n*/\nfunction entityAt(storage, coord) {\n\tconst ns = storage.namespaces[coord.namespaceId];\n\tif (ns === void 0) return void 0;\n\tconst entries = ns.entries;\n\tif (!isPlainRecord(entries)) return void 0;\n\tconst kindMap = entries[coord.entityKind];\n\tif (!isPlainRecord(kindMap)) return void 0;\n\tif (!Object.hasOwn(kindMap, coord.entityName)) return void 0;\n\treturn blindCast(kindMap[coord.entityName]);\n}\n//#endregion\nexport { IRNodeBase, NamespaceBase, UNBOUND_NAMESPACE_ID, buildNamespacedEntities, buildSingleNamespaceView, coordinateKey, domainElementCoordinates, elementCoordinates, entityAt, freezeNode, hydrateNamespaceEntities, isPlainRecord, promoteBuiltinKinds };\n\n//# sourceMappingURL=ir.mjs.map"],"mappings":";;;;;A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AW,MAAM;CACpC,IAAI,OAAO,KAAK,GAAG,OAAO,KAAK;CAC/B,MAAM,UAAU,GAAG;CACnB,IAAI,CAAC,cAAc,OAAO,GAAG,OAAO,KAAK;CACzC,MAAM,UAAU,QAAQ,MAAM;CAC9B,IAAI,CAAC,cAAc,OAAO,GAAG,OAAO,KAAK;CACzC,IAAI,CAAC,OAAO,OAAO,SAAS,MAAM,UAAU,GAAG,OAAO,KAAK;CAC3D,OAAO,UAAU,QAAQ,MAAM,WAAW;AAC3C"}
@@ -1,4 +1,4 @@
1
- import { t as InternalError } from "./internal-error-BIc-ehme-ouBQPoEL.mjs";
1
+ import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
2
2
  import { n as UNSPECIFIED_PSL_NAMESPACE_ID } from "./psl-ast-DUCvVXbB.mjs";
3
3
  import { k as createSyntaxTree, o as DocumentAst } from "./declarations-DR6To8_k-BFwkCGeP.mjs";
4
4
  import { n as isTerminatedStringLiteral, t as Tokenizer } from "./tokenizer-1hAHZzmp-QGPORvmA.mjs";
@@ -618,4 +618,4 @@ function parseKeyValue(cursor) {
618
618
  //#endregion
619
619
  export { parse as a, greenToken as i, SourceFile as n, greenNode as r, GreenNodeBuilder as t };
620
620
 
621
- //# sourceMappingURL=parse-GbZGfMUj-BFSrD2AN.mjs.map
621
+ //# sourceMappingURL=parse-GbZGfMUj-C9tHGn-6.mjs.map