@prisma/orm-framework 8.0.0-rc.24-dev.6 → 8.0.0-rc.24-dev.7

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.
@@ -1,8 +1,8 @@
1
1
  import { o as structuredError } from "./structured-error-BXbihKQ-.mjs";
2
2
  import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
3
- import { f as SyntaxNode } from "./expressions-CMQzbnHk-DUoL8DKO.mjs";
4
- import { a as FieldDeclarationAst, c as MixinDeclarationAst, d as ModelDeclarationAst, f as NamedTypeDeclarationAst, h as TypesBlockAst, l as MixinInclusionAst, n as CompositeTypeDeclarationAst, o as GenericBlockDeclarationAst, p as NamespaceDeclarationAst, s as KeyValuePairAst, u as ModelAttributeAst } from "./declarations-BgUAq1RG-1LikMIfo.mjs";
5
- import { o as parse } from "./parse-bZgfjovA-Duxv-s-s.mjs";
3
+ import { f as SyntaxNode } from "./expressions-BlhT51Ib-CQCMuQD8.mjs";
4
+ import { a as FieldDeclarationAst, c as MixinDeclarationAst, d as ModelDeclarationAst, f as NamedTypeDeclarationAst, h as TypesBlockAst, l as MixinInclusionAst, n as CompositeTypeDeclarationAst, o as GenericBlockDeclarationAst, p as NamespaceDeclarationAst, s as KeyValuePairAst, u as ModelAttributeAst } from "./declarations-8CRDqUTt-B0YG2lqY.mjs";
5
+ import { o as parse } from "./parse-D-B_nrfC-FsqZwLif.mjs";
6
6
  //#region ../../../1-framework/2-authoring/psl-parser/dist/format.mjs
7
7
  function emitDocument(document, indentUnit, newline) {
8
8
  const writer = new LineWriter(indentUnit, newline);
@@ -1 +1 @@
1
- {"version":3,"file":"psl-parser__format.mjs","names":["#indentUnit","#newline","#depth","#lastWasBlank","#lineOpen","#prevKind","#out","#line","#hasContent"],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/format.mjs"],"sourcesContent":["import { x as SyntaxNode } from \"./expressions-CMQzbnHk.mjs\";\nimport { a as KeyValuePairAst, c as ModelDeclarationAst, d as TypesBlockAst, i as GenericBlockDeclarationAst, l as NamedTypeDeclarationAst, o as MixinDeclarationAst, r as FieldDeclarationAst, s as MixinInclusionAst, t as CompositeTypeDeclarationAst, u as NamespaceDeclarationAst, y as ModelAttributeAst } from \"./declarations-BgUAq1RG.mjs\";\nimport { t as parse } from \"./parse-bZgfjovA.mjs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/format/emit.ts\nfunction emitDocument(document, indentUnit, newline) {\n\tconst writer = new LineWriter(indentUnit, newline);\n\temitTopLevel(writer, document);\n\treturn writer.finish();\n}\nvar LineWriter = class {\n\t#indentUnit;\n\t#newline;\n\t#out = [];\n\t#depth = 0;\n\t#line = \"\";\n\t#lineOpen = false;\n\t#prevKind;\n\t#lastWasBlank = false;\n\t#hasContent = false;\n\tconstructor(indentUnit, newline) {\n\t\tthis.#indentUnit = indentUnit;\n\t\tthis.#newline = newline;\n\t}\n\tindent() {\n\t\tthis.#depth += 1;\n\t}\n\tunindent() {\n\t\tthis.#depth = Math.max(0, this.#depth - 1);\n\t}\n\tlastIsBlank() {\n\t\treturn this.#lastWasBlank;\n\t}\n\tlineOpen() {\n\t\treturn this.#lineOpen;\n\t}\n\tprevKind() {\n\t\treturn this.#prevKind;\n\t}\n\tnewline() {\n\t\tif (!this.#lineOpen) return;\n\t\tthis.#out.push(`${this.#indentUnit.repeat(this.#depth)}${this.#line}`);\n\t\tthis.#line = \"\";\n\t\tthis.#lineOpen = false;\n\t\tthis.#prevKind = void 0;\n\t\tthis.#lastWasBlank = false;\n\t\tthis.#hasContent = true;\n\t}\n\tblank() {\n\t\tthis.newline();\n\t\tif (!this.#hasContent || this.#lastWasBlank) return;\n\t\tthis.#out.push(\"\");\n\t\tthis.#lastWasBlank = true;\n\t}\n\twrite(token, space, padTo) {\n\t\tif (this.#lineOpen && padTo !== void 0) this.#line = this.#line.padEnd(padTo);\n\t\telse if (this.#lineOpen && space) this.#line += \" \";\n\t\tthis.#line += token.text;\n\t\tthis.#lineOpen = true;\n\t\tthis.#prevKind = token.kind;\n\t}\n\twriteRaw(text) {\n\t\tthis.#line += text;\n\t\tthis.#lineOpen = true;\n\t}\n\tcomment(text) {\n\t\tif (this.#lineOpen) this.#line += ` ${text}`;\n\t\telse this.#line = text;\n\t\tthis.#lineOpen = true;\n\t\tthis.newline();\n\t}\n\tfinish() {\n\t\tthis.newline();\n\t\tconst body = this.#out.join(this.#newline);\n\t\treturn body.length > 0 ? `${body}${this.#newline}` : \"\";\n\t}\n};\nfunction spaceBetween(prev, cur, inQualifiedName) {\n\tif (prev === void 0) return false;\n\tif (inQualifiedName) return false;\n\tif (prev === \"Ident\" && cur === \"StringLiteral\") return false;\n\tswitch (cur) {\n\t\tcase \"LBracket\": return prev === \"Colon\" || prev === \"Comma\" || prev === \"Equals\";\n\t\tcase \"LParen\":\n\t\tcase \"RParen\":\n\t\tcase \"RBracket\":\n\t\tcase \"Comma\":\n\t\tcase \"Question\":\n\t\tcase \"Dot\":\n\t\tcase \"Colon\": return false;\n\t\tcase \"RBrace\": return prev !== \"LBrace\";\n\t\tdefault: break;\n\t}\n\tswitch (prev) {\n\t\tcase \"LParen\":\n\t\tcase \"LBracket\":\n\t\tcase \"Dot\":\n\t\tcase \"At\":\n\t\tcase \"DoubleAt\":\n\t\tcase \"Plus\": return false;\n\t\tdefault: return true;\n\t}\n}\nfunction streamNode(writer, node, padTo) {\n\tlet continuation = 0;\n\tlet first = true;\n\tlet prevQualified = false;\n\tconst walk = (parent, qualified) => {\n\t\tfor (const child of parent.children()) {\n\t\t\tif (child instanceof SyntaxNode) {\n\t\t\t\twalk(child, qualified || child.kind === \"QualifiedName\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\") continue;\n\t\t\tif (child.kind === \"Comment\") {\n\t\t\t\twriter.comment(child.text);\n\t\t\t\twriter.indent();\n\t\t\t\tcontinuation += 1;\n\t\t\t\tprevQualified = false;\n\t\t\t\tfirst = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst pad = first ? padTo : void 0;\n\t\t\tconst space = spaceBetween(writer.prevKind(), child.kind, qualified && prevQualified);\n\t\t\twriter.write(child, space, writer.lineOpen() ? pad : void 0);\n\t\t\tprevQualified = qualified;\n\t\t\tfirst = false;\n\t\t}\n\t};\n\twalk(node, false);\n\treturn continuation;\n}\nfunction closeContinuation(writer, count) {\n\tfor (let i = 0; i < count; i++) writer.unindent();\n}\nfunction emitField(writer, field, alignmentColumns) {\n\treturn streamRow(writer, field.syntax, alignmentColumns);\n}\nfunction emitNamedType(writer, decl) {\n\treturn streamRow(writer, decl.syntax, void 0);\n}\nfunction streamRow(writer, row, alignmentColumns) {\n\tlet continuation = 0;\n\tlet sawAttribute = false;\n\tfor (const child of row.children()) {\n\t\tif (child instanceof SyntaxNode) {\n\t\t\tlet padTo;\n\t\t\tif (child.kind === \"TypeAnnotation\" && continuation === 0) padTo = alignmentColumns?.typeColumn;\n\t\t\telse if (child.kind === \"FieldAttribute\") {\n\t\t\t\tif (continuation > 0) writer.newline();\n\t\t\t\telse if (!sawAttribute) padTo = alignmentColumns?.attributeColumn;\n\t\t\t\tsawAttribute = true;\n\t\t\t}\n\t\t\tcontinuation += streamNode(writer, child, padTo);\n\t\t\tcontinue;\n\t\t}\n\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\") continue;\n\t\tif (child.kind === \"Comment\") {\n\t\t\twriter.comment(child.text);\n\t\t\twriter.indent();\n\t\t\tcontinuation += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tconst space = spaceBetween(writer.prevKind(), child.kind, false);\n\t\twriter.write(child, space);\n\t}\n\treturn continuation;\n}\nfunction emitBlockAttribute(writer, attribute) {\n\treturn streamNode(writer, attribute.syntax);\n}\nfunction emitKeyValue(writer, pair) {\n\treturn streamNode(writer, pair.syntax);\n}\nfunction leafMember(writer, category, print) {\n\treturn {\n\t\tcategory,\n\t\temit(trailing) {\n\t\t\tconst continuation = print();\n\t\t\tif (trailing !== void 0) writer.comment(trailing);\n\t\t\telse writer.newline();\n\t\t\treturn continuation;\n\t\t}\n\t};\n}\nfunction inclusionMember(writer, node) {\n\tconst inclusion = MixinInclusionAst.cast(node);\n\tif (inclusion === void 0) return void 0;\n\treturn leafMember(writer, \"regular\", () => streamNode(writer, inclusion.syntax));\n}\nfunction fieldBodyMembers(writer, block) {\n\tconst alignmentColumns = alignmentMap(block);\n\treturn (node) => {\n\t\tconst field = FieldDeclarationAst.cast(node);\n\t\tif (field) return leafMember(writer, \"regular\", () => emitField(writer, field, alignmentColumns));\n\t\tconst attribute = ModelAttributeAst.cast(node);\n\t\tif (attribute) return leafMember(writer, \"blockAttribute\", () => emitBlockAttribute(writer, attribute));\n\t\treturn inclusionMember(writer, node);\n\t};\n}\nfunction entryBodyMembers(writer, block) {\n\tconst alignment = alignmentMap(block);\n\treturn (node) => {\n\t\tconst field = FieldDeclarationAst.cast(node);\n\t\tif (field) return leafMember(writer, \"regular\", () => emitField(writer, field, alignment));\n\t\tconst entry = KeyValuePairAst.cast(node);\n\t\tif (entry) return leafMember(writer, \"regular\", () => emitKeyValue(writer, entry));\n\t\tconst attribute = ModelAttributeAst.cast(node);\n\t\tif (attribute) return leafMember(writer, \"blockAttribute\", () => emitBlockAttribute(writer, attribute));\n\t\treturn inclusionMember(writer, node);\n\t};\n}\nfunction emitModel(writer, model, trailing) {\n\temitBlockBody(writer, model.syntax, trailing, fieldBodyMembers(writer, model.syntax));\n}\nfunction emitCompositeType(writer, composite, trailing) {\n\temitBlockBody(writer, composite.syntax, trailing, fieldBodyMembers(writer, composite.syntax));\n}\nfunction emitGenericBlock(writer, block, trailing) {\n\temitBlockBody(writer, block.syntax, trailing, entryBodyMembers(writer, block.syntax));\n}\nconst FIELD_BODY_KEYWORDS = /* @__PURE__ */ new Set([\"model\", \"type\"]);\nfunction emitMixinDeclaration(writer, mixin, trailing) {\n\tconst members = FIELD_BODY_KEYWORDS.has(mixin.keyword()?.text ?? \"\") ? fieldBodyMembers(writer, mixin.syntax) : entryBodyMembers(writer, mixin.syntax);\n\temitBlockBody(writer, mixin.syntax, trailing, members);\n}\nfunction emitNamespace(writer, namespace, trailing) {\n\temitBlockBody(writer, namespace.syntax, trailing, (node) => {\n\t\tconst declaration = castBlockDeclaration(node);\n\t\tif (declaration) return nestedBlockMember(writer, declaration);\n\t});\n}\nfunction emitTypesBlock(writer, block, trailing) {\n\temitBlockBody(writer, block.syntax, trailing, (node) => {\n\t\tconst named = NamedTypeDeclarationAst.cast(node);\n\t\tif (named) return leafMember(writer, \"regular\", () => emitNamedType(writer, named));\n\t});\n}\nfunction emitTopLevel(writer, document) {\n\twalkRegion(writer, Array.from(document.syntax.children()), void 0, (node) => {\n\t\tconst declaration = castTopLevelDeclaration(node);\n\t\tif (declaration) return nestedBlockMember(writer, declaration);\n\t});\n}\nfunction nestedBlockMember(writer, block) {\n\treturn {\n\t\tcategory: \"nestedBlock\",\n\t\temit(trailing) {\n\t\t\tblock(writer, trailing);\n\t\t\treturn 0;\n\t\t}\n\t};\n}\nfunction castBlockDeclaration(node) {\n\tconst model = ModelDeclarationAst.cast(node);\n\tif (model) return (writer, trailing) => emitModel(writer, model, trailing);\n\tconst composite = CompositeTypeDeclarationAst.cast(node);\n\tif (composite) return (writer, trailing) => emitCompositeType(writer, composite, trailing);\n\tconst generic = GenericBlockDeclarationAst.cast(node);\n\tif (generic) return (writer, trailing) => emitGenericBlock(writer, generic, trailing);\n\tconst mixin = MixinDeclarationAst.cast(node);\n\tif (mixin) return (writer, trailing) => emitMixinDeclaration(writer, mixin, trailing);\n}\nfunction castTopLevelDeclaration(node) {\n\tconst block = castBlockDeclaration(node);\n\tif (block) return block;\n\tconst namespace = NamespaceDeclarationAst.cast(node);\n\tif (namespace) return (writer, trailing) => emitNamespace(writer, namespace, trailing);\n\tconst types = TypesBlockAst.cast(node);\n\tif (types) return (writer, trailing) => emitTypesBlock(writer, types, trailing);\n}\nfunction emitBlockBody(writer, node, closingTrailing, classify) {\n\tconst children = Array.from(node.children());\n\tconst openIndex = children.findIndex((el) => !(el instanceof SyntaxNode) && el.kind === \"LBrace\");\n\tconst headerComments = streamHeader(writer, node);\n\tconst openingComment = sameLineCommentAfter(children, openIndex);\n\tif (openingComment !== void 0) headerComments.push(openingComment);\n\tconst [firstComment, ...otherComments] = headerComments;\n\tif (firstComment !== void 0) writer.comment(firstComment);\n\telse writer.newline();\n\twriter.indent();\n\tfor (const comment of otherComments) writer.comment(comment);\n\twalkRegion(writer, children, \"RBrace\", classify);\n\twriter.unindent();\n\twriter.writeRaw(\"}\");\n\tif (closingTrailing !== void 0) writer.comment(closingTrailing);\n\telse writer.newline();\n}\n/** Writes the block header through `{` and returns the source comments found before the `{`. */\nfunction streamHeader(writer, node) {\n\tconst comments = [];\n\tlet done = false;\n\tconst walk = (parent) => {\n\t\tfor (const child of parent.children()) {\n\t\t\tif (done) return;\n\t\t\tif (child instanceof SyntaxNode) {\n\t\t\t\twalk(child);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Comment\") {\n\t\t\t\tcomments.push(child.text);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\") continue;\n\t\t\tconst space = spaceBetween(writer.prevKind(), child.kind, false);\n\t\t\twriter.write(child, space);\n\t\t\tif (child.kind === \"LBrace\") {\n\t\t\t\tdone = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\twalk(node);\n\treturn comments;\n}\nfunction walkRegion(writer, elements, closeKind, classify) {\n\tlet sawOpenBrace = closeKind === void 0;\n\tlet sawContent = false;\n\tlet lastWasRegular = false;\n\tlet ledByComment = false;\n\tlet newlines = 0;\n\tfor (let i = 0; i < elements.length; i++) {\n\t\tconst element = elements[i];\n\t\tif (element === void 0) continue;\n\t\tif (element instanceof SyntaxNode) {\n\t\t\tif (!sawOpenBrace) continue;\n\t\t\tconst member = classify(element);\n\t\t\tif (member === void 0) throw new InternalError(`Formatter has no rule for a ${element.kind} node at offset ${element.offset}; formatting would drop its text`);\n\t\t\tif (!ledByComment) {\n\t\t\t\tif (newlines >= 2 && sawContent && !writer.lastIsBlank()) writer.blank();\n\t\t\t\telse if (separationBlankWanted(writer, member.category, sawContent, lastWasRegular)) writer.blank();\n\t\t\t}\n\t\t\tconst trailing = sameLineTrailingComment(elements, i);\n\t\t\tcloseContinuation(writer, member.emit(trailing.text));\n\t\t\tif (trailing.index !== void 0) i = trailing.index;\n\t\t\tsawContent = true;\n\t\t\tlastWasRegular = member.category !== \"blockAttribute\";\n\t\t\tledByComment = false;\n\t\t\tnewlines = 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (element.kind === \"LBrace\" && closeKind === \"RBrace\" && !sawOpenBrace) {\n\t\t\tsawOpenBrace = true;\n\t\t\tnewlines = 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (!sawOpenBrace) continue;\n\t\tif (closeKind === \"RBrace\" && element.kind === \"RBrace\") break;\n\t\tif (element.kind === \"Whitespace\") continue;\n\t\tif (element.kind === \"Newline\") {\n\t\t\tnewlines += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tif (element.kind === \"Comment\") {\n\t\t\tif (closeKind === \"RBrace\" && newlines === 0 && !sawContent) continue;\n\t\t\tif (newlines >= 2 && sawContent && !writer.lastIsBlank()) writer.blank();\n\t\t\telse if (!ledByComment) {\n\t\t\t\tconst led = leadingMemberAfter(elements, i, classify);\n\t\t\t\tif (led && separationBlankWanted(writer, led, sawContent, lastWasRegular)) writer.blank();\n\t\t\t}\n\t\t\twriter.writeRaw(element.text);\n\t\t\twriter.newline();\n\t\t\tsawContent = true;\n\t\t\tledByComment = true;\n\t\t\tnewlines = 0;\n\t\t}\n\t}\n}\nfunction separationBlankWanted(writer, category, sawContent, lastWasRegular) {\n\tif (!sawContent || writer.lastIsBlank()) return false;\n\tif (category === \"nestedBlock\") return true;\n\treturn category === \"blockAttribute\" && lastWasRegular;\n}\nfunction leadingMemberAfter(elements, commentIndex, classify) {\n\tfor (let i = commentIndex + 1; i < elements.length; i++) {\n\t\tconst element = elements[i];\n\t\tif (element === void 0) continue;\n\t\tif (element instanceof SyntaxNode) return classify(element)?.category;\n\t\tif (element.kind === \"RBrace\") return void 0;\n\t}\n}\nfunction sameLineTrailingComment(elements, memberIndex) {\n\tfor (let i = memberIndex + 1; i < elements.length; i++) {\n\t\tconst element = elements[i];\n\t\tif (element === void 0) continue;\n\t\tif (element instanceof SyntaxNode) break;\n\t\tif (element.kind === \"Whitespace\") continue;\n\t\tif (element.kind === \"Comment\") return {\n\t\t\ttext: element.text,\n\t\t\tindex: i\n\t\t};\n\t\tbreak;\n\t}\n\treturn {\n\t\ttext: void 0,\n\t\tindex: void 0\n\t};\n}\nfunction sameLineCommentAfter(children, openIndex) {\n\tfor (let i = openIndex + 1; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tif (child === void 0) continue;\n\t\tif (child instanceof SyntaxNode) return void 0;\n\t\tif (child.kind === \"Whitespace\") continue;\n\t\tif (child.kind === \"Comment\") return child.text;\n\t\treturn;\n\t}\n}\nfunction alignmentMap(block) {\n\tconst fields = [];\n\tfor (const element of block.children()) {\n\t\tif (!(element instanceof SyntaxNode)) continue;\n\t\tif (FieldDeclarationAst.cast(element) === void 0) continue;\n\t\tif (hasInteriorComment(element)) continue;\n\t\tfields.push(element);\n\t}\n\tif (fields.length === 0) return void 0;\n\treturn alignmentColumns(fields);\n}\nfunction alignmentColumns(rows) {\n\tlet nameWidth = 0;\n\tfor (const row of rows) {\n\t\tconst field = FieldDeclarationAst.cast(row);\n\t\tif (!field) continue;\n\t\tnameWidth = Math.max(nameWidth, renderTokens(field.name()?.syntax).length);\n\t}\n\tconst typeColumn = nameWidth + 1;\n\tlet cellEnd = 0;\n\tfor (const row of rows) {\n\t\tconst field = FieldDeclarationAst.cast(row);\n\t\tif (!field) continue;\n\t\tconst name = renderTokens(field.name()?.syntax);\n\t\tconst type = renderTokens(field.typeAnnotation()?.syntax);\n\t\tcellEnd = Math.max(cellEnd, type.length > 0 ? typeColumn + type.length : name.length);\n\t}\n\treturn {\n\t\ttypeColumn,\n\t\tattributeColumn: cellEnd + 1\n\t};\n}\nfunction hasInteriorComment(node) {\n\tfor (const token of node.tokens()) if (token.kind === \"Comment\") return true;\n\treturn false;\n}\nfunction renderTokens(node) {\n\tif (!node) return \"\";\n\tlet out = \"\";\n\tlet prev;\n\tlet prevQualified = false;\n\tconst walk = (parent, qualified) => {\n\t\tfor (const child of parent.children()) {\n\t\t\tif (child instanceof SyntaxNode) {\n\t\t\t\twalk(child, qualified || child.kind === \"QualifiedName\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\" || child.kind === \"Comment\") continue;\n\t\t\tif (spaceBetween(prev, child.kind, qualified && prevQualified)) out += \" \";\n\t\t\tout += child.text;\n\t\t\tprev = child.kind;\n\t\t\tprevQualified = qualified;\n\t\t}\n\t};\n\twalk(node, false);\n\treturn out;\n}\n//#endregion\n//#region src/format/error.ts\nfunction pslError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/format/options.ts\nfunction resolveFormatOptions(options) {\n\tconst indent = options?.indent ?? 2;\n\tif (indent !== \"tab\" && (typeof indent !== \"number\" || !Number.isInteger(indent) || indent < 1)) throw pslError(\"PSL.FORMAT_OPTION_INVALID\", `Invalid format options: indent must be a positive integer or 'tab', got ${String(indent)}`, { meta: {\n\t\toption: \"indent\",\n\t\treceived: String(indent)\n\t} });\n\tconst newline = options?.newline ?? \"LF\";\n\tif (newline !== \"LF\" && newline !== \"CRLF\") throw pslError(\"PSL.FORMAT_OPTION_INVALID\", `Invalid format options: newline must be 'LF' or 'CRLF', got ${String(newline)}`, { meta: {\n\t\toption: \"newline\",\n\t\treceived: String(newline)\n\t} });\n\treturn {\n\t\tindentUnit: indent === \"tab\" ? \"\t\" : \" \".repeat(indent),\n\t\tnewline: newline === \"CRLF\" ? \"\\r\\n\" : \"\\n\"\n\t};\n}\n//#endregion\n//#region src/format/format.ts\nfunction format(source, options, parserOptions = {}) {\n\tconst resolved = resolveFormatOptions(options);\n\tconst { document, diagnostics } = parse(source, \"<format-input>.psl\", parserOptions);\n\tif (diagnostics.length > 0) throw pslError(\"PSL.PARSE_FAILED\", `Cannot format PSL with parse errors: ${diagnostics[0]?.message ?? \"unknown parse error\"}${diagnostics.length > 1 ? ` (and ${diagnostics.length - 1} more)` : \"\"}`, { meta: { diagnostics } });\n\treturn emitDocument(document, resolved.indentUnit, resolved.newline);\n}\n//#endregion\nexport { format, resolveFormatOptions };\n\n//# sourceMappingURL=format.mjs.map"],"mappings":";;;;;;AAMA,SAAS,aAAa,UAAU,YAAY,SAAS;CACpD,MAAM,SAAS,IAAI,WAAW,YAAY,OAAO;CACjD,aAAa,QAAQ,QAAQ;CAC7B,OAAO,OAAO,OAAO;AACtB;AACA,IAAI,aAAa,MAAM;CACtB;CACA;CACA,OAAO,CAAC;CACR,SAAS;CACT,QAAQ;CACR,YAAY;CACZ;CACA,gBAAgB;CAChB,cAAc;CACd,YAAY,YAAY,SAAS;EAChC,KAAKA,cAAc;EACnB,KAAKC,WAAW;CACjB;CACA,SAAS;EACR,KAAKC,UAAU;CAChB;CACA,WAAW;EACV,KAAKA,SAAS,KAAK,IAAI,GAAG,KAAKA,SAAS,CAAC;CAC1C;CACA,cAAc;EACb,OAAO,KAAKC;CACb;CACA,WAAW;EACV,OAAO,KAAKC;CACb;CACA,WAAW;EACV,OAAO,KAAKC;CACb;CACA,UAAU;EACT,IAAI,CAAC,KAAKD,WAAW;EACrB,KAAKE,KAAK,KAAK,GAAG,KAAKN,YAAY,OAAO,KAAKE,MAAM,IAAI,KAAKK,OAAO;EACrE,KAAKA,QAAQ;EACb,KAAKH,YAAY;EACjB,KAAKC,YAAY,KAAK;EACtB,KAAKF,gBAAgB;EACrB,KAAKK,cAAc;CACpB;CACA,Q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MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;CAC5P,OAAO,aAAa,UAAU,SAAS,YAAY,SAAS,OAAO;AACpE"}
1
+ {"version":3,"file":"psl-parser__format.mjs","names":["#indentUnit","#newline","#depth","#lastWasBlank","#lineOpen","#prevKind","#out","#line","#hasContent"],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/format.mjs"],"sourcesContent":["import { x as SyntaxNode } from \"./expressions-BlhT51Ib.mjs\";\nimport { a as KeyValuePairAst, c as ModelDeclarationAst, d as TypesBlockAst, i as GenericBlockDeclarationAst, l as NamedTypeDeclarationAst, o as MixinDeclarationAst, r as FieldDeclarationAst, s as MixinInclusionAst, t as CompositeTypeDeclarationAst, u as NamespaceDeclarationAst, y as ModelAttributeAst } from \"./declarations-8CRDqUTt.mjs\";\nimport { t as parse } from \"./parse-D-B_nrfC.mjs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/format/emit.ts\nfunction emitDocument(document, indentUnit, newline) {\n\tconst writer = new LineWriter(indentUnit, newline);\n\temitTopLevel(writer, document);\n\treturn writer.finish();\n}\nvar LineWriter = class {\n\t#indentUnit;\n\t#newline;\n\t#out = [];\n\t#depth = 0;\n\t#line = \"\";\n\t#lineOpen = false;\n\t#prevKind;\n\t#lastWasBlank = false;\n\t#hasContent = false;\n\tconstructor(indentUnit, newline) {\n\t\tthis.#indentUnit = indentUnit;\n\t\tthis.#newline = newline;\n\t}\n\tindent() {\n\t\tthis.#depth += 1;\n\t}\n\tunindent() {\n\t\tthis.#depth = Math.max(0, this.#depth - 1);\n\t}\n\tlastIsBlank() {\n\t\treturn this.#lastWasBlank;\n\t}\n\tlineOpen() {\n\t\treturn this.#lineOpen;\n\t}\n\tprevKind() {\n\t\treturn this.#prevKind;\n\t}\n\tnewline() {\n\t\tif (!this.#lineOpen) return;\n\t\tthis.#out.push(`${this.#indentUnit.repeat(this.#depth)}${this.#line}`);\n\t\tthis.#line = \"\";\n\t\tthis.#lineOpen = false;\n\t\tthis.#prevKind = void 0;\n\t\tthis.#lastWasBlank = false;\n\t\tthis.#hasContent = true;\n\t}\n\tblank() {\n\t\tthis.newline();\n\t\tif (!this.#hasContent || this.#lastWasBlank) return;\n\t\tthis.#out.push(\"\");\n\t\tthis.#lastWasBlank = true;\n\t}\n\twrite(token, space, padTo) {\n\t\tif (this.#lineOpen && padTo !== void 0) this.#line = this.#line.padEnd(padTo);\n\t\telse if (this.#lineOpen && space) this.#line += \" \";\n\t\tthis.#line += token.text;\n\t\tthis.#lineOpen = true;\n\t\tthis.#prevKind = token.kind;\n\t}\n\twriteRaw(text) {\n\t\tthis.#line += text;\n\t\tthis.#lineOpen = true;\n\t}\n\tcomment(text) {\n\t\tif (this.#lineOpen) this.#line += ` ${text}`;\n\t\telse this.#line = text;\n\t\tthis.#lineOpen = true;\n\t\tthis.newline();\n\t}\n\tfinish() {\n\t\tthis.newline();\n\t\tconst body = this.#out.join(this.#newline);\n\t\treturn body.length > 0 ? `${body}${this.#newline}` : \"\";\n\t}\n};\nfunction spaceBetween(prev, cur, inQualifiedName) {\n\tif (prev === void 0) return false;\n\tif (inQualifiedName) return false;\n\tif (prev === \"Ident\" && cur === \"StringLiteral\") return false;\n\tswitch (cur) {\n\t\tcase \"LBracket\": return prev === \"Colon\" || prev === \"Comma\" || prev === \"Equals\";\n\t\tcase \"LParen\":\n\t\tcase \"RParen\":\n\t\tcase \"RBracket\":\n\t\tcase \"Comma\":\n\t\tcase \"Question\":\n\t\tcase \"Dot\":\n\t\tcase \"Colon\": return false;\n\t\tcase \"RBrace\": return prev !== \"LBrace\";\n\t\tdefault: break;\n\t}\n\tswitch (prev) {\n\t\tcase \"LParen\":\n\t\tcase \"LBracket\":\n\t\tcase \"Dot\":\n\t\tcase \"At\":\n\t\tcase \"DoubleAt\":\n\t\tcase \"Plus\": return false;\n\t\tdefault: return true;\n\t}\n}\nfunction streamNode(writer, node, padTo) {\n\tlet continuation = 0;\n\tlet first = true;\n\tlet prevQualified = false;\n\tconst walk = (parent, qualified) => {\n\t\tfor (const child of parent.children()) {\n\t\t\tif (child instanceof SyntaxNode) {\n\t\t\t\twalk(child, qualified || child.kind === \"QualifiedName\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\") continue;\n\t\t\tif (child.kind === \"Comment\") {\n\t\t\t\twriter.comment(child.text);\n\t\t\t\twriter.indent();\n\t\t\t\tcontinuation += 1;\n\t\t\t\tprevQualified = false;\n\t\t\t\tfirst = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst pad = first ? padTo : void 0;\n\t\t\tconst space = spaceBetween(writer.prevKind(), child.kind, qualified && prevQualified);\n\t\t\twriter.write(child, space, writer.lineOpen() ? pad : void 0);\n\t\t\tprevQualified = qualified;\n\t\t\tfirst = false;\n\t\t}\n\t};\n\twalk(node, false);\n\treturn continuation;\n}\nfunction closeContinuation(writer, count) {\n\tfor (let i = 0; i < count; i++) writer.unindent();\n}\nfunction emitField(writer, field, alignmentColumns) {\n\treturn streamRow(writer, field.syntax, alignmentColumns);\n}\nfunction emitNamedType(writer, decl) {\n\treturn streamRow(writer, decl.syntax, void 0);\n}\nfunction streamRow(writer, row, alignmentColumns) {\n\tlet continuation = 0;\n\tlet sawAttribute = false;\n\tfor (const child of row.children()) {\n\t\tif (child instanceof SyntaxNode) {\n\t\t\tlet padTo;\n\t\t\tif (child.kind === \"TypeAnnotation\" && continuation === 0) padTo = alignmentColumns?.typeColumn;\n\t\t\telse if (child.kind === \"FieldAttribute\") {\n\t\t\t\tif (continuation > 0) writer.newline();\n\t\t\t\telse if (!sawAttribute) padTo = alignmentColumns?.attributeColumn;\n\t\t\t\tsawAttribute = true;\n\t\t\t}\n\t\t\tcontinuation += streamNode(writer, child, padTo);\n\t\t\tcontinue;\n\t\t}\n\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\") continue;\n\t\tif (child.kind === \"Comment\") {\n\t\t\twriter.comment(child.text);\n\t\t\twriter.indent();\n\t\t\tcontinuation += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tconst space = spaceBetween(writer.prevKind(), child.kind, false);\n\t\twriter.write(child, space);\n\t}\n\treturn continuation;\n}\nfunction emitBlockAttribute(writer, attribute) {\n\treturn streamNode(writer, attribute.syntax);\n}\nfunction emitKeyValue(writer, pair) {\n\treturn streamNode(writer, pair.syntax);\n}\nfunction leafMember(writer, category, print) {\n\treturn {\n\t\tcategory,\n\t\temit(trailing) {\n\t\t\tconst continuation = print();\n\t\t\tif (trailing !== void 0) writer.comment(trailing);\n\t\t\telse writer.newline();\n\t\t\treturn continuation;\n\t\t}\n\t};\n}\nfunction inclusionMember(writer, node) {\n\tconst inclusion = MixinInclusionAst.cast(node);\n\tif (inclusion === void 0) return void 0;\n\treturn leafMember(writer, \"regular\", () => streamNode(writer, inclusion.syntax));\n}\nfunction fieldBodyMembers(writer, block) {\n\tconst alignmentColumns = alignmentMap(block);\n\treturn (node) => {\n\t\tconst field = FieldDeclarationAst.cast(node);\n\t\tif (field) return leafMember(writer, \"regular\", () => emitField(writer, field, alignmentColumns));\n\t\tconst attribute = ModelAttributeAst.cast(node);\n\t\tif (attribute) return leafMember(writer, \"blockAttribute\", () => emitBlockAttribute(writer, attribute));\n\t\treturn inclusionMember(writer, node);\n\t};\n}\nfunction entryBodyMembers(writer, block) {\n\tconst alignment = alignmentMap(block);\n\treturn (node) => {\n\t\tconst field = FieldDeclarationAst.cast(node);\n\t\tif (field) return leafMember(writer, \"regular\", () => emitField(writer, field, alignment));\n\t\tconst entry = KeyValuePairAst.cast(node);\n\t\tif (entry) return leafMember(writer, \"regular\", () => emitKeyValue(writer, entry));\n\t\tconst attribute = ModelAttributeAst.cast(node);\n\t\tif (attribute) return leafMember(writer, \"blockAttribute\", () => emitBlockAttribute(writer, attribute));\n\t\treturn inclusionMember(writer, node);\n\t};\n}\nfunction emitModel(writer, model, trailing) {\n\temitBlockBody(writer, model.syntax, trailing, fieldBodyMembers(writer, model.syntax));\n}\nfunction emitCompositeType(writer, composite, trailing) {\n\temitBlockBody(writer, composite.syntax, trailing, fieldBodyMembers(writer, composite.syntax));\n}\nfunction emitGenericBlock(writer, block, trailing) {\n\temitBlockBody(writer, block.syntax, trailing, entryBodyMembers(writer, block.syntax));\n}\nconst FIELD_BODY_KEYWORDS = /* @__PURE__ */ new Set([\"model\", \"type\"]);\nfunction emitMixinDeclaration(writer, mixin, trailing) {\n\tconst members = FIELD_BODY_KEYWORDS.has(mixin.keyword()?.text ?? \"\") ? fieldBodyMembers(writer, mixin.syntax) : entryBodyMembers(writer, mixin.syntax);\n\temitBlockBody(writer, mixin.syntax, trailing, members);\n}\nfunction emitNamespace(writer, namespace, trailing) {\n\temitBlockBody(writer, namespace.syntax, trailing, (node) => {\n\t\tconst declaration = castBlockDeclaration(node);\n\t\tif (declaration) return nestedBlockMember(writer, declaration);\n\t});\n}\nfunction emitTypesBlock(writer, block, trailing) {\n\temitBlockBody(writer, block.syntax, trailing, (node) => {\n\t\tconst named = NamedTypeDeclarationAst.cast(node);\n\t\tif (named) return leafMember(writer, \"regular\", () => emitNamedType(writer, named));\n\t});\n}\nfunction emitTopLevel(writer, document) {\n\twalkRegion(writer, Array.from(document.syntax.children()), void 0, (node) => {\n\t\tconst declaration = castTopLevelDeclaration(node);\n\t\tif (declaration) return nestedBlockMember(writer, declaration);\n\t});\n}\nfunction nestedBlockMember(writer, block) {\n\treturn {\n\t\tcategory: \"nestedBlock\",\n\t\temit(trailing) {\n\t\t\tblock(writer, trailing);\n\t\t\treturn 0;\n\t\t}\n\t};\n}\nfunction castBlockDeclaration(node) {\n\tconst model = ModelDeclarationAst.cast(node);\n\tif (model) return (writer, trailing) => emitModel(writer, model, trailing);\n\tconst composite = CompositeTypeDeclarationAst.cast(node);\n\tif (composite) return (writer, trailing) => emitCompositeType(writer, composite, trailing);\n\tconst generic = GenericBlockDeclarationAst.cast(node);\n\tif (generic) return (writer, trailing) => emitGenericBlock(writer, generic, trailing);\n\tconst mixin = MixinDeclarationAst.cast(node);\n\tif (mixin) return (writer, trailing) => emitMixinDeclaration(writer, mixin, trailing);\n}\nfunction castTopLevelDeclaration(node) {\n\tconst block = castBlockDeclaration(node);\n\tif (block) return block;\n\tconst namespace = NamespaceDeclarationAst.cast(node);\n\tif (namespace) return (writer, trailing) => emitNamespace(writer, namespace, trailing);\n\tconst types = TypesBlockAst.cast(node);\n\tif (types) return (writer, trailing) => emitTypesBlock(writer, types, trailing);\n}\nfunction emitBlockBody(writer, node, closingTrailing, classify) {\n\tconst children = Array.from(node.children());\n\tconst openIndex = children.findIndex((el) => !(el instanceof SyntaxNode) && el.kind === \"LBrace\");\n\tconst headerComments = streamHeader(writer, node);\n\tconst openingComment = sameLineCommentAfter(children, openIndex);\n\tif (openingComment !== void 0) headerComments.push(openingComment);\n\tconst [firstComment, ...otherComments] = headerComments;\n\tif (firstComment !== void 0) writer.comment(firstComment);\n\telse writer.newline();\n\twriter.indent();\n\tfor (const comment of otherComments) writer.comment(comment);\n\twalkRegion(writer, children, \"RBrace\", classify);\n\twriter.unindent();\n\twriter.writeRaw(\"}\");\n\tif (closingTrailing !== void 0) writer.comment(closingTrailing);\n\telse writer.newline();\n}\n/** Writes the block header through `{` and returns the source comments found before the `{`. */\nfunction streamHeader(writer, node) {\n\tconst comments = [];\n\tlet done = false;\n\tconst walk = (parent) => {\n\t\tfor (const child of parent.children()) {\n\t\t\tif (done) return;\n\t\t\tif (child instanceof SyntaxNode) {\n\t\t\t\twalk(child);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Comment\") {\n\t\t\t\tcomments.push(child.text);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\") continue;\n\t\t\tconst space = spaceBetween(writer.prevKind(), child.kind, false);\n\t\t\twriter.write(child, space);\n\t\t\tif (child.kind === \"LBrace\") {\n\t\t\t\tdone = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\twalk(node);\n\treturn comments;\n}\nfunction walkRegion(writer, elements, closeKind, classify) {\n\tlet sawOpenBrace = closeKind === void 0;\n\tlet sawContent = false;\n\tlet lastWasRegular = false;\n\tlet ledByComment = false;\n\tlet newlines = 0;\n\tfor (let i = 0; i < elements.length; i++) {\n\t\tconst element = elements[i];\n\t\tif (element === void 0) continue;\n\t\tif (element instanceof SyntaxNode) {\n\t\t\tif (!sawOpenBrace) continue;\n\t\t\tconst member = classify(element);\n\t\t\tif (member === void 0) throw new InternalError(`Formatter has no rule for a ${element.kind} node at offset ${element.offset}; formatting would drop its text`);\n\t\t\tif (!ledByComment) {\n\t\t\t\tif (newlines >= 2 && sawContent && !writer.lastIsBlank()) writer.blank();\n\t\t\t\telse if (separationBlankWanted(writer, member.category, sawContent, lastWasRegular)) writer.blank();\n\t\t\t}\n\t\t\tconst trailing = sameLineTrailingComment(elements, i);\n\t\t\tcloseContinuation(writer, member.emit(trailing.text));\n\t\t\tif (trailing.index !== void 0) i = trailing.index;\n\t\t\tsawContent = true;\n\t\t\tlastWasRegular = member.category !== \"blockAttribute\";\n\t\t\tledByComment = false;\n\t\t\tnewlines = 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (element.kind === \"LBrace\" && closeKind === \"RBrace\" && !sawOpenBrace) {\n\t\t\tsawOpenBrace = true;\n\t\t\tnewlines = 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (!sawOpenBrace) continue;\n\t\tif (closeKind === \"RBrace\" && element.kind === \"RBrace\") break;\n\t\tif (element.kind === \"Whitespace\") continue;\n\t\tif (element.kind === \"Newline\") {\n\t\t\tnewlines += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tif (element.kind === \"Comment\") {\n\t\t\tif (closeKind === \"RBrace\" && newlines === 0 && !sawContent) continue;\n\t\t\tif (newlines >= 2 && sawContent && !writer.lastIsBlank()) writer.blank();\n\t\t\telse if (!ledByComment) {\n\t\t\t\tconst led = leadingMemberAfter(elements, i, classify);\n\t\t\t\tif (led && separationBlankWanted(writer, led, sawContent, lastWasRegular)) writer.blank();\n\t\t\t}\n\t\t\twriter.writeRaw(element.text);\n\t\t\twriter.newline();\n\t\t\tsawContent = true;\n\t\t\tledByComment = true;\n\t\t\tnewlines = 0;\n\t\t}\n\t}\n}\nfunction separationBlankWanted(writer, category, sawContent, lastWasRegular) {\n\tif (!sawContent || writer.lastIsBlank()) return false;\n\tif (category === \"nestedBlock\") return true;\n\treturn category === \"blockAttribute\" && lastWasRegular;\n}\nfunction leadingMemberAfter(elements, commentIndex, classify) {\n\tfor (let i = commentIndex + 1; i < elements.length; i++) {\n\t\tconst element = elements[i];\n\t\tif (element === void 0) continue;\n\t\tif (element instanceof SyntaxNode) return classify(element)?.category;\n\t\tif (element.kind === \"RBrace\") return void 0;\n\t}\n}\nfunction sameLineTrailingComment(elements, memberIndex) {\n\tfor (let i = memberIndex + 1; i < elements.length; i++) {\n\t\tconst element = elements[i];\n\t\tif (element === void 0) continue;\n\t\tif (element instanceof SyntaxNode) break;\n\t\tif (element.kind === \"Whitespace\") continue;\n\t\tif (element.kind === \"Comment\") return {\n\t\t\ttext: element.text,\n\t\t\tindex: i\n\t\t};\n\t\tbreak;\n\t}\n\treturn {\n\t\ttext: void 0,\n\t\tindex: void 0\n\t};\n}\nfunction sameLineCommentAfter(children, openIndex) {\n\tfor (let i = openIndex + 1; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tif (child === void 0) continue;\n\t\tif (child instanceof SyntaxNode) return void 0;\n\t\tif (child.kind === \"Whitespace\") continue;\n\t\tif (child.kind === \"Comment\") return child.text;\n\t\treturn;\n\t}\n}\nfunction alignmentMap(block) {\n\tconst fields = [];\n\tfor (const element of block.children()) {\n\t\tif (!(element instanceof SyntaxNode)) continue;\n\t\tif (FieldDeclarationAst.cast(element) === void 0) continue;\n\t\tif (hasInteriorComment(element)) continue;\n\t\tfields.push(element);\n\t}\n\tif (fields.length === 0) return void 0;\n\treturn alignmentColumns(fields);\n}\nfunction alignmentColumns(rows) {\n\tlet nameWidth = 0;\n\tfor (const row of rows) {\n\t\tconst field = FieldDeclarationAst.cast(row);\n\t\tif (!field) continue;\n\t\tnameWidth = Math.max(nameWidth, renderTokens(field.name()?.syntax).length);\n\t}\n\tconst typeColumn = nameWidth + 1;\n\tlet cellEnd = 0;\n\tfor (const row of rows) {\n\t\tconst field = FieldDeclarationAst.cast(row);\n\t\tif (!field) continue;\n\t\tconst name = renderTokens(field.name()?.syntax);\n\t\tconst type = renderTokens(field.typeAnnotation()?.syntax);\n\t\tcellEnd = Math.max(cellEnd, type.length > 0 ? typeColumn + type.length : name.length);\n\t}\n\treturn {\n\t\ttypeColumn,\n\t\tattributeColumn: cellEnd + 1\n\t};\n}\nfunction hasInteriorComment(node) {\n\tfor (const token of node.tokens()) if (token.kind === \"Comment\") return true;\n\treturn false;\n}\nfunction renderTokens(node) {\n\tif (!node) return \"\";\n\tlet out = \"\";\n\tlet prev;\n\tlet prevQualified = false;\n\tconst walk = (parent, qualified) => {\n\t\tfor (const child of parent.children()) {\n\t\t\tif (child instanceof SyntaxNode) {\n\t\t\t\twalk(child, qualified || child.kind === \"QualifiedName\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\" || child.kind === \"Comment\") continue;\n\t\t\tif (spaceBetween(prev, child.kind, qualified && prevQualified)) out += \" \";\n\t\t\tout += child.text;\n\t\t\tprev = child.kind;\n\t\t\tprevQualified = qualified;\n\t\t}\n\t};\n\twalk(node, false);\n\treturn out;\n}\n//#endregion\n//#region src/format/error.ts\nfunction pslError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/format/options.ts\nfunction resolveFormatOptions(options) {\n\tconst indent = options?.indent ?? 2;\n\tif (indent !== \"tab\" && (typeof indent !== \"number\" || !Number.isInteger(indent) || indent < 1)) throw pslError(\"PSL.FORMAT_OPTION_INVALID\", `Invalid format options: indent must be a positive integer or 'tab', got ${String(indent)}`, { meta: {\n\t\toption: \"indent\",\n\t\treceived: String(indent)\n\t} });\n\tconst newline = options?.newline ?? \"LF\";\n\tif (newline !== \"LF\" && newline !== \"CRLF\") throw pslError(\"PSL.FORMAT_OPTION_INVALID\", `Invalid format options: newline must be 'LF' or 'CRLF', got ${String(newline)}`, { meta: {\n\t\toption: \"newline\",\n\t\treceived: String(newline)\n\t} });\n\treturn {\n\t\tindentUnit: indent === \"tab\" ? \"\t\" : \" \".repeat(indent),\n\t\tnewline: newline === \"CRLF\" ? \"\\r\\n\" : \"\\n\"\n\t};\n}\n//#endregion\n//#region src/format/format.ts\nfunction format(source, options, parserOptions = {}) {\n\tconst resolved = resolveFormatOptions(options);\n\tconst { document, diagnostics } = parse(source, \"<format-input>.psl\", parserOptions);\n\tif (diagnostics.length > 0) throw pslError(\"PSL.PARSE_FAILED\", `Cannot format PSL with parse errors: ${diagnostics[0]?.message ?? \"unknown parse error\"}${diagnostics.length > 1 ? ` (and ${diagnostics.length - 1} more)` : \"\"}`, { meta: { diagnostics } });\n\treturn emitDocument(document, resolved.indentUnit, resolved.newline);\n}\n//#endregion\nexport { format, resolveFormatOptions };\n\n//# sourceMappingURL=format.mjs.map"],"mappings":";;;;;;AAMA,SAAS,aAAa,UAAU,YAAY,SAAS;CACpD,MAAM,SAAS,IAAI,WAAW,YAAY,OAAO;CACjD,aAAa,QAAQ,QAAQ;CAC7B,OAAO,OAAO,OAAO;AACtB;AACA,IAAI,aAAa,MAAM;CACtB;CACA;CACA,OAAO,CAAC;CACR,SAAS;CACT,QAAQ;CACR,YAAY;CACZ;CACA,gBAAgB;CAChB,cAAc;CACd,YAAY,YAAY,SAAS;EAChC,KAAKA,cAAc;EACnB,KAAKC,WAAW;CACjB;CACA,SAAS;EACR,KAAKC,UAAU;CAChB;CACA,WAAW;EACV,KAAKA,SAAS,KAAK,IAAI,GAAG,KAAKA,SAAS,CAAC;CAC1C;CACA,cAAc;EACb,OAAO,KAAKC;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AAY,SAAS,SAAS;CACxC;AACD;AAGA,SAAS,OAAO,QAAQ,SAAS,gBAAgB,CAAC,GAAG;CACpD,MAAM,WAAW,qBAAqB,OAAO;CAC7C,MAAM,EAAE,UAAU,gBAAgB,MAAM,QAAQ,sBAAsB,aAAa;CACnF,IAAI,YAAY,SAAS,GAAG,MAAM,SAAS,oBAAoB,wCAAwC,YAAY,EAAE,EAAE,WAAW,wBAAwB,YAAY,SAAS,IAAI,SAAS,YAAY,SAAS,EAAE,UAAU,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;CAC5P,OAAO,aAAa,UAAU,SAAS,YAAY,SAAS,OAAO;AACpE"}
@@ -1,7 +1,7 @@
1
1
  import { r as isInternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
2
2
  import { n as notOk } from "./result-8OXF26MN.mjs";
3
3
  import { $ as validateAuthoringTypeChoiceParams, B as resolveAuthoringTypeChoice, Z as unknownTypeChoiceArgumentMessage, k as isAuthoringPslBlockDescriptor, w as instantiateAuthoringTypeConstructor } from "./temporal-type-aliases-CFh3BW2a-DOlmiuQn.mjs";
4
- import { T as writtenContributedTypeCodecId, _ as printTypeConstructorCall, d as diagnosticSource, g as nodePslSpan, h as mapPslHelperArgs, i as argumentsByParameter, n as reportTypeConstructorNotCalled, p as keywordPslSpan, t as isBareTypeConstructor } from "./type-constructor-calls-Bfg5ojed-DwjW6zNQ.mjs";
4
+ import { T as writtenContributedTypeCodecId, _ as printTypeConstructorCall, d as diagnosticSource, g as nodePslSpan, h as mapPslHelperArgs, i as argumentsByParameter, n as reportTypeConstructorNotCalled, p as keywordPslSpan, t as isBareTypeConstructor } from "./type-constructor-calls-Bfg5ojed-Ld7LE20u.mjs";
5
5
  //#region ../../../1-framework/2-authoring/psl-parser/dist/interpret.mjs
6
6
  function enumMemberAttributeDiagnostics(enumBlock, sources) {
7
7
  const source = diagnosticSource(sources, enumBlock.node.syntax);
@@ -1 +1 @@
1
- {"version":3,"file":"psl-parser__interpret.mjs","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/interpret.mjs"],"sourcesContent":["import { S as diagnosticSource, c as argumentsByParameter, g as nodePslSpan, h as keywordPslSpan, l as printTypeConstructorCall, o as writtenContributedTypeCodecId, s as mapPslHelperArgs } from \"./contributed-type-scope-Ds4uDG91.mjs\";\nimport { n as reportTypeConstructorNotCalled, t as isBareTypeConstructor } from \"./type-constructor-calls-Bfg5ojed.mjs\";\nimport { instantiateAuthoringTypeConstructor, isAuthoringPslBlockDescriptor, resolveAuthoringTypeChoice, unknownTypeChoiceArgumentMessage, validateAuthoringTypeChoiceParams } from \"@internal/framework-components/authoring\";\nimport { isInternalError } from \"@internal/utils/internal-error\";\nimport { notOk } from \"@internal/utils/result\";\n//#region src/enum-member-attributes.ts\nfunction enumMemberAttributeDiagnostics(enumBlock, sources) {\n\tconst source = diagnosticSource(sources, enumBlock.node.syntax);\n\treturn enumBlock.entries.flatMap((member) => Array.from(member.attributes(), (attribute) => ({\n\t\tcode: \"PSL_UNSUPPORTED_ENUM_MEMBER_ATTRIBUTE\",\n\t\tmessage: `enum \"${enumBlock.name}\": member \"${member.key()?.name() ?? \"?\"}\" carries @${attribute.name()?.path().join(\".\") ?? \"?\"}, but an enum member takes no attributes`,\n\t\t...source.at(nodePslSpan(attribute.syntax, sources))\n\t})));\n}\n//#endregion\n//#region src/interpret.ts\n/**\n* Merges caller-side diagnostics (e.g. parse / symbol-table findings) into an\n* interpretation result. The authored headline is deliberately uniform — it\n* reports how many errors the schema has, never which pipeline stage found\n* them.\n*/\nfunction withSeedDiagnostics(result, seedDiagnostics) {\n\tif (seedDiagnostics.length === 0) return result;\n\tconst diagnostics = result.ok ? seedDiagnostics : [...seedDiagnostics, ...result.failure.diagnostics];\n\treturn notOk({\n\t\tsummary: `Schema has ${diagnostics.length} error${diagnostics.length === 1 ? \"\" : \"s\"}`,\n\t\tdiagnostics,\n\t\t...result.ok || result.failure.meta === void 0 ? {} : { meta: result.failure.meta }\n\t});\n}\n/** The single seam that narrows a contract source to the interpret capability. */\nfunction hasPslInterpreter(source) {\n\treturn source.format === \"psl\" && \"interpret\" in source && typeof source.interpret === \"function\";\n}\n//#endregion\n//#region src/relation-backrelations.ts\nfunction fkRelationPairKey(declaringModelName, targetModelName) {\n\treturn `${declaringModelName}::${targetModelName}`;\n}\n/**\n* Claims the one rejected FK side that pairs with this back-relation candidate: same model pair\n* and the same relation name, where an unnamed candidate pairs only with an unnamed FK side.\n* A claimed pairing is removed, so a second candidate on the same pair reports its own problem.\n*/\nfunction consumeInvalidFkPairing(candidate, pairKey, invalidFkPairings) {\n\tconst index = invalidFkPairings.findIndex((pairing) => pairing.pairKey === pairKey && pairing.relationName === candidate.relationName);\n\tif (index === -1) return false;\n\tinvalidFkPairings.splice(index, 1);\n\treturn true;\n}\nfunction requiredOneToOneBackrelationDiagnostic(input) {\n\tconst { modelName, field, targetModelName, sources, recordNoun } = input;\n\treturn {\n\t\tcode: \"PSL_REQUIRED_ONE_TO_ONE_BACKRELATION\",\n\t\tmessage: `Backrelation field \"${modelName}.${field.name}\" is required, but \"${targetModelName}\" holds the relation fields, so nothing in storage guarantees a \"${targetModelName}\" ${recordNoun} exists. Make it optional: \"${field.name} ${targetModelName}?\".`,\n\t\t...diagnosticSource(sources, field.node.syntax).at(field.span)\n\t};\n}\n//#endregion\n//#region src/removed-field-presets.ts\n/** The type at the dotted `path`, called with `options`. */\nfunction presetType(path, options = {}) {\n\treturn {\n\t\tpath: path.split(\".\"),\n\t\toptions\n\t};\n}\n/** The type as PSL writes it, with `extra` after its options, such as `precision: 3`. */\nfunction writtenPresetType(type, extra) {\n\tconst args = [...Object.entries(type.options).map(([name, value]) => `${name}: ${value}`), ...extra === void 0 ? [] : [extra]];\n\tconst path = type.path.join(\".\");\n\treturn args.length === 0 ? path : `${path}(${args.join(\", \")})`;\n}\nconst PHASES = [\"onCreate\", \"onUpdate\"];\nfunction asType(type) {\n\treturn typeof type === \"string\" ? presetType(type) : type;\n}\n/** The row of a preset whose rewrite always writes `type`, then `attributes` when given, such as `Ulid @id @onCreate(ulid())`. */\nfunction removedPresetWrittenAs(type, codecId, attributes) {\n\tconst written = asType(type);\n\tconst suffix = attributes === void 0 ? \"\" : ` ${attributes}`;\n\treturn [{\n\t\ttype: written,\n\t\tcodecId,\n\t\trewrite: (_, modifier) => `Write ${writtenPresetType(written)}${modifier}${suffix}.`\n\t}];\n}\n/**\n* The row of a preset that took `onCreate: now` and `onUpdate: now`, and a precision first when `takesPrecision`. Its rewrite writes `type`, with the precision as its `precision` argument and `@onCreate(now())` and `@onUpdate(now())` for the phases the call set. When the call writes a precision and `withPrecision` is given, it writes `withPrecision.type` instead, leaving out a precision equal to its default.\n*/\nfunction removedPresetWithPhases(type, codecId, takesPrecision, withPrecision) {\n\tconst written = asType(type);\n\tconst parameters = takesPrecision ? [\"precision\", ...PHASES] : [...PHASES];\n\treturn [{\n\t\ttype: written,\n\t\tcodecId,\n\t\trewrite: (call, modifier) => {\n\t\t\tconst args = argumentsByParameter(call.args, parameters);\n\t\t\tconst precision = args?.get(\"precision\");\n\t\t\tif (args === void 0 || precision !== void 0 && !/^\\d+$/.test(precision) || PHASES.some((phase) => args.has(phase) && args.get(phase) !== \"now\")) return `Write ${writtenPresetType(written, takesPrecision ? \"...\" : void 0)}${modifier} with @onCreate(now()) and @onUpdate(now()) for the phases the preset set.`;\n\t\t\tconst attributes = PHASES.filter((phase) => args.has(phase)).map((phase) => ` @${phase}(now())`);\n\t\t\treturn `Write ${precision === void 0 ? writtenPresetType(written) : withPrecision === void 0 ? writtenPresetType(written, `precision: ${precision}`) : writtenPresetType(withPrecision.type, precision === withPrecision.defaultPrecision ? void 0 : `precision: ${precision}`)}${modifier}${attributes.join(\"\")}.`;\n\t\t}\n\t}];\n}\n/** The `?` or `[]` a field writes right after its type. */\nfunction typeModifier(field) {\n\tif (field.list) return field.elementOptional ? \"?[]\" : \"[]\";\n\treturn field.optional ? \"?\" : \"\";\n}\n/**\n* The refusal of a field typed by a call to a field preset Prisma 8 removed, naming what to write instead, with the field's `?` or `[]` right after the type and before any attribute. `undefined` when the field is not typed by a call, or `presets` has no row for the call that applies to a stack whose types `types` holds. A row applies where its type, called as the rewrite writes it, resolves as a column would, to the row's codec. A row is skipped when `isDeclared` says the schema declares the first name of its type, because the rewrite would then name the schema's declaration.\n*/\nfunction describeRemovedFieldPreset(presets, field, types, isDeclared) {\n\tconst call = field.typeConstructor;\n\tif (call === void 0) return void 0;\n\tconst path = call.path.join(\".\");\n\tconst preset = (Object.hasOwn(presets, path) ? presets[path] : void 0)?.find((row) => {\n\t\tconst [name] = row.type.path;\n\t\treturn writtenContributedTypeCodecId(types, {\n\t\t\tpath: row.type.path,\n\t\t\targs: Object.entries(row.type.options).map(([option, value]) => ({\n\t\t\t\tkind: \"named\",\n\t\t\t\tname: option,\n\t\t\t\tvalue,\n\t\t\t\tspan: call.span\n\t\t\t})),\n\t\t\tspan: call.span\n\t\t}) === row.codecId && (name === void 0 || !isDeclared(name));\n\t});\n\tif (preset === void 0) return void 0;\n\treturn `${printTypeConstructorCall(call)} was a field preset, and Prisma 8 removed field presets. ${preset.rewrite(call, typeModifier(field))}`;\n}\n//#endregion\n//#region src/type-choice-calls.ts\n/** The span of the argument at `index` of `descriptors` in `call`, named or positional, or the call's when it is not written. */\nfunction argumentSpan(call, descriptors, index) {\n\tif (index === void 0) return call.span;\n\tconst name = descriptors?.[index]?.name;\n\tconst named = call.args.find((arg) => arg.kind === \"named\" && arg.name === name);\n\tconst positional = call.args.filter((arg) => arg.kind === \"positional\")[index];\n\treturn (named ?? positional)?.span ?? call.span;\n}\n/** The index of the argument an authoring refusal names, when it names one. */\nfunction argumentIndexOf(error) {\n\tif (typeof error !== \"object\" || error === null || !(\"details\" in error)) return void 0;\n\tconst { details } = error;\n\tif (typeof details !== \"object\" || details === null || !(\"argumentIndex\" in details)) return;\n\treturn typeof details.argumentIndex === \"number\" ? details.argumentIndex : void 0;\n}\n/**\n* The column a field or type alias typed by the type choice `symbol` gets: its call's arguments, read as the choice declares them, choose a type constructor, which is instantiated with the arguments the choice passes on. A refusal is reported at the argument that makes it. `span` is where a bare use is written.\n*/\nfunction instantiatePslTypeChoice(input) {\n\tconst { symbol } = input;\n\tconst { descriptor } = symbol;\n\tconst helperPath = symbol.path.join(\".\");\n\tconst call = input.call ?? {\n\t\tpath: symbol.path,\n\t\targs: [],\n\t\tspan: input.span\n\t};\n\tconst subject = `${input.entityLabel} type \"${helperPath}\"`;\n\tconst unknown = call.args.find((arg) => arg.kind === \"named\" && !descriptor.args.some((declared) => declared.name === arg.name));\n\tif (unknown?.name !== void 0) {\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: unknownTypeChoiceArgumentMessage(subject, descriptor, unknown.name),\n\t\t\t...input.source.at(unknown.span)\n\t\t});\n\t\treturn;\n\t}\n\tconst args = mapPslHelperArgs({\n\t\targs: call.args,\n\t\tdescriptors: descriptor.args,\n\t\thelperLabel: `type \"${helperPath}\"`,\n\t\tspan: call.span,\n\t\tdiagnostics: input.diagnostics,\n\t\tsource: input.source,\n\t\tentityLabel: input.entityLabel,\n\t\tdataTypes: input.dataTypes\n\t});\n\tif (!args) return void 0;\n\tlet chosen;\n\ttry {\n\t\tchosen = resolveAuthoringTypeChoice({\n\t\t\thelperPath,\n\t\t\tdescriptor,\n\t\t\targs,\n\t\t\tconstructorNamed: (name) => symbol.choiceTypes.get(name)\n\t\t});\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${subject}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t...input.source.at(argumentSpan(call, descriptor.args, argumentIndexOf(error)))\n\t\t});\n\t\treturn;\n\t}\n\tconst output = instantiateAuthoringTypeConstructor(chosen.descriptor, chosen.args);\n\ttry {\n\t\tvalidateAuthoringTypeChoiceParams(helperPath, descriptor, chosen.descriptor, output.typeParams, input.codecLookup.descriptorFor(output.codecId)?.paramsSchema);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${subject}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t...input.source.at(argumentSpan(call, descriptor.args, argumentIndexOf(error)))\n\t\t});\n\t\treturn;\n\t}\n\treturn output;\n}\n//#endregion\n//#region src/unclaimed-blocks.ts\n/** A generic block is read only when a composed descriptor claims its keyword. */\nfunction claimedBlockKeywords(descriptors) {\n\tconst keywords = /* @__PURE__ */ new Set();\n\tfor (const [keyword, value] of Object.entries(descriptors ?? {})) if (isAuthoringPslBlockDescriptor(value)) keywords.add(keyword);\n\treturn keywords;\n}\nfunction unsupportedBlockDiagnostic(block, sources) {\n\treturn {\n\t\tcode: \"PSL_UNSUPPORTED_TOP_LEVEL_BLOCK\",\n\t\tmessage: `Unsupported top-level block \"${block.keyword}\"`,\n\t\t...diagnosticSource(sources, block.node.syntax).at(keywordPslSpan(block.node.syntax, block.keyword, sources))\n\t};\n}\n//#endregion\nexport { argumentIndexOf, argumentSpan, claimedBlockKeywords, consumeInvalidFkPairing, describeRemovedFieldPreset, enumMemberAttributeDiagnostics, fkRelationPairKey, hasPslInterpreter, instantiatePslTypeChoice, isBareTypeConstructor, mapPslHelperArgs, presetType, removedPresetWithPhases, removedPresetWrittenAs, reportTypeConstructorNotCalled, requiredOneToOneBackrelationDiagnostic, unsupportedBlockDiagnostic, withSeedDiagnostics, writtenPresetType };\n\n//# sourceMappingURL=interpret.mjs.map"],"mappings":";;;;;AAMA,SAAS,+BAA+B,WAAW,SAAS;CAC3D,MAAM,SAAS,iBAAiB,SAAS,UAAU,KAAK,MAAM;CAC9D,OAAO,UAAU,QAAQ,SAAS,WAAW,MAAM,KAAK,OAAO,WAAW,IAAI,eAAe;EAC5F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B,OAAO,SAAS;CACnD,OAAO;EACN,MAAM;EACN,SAAS,gCAAgC,MAAM,QAAQ;EACvD,GAAG,iBAAiB,SAAS,MAAM,KAAK,MAAM,CAAC,CAAC,GAAG,eAAe,MAAM,KAAK,QAAQ,MAAM,SAAS,OAAO,CAAC;CAC7G;AACD"}
1
+ {"version":3,"file":"psl-parser__interpret.mjs","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/interpret.mjs"],"sourcesContent":["import { S as diagnosticSource, c as argumentsByParameter, g as nodePslSpan, h as keywordPslSpan, l as printTypeConstructorCall, o as writtenContributedTypeCodecId, s as mapPslHelperArgs } from \"./contributed-type-scope-CUwinsgb.mjs\";\nimport { n as reportTypeConstructorNotCalled, t as isBareTypeConstructor } from \"./type-constructor-calls-Bfg5ojed.mjs\";\nimport { instantiateAuthoringTypeConstructor, isAuthoringPslBlockDescriptor, resolveAuthoringTypeChoice, unknownTypeChoiceArgumentMessage, validateAuthoringTypeChoiceParams } from \"@internal/framework-components/authoring\";\nimport { isInternalError } from \"@internal/utils/internal-error\";\nimport { notOk } from \"@internal/utils/result\";\n//#region src/enum-member-attributes.ts\nfunction enumMemberAttributeDiagnostics(enumBlock, sources) {\n\tconst source = diagnosticSource(sources, enumBlock.node.syntax);\n\treturn enumBlock.entries.flatMap((member) => Array.from(member.attributes(), (attribute) => ({\n\t\tcode: \"PSL_UNSUPPORTED_ENUM_MEMBER_ATTRIBUTE\",\n\t\tmessage: `enum \"${enumBlock.name}\": member \"${member.key()?.name() ?? \"?\"}\" carries @${attribute.name()?.path().join(\".\") ?? \"?\"}, but an enum member takes no attributes`,\n\t\t...source.at(nodePslSpan(attribute.syntax, sources))\n\t})));\n}\n//#endregion\n//#region src/interpret.ts\n/**\n* Merges caller-side diagnostics (e.g. parse / symbol-table findings) into an\n* interpretation result. The authored headline is deliberately uniform — it\n* reports how many errors the schema has, never which pipeline stage found\n* them.\n*/\nfunction withSeedDiagnostics(result, seedDiagnostics) {\n\tif (seedDiagnostics.length === 0) return result;\n\tconst diagnostics = result.ok ? seedDiagnostics : [...seedDiagnostics, ...result.failure.diagnostics];\n\treturn notOk({\n\t\tsummary: `Schema has ${diagnostics.length} error${diagnostics.length === 1 ? \"\" : \"s\"}`,\n\t\tdiagnostics,\n\t\t...result.ok || result.failure.meta === void 0 ? {} : { meta: result.failure.meta }\n\t});\n}\n/** The single seam that narrows a contract source to the interpret capability. */\nfunction hasPslInterpreter(source) {\n\treturn source.format === \"psl\" && \"interpret\" in source && typeof source.interpret === \"function\";\n}\n//#endregion\n//#region src/relation-backrelations.ts\nfunction fkRelationPairKey(declaringModelName, targetModelName) {\n\treturn `${declaringModelName}::${targetModelName}`;\n}\n/**\n* Claims the one rejected FK side that pairs with this back-relation candidate: same model pair\n* and the same relation name, where an unnamed candidate pairs only with an unnamed FK side.\n* A claimed pairing is removed, so a second candidate on the same pair reports its own problem.\n*/\nfunction consumeInvalidFkPairing(candidate, pairKey, invalidFkPairings) {\n\tconst index = invalidFkPairings.findIndex((pairing) => pairing.pairKey === pairKey && pairing.relationName === candidate.relationName);\n\tif (index === -1) return false;\n\tinvalidFkPairings.splice(index, 1);\n\treturn true;\n}\nfunction requiredOneToOneBackrelationDiagnostic(input) {\n\tconst { modelName, field, targetModelName, sources, recordNoun } = input;\n\treturn {\n\t\tcode: \"PSL_REQUIRED_ONE_TO_ONE_BACKRELATION\",\n\t\tmessage: `Backrelation field \"${modelName}.${field.name}\" is required, but \"${targetModelName}\" holds the relation fields, so nothing in storage guarantees a \"${targetModelName}\" ${recordNoun} exists. Make it optional: \"${field.name} ${targetModelName}?\".`,\n\t\t...diagnosticSource(sources, field.node.syntax).at(field.span)\n\t};\n}\n//#endregion\n//#region src/removed-field-presets.ts\n/** The type at the dotted `path`, called with `options`. */\nfunction presetType(path, options = {}) {\n\treturn {\n\t\tpath: path.split(\".\"),\n\t\toptions\n\t};\n}\n/** The type as PSL writes it, with `extra` after its options, such as `precision: 3`. */\nfunction writtenPresetType(type, extra) {\n\tconst args = [...Object.entries(type.options).map(([name, value]) => `${name}: ${value}`), ...extra === void 0 ? [] : [extra]];\n\tconst path = type.path.join(\".\");\n\treturn args.length === 0 ? path : `${path}(${args.join(\", \")})`;\n}\nconst PHASES = [\"onCreate\", \"onUpdate\"];\nfunction asType(type) {\n\treturn typeof type === \"string\" ? presetType(type) : type;\n}\n/** The row of a preset whose rewrite always writes `type`, then `attributes` when given, such as `Ulid @id @onCreate(ulid())`. */\nfunction removedPresetWrittenAs(type, codecId, attributes) {\n\tconst written = asType(type);\n\tconst suffix = attributes === void 0 ? \"\" : ` ${attributes}`;\n\treturn [{\n\t\ttype: written,\n\t\tcodecId,\n\t\trewrite: (_, modifier) => `Write ${writtenPresetType(written)}${modifier}${suffix}.`\n\t}];\n}\n/**\n* The row of a preset that took `onCreate: now` and `onUpdate: now`, and a precision first when `takesPrecision`. Its rewrite writes `type`, with the precision as its `precision` argument and `@onCreate(now())` and `@onUpdate(now())` for the phases the call set. When the call writes a precision and `withPrecision` is given, it writes `withPrecision.type` instead, leaving out a precision equal to its default.\n*/\nfunction removedPresetWithPhases(type, codecId, takesPrecision, withPrecision) {\n\tconst written = asType(type);\n\tconst parameters = takesPrecision ? [\"precision\", ...PHASES] : [...PHASES];\n\treturn [{\n\t\ttype: written,\n\t\tcodecId,\n\t\trewrite: (call, modifier) => {\n\t\t\tconst args = argumentsByParameter(call.args, parameters);\n\t\t\tconst precision = args?.get(\"precision\");\n\t\t\tif (args === void 0 || precision !== void 0 && !/^\\d+$/.test(precision) || PHASES.some((phase) => args.has(phase) && args.get(phase) !== \"now\")) return `Write ${writtenPresetType(written, takesPrecision ? \"...\" : void 0)}${modifier} with @onCreate(now()) and @onUpdate(now()) for the phases the preset set.`;\n\t\t\tconst attributes = PHASES.filter((phase) => args.has(phase)).map((phase) => ` @${phase}(now())`);\n\t\t\treturn `Write ${precision === void 0 ? writtenPresetType(written) : withPrecision === void 0 ? writtenPresetType(written, `precision: ${precision}`) : writtenPresetType(withPrecision.type, precision === withPrecision.defaultPrecision ? void 0 : `precision: ${precision}`)}${modifier}${attributes.join(\"\")}.`;\n\t\t}\n\t}];\n}\n/** The `?` or `[]` a field writes right after its type. */\nfunction typeModifier(field) {\n\tif (field.list) return field.elementOptional ? \"?[]\" : \"[]\";\n\treturn field.optional ? \"?\" : \"\";\n}\n/**\n* The refusal of a field typed by a call to a field preset Prisma 8 removed, naming what to write instead, with the field's `?` or `[]` right after the type and before any attribute. `undefined` when the field is not typed by a call, or `presets` has no row for the call that applies to a stack whose types `types` holds. A row applies where its type, called as the rewrite writes it, resolves as a column would, to the row's codec. A row is skipped when `isDeclared` says the schema declares the first name of its type, because the rewrite would then name the schema's declaration.\n*/\nfunction describeRemovedFieldPreset(presets, field, types, isDeclared) {\n\tconst call = field.typeConstructor;\n\tif (call === void 0) return void 0;\n\tconst path = call.path.join(\".\");\n\tconst preset = (Object.hasOwn(presets, path) ? presets[path] : void 0)?.find((row) => {\n\t\tconst [name] = row.type.path;\n\t\treturn writtenContributedTypeCodecId(types, {\n\t\t\tpath: row.type.path,\n\t\t\targs: Object.entries(row.type.options).map(([option, value]) => ({\n\t\t\t\tkind: \"named\",\n\t\t\t\tname: option,\n\t\t\t\tvalue,\n\t\t\t\tspan: call.span\n\t\t\t})),\n\t\t\tspan: call.span\n\t\t}) === row.codecId && (name === void 0 || !isDeclared(name));\n\t});\n\tif (preset === void 0) return void 0;\n\treturn `${printTypeConstructorCall(call)} was a field preset, and Prisma 8 removed field presets. ${preset.rewrite(call, typeModifier(field))}`;\n}\n//#endregion\n//#region src/type-choice-calls.ts\n/** The span of the argument at `index` of `descriptors` in `call`, named or positional, or the call's when it is not written. */\nfunction argumentSpan(call, descriptors, index) {\n\tif (index === void 0) return call.span;\n\tconst name = descriptors?.[index]?.name;\n\tconst named = call.args.find((arg) => arg.kind === \"named\" && arg.name === name);\n\tconst positional = call.args.filter((arg) => arg.kind === \"positional\")[index];\n\treturn (named ?? positional)?.span ?? call.span;\n}\n/** The index of the argument an authoring refusal names, when it names one. */\nfunction argumentIndexOf(error) {\n\tif (typeof error !== \"object\" || error === null || !(\"details\" in error)) return void 0;\n\tconst { details } = error;\n\tif (typeof details !== \"object\" || details === null || !(\"argumentIndex\" in details)) return;\n\treturn typeof details.argumentIndex === \"number\" ? details.argumentIndex : void 0;\n}\n/**\n* The column a field or type alias typed by the type choice `symbol` gets: its call's arguments, read as the choice declares them, choose a type constructor, which is instantiated with the arguments the choice passes on. A refusal is reported at the argument that makes it. `span` is where a bare use is written.\n*/\nfunction instantiatePslTypeChoice(input) {\n\tconst { symbol } = input;\n\tconst { descriptor } = symbol;\n\tconst helperPath = symbol.path.join(\".\");\n\tconst call = input.call ?? {\n\t\tpath: symbol.path,\n\t\targs: [],\n\t\tspan: input.span\n\t};\n\tconst subject = `${input.entityLabel} type \"${helperPath}\"`;\n\tconst unknown = call.args.find((arg) => arg.kind === \"named\" && !descriptor.args.some((declared) => declared.name === arg.name));\n\tif (unknown?.name !== void 0) {\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: unknownTypeChoiceArgumentMessage(subject, descriptor, unknown.name),\n\t\t\t...input.source.at(unknown.span)\n\t\t});\n\t\treturn;\n\t}\n\tconst args = mapPslHelperArgs({\n\t\targs: call.args,\n\t\tdescriptors: descriptor.args,\n\t\thelperLabel: `type \"${helperPath}\"`,\n\t\tspan: call.span,\n\t\tdiagnostics: input.diagnostics,\n\t\tsource: input.source,\n\t\tentityLabel: input.entityLabel,\n\t\tdataTypes: input.dataTypes\n\t});\n\tif (!args) return void 0;\n\tlet chosen;\n\ttry {\n\t\tchosen = resolveAuthoringTypeChoice({\n\t\t\thelperPath,\n\t\t\tdescriptor,\n\t\t\targs,\n\t\t\tconstructorNamed: (name) => symbol.choiceTypes.get(name)\n\t\t});\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${subject}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t...input.source.at(argumentSpan(call, descriptor.args, argumentIndexOf(error)))\n\t\t});\n\t\treturn;\n\t}\n\tconst output = instantiateAuthoringTypeConstructor(chosen.descriptor, chosen.args);\n\ttry {\n\t\tvalidateAuthoringTypeChoiceParams(helperPath, descriptor, chosen.descriptor, output.typeParams, input.codecLookup.descriptorFor(output.codecId)?.paramsSchema);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${subject}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t...input.source.at(argumentSpan(call, descriptor.args, argumentIndexOf(error)))\n\t\t});\n\t\treturn;\n\t}\n\treturn output;\n}\n//#endregion\n//#region src/unclaimed-blocks.ts\n/** A generic block is read only when a composed descriptor claims its keyword. */\nfunction claimedBlockKeywords(descriptors) {\n\tconst keywords = /* @__PURE__ */ new Set();\n\tfor (const [keyword, value] of Object.entries(descriptors ?? {})) if (isAuthoringPslBlockDescriptor(value)) keywords.add(keyword);\n\treturn keywords;\n}\nfunction unsupportedBlockDiagnostic(block, sources) {\n\treturn {\n\t\tcode: \"PSL_UNSUPPORTED_TOP_LEVEL_BLOCK\",\n\t\tmessage: `Unsupported top-level block \"${block.keyword}\"`,\n\t\t...diagnosticSource(sources, block.node.syntax).at(keywordPslSpan(block.node.syntax, block.keyword, sources))\n\t};\n}\n//#endregion\nexport { argumentIndexOf, argumentSpan, claimedBlockKeywords, consumeInvalidFkPairing, describeRemovedFieldPreset, enumMemberAttributeDiagnostics, fkRelationPairKey, hasPslInterpreter, instantiatePslTypeChoice, isBareTypeConstructor, mapPslHelperArgs, presetType, removedPresetWithPhases, removedPresetWrittenAs, reportTypeConstructorNotCalled, requiredOneToOneBackrelationDiagnostic, unsupportedBlockDiagnostic, withSeedDiagn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AO;AACR;;AAIA,SAAS,qBAAqB,aAAa;CAC1C,MAAM,2BAA2B,IAAI,IAAI;CACzC,KAAK,MAAM,CAAC,SAAS,UAAU,OAAO,QAAQ,eAAe,CAAC,CAAC,GAAG,IAAI,8BAA8B,KAAK,GAAG,SAAS,IAAI,OAAO;CAChI,OAAO;AACR;AACA,SAAS,2BAA2B,OAAO,SAAS;CACnD,OAAO;EACN,MAAM;EACN,SAAS,gCAAgC,MAAM,QAAQ;EACvD,GAAG,iBAAiB,SAAS,MAAM,KAAK,MAAM,CAAC,CAAC,GAAG,eAAe,MAAM,KAAK,QAAQ,MAAM,SAAS,OAAO,CAAC;CAC7G;AACD"}
@@ -1,4 +1,4 @@
1
- import { C as printSyntax, S as findFirstChild, _ as castExpression, a as IdentifierAst, b as filterChildren, c as ObjectLiteralExprAst, d as StringLiteralExprAst, f as SyntaxNode, g as any, h as TokenAtOffset, i as FunctionCallAst, l as PathExprAst, m as TaggedLiteralExprAst, n as AttributeArgAst, o as NumberLiteralExprAst, p as SyntaxToken, r as BooleanLiteralExprAst, s as ObjectFieldAst, t as ArrayLiteralAst, u as QualifiedNameAst, v as createSyntaxTree, x as findChildToken, y as dottedPathsIn } from "./expressions-CMQzbnHk-DUoL8DKO.mjs";
2
- import { _ as isTriviaKind, a as FieldDeclarationAst, c as MixinDeclarationAst, d as ModelDeclarationAst, f as NamedTypeDeclarationAst, g as isTrivia, h as TypesBlockAst, i as FieldAttributeAst, l as MixinInclusionAst, m as TypeAnnotationAst, n as CompositeTypeDeclarationAst, o as GenericBlockDeclarationAst, p as NamespaceDeclarationAst, r as DocumentAst, s as KeyValuePairAst, t as AttributeArgListAst, u as ModelAttributeAst, v as nonTriviaSibling, y as skipTriviaToken } from "./declarations-BgUAq1RG-1LikMIfo.mjs";
3
- import { a as greenToken, i as greenNode, n as PslSources, o as parse, r as SourceFile, t as GreenNodeBuilder } from "./parse-bZgfjovA-Duxv-s-s.mjs";
1
+ import { C as printSyntax, S as findFirstChild, _ as castExpression, a as IdentifierAst, b as filterChildren, c as ObjectLiteralExprAst, d as StringLiteralExprAst, f as SyntaxNode, g as any, h as TokenAtOffset, i as FunctionCallAst, l as PathExprAst, m as TaggedLiteralExprAst, n as AttributeArgAst, o as NumberLiteralExprAst, p as SyntaxToken, r as BooleanLiteralExprAst, s as ObjectFieldAst, t as ArrayLiteralAst, u as QualifiedNameAst, v as createSyntaxTree, x as findChildToken, y as dottedPathsIn } from "./expressions-BlhT51Ib-CQCMuQD8.mjs";
2
+ import { _ as isTriviaKind, a as FieldDeclarationAst, c as MixinDeclarationAst, d as ModelDeclarationAst, f as NamedTypeDeclarationAst, g as isTrivia, h as TypesBlockAst, i as FieldAttributeAst, l as MixinInclusionAst, m as TypeAnnotationAst, n as CompositeTypeDeclarationAst, o as GenericBlockDeclarationAst, p as NamespaceDeclarationAst, r as DocumentAst, s as KeyValuePairAst, t as AttributeArgListAst, u as ModelAttributeAst, v as nonTriviaSibling, y as skipTriviaToken } from "./declarations-8CRDqUTt-B0YG2lqY.mjs";
3
+ import { a as greenToken, i as greenNode, n as PslSources, o as parse, r as SourceFile, t as GreenNodeBuilder } from "./parse-D-B_nrfC-FsqZwLif.mjs";
4
4
  export { ArrayLiteralAst, AttributeArgAst, AttributeArgListAst, BooleanLiteralExprAst, CompositeTypeDeclarationAst, DocumentAst, FieldAttributeAst, FieldDeclarationAst, FunctionCallAst, GenericBlockDeclarationAst, GreenNodeBuilder, IdentifierAst, KeyValuePairAst, MixinDeclarationAst, MixinInclusionAst, ModelAttributeAst, ModelDeclarationAst, NamedTypeDeclarationAst, NamespaceDeclarationAst, NumberLiteralExprAst, ObjectFieldAst, ObjectLiteralExprAst, PathExprAst, PslSources, QualifiedNameAst, SourceFile, StringLiteralExprAst, SyntaxNode, SyntaxToken, TaggedLiteralExprAst, TokenAtOffset, TypeAnnotationAst, TypesBlockAst, any, castExpression, createSyntaxTree, dottedPathsIn, filterChildren, findChildToken, findFirstChild, greenNode, greenToken, isTrivia, isTriviaKind, nonTriviaSibling, parse, printSyntax, skipTriviaToken };
@@ -1,2 +1,2 @@
1
- import { t as Tokenizer } from "./tokenizer-C-GTKKjR-B1vOzJy0.mjs";
1
+ import { t as Tokenizer } from "./tokenizer-Dz9ZnxyT-C74mPv3k.mjs";
2
2
  export { Tokenizer };
@@ -1,5 +1,5 @@
1
1
  import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
2
- //#region ../../../1-framework/2-authoring/psl-parser/dist/tokenizer-C-GTKKjR.mjs
2
+ //#region ../../../1-framework/2-authoring/psl-parser/dist/tokenizer-Dz9ZnxyT.mjs
3
3
  var Tokenizer = class {
4
4
  #source;
5
5
  #pos;
@@ -79,7 +79,9 @@ function scanWhitespace(source, pos) {
79
79
  };
80
80
  }
81
81
  function scanComment(source, pos) {
82
- if (source.charAt(pos) !== "/" || source.charAt(pos + 1) !== "/") return void 0;
82
+ if (source.charAt(pos) !== "/") return void 0;
83
+ if (source.charAt(pos + 1) === "*") return scanBlockComment(source, pos);
84
+ if (source.charAt(pos + 1) !== "/") return void 0;
83
85
  let end = pos + 2;
84
86
  while (end < source.length) {
85
87
  const c = source.charAt(end);
@@ -91,6 +93,14 @@ function scanComment(source, pos) {
91
93
  text: source.slice(pos, end)
92
94
  };
93
95
  }
96
+ function scanBlockComment(source, pos) {
97
+ const close = source.indexOf("*/", pos + 2);
98
+ if (close === -1) return void 0;
99
+ return {
100
+ kind: "Comment",
101
+ text: source.slice(pos, close + 2)
102
+ };
103
+ }
94
104
  function scanAt(source, pos) {
95
105
  if (source.charAt(pos) !== "@") return void 0;
96
106
  if (source.charAt(pos + 1) === "@") return {
@@ -269,4 +279,4 @@ const PUNCTUATION = {
269
279
  //#endregion
270
280
  export { isPslIdentifier as n, isTerminatedStringLiteral as r, Tokenizer as t };
271
281
 
272
- //# sourceMappingURL=tokenizer-C-GTKKjR-B1vOzJy0.mjs.map
282
+ //# sourceMappingURL=tokenizer-Dz9ZnxyT-C74mPv3k.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenizer-Dz9ZnxyT-C74mPv3k.mjs","names":["#source","#pos","#buffer","#scanNext"],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/tokenizer-Dz9ZnxyT.mjs"],"sourcesContent":["import { blindCast } from \"@internal/utils/casts\";\n//#region src/tokenizer.ts\nvar Tokenizer = class {\n\t#source;\n\t#pos;\n\t#buffer;\n\tconstructor(source) {\n\t\tthis.#source = source;\n\t\tthis.#pos = 0;\n\t\tthis.#buffer = [];\n\t}\n\tnext() {\n\t\tconst next = this.#buffer.shift();\n\t\tif (next) return next;\n\t\treturn this.#scanNext();\n\t}\n\tpeek(offset = 0) {\n\t\tif (offset > this.#buffer.length) {\n\t\t\tconst last = this.#buffer.at(-1);\n\t\t\tif (last?.kind === \"Eof\") return last;\n\t\t}\n\t\tconst token = this.#buffer[offset];\n\t\tif (token) return token;\n\t\twhile (this.#buffer.length <= offset) {\n\t\t\tconst token = this.#scanNext();\n\t\t\tif (token.kind === \"Eof\") return token;\n\t\t\tthis.#buffer.push(token);\n\t\t}\n\t\treturn blindCast(this.#buffer[offset]);\n\t}\n\t#scanNext() {\n\t\tconst token = scan(this.#source, this.#pos);\n\t\tthis.#pos += token.text.length;\n\t\treturn token;\n\t}\n};\n/**\n* Whether the tokenizer reads `text` as one identifier: a letter or `_`, then letters, `_`, ASCII\n* digits or `-`, and not one of the number words `NaN` and `Infinity`.\n*/\nfunction isPslIdentifier(text) {\n\tconst token = scan(text, 0);\n\treturn token.kind === \"Ident\" && token.text === text;\n}\nfunction scan(source, pos) {\n\tif (pos >= source.length) return {\n\t\tkind: \"Eof\",\n\t\ttext: \"\"\n\t};\n\treturn scanNewline(source, pos) ?? scanWhitespace(source, pos) ?? scanComment(source, pos) ?? scanAt(source, pos) ?? scanKeywordNumber(source, pos) ?? scanIdent(source, pos) ?? scanNumber(source, pos) ?? scanString(source, pos) ?? scanPunctuation(source, pos) ?? {\n\t\tkind: \"Invalid\",\n\t\ttext: readChar(source, pos)\n\t};\n}\nfunction scanNewline(source, pos) {\n\tconst ch = source.charAt(pos);\n\tif (ch !== \"\\r\" && ch !== \"\\n\") return void 0;\n\tif (ch === \"\\r\" && source.charAt(pos + 1) === \"\\n\") return {\n\t\tkind: \"Newline\",\n\t\ttext: \"\\r\\n\"\n\t};\n\treturn {\n\t\tkind: \"Newline\",\n\t\ttext: ch\n\t};\n}\nfunction scanWhitespace(source, pos) {\n\tconst ch = source.charAt(pos);\n\tif (ch !== \" \" && ch !== \"\t\") return void 0;\n\tlet end = pos + 1;\n\twhile (end < source.length) {\n\t\tconst c = source.charAt(end);\n\t\tif (c !== \" \" && c !== \"\t\") break;\n\t\tend++;\n\t}\n\treturn {\n\t\tkind: \"Whitespace\",\n\t\ttext: source.slice(pos, end)\n\t};\n}\nfunction scanComment(source, pos) {\n\tif (source.charAt(pos) !== \"/\") return void 0;\n\tif (source.charAt(pos + 1) === \"*\") return scanBlockComment(source, pos);\n\tif (source.charAt(pos + 1) !== \"/\") return void 0;\n\tlet end = pos + 2;\n\twhile (end < source.length) {\n\t\tconst c = source.charAt(end);\n\t\tif (c === \"\\n\" || c === \"\\r\") break;\n\t\tend++;\n\t}\n\treturn {\n\t\tkind: \"Comment\",\n\t\ttext: source.slice(pos, end)\n\t};\n}\nfunction scanBlockComment(source, pos) {\n\tconst close = source.indexOf(\"*/\", pos + 2);\n\tif (close === -1) return void 0;\n\treturn {\n\t\tkind: \"Comment\",\n\t\ttext: source.slice(pos, close + 2)\n\t};\n}\nfunction scanAt(source, pos) {\n\tif (source.charAt(pos) !== \"@\") return void 0;\n\tif (source.charAt(pos + 1) === \"@\") return {\n\t\tkind: \"DoubleAt\",\n\t\ttext: \"@@\"\n\t};\n\treturn {\n\t\tkind: \"At\",\n\t\ttext: \"@\"\n\t};\n}\nfunction scanIdent(source, pos) {\n\tconst ch = readChar(source, pos);\n\tif (!isIdentStart(ch)) return void 0;\n\tlet end = pos + ch.length;\n\twhile (end < source.length) {\n\t\tconst c = readChar(source, end);\n\t\tif (isIdentPart(c)) end += c.length;\n\t\telse break;\n\t}\n\treturn {\n\t\tkind: \"Ident\",\n\t\ttext: source.slice(pos, end)\n\t};\n}\nconst KEYWORD_NUMBERS = [\n\t\"-Infinity\",\n\t\"Infinity\",\n\t\"NaN\"\n];\nfunction scanKeywordNumber(source, pos) {\n\tfor (const word of KEYWORD_NUMBERS) {\n\t\tif (!source.startsWith(word, pos)) continue;\n\t\tconst after = readChar(source, pos + word.length);\n\t\tif (after !== \"\" && isIdentPart(after)) return void 0;\n\t\treturn {\n\t\t\tkind: \"NumberLiteral\",\n\t\t\ttext: word\n\t\t};\n\t}\n}\nfunction scanNumber(source, pos) {\n\tlet end = pos;\n\tif (source.charAt(end) === \"-\" || source.charAt(end) === \"+\") {\n\t\tif (end + 1 >= source.length || !isDigit(source.charAt(end + 1))) return void 0;\n\t\tend++;\n\t} else if (!isDigit(source.charAt(end))) return;\n\tend++;\n\twhile (end < source.length && isDigit(source.charAt(end))) end++;\n\tif (source.charAt(end) === \".\" && end + 1 < source.length && isDigit(source.charAt(end + 1))) {\n\t\tend++;\n\t\twhile (end < source.length && isDigit(source.charAt(end))) end++;\n\t}\n\treturn {\n\t\tkind: \"NumberLiteral\",\n\t\ttext: source.slice(pos, end)\n\t};\n}\nconst QUOTES = /* @__PURE__ */ new Set([\n\t\"\\\"\",\n\t\"'\",\n\t\"`\"\n]);\n/**\n* A string in any of the three quote styles. A backslash escapes the next\n* character, so it never closes the string. A `\"` or `'` string ends at the\n* end of its line when unterminated. A backtick string may span lines; when\n* unterminated it ends before the first later line whose first non-blank\n* character is `}`, so the parser resumes at the block's closing brace, or at\n* the end of the input. That recovery only applies when no later backtick\n* exists: a later backtick closes the string first.\n*/\nfunction scanString(source, pos) {\n\tconst quote = source.charAt(pos);\n\tif (!QUOTES.has(quote)) return void 0;\n\tconst multiline = quote === \"`\";\n\tlet end = pos + 1;\n\twhile (end < source.length) {\n\t\tconst c = source.charAt(end);\n\t\tif (c === \"\\\\\" && end + 1 < source.length) {\n\t\t\tend += 2;\n\t\t\tcontinue;\n\t\t}\n\t\tif (c === quote) {\n\t\t\tend++;\n\t\t\treturn {\n\t\t\t\tkind: \"StringLiteral\",\n\t\t\t\ttext: source.slice(pos, end)\n\t\t\t};\n\t\t}\n\t\tif (!multiline && (c === \"\\n\" || c === \"\\r\")) return {\n\t\t\tkind: \"StringLiteral\",\n\t\t\ttext: source.slice(pos, end)\n\t\t};\n\t\tend++;\n\t}\n\tconst unterminatedEnd = multiline ? unterminatedBacktickStringEnd(source, pos + 1) : end;\n\treturn {\n\t\tkind: \"StringLiteral\",\n\t\ttext: source.slice(pos, unterminatedEnd)\n\t};\n}\nfunction unterminatedBacktickStringEnd(source, from) {\n\tlet lineStart = nextLineStart(source, from);\n\twhile (lineStart !== void 0) {\n\t\tlet cursor = lineStart;\n\t\twhile (source.charAt(cursor) === \" \" || source.charAt(cursor) === \"\t\") cursor++;\n\t\tif (source.charAt(cursor) === \"}\") return lineStart;\n\t\tlineStart = nextLineStart(source, cursor);\n\t}\n\treturn source.length;\n}\n/** The offset just past the next `\\r\\n`, `\\r`, or `\\n` at or after `from`. */\nfunction nextLineStart(source, from) {\n\tfor (let index = from; index < source.length; index++) {\n\t\tconst c = source.charAt(index);\n\t\tif (c === \"\\n\") return index + 1;\n\t\tif (c === \"\\r\") return source.charAt(index + 1) === \"\\n\" ? index + 2 : index + 1;\n\t}\n}\n/**\n* `scanString` emits the same `StringLiteral` kind for well-formed and\n* unterminated strings, so callers ask here to tell them apart.\n*\n* The closing quote is unescaped iff an **even** number of backslashes precede\n* it (each `\\\\` pair cancels; an odd run leaves the final `\\` escaping the\n* quote), so counting the trailing backslash run suffices — no full re-scan:\n*\n* - `\"ok\"` → 0 backslashes (even) → terminated\n* - `'a\\'` → 1 backslash (odd) → the quote is escaped → unterminated\n* - `\"a\\\\\"` → 2 backslashes (even) → escaped `\\`, real `\"` → terminated\n*/\nfunction isTerminatedStringLiteral(text) {\n\tconst quote = text.charAt(0);\n\tif (!QUOTES.has(quote)) return false;\n\tif (text.length < 2 || text.charAt(text.length - 1) !== quote) return false;\n\tlet backslashes = 0;\n\tfor (let i = text.length - 2; i >= 1 && text.charAt(i) === \"\\\\\"; i--) backslashes++;\n\treturn backslashes % 2 === 0;\n}\nfunction scanPunctuation(source, pos) {\n\tconst kind = PUNCTUATION[source.charAt(pos)];\n\tif (kind === void 0) return void 0;\n\treturn {\n\t\tkind,\n\t\ttext: source.charAt(pos)\n\t};\n}\nfunction readChar(source, pos) {\n\tconst cp = source.codePointAt(pos);\n\treturn cp !== void 0 ? String.fromCodePoint(cp) : \"\";\n}\nfunction isIdentStart(ch) {\n\treturn /\\p{L}/u.test(ch) || ch === \"_\";\n}\nfunction isIdentPart(ch) {\n\treturn isIdentStart(ch) || isDigit(ch) || ch === \"-\";\n}\nfunction isDigit(ch) {\n\treturn ch >= \"0\" && ch <= \"9\";\n}\nconst PUNCTUATION = {\n\t\"{\": \"LBrace\",\n\t\"}\": \"RBrace\",\n\t\"(\": \"LParen\",\n\t\")\": \"RParen\",\n\t\"[\": \"LBracket\",\n\t\"]\": \"RBracket\",\n\t\"=\": \"Equals\",\n\t\"?\": \"Question\",\n\t\".\": \"Dot\",\n\t\",\": \"Comma\",\n\t\":\": \"Colon\",\n\t\"+\": \"Plus\"\n};\n//#endregion\nexport { isPslIdentifier as n, isTerminatedStringLiteral as r, Tokenizer as t };\n\n//# sourceMappingURL=tokenizer-Dz9ZnxyT.mjs.map"],"mappings":";;AAEA,IAAI,YAAY,MAAM;CACrB;CACA;CACA;CACA,YAAY,QAAQ;EACnB,KAAKA,UAAU;EACf,KAAKC,OAAO;EACZ,KAAKC,UAAU,CAAC;CACjB;CACA,OAAO;EACN,MAAM,OAAO,KAAKA,QAAQ,MAAM;EAChC,IAAI,MAAM,OAAO;EACjB,OAAO,KAAKC,UAAU;CACvB;CACA,KAAK,SAAS,GAAG;EAChB,IAAI,SAAS,KAAKD,QAAQ,QAAQ;GAC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,QAAQ;CAChF;AACD;;;;;;;;;;;;;AAaA,SAAS,0BAA0B,MAAM;CACxC,MAAM,QAAQ,KAAK,OAAO,CAAC;CAC3B,IAAI,CAAC,OAAO,IAAI,KAAK,GAAG,OAAO;CAC/B,IAAI,KAAK,SAAS,KAAK,KAAK,OAAO,KAAK,SAAS,CAAC,MAAM,OAAO,OAAO;CACtE,IAAI,cAAc;CAClB,KAAK,IAAI,IAAI,KAAK,SAAS,GAAG,KAAK,KAAK,KAAK,OAAO,CAAC,MAAM,MAAM,KAAK;CACtE,OAAO,cAAc,MAAM;AAC5B;AACA,SAAS,gBAAgB,QAAQ,KAAK;CACrC,MAAM,OAAO,YAAY,OAAO,OAAO,GAAG;CAC1C,IAAI,SAAS,KAAK,GAAG,OAAO,KAAK;CACjC,OAAO;EACN;EACA,MAAM,OAAO,OAAO,GAAG;CACxB;AACD;AACA,SAAS,SAAS,QAAQ,KAAK;CAC9B,MAAM,KAAK,OAAO,YAAY,GAAG;CACjC,OAAO,OAAO,KAAK,IAAI,OAAO,cAAc,EAAE,IAAI;AACnD;AACA,SAAS,aAAa,IAAI;CACzB,OAAO,SAAS,KAAK,EAAE,KAAK,OAAO;AACpC;AACA,SAAS,YAAY,IAAI;CACxB,OAAO,aAAa,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO;AAClD;AACA,SAAS,QAAQ,IAAI;CACpB,OAAO,MAAM,OAAO,MAAM;AAC3B;AACA,MAAM,cAAc;CACnB,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;AACN"}
@@ -3,8 +3,8 @@ import { n as notOk, r as ok } from "./result-8OXF26MN.mjs";
3
3
  import { c as createDataTypeLookup, u as dataTypeId } from "./data-type-V6mcDhcG-DVQAPOQT.mjs";
4
4
  import { B as resolveAuthoringTypeChoice, X as typeConstructorLookup, _ as describeTaggedLiteralFailure } from "./temporal-type-aliases-CFh3BW2a-DOlmiuQn.mjs";
5
5
  import { C as readWrittenValueAs, l as describeExpected, t as admittedForms } from "./authoring-DnYn5EZT.mjs";
6
- import { C as printSyntax, a as IdentifierAst, c as ObjectLiteralExprAst, d as StringLiteralExprAst, i as FunctionCallAst, m as TaggedLiteralExprAst, o as NumberLiteralExprAst, r as BooleanLiteralExprAst, t as ArrayLiteralAst } from "./expressions-CMQzbnHk-DUoL8DKO.mjs";
7
- //#region ../../../1-framework/2-authoring/psl-parser/dist/contributed-type-scope-Ds4uDG91.mjs
6
+ import { C as printSyntax, a as IdentifierAst, c as ObjectLiteralExprAst, d as StringLiteralExprAst, i as FunctionCallAst, m as TaggedLiteralExprAst, o as NumberLiteralExprAst, r as BooleanLiteralExprAst, t as ArrayLiteralAst } from "./expressions-BlhT51Ib-CQCMuQD8.mjs";
7
+ //#region ../../../1-framework/2-authoring/psl-parser/dist/contributed-type-scope-CUwinsgb.mjs
8
8
  function diagnosticSource(sources, node) {
9
9
  return {
10
10
  sources,
@@ -535,4 +535,4 @@ function reportTypeConstructorNotCalled(input) {
535
535
  //#endregion
536
536
  export { typeAttributeSpecContextOfField as C, readWrittenScalar as S, writtenContributedTypeCodecId as T, printTypeConstructorCall as _, chosenTypeConstructor as a, readResolvedAttributes as b, contributedTypeScope as c, diagnosticSource as d, isContributedTypeChoice as f, nodePslSpan as g, mapPslHelperArgs as h, argumentsByParameter as i, createPslDiagnosticCollector as l, mapPslDiagnostics as m, reportTypeConstructorNotCalled as n, contributedTypeAt as o, keywordPslSpan as p, EMPTY_DATA_TYPES as r, contributedTypeCodecId as s, isBareTypeConstructor as t, diagnosticFromSpan as u, readExpressionAs as v, typeAttributeSubjectLabel as w, readResolvedConstructorCall as x, readResolvedAttribute as y };
537
537
 
538
- //# sourceMappingURL=type-constructor-calls-Bfg5ojed-DwjW6zNQ.mjs.map
538
+ //# sourceMappingURL=type-constructor-calls-Bfg5ojed-Ld7LE20u.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-constructor-calls-Bfg5ojed-DwjW6zNQ.mjs","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/contributed-type-scope-Ds4uDG91.mjs","../../../../1-framework/2-authoring/psl-parser/dist/type-constructor-calls-Bfg5ojed.mjs"],"sourcesContent":["import { a as NumberLiteralExprAst, i as FunctionCallAst, l as StringLiteralExprAst, m as IdentifierAst, r as BooleanLiteralExprAst, s as ObjectLiteralExprAst, t as ArrayLiteralAst, u as TaggedLiteralExprAst, y as printSyntax } from \"./expressions-CMQzbnHk.mjs\";\nimport { admittedForms, describeExpected, readWrittenValueAs, resolveAuthoringTypeChoice, typeConstructorLookup } from \"@internal/framework-components/authoring\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { describeTaggedLiteralFailure } from \"@internal/framework-components/control\";\nimport { createDataTypeLookup, dataTypeId } from \"@internal/framework-components/codec\";\n//#region src/diagnostic.ts\nfunction diagnosticSource(sources, node) {\n\treturn {\n\t\tsources,\n\t\tnode,\n\t\tat(span) {\n\t\t\tconst sourceFile = sources.sourceFileFor(node);\n\t\t\tconst range = span === void 0 ? {\n\t\t\t\tstart: sourceFile.positionAt(node.offset),\n\t\t\t\tend: sourceFile.positionAt(node.endOffset)\n\t\t\t} : sourceFile.pslSpanToRange(span);\n\t\t\treturn {\n\t\t\t\tfilename: sourceFile.filename,\n\t\t\t\trange\n\t\t\t};\n\t\t}\n\t};\n}\nfunction diagnosticFromSpan(diagnostic, source) {\n\tif (diagnostic.span === void 0) throw new InternalError(\"Owned PSL diagnostic has no span\");\n\treturn {\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\t...source.at(diagnostic.span),\n\t\t...diagnostic.data === void 0 ? {} : { data: diagnostic.data }\n\t};\n}\nfunction mapPslDiagnostics(diagnostics, sources) {\n\treturn diagnostics.map(({ filename, code, message, range, data }) => ({\n\t\tcode,\n\t\tmessage,\n\t\tsourceId: filename,\n\t\tspan: sources.sourceFileNamed(filename).rangeToPslSpan(range),\n\t\t...data === void 0 ? {} : { data }\n\t}));\n}\nfunction createPslDiagnosticCollector(sources) {\n\tconst entries = [];\n\treturn {\n\t\tget length() {\n\t\t\treturn entries.length;\n\t\t},\n\t\tpush(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"psl\",\n\t\t\t\tdiagnostic\n\t\t\t});\n\t\t},\n\t\tpushUnlocated(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"psl\",\n\t\t\t\tdiagnostic,\n\t\t\t\tomitSpan: true\n\t\t\t});\n\t\t},\n\t\tpushExternal(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"external\",\n\t\t\t\tdiagnostic\n\t\t\t});\n\t\t},\n\t\ttoExternal() {\n\t\t\treturn entries.flatMap((entry) => {\n\t\t\t\tif (entry.kind === \"external\") return [entry.diagnostic];\n\t\t\t\tif (entry.omitSpan) {\n\t\t\t\t\tconst { code, message, filename, data } = entry.diagnostic;\n\t\t\t\t\treturn [{\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t\tsourceId: filename,\n\t\t\t\t\t\t...data === void 0 ? {} : { data }\n\t\t\t\t\t}];\n\t\t\t\t}\n\t\t\t\treturn mapPslDiagnostics([entry.diagnostic], sources);\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/resolve.ts\nfunction readResolvedAttribute(attribute, sources) {\n\treturn {\n\t\tname: attributeName(attribute.name()),\n\t\targs: readResolvedArgList(attribute.argList(), sources),\n\t\tspan: nodePslSpan(attribute.syntax, sources),\n\t\tnode: attribute\n\t};\n}\nfunction readResolvedAttributes(attributes, sources) {\n\treturn Array.from(attributes, (attribute) => readResolvedAttribute(attribute, sources));\n}\nfunction readResolvedConstructorCall(annotation, sources) {\n\tconst argList = annotation?.argList();\n\tif (annotation === void 0 || argList === void 0) return void 0;\n\treturn {\n\t\tpath: annotation.name()?.path() ?? [],\n\t\targs: readResolvedArgList(argList, sources),\n\t\tspan: nodePslSpan(annotation.syntax, sources)\n\t};\n}\nfunction readResolvedArgList(argList, sources) {\n\tif (argList === void 0) return [];\n\tconst args = [];\n\tfor (const arg of argList.args()) {\n\t\tconst name = arg.name()?.name();\n\t\tconst expression = arg.value();\n\t\targs.push({\n\t\t\tkind: name !== void 0 ? \"named\" : \"positional\",\n\t\t\t...name !== void 0 ? { name } : {},\n\t\t\tvalue: renderExpression(expression),\n\t\t\t...expression !== void 0 ? { expression } : {},\n\t\t\tspan: nodePslSpan(arg.syntax, sources),\n\t\t\tnode: arg\n\t\t});\n\t}\n\treturn args;\n}\nfunction attributeName(name) {\n\treturn name?.path().join(\".\") ?? \"\";\n}\nfunction renderExpression(expression) {\n\tif (expression === void 0) return \"\";\n\treturn printSyntax(expression.syntax).trim();\n}\nfunction nodePslSpan(node, sources) {\n\tconst sourceFile = sources.sourceFileFor(node);\n\tconst start = node.offset;\n\tconst end = start + node.green.textLength;\n\treturn {\n\t\tstart: sourceFile.offsetToPslPosition(start),\n\t\tend: sourceFile.offsetToPslPosition(end)\n\t};\n}\n/** Unsupported-top-level-block diagnostics are anchored to the keyword token. */\nfunction keywordPslSpan(node, keyword, sources) {\n\tconst sourceFile = sources.sourceFileFor(node);\n\tconst start = node.offset;\n\tconst end = start + keyword.length;\n\treturn {\n\t\tstart: sourceFile.offsetToPslPosition(start),\n\t\tend: sourceFile.offsetToPslPosition(end)\n\t};\n}\n//#endregion\n//#region src/written-scalar.ts\nconst AN_EXPRESSION = {\n\tok: false,\n\treason: \"not-a-literal\",\n\tfound: \"an expression\"\n};\nfunction written(value) {\n\treturn {\n\t\tok: true,\n\t\twritten: value\n\t};\n}\n/** Reads a PSL literal expression as a `WrittenScalar`, for a position that takes a value of a data type. ADR 254. */\nfunction readWrittenScalar(expression) {\n\tconst syntax = expression.syntax;\n\tconst string = StringLiteralExprAst.cast(syntax)?.value();\n\tif (string !== void 0) return written({\n\t\tkind: \"string\",\n\t\ttext: string\n\t});\n\tconst number = NumberLiteralExprAst.cast(syntax);\n\tif (number !== void 0) {\n\t\tconst text = number.token()?.text;\n\t\treturn text === void 0 ? AN_EXPRESSION : written({\n\t\t\tkind: \"number\",\n\t\t\ttext\n\t\t});\n\t}\n\tconst boolean = BooleanLiteralExprAst.cast(syntax)?.value();\n\tif (boolean !== void 0) return written({\n\t\tkind: \"boolean\",\n\t\tvalue: boolean\n\t});\n\tconst tagged = TaggedLiteralExprAst.cast(syntax);\n\tif (tagged !== void 0) {\n\t\tconst canonicalization = tagged.canonicalization();\n\t\treturn canonicalization.ok ? written({\n\t\t\tkind: \"tag\",\n\t\t\ttag: tagged.tagName(),\n\t\t\ttext: canonicalization.text\n\t\t}) : {\n\t\t\tok: false,\n\t\t\treason: canonicalization.reason\n\t\t};\n\t}\n\tif (IdentifierAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"an identifier\"\n\t};\n\tif (FunctionCallAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"a function call\"\n\t};\n\tif (ArrayLiteralAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"a list\"\n\t};\n\tif (ObjectLiteralExprAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"an object\"\n\t};\n\treturn AN_EXPRESSION;\n}\n//#endregion\n//#region src/read-expression-as.ts\nconst TAGGED_LITERAL_FAILURE_CODES = {\n\tnul: \"PSL_TAGGED_LITERAL_NUL\",\n\t\"too-large\": \"PSL_TAGGED_LITERAL_TOO_LARGE\"\n};\n/**\n* Reads `expression` as a value of `dataType`: the literal is read through the authoring entry for its syntax, then taken into `dataType` directly or through a cast it declares. The read every argument typed by a data type takes, in an attribute or a type constructor. ADR 254.\n*/\nfunction readExpressionAs(support, dataType, expression) {\n\tif (!support.lookup.has(dataType)) throw new InternalError(`An argument receives data type \"${dataType}\", which this stack does not register.`);\n\tconst forms = admittedForms(support, [dataType]);\n\tif (forms.length === 0) throw new InternalError(`An argument receives data type \"${dataType}\", which nothing in this stack writes.`);\n\tconst literal = readWrittenScalar(expression);\n\tif (!literal.ok) return literal.reason === \"not-a-literal\" ? notOk({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_SYNTAX\",\n\t\tmessage: `${describeExpected(forms)}; got ${literal.found}`\n\t}) : notOk({\n\t\tcode: TAGGED_LITERAL_FAILURE_CODES[literal.reason],\n\t\tmessage: describeTaggedLiteralFailure(literal.reason)\n\t});\n\treturn readWrittenValueAs(support, dataType, literal.written);\n}\n//#endregion\n//#region src/attribute-spec/spec-context.ts\n/** The data types of a stack that registers none. */\nconst EMPTY_DATA_TYPES = {\n\tentries: {},\n\tlookup: createDataTypeLookup([]),\n\tdataTypeOfCodec: () => void 0\n};\n/** How a diagnostic names a subject, as in `Field \"Post.slug\"` or `Type alias \"Slug\"`. */\nfunction typeAttributeSubjectLabel(subject) {\n\treturn `${subject.kind === \"field\" ? \"Field\" : \"Type alias\"} \"${subject.name}\"`;\n}\nfunction typeAttributeSpecContextOfField(ctx) {\n\treturn {\n\t\tsymbols: ctx.symbols,\n\t\tdefaultFunctionRegistry: ctx.defaultFunctionRegistry,\n\t\tgeneratorFunctions: ctx.generatorFunctions,\n\t\tdataTypes: ctx.dataTypes,\n\t\tsubject: {\n\t\t\tkind: \"field\",\n\t\t\tname: `${ctx.model.name}.${ctx.field.name}`\n\t\t},\n\t\tlist: ctx.field.list,\n\t\ttypeName: ctx.field.typeName,\n\t\ttypeResolution: ctx.typeResolution,\n\t\tcontributedType: ctx.contributedType\n\t};\n}\n//#endregion\n//#region src/call-arguments.ts\n/** The call as the schema writes it, with its arguments separated by `, `. */\nfunction printTypeConstructorCall(call) {\n\tconst args = call.args.map((arg) => arg.kind === \"named\" ? `${arg.name}: ${arg.value}` : arg.value);\n\treturn `${call.path.join(\".\")}(${args.join(\", \")})`;\n}\n/**\n* Binds a call's arguments to its parameters, as PSL reads every call: the positional arguments fill the parameters in order, wherever named ones sit among them, and a named argument fills the parameter it names, which no other argument may fill. The bound arguments come positional ones first, then named ones, each in the order written.\n*/\nfunction bindCallArguments(args, parameters) {\n\tconst positional = args.filter((arg) => arg.kind === \"positional\");\n\tif (positional.length > parameters.length) return notOk({\n\t\tkind: \"tooManyPositional\",\n\t\treceived: positional.length,\n\t\tbound: []\n\t});\n\tconst bound = positional.map((argument, index) => ({\n\t\targument,\n\t\tindex\n\t}));\n\tconst filled = new Set(bound.map(({ index }) => index));\n\tfor (const argument of args.filter((arg) => arg.kind === \"named\")) {\n\t\tconst index = argument.name === void 0 ? -1 : parameters.indexOf(argument.name);\n\t\tif (index < 0) return notOk({\n\t\t\tkind: \"unknownName\",\n\t\t\targument,\n\t\t\tbound\n\t\t});\n\t\tif (filled.has(index)) return notOk({\n\t\t\tkind: \"filledTwice\",\n\t\t\targument,\n\t\t\tbound\n\t\t});\n\t\tfilled.add(index);\n\t\tbound.push({\n\t\t\targument,\n\t\t\tindex\n\t\t});\n\t}\n\treturn ok(bound);\n}\n/** Each argument's value, keyed by the parameter it fills, as {@link bindCallArguments} binds them; `undefined` when they do not bind. */\nfunction argumentsByParameter(args, parameters) {\n\tconst bound = bindCallArguments(args, parameters);\n\tif (!bound.ok) return void 0;\n\tconst values = /* @__PURE__ */ new Map();\n\tfor (const { argument, index } of bound.value) {\n\t\tconst parameter = parameters[index];\n\t\tif (parameter === void 0) return void 0;\n\t\tvalues.set(parameter, argument.value);\n\t}\n\treturn values;\n}\n//#endregion\n//#region src/authoring-arguments.ts\nconst INVALID_AUTHORING_ARGUMENT = Symbol(\"invalidAuthoringArgument\");\n/** Why a written value is not one of the names an option takes, and, for a number that only one value argument takes, that argument. */\nfunction misplacedOptionMessage(descriptors, dataTypes, option, written, argumentLabel) {\n\tconst refused = `${argumentLabel} is ${written}, but argument \"${option.name}\" takes one of these names, written without quotes: ${option.values.join(\", \")}.`;\n\tif (!/^[+-]?\\d/.test(written)) return refused;\n\tconst takers = descriptors.flatMap((descriptor) => descriptor.kind === \"value\" && descriptor.name !== void 0 && readWrittenValueAs(dataTypes, dataTypeId(descriptor.dataType), {\n\t\tkind: \"number\",\n\t\ttext: written\n\t}).ok ? [descriptor.name] : []);\n\tconst [taker] = takers;\n\treturn takers.length === 1 && taker !== void 0 ? `${refused} Write ${taker} by name, as in ${taker}: ${written}.` : refused;\n}\nconst SILENT_REFUSALS = {\n\tcall: () => {},\n\targument: () => {},\n\tvalue: () => {}\n};\n/**\n* The value of one argument as `descriptor` reads it: a `value` argument as a value of its data type, read from its expression as attribute arguments are, and a type choice's option as a bare name. A refusal is reported at the argument.\n*/\nfunction readPslHelperArgument(input, refusals, descriptor, argument, argumentLabel) {\n\tconst refuse = (message) => {\n\t\trefusals.argument(argument.span, message);\n\t\treturn INVALID_AUTHORING_ARGUMENT;\n\t};\n\tif (descriptor.kind === \"option\") {\n\t\tconst written = argument.value.trim();\n\t\tif (/^[A-Za-z_][A-Za-z0-9_]*$/.test(written)) return written;\n\t\treturn refuse(misplacedOptionMessage(input.descriptors, input.dataTypes, descriptor, written, argumentLabel));\n\t}\n\tconst { expression } = argument;\n\tif (expression === void 0 && argument.node !== void 0) return refuse(`${argumentLabel} has no value.`);\n\tif (expression === void 0) throw new InternalError(`A call received ${argumentLabel} with no expression. A value argument is read from the expression a schema writes; a reader that builds a call must pass the arguments it parsed, or instantiate the constructor with values.`);\n\tconst read = readExpressionAs(input.dataTypes, dataTypeId(descriptor.dataType), expression);\n\tif (read.ok) return read.value.value;\n\trefusals.value(expression.syntax, read.failure);\n\treturn INVALID_AUTHORING_ARGUMENT;\n}\nfunction readPslHelperArgsReporting(input, refusals) {\n\tconst bound = bindCallArguments(input.args, input.descriptors.map((descriptor) => descriptor?.name));\n\tconst mappedArgs = input.descriptors.map(() => void 0);\n\tfor (const { argument, index } of bound.ok ? bound.value : bound.failure.bound) {\n\t\tconst descriptor = input.descriptors[index];\n\t\tif (!descriptor) {\n\t\t\trefusals.argument(argument.span, `does not define positional argument #${index + 1}.`);\n\t\t\treturn;\n\t\t}\n\t\tconst value = readPslHelperArgument(input, refusals, descriptor, argument, argument.kind === \"named\" ? `named argument \"${argument.name}\"` : `argument #${index + 1}`);\n\t\tif (value === INVALID_AUTHORING_ARGUMENT) return void 0;\n\t\tmappedArgs[index] = value;\n\t}\n\tif (bound.ok) return mappedArgs;\n\tconst failure = bound.failure;\n\tswitch (failure.kind) {\n\t\tcase \"tooManyPositional\":\n\t\t\trefusals.call(`accepts at most ${input.descriptors.length} argument(s), received ${failure.received}.`);\n\t\t\treturn;\n\t\tcase \"unknownName\":\n\t\t\trefusals.argument(failure.argument.span, `received unknown named argument \"${failure.argument.name}\".`);\n\t\t\treturn;\n\t\tcase \"filledTwice\":\n\t\t\trefusals.argument(failure.argument.span, `received duplicate value for argument \"${failure.argument.name}\".`);\n\t\t\treturn;\n\t}\n}\n/**\n* The arguments of a type constructor or type choice call, positional and named, each read as its descriptor says. `undefined`, with a diagnostic pushed, when one cannot be read or does not match a descriptor.\n*/\nfunction mapPslHelperArgs(input) {\n\tconst refused = (span, message) => input.diagnostics.push({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\tmessage: `${input.entityLabel} ${input.helperLabel} ${message}`,\n\t\t...input.source.at(span)\n\t});\n\treturn readPslHelperArgsReporting(input, {\n\t\tcall: (message) => refused(input.span, message),\n\t\targument: refused,\n\t\tvalue: (node, failure) => input.diagnostics.push({\n\t\t\tcode: failure.code,\n\t\t\tmessage: failure.message,\n\t\t\t...input.source.at(nodePslSpan(node, input.source.sources))\n\t\t})\n\t});\n}\n/**\n* The arguments of a call read as {@link mapPslHelperArgs} reads them, without reporting what it refuses: `undefined` when the call does not read, which the reader that resolves the column reports.\n*/\nfunction readPslHelperArgs(input) {\n\treturn readPslHelperArgsReporting(input, SILENT_REFUSALS);\n}\n//#endregion\n//#region src/contributed-type-scope.ts\nfunction isContributedTypeChoice(symbol) {\n\treturn symbol.descriptor.kind === \"typeChoice\";\n}\nfunction isContributedTypeDescriptor(value) {\n\treturn \"kind\" in value && (value.kind === \"typeConstructor\" || value.kind === \"typeAlias\" || value.kind === \"typeChoice\");\n}\n/** The explicit type a call of the type choice `symbol` chooses and the arguments it is built with, reading the call as the column does, or why it chooses none. */\nfunction chosenTypeConstructor(symbol, call, dataTypes) {\n\tconst helperPath = symbol.path.join(\".\");\n\tconst args = readPslHelperArgs({\n\t\targs: call?.args ?? [],\n\t\tdescriptors: symbol.descriptor.args,\n\t\tdataTypes\n\t});\n\tif (args === void 0) return notOk(`The arguments of ${helperPath} do not read.`);\n\ttry {\n\t\treturn ok(resolveAuthoringTypeChoice({\n\t\t\thelperPath,\n\t\t\tdescriptor: symbol.descriptor,\n\t\t\targs,\n\t\t\tconstructorNamed: (name) => symbol.choiceTypes.get(name)\n\t\t}));\n\t} catch (error) {\n\t\tif (isInternalError(error) || !(error instanceof Error)) throw error;\n\t\treturn notOk(error.message);\n\t}\n}\n/** The codec a column typed by `use` is stored with; `undefined` for a type choice whose call chooses no type, which the column's resolution reports. */\nfunction contributedTypeCodecId(use, dataTypes) {\n\tconst { symbol } = use;\n\tif (isContributedTypeChoice(symbol)) {\n\t\tconst chosen = chosenTypeConstructor(symbol, use.call, dataTypes);\n\t\treturn chosen.ok ? chosen.value.descriptor.output.codecId : void 0;\n\t}\n\tconst { descriptor } = symbol;\n\treturn descriptor.kind === \"typeAlias\" ? descriptor.output.type.codecId : descriptor.output.codecId;\n}\n/** The descriptor at `path` in `namespace`, or `undefined` when none is contributed there. */\nfunction contributedTypeAt(namespace, path) {\n\tconst [name, ...rest] = path;\n\tif (name === void 0 || !Object.hasOwn(namespace, name)) return void 0;\n\tconst value = namespace[name];\n\tif (value === void 0) return void 0;\n\tif (isContributedTypeDescriptor(value)) return rest.length === 0 ? value : void 0;\n\treturn contributedTypeAt(value, rest);\n}\n/** The codec a column typed by `call` is stored with, reading the call's arguments as the column does, or `undefined` when no type is contributed at its path or it is a type choice whose arguments choose no type. */\nfunction writtenContributedTypeCodecId(namespace, call) {\n\treturn codecIdAtPath(namespace, call.path, [], call);\n}\nfunction codecIdAtPath(namespace, path, prefix, call) {\n\tconst [name, ...rest] = path;\n\tif (name === void 0 || !Object.hasOwn(namespace, name)) return void 0;\n\tconst value = namespace[name];\n\tif (value === void 0) return void 0;\n\tconst at = [...prefix, name];\n\tif (!isContributedTypeDescriptor(value)) return codecIdAtPath(value, rest, at, call);\n\tif (rest.length > 0) return void 0;\n\treturn contributedTypeCodecId({\n\t\tsymbol: contributedTypeSymbol(name, at, value, namespace),\n\t\tcall\n\t}, EMPTY_DATA_TYPES);\n}\nfunction contributedTypeScope(contributedTypes) {\n\tconst members = collect(contributedTypes, []);\n\treturn {\n\t\tlookup(name) {\n\t\t\treturn members.get(name);\n\t\t},\n\t\tentries() {\n\t\t\treturn members.entries();\n\t\t}\n\t};\n}\nfunction collect(namespace, prefix) {\n\tconst members = /* @__PURE__ */ new Map();\n\tfor (const [name, value] of Object.entries(namespace)) {\n\t\tconst path = [...prefix, name];\n\t\tmembers.set(name, isContributedTypeDescriptor(value) ? contributedTypeSymbol(name, path, value, namespace) : {\n\t\t\tkind: \"contributedNamespace\",\n\t\t\tname,\n\t\t\tpath,\n\t\t\tmembers: collect(value, path)\n\t\t});\n\t}\n\treturn members;\n}\nfunction contributedTypeSymbol(name, path, descriptor, namespace) {\n\tif (descriptor.kind !== \"typeChoice\") return {\n\t\tkind: \"contributedType\",\n\t\tname,\n\t\tpath,\n\t\tdescriptor\n\t};\n\tconst constructorNamed = typeConstructorLookup(namespace);\n\tconst choiceTypes = /* @__PURE__ */ new Map();\n\tfor (const { type } of descriptor.choices) {\n\t\tconst chosen = constructorNamed(type);\n\t\tif (chosen !== void 0) choiceTypes.set(type, chosen);\n\t}\n\treturn {\n\t\tkind: \"contributedType\",\n\t\tname,\n\t\tpath,\n\t\tdescriptor,\n\t\tchoiceTypes\n\t};\n}\n//#endregion\nexport { mapPslDiagnostics as C, diagnosticSource as S, readResolvedAttribute as _, isContributedTypeChoice as a, createPslDiagnosticCollector as b, argumentsByParameter as c, typeAttributeSpecContextOfField as d, typeAttributeSubjectLabel as f, nodePslSpan as g, keywordPslSpan as h, contributedTypeScope as i, printTypeConstructorCall as l, readWrittenScalar as m, contributedTypeAt as n, writtenContributedTypeCodecId as o, readExpressionAs as p, contributedTypeCodecId as r, mapPslHelperArgs as s, chosenTypeConstructor as t, EMPTY_DATA_TYPES as u, readResolvedAttributes as v, diagnosticFromSpan as x, readResolvedConstructorCall as y };\n\n//# sourceMappingURL=contributed-type-scope-Ds4uDG91.mjs.map","//#region src/type-constructor-calls.ts\nfunction isBareTypeConstructor(descriptor) {\n\treturn descriptor.entityRefArg === void 0 && (descriptor.args ?? []).every((arg) => arg.optional === true);\n}\nfunction argumentSpelling(descriptor) {\n\tconst args = descriptor.args ?? [];\n\tconst reference = descriptor.entityRefArg;\n\tconst count = Math.max(args.length, (reference?.index ?? -1) + 1);\n\tconst names = [];\n\tfor (let index = 0; index < count; index++) {\n\t\tconst arg = args[index];\n\t\tif (index === reference?.index) names.push(reference.entityKind);\n\t\telse if (arg !== void 0 && arg.optional !== true) names.push(arg.name ?? `argument${index + 1}`);\n\t}\n\treturn names.join(\", \");\n}\nfunction reportTypeConstructorNotCalled(input) {\n\tinput.diagnostics.push({\n\t\tcode: \"PSL_TYPE_CONSTRUCTOR_NOT_CALLED\",\n\t\tmessage: `${input.entityLabel} uses type constructor \"${input.path}\" without arguments. Write ${input.path}(${argumentSpelling(input.descriptor)}).`,\n\t\t...input.source.at(input.span)\n\t});\n}\n//#endregion\nexport { reportTypeConstructorNotCalled as n, isBareTypeConstructor as t };\n\n//# sourceMappingURL=type-constructor-calls-Bfg5ojed.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,iBAAiB,SA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C,MAAM,SAAS,iBAAiB,IAAI;EACpC,IAAI,WAAW,KAAK,GAAG,YAAY,IAAI,MAAM,MAAM;CACpD;CACA,OAAO;EACN,MAAM;EACN;EACA;EACA;EACA;CACD;AACD;;;AC1gBA,SAAS,sBAAsB,YAAY;CAC1C,OAAO,WAAW,iBAAiB,KAAK,MAAM,WAAW,QAAQ,CAAC,EAAA,CAAG,OAAO,QAAQ,IAAI,aAAa,IAAI;AAC1G;AACA,SAAS,iBAAiB,YAAY;CACrC,MAAM,OAAO,WAAW,QAAQ,CAAC;CACjC,MAAM,YAAY,WAAW;CAC7B,MAAM,QAAQ,KAAK,IAAI,KAAK,SAAS,WAAW,SAAS,MAAM,CAAC;CAChE,MAAM,QAAQ,CAAC;CACf,KAAK,IAAI,QAAQ,GAAG,QAAQ,OAAO,SAAS;EAC3C,MAAM,MAAM,KAAK;EACjB,IAAI,UAAU,WAAW,OAAO,MAAM,KAAK,UAAU,UAAU;OAC1D,IAAI,QAAQ,KAAK,KAAK,IAAI,aAAa,MAAM,MAAM,KAAK,IAAI,QAAQ,WAAW,QAAQ,GAAG;CAChG;CACA,OAAO,MAAM,KAAK,IAAI;AACvB;AACA,SAAS,+BAA+B,OAAO;CAC9C,MAAM,YAAY,KAAK;EACtB,MAAM;EACN,SAAS,GAAG,MAAM,YAAY,0BAA0B,MAAM,KAAK,6BAA6B,MAAM,KAAK,GAAG,iBAAiB,MAAM,UAAU,EAAE;EACjJ,GAAG,MAAM,OAAO,GAAG,MAAM,IAAI;CAC9B,CAAC;AACF"}
1
+ {"version":3,"file":"type-constructor-calls-Bfg5ojed-Ld7LE20u.mjs","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/contributed-type-scope-CUwinsgb.mjs","../../../../1-framework/2-authoring/psl-parser/dist/type-constructor-calls-Bfg5ojed.mjs"],"sourcesContent":["import { a as NumberLiteralExprAst, i as FunctionCallAst, l as StringLiteralExprAst, m as IdentifierAst, r as BooleanLiteralExprAst, s as ObjectLiteralExprAst, t as ArrayLiteralAst, u as TaggedLiteralExprAst, y as printSyntax } from \"./expressions-BlhT51Ib.mjs\";\nimport { admittedForms, describeExpected, readWrittenValueAs, resolveAuthoringTypeChoice, typeConstructorLookup } from \"@internal/framework-components/authoring\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { describeTaggedLiteralFailure } from \"@internal/framework-components/control\";\nimport { createDataTypeLookup, dataTypeId } from \"@internal/framework-components/codec\";\n//#region src/diagnostic.ts\nfunction diagnosticSource(sources, node) {\n\treturn {\n\t\tsources,\n\t\tnode,\n\t\tat(span) {\n\t\t\tconst sourceFile = sources.sourceFileFor(node);\n\t\t\tconst range = span === void 0 ? {\n\t\t\t\tstart: sourceFile.positionAt(node.offset),\n\t\t\t\tend: sourceFile.positionAt(node.endOffset)\n\t\t\t} : sourceFile.pslSpanToRange(span);\n\t\t\treturn {\n\t\t\t\tfilename: sourceFile.filename,\n\t\t\t\trange\n\t\t\t};\n\t\t}\n\t};\n}\nfunction diagnosticFromSpan(diagnostic, source) {\n\tif (diagnostic.span === void 0) throw new InternalError(\"Owned PSL diagnostic has no span\");\n\treturn {\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\t...source.at(diagnostic.span),\n\t\t...diagnostic.data === void 0 ? {} : { data: diagnostic.data }\n\t};\n}\nfunction mapPslDiagnostics(diagnostics, sources) {\n\treturn diagnostics.map(({ filename, code, message, range, data }) => ({\n\t\tcode,\n\t\tmessage,\n\t\tsourceId: filename,\n\t\tspan: sources.sourceFileNamed(filename).rangeToPslSpan(range),\n\t\t...data === void 0 ? {} : { data }\n\t}));\n}\nfunction createPslDiagnosticCollector(sources) {\n\tconst entries = [];\n\treturn {\n\t\tget length() {\n\t\t\treturn entries.length;\n\t\t},\n\t\tpush(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"psl\",\n\t\t\t\tdiagnostic\n\t\t\t});\n\t\t},\n\t\tpushUnlocated(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"psl\",\n\t\t\t\tdiagnostic,\n\t\t\t\tomitSpan: true\n\t\t\t});\n\t\t},\n\t\tpushExternal(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"external\",\n\t\t\t\tdiagnostic\n\t\t\t});\n\t\t},\n\t\ttoExternal() {\n\t\t\treturn entries.flatMap((entry) => {\n\t\t\t\tif (entry.kind === \"external\") return [entry.diagnostic];\n\t\t\t\tif (entry.omitSpan) {\n\t\t\t\t\tconst { code, message, filename, data } = entry.diagnostic;\n\t\t\t\t\treturn [{\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t\tsourceId: filename,\n\t\t\t\t\t\t...data === void 0 ? {} : { data }\n\t\t\t\t\t}];\n\t\t\t\t}\n\t\t\t\treturn mapPslDiagnostics([entry.diagnostic], sources);\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/resolve.ts\nfunction readResolvedAttribute(attribute, sources) {\n\treturn {\n\t\tname: attributeName(attribute.name()),\n\t\targs: readResolvedArgList(attribute.argList(), sources),\n\t\tspan: nodePslSpan(attribute.syntax, sources),\n\t\tnode: attribute\n\t};\n}\nfunction readResolvedAttributes(attributes, sources) {\n\treturn Array.from(attributes, (attribute) => readResolvedAttribute(attribute, sources));\n}\nfunction readResolvedConstructorCall(annotation, sources) {\n\tconst argList = annotation?.argList();\n\tif (annotation === void 0 || argList === void 0) return void 0;\n\treturn {\n\t\tpath: annotation.name()?.path() ?? [],\n\t\targs: readResolvedArgList(argList, sources),\n\t\tspan: nodePslSpan(annotation.syntax, sources)\n\t};\n}\nfunction readResolvedArgList(argList, sources) {\n\tif (argList === void 0) return [];\n\tconst args = [];\n\tfor (const arg of argList.args()) {\n\t\tconst name = arg.name()?.name();\n\t\tconst expression = arg.value();\n\t\targs.push({\n\t\t\tkind: name !== void 0 ? \"named\" : \"positional\",\n\t\t\t...name !== void 0 ? { name } : {},\n\t\t\tvalue: renderExpression(expression),\n\t\t\t...expression !== void 0 ? { expression } : {},\n\t\t\tspan: nodePslSpan(arg.syntax, sources),\n\t\t\tnode: arg\n\t\t});\n\t}\n\treturn args;\n}\nfunction attributeName(name) {\n\treturn name?.path().join(\".\") ?? \"\";\n}\nfunction renderExpression(expression) {\n\tif (expression === void 0) return \"\";\n\treturn printSyntax(expression.syntax).trim();\n}\nfunction nodePslSpan(node, sources) {\n\tconst sourceFile = sources.sourceFileFor(node);\n\tconst start = node.offset;\n\tconst end = start + node.green.textLength;\n\treturn {\n\t\tstart: sourceFile.offsetToPslPosition(start),\n\t\tend: sourceFile.offsetToPslPosition(end)\n\t};\n}\n/** Unsupported-top-level-block diagnostics are anchored to the keyword token. */\nfunction keywordPslSpan(node, keyword, sources) {\n\tconst sourceFile = sources.sourceFileFor(node);\n\tconst start = node.offset;\n\tconst end = start + keyword.length;\n\treturn {\n\t\tstart: sourceFile.offsetToPslPosition(start),\n\t\tend: sourceFile.offsetToPslPosition(end)\n\t};\n}\n//#endregion\n//#region src/written-scalar.ts\nconst AN_EXPRESSION = {\n\tok: false,\n\treason: \"not-a-literal\",\n\tfound: \"an expression\"\n};\nfunction written(value) {\n\treturn {\n\t\tok: true,\n\t\twritten: value\n\t};\n}\n/** Reads a PSL literal expression as a `WrittenScalar`, for a position that takes a value of a data type. ADR 254. */\nfunction readWrittenScalar(expression) {\n\tconst syntax = expression.syntax;\n\tconst string = StringLiteralExprAst.cast(syntax)?.value();\n\tif (string !== void 0) return written({\n\t\tkind: \"string\",\n\t\ttext: string\n\t});\n\tconst number = NumberLiteralExprAst.cast(syntax);\n\tif (number !== void 0) {\n\t\tconst text = number.token()?.text;\n\t\treturn text === void 0 ? AN_EXPRESSION : written({\n\t\t\tkind: \"number\",\n\t\t\ttext\n\t\t});\n\t}\n\tconst boolean = BooleanLiteralExprAst.cast(syntax)?.value();\n\tif (boolean !== void 0) return written({\n\t\tkind: \"boolean\",\n\t\tvalue: boolean\n\t});\n\tconst tagged = TaggedLiteralExprAst.cast(syntax);\n\tif (tagged !== void 0) {\n\t\tconst canonicalization = tagged.canonicalization();\n\t\treturn canonicalization.ok ? written({\n\t\t\tkind: \"tag\",\n\t\t\ttag: tagged.tagName(),\n\t\t\ttext: canonicalization.text\n\t\t}) : {\n\t\t\tok: false,\n\t\t\treason: canonicalization.reason\n\t\t};\n\t}\n\tif (IdentifierAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"an identifier\"\n\t};\n\tif (FunctionCallAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"a function call\"\n\t};\n\tif (ArrayLiteralAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"a list\"\n\t};\n\tif (ObjectLiteralExprAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"an object\"\n\t};\n\treturn AN_EXPRESSION;\n}\n//#endregion\n//#region src/read-expression-as.ts\nconst TAGGED_LITERAL_FAILURE_CODES = {\n\tnul: \"PSL_TAGGED_LITERAL_NUL\",\n\t\"too-large\": \"PSL_TAGGED_LITERAL_TOO_LARGE\"\n};\n/**\n* Reads `expression` as a value of `dataType`: the literal is read through the authoring entry for its syntax, then taken into `dataType` directly or through a cast it declares. The read every argument typed by a data type takes, in an attribute or a type constructor. ADR 254.\n*/\nfunction readExpressionAs(support, dataType, expression) {\n\tif (!support.lookup.has(dataType)) throw new InternalError(`An argument receives data type \"${dataType}\", which this stack does not register.`);\n\tconst forms = admittedForms(support, [dataType]);\n\tif (forms.length === 0) throw new InternalError(`An argument receives data type \"${dataType}\", which nothing in this stack writes.`);\n\tconst literal = readWrittenScalar(expression);\n\tif (!literal.ok) return literal.reason === \"not-a-literal\" ? notOk({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_SYNTAX\",\n\t\tmessage: `${describeExpected(forms)}; got ${literal.found}`\n\t}) : notOk({\n\t\tcode: TAGGED_LITERAL_FAILURE_CODES[literal.reason],\n\t\tmessage: describeTaggedLiteralFailure(literal.reason)\n\t});\n\treturn readWrittenValueAs(support, dataType, literal.written);\n}\n//#endregion\n//#region src/attribute-spec/spec-context.ts\n/** The data types of a stack that registers none. */\nconst EMPTY_DATA_TYPES = {\n\tentries: {},\n\tlookup: createDataTypeLookup([]),\n\tdataTypeOfCodec: () => void 0\n};\n/** How a diagnostic names a subject, as in `Field \"Post.slug\"` or `Type alias \"Slug\"`. */\nfunction typeAttributeSubjectLabel(subject) {\n\treturn `${subject.kind === \"field\" ? \"Field\" : \"Type alias\"} \"${subject.name}\"`;\n}\nfunction typeAttributeSpecContextOfField(ctx) {\n\treturn {\n\t\tsymbols: ctx.symbols,\n\t\tdefaultFunctionRegistry: ctx.defaultFunctionRegistry,\n\t\tgeneratorFunctions: ctx.generatorFunctions,\n\t\tdataTypes: ctx.dataTypes,\n\t\tsubject: {\n\t\t\tkind: \"field\",\n\t\t\tname: `${ctx.model.name}.${ctx.field.name}`\n\t\t},\n\t\tlist: ctx.field.list,\n\t\ttypeName: ctx.field.typeName,\n\t\ttypeResolution: ctx.typeResolution,\n\t\tcontributedType: ctx.contributedType\n\t};\n}\n//#endregion\n//#region src/call-arguments.ts\n/** The call as the schema writes it, with its arguments separated by `, `. */\nfunction printTypeConstructorCall(call) {\n\tconst args = call.args.map((arg) => arg.kind === \"named\" ? `${arg.name}: ${arg.value}` : arg.value);\n\treturn `${call.path.join(\".\")}(${args.join(\", \")})`;\n}\n/**\n* Binds a call's arguments to its parameters, as PSL reads every call: the positional arguments fill the parameters in order, wherever named ones sit among them, and a named argument fills the parameter it names, which no other argument may fill. The bound arguments come positional ones first, then named ones, each in the order written.\n*/\nfunction bindCallArguments(args, parameters) {\n\tconst positional = args.filter((arg) => arg.kind === \"positional\");\n\tif (positional.length > parameters.length) return notOk({\n\t\tkind: \"tooManyPositional\",\n\t\treceived: positional.length,\n\t\tbound: []\n\t});\n\tconst bound = positional.map((argument, index) => ({\n\t\targument,\n\t\tindex\n\t}));\n\tconst filled = new Set(bound.map(({ index }) => index));\n\tfor (const argument of args.filter((arg) => arg.kind === \"named\")) {\n\t\tconst index = argument.name === void 0 ? -1 : parameters.indexOf(argument.name);\n\t\tif (index < 0) return notOk({\n\t\t\tkind: \"unknownName\",\n\t\t\targument,\n\t\t\tbound\n\t\t});\n\t\tif (filled.has(index)) return notOk({\n\t\t\tkind: \"filledTwice\",\n\t\t\targument,\n\t\t\tbound\n\t\t});\n\t\tfilled.add(index);\n\t\tbound.push({\n\t\t\targument,\n\t\t\tindex\n\t\t});\n\t}\n\treturn ok(bound);\n}\n/** Each argument's value, keyed by the parameter it fills, as {@link bindCallArguments} binds them; `undefined` when they do not bind. */\nfunction argumentsByParameter(args, parameters) {\n\tconst bound = bindCallArguments(args, parameters);\n\tif (!bound.ok) return void 0;\n\tconst values = /* @__PURE__ */ new Map();\n\tfor (const { argument, index } of bound.value) {\n\t\tconst parameter = parameters[index];\n\t\tif (parameter === void 0) return void 0;\n\t\tvalues.set(parameter, argument.value);\n\t}\n\treturn values;\n}\n//#endregion\n//#region src/authoring-arguments.ts\nconst INVALID_AUTHORING_ARGUMENT = Symbol(\"invalidAuthoringArgument\");\n/** Why a written value is not one of the names an option takes, and, for a number that only one value argument takes, that argument. */\nfunction misplacedOptionMessage(descriptors, dataTypes, option, written, argumentLabel) {\n\tconst refused = `${argumentLabel} is ${written}, but argument \"${option.name}\" takes one of these names, written without quotes: ${option.values.join(\", \")}.`;\n\tif (!/^[+-]?\\d/.test(written)) return refused;\n\tconst takers = descriptors.flatMap((descriptor) => descriptor.kind === \"value\" && descriptor.name !== void 0 && readWrittenValueAs(dataTypes, dataTypeId(descriptor.dataType), {\n\t\tkind: \"number\",\n\t\ttext: written\n\t}).ok ? [descriptor.name] : []);\n\tconst [taker] = takers;\n\treturn takers.length === 1 && taker !== void 0 ? `${refused} Write ${taker} by name, as in ${taker}: ${written}.` : refused;\n}\nconst SILENT_REFUSALS = {\n\tcall: () => {},\n\targument: () => {},\n\tvalue: () => {}\n};\n/**\n* The value of one argument as `descriptor` reads it: a `value` argument as a value of its data type, read from its expression as attribute arguments are, and a type choice's option as a bare name. A refusal is reported at the argument.\n*/\nfunction readPslHelperArgument(input, refusals, descriptor, argument, argumentLabel) {\n\tconst refuse = (message) => {\n\t\trefusals.argument(argument.span, message);\n\t\treturn INVALID_AUTHORING_ARGUMENT;\n\t};\n\tif (descriptor.kind === \"option\") {\n\t\tconst written = argument.value.trim();\n\t\tif (/^[A-Za-z_][A-Za-z0-9_]*$/.test(written)) return written;\n\t\treturn refuse(misplacedOptionMessage(input.descriptors, input.dataTypes, descriptor, written, argumentLabel));\n\t}\n\tconst { expression } = argument;\n\tif (expression === void 0 && argument.node !== void 0) return refuse(`${argumentLabel} has no value.`);\n\tif (expression === void 0) throw new InternalError(`A call received ${argumentLabel} with no expression. A value argument is read from the expression a schema writes; a reader that builds a call must pass the arguments it parsed, or instantiate the constructor with values.`);\n\tconst read = readExpressionAs(input.dataTypes, dataTypeId(descriptor.dataType), expression);\n\tif (read.ok) return read.value.value;\n\trefusals.value(expression.syntax, read.failure);\n\treturn INVALID_AUTHORING_ARGUMENT;\n}\nfunction readPslHelperArgsReporting(input, refusals) {\n\tconst bound = bindCallArguments(input.args, input.descriptors.map((descriptor) => descriptor?.name));\n\tconst mappedArgs = input.descriptors.map(() => void 0);\n\tfor (const { argument, index } of bound.ok ? bound.value : bound.failure.bound) {\n\t\tconst descriptor = input.descriptors[index];\n\t\tif (!descriptor) {\n\t\t\trefusals.argument(argument.span, `does not define positional argument #${index + 1}.`);\n\t\t\treturn;\n\t\t}\n\t\tconst value = readPslHelperArgument(input, refusals, descriptor, argument, argument.kind === \"named\" ? `named argument \"${argument.name}\"` : `argument #${index + 1}`);\n\t\tif (value === INVALID_AUTHORING_ARGUMENT) return void 0;\n\t\tmappedArgs[index] = value;\n\t}\n\tif (bound.ok) return mappedArgs;\n\tconst failure = bound.failure;\n\tswitch (failure.kind) {\n\t\tcase \"tooManyPositional\":\n\t\t\trefusals.call(`accepts at most ${input.descriptors.length} argument(s), received ${failure.received}.`);\n\t\t\treturn;\n\t\tcase \"unknownName\":\n\t\t\trefusals.argument(failure.argument.span, `received unknown named argument \"${failure.argument.name}\".`);\n\t\t\treturn;\n\t\tcase \"filledTwice\":\n\t\t\trefusals.argument(failure.argument.span, `received duplicate value for argument \"${failure.argument.name}\".`);\n\t\t\treturn;\n\t}\n}\n/**\n* The arguments of a type constructor or type choice call, positional and named, each read as its descriptor says. `undefined`, with a diagnostic pushed, when one cannot be read or does not match a descriptor.\n*/\nfunction mapPslHelperArgs(input) {\n\tconst refused = (span, message) => input.diagnostics.push({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\tmessage: `${input.entityLabel} ${input.helperLabel} ${message}`,\n\t\t...input.source.at(span)\n\t});\n\treturn readPslHelperArgsReporting(input, {\n\t\tcall: (message) => refused(input.span, message),\n\t\targument: refused,\n\t\tvalue: (node, failure) => input.diagnostics.push({\n\t\t\tcode: failure.code,\n\t\t\tmessage: failure.message,\n\t\t\t...input.source.at(nodePslSpan(node, input.source.sources))\n\t\t})\n\t});\n}\n/**\n* The arguments of a call read as {@link mapPslHelperArgs} reads them, without reporting what it refuses: `undefined` when the call does not read, which the reader that resolves the column reports.\n*/\nfunction readPslHelperArgs(input) {\n\treturn readPslHelperArgsReporting(input, SILENT_REFUSALS);\n}\n//#endregion\n//#region src/contributed-type-scope.ts\nfunction isContributedTypeChoice(symbol) {\n\treturn symbol.descriptor.kind === \"typeChoice\";\n}\nfunction isContributedTypeDescriptor(value) {\n\treturn \"kind\" in value && (value.kind === \"typeConstructor\" || value.kind === \"typeAlias\" || value.kind === \"typeChoice\");\n}\n/** The explicit type a call of the type choice `symbol` chooses and the arguments it is built with, reading the call as the column does, or why it chooses none. */\nfunction chosenTypeConstructor(symbol, call, dataTypes) {\n\tconst helperPath = symbol.path.join(\".\");\n\tconst args = readPslHelperArgs({\n\t\targs: call?.args ?? [],\n\t\tdescriptors: symbol.descriptor.args,\n\t\tdataTypes\n\t});\n\tif (args === void 0) return notOk(`The arguments of ${helperPath} do not read.`);\n\ttry {\n\t\treturn ok(resolveAuthoringTypeChoice({\n\t\t\thelperPath,\n\t\t\tdescriptor: symbol.descriptor,\n\t\t\targs,\n\t\t\tconstructorNamed: (name) => symbol.choiceTypes.get(name)\n\t\t}));\n\t} catch (error) {\n\t\tif (isInternalError(error) || !(error instanceof Error)) throw error;\n\t\treturn notOk(error.message);\n\t}\n}\n/** The codec a column typed by `use` is stored with; `undefined` for a type choice whose call chooses no type, which the column's resolution reports. */\nfunction contributedTypeCodecId(use, dataTypes) {\n\tconst { symbol } = use;\n\tif (isContributedTypeChoice(symbol)) {\n\t\tconst chosen = chosenTypeConstructor(symbol, use.call, dataTypes);\n\t\treturn chosen.ok ? chosen.value.descriptor.output.codecId : void 0;\n\t}\n\tconst { descriptor } = symbol;\n\treturn descriptor.kind === \"typeAlias\" ? descriptor.output.type.codecId : descriptor.output.codecId;\n}\n/** The descriptor at `path` in `namespace`, or `undefined` when none is contributed there. */\nfunction contributedTypeAt(namespace, path) {\n\tconst [name, ...rest] = path;\n\tif (name === void 0 || !Object.hasOwn(namespace, name)) return void 0;\n\tconst value = namespace[name];\n\tif (value === void 0) return void 0;\n\tif (isContributedTypeDescriptor(value)) return rest.length === 0 ? value : void 0;\n\treturn contributedTypeAt(value, rest);\n}\n/** The codec a column typed by `call` is stored with, reading the call's arguments as the column does, or `undefined` when no type is contributed at its path or it is a type choice whose arguments choose no type. */\nfunction writtenContributedTypeCodecId(namespace, call) {\n\treturn codecIdAtPath(namespace, call.path, [], call);\n}\nfunction codecIdAtPath(namespace, path, prefix, call) {\n\tconst [name, ...rest] = path;\n\tif (name === void 0 || !Object.hasOwn(namespace, name)) return void 0;\n\tconst value = namespace[name];\n\tif (value === void 0) return void 0;\n\tconst at = [...prefix, name];\n\tif (!isContributedTypeDescriptor(value)) return codecIdAtPath(value, rest, at, call);\n\tif (rest.length > 0) return void 0;\n\treturn contributedTypeCodecId({\n\t\tsymbol: contributedTypeSymbol(name, at, value, namespace),\n\t\tcall\n\t}, EMPTY_DATA_TYPES);\n}\nfunction contributedTypeScope(contributedTypes) {\n\tconst members = collect(contributedTypes, []);\n\treturn {\n\t\tlookup(name) {\n\t\t\treturn members.get(name);\n\t\t},\n\t\tentries() {\n\t\t\treturn members.entries();\n\t\t}\n\t};\n}\nfunction collect(namespace, prefix) {\n\tconst members = /* @__PURE__ */ new Map();\n\tfor (const [name, value] of Object.entries(namespace)) {\n\t\tconst path = [...prefix, name];\n\t\tmembers.set(name, isContributedTypeDescriptor(value) ? contributedTypeSymbol(name, path, value, namespace) : {\n\t\t\tkind: \"contributedNamespace\",\n\t\t\tname,\n\t\t\tpath,\n\t\t\tmembers: collect(value, path)\n\t\t});\n\t}\n\treturn members;\n}\nfunction contributedTypeSymbol(name, path, descriptor, namespace) {\n\tif (descriptor.kind !== \"typeChoice\") return {\n\t\tkind: \"contributedType\",\n\t\tname,\n\t\tpath,\n\t\tdescriptor\n\t};\n\tconst constructorNamed = typeConstructorLookup(namespace);\n\tconst choiceTypes = /* @__PURE__ */ new Map();\n\tfor (const { type } of descriptor.choices) {\n\t\tconst chosen = constructorNamed(type);\n\t\tif (chosen !== void 0) choiceTypes.set(type, chosen);\n\t}\n\treturn {\n\t\tkind: \"contributedType\",\n\t\tname,\n\t\tpath,\n\t\tdescriptor,\n\t\tchoiceTypes\n\t};\n}\n//#endregion\nexport { mapPslDiagnostics as C, diagnosticSource as S, readResolvedAttribute as _, isContributedTypeChoice as a, createPslDiagnosticCollector as b, argumentsByParameter as c, typeAttributeSpecContextOfField as d, typeAttributeSubjectLabel as f, nodePslSpan as g, keywordPslSpan as h, contributedTypeScope as i, printTypeConstructorCall as l, readWrittenScalar as m, contributedTypeAt as n, writtenContributedTypeCodecId as o, readExpressionAs as p, contributedTypeCodecId as r, mapPslHelperArgs as s, chosenTypeConstructor as t, EMPTY_DATA_TYPES as u, readResolvedAttributes as v, diagnosticFromSpan as x, readResolvedConstructorCall as y };\n\n//# sourceMappingURL=contributed-type-scope-CUwinsgb.mjs.map","//#region src/type-constructor-calls.ts\nfunction isBareTypeConstructor(descriptor) {\n\treturn descriptor.entityRefArg === void 0 && (descriptor.args ?? []).every((arg) => arg.optional === true);\n}\nfunction argumentSpelling(descriptor) {\n\tconst args = descriptor.args ?? [];\n\tconst reference = descriptor.entityRefArg;\n\tconst count = Math.max(args.length, (reference?.index ?? -1) + 1);\n\tconst names = [];\n\tfor (let index = 0; index < count; index++) {\n\t\tconst arg = args[index];\n\t\tif (index === reference?.index) names.push(reference.entityKind);\n\t\telse if (arg !== void 0 && arg.optional !== true) names.push(arg.name ?? `argument${index + 1}`);\n\t}\n\treturn names.join(\", \");\n}\nfunction reportTypeConstructorNotCalled(input) {\n\tinput.diagnostics.push({\n\t\tcode: \"PSL_TYPE_CONSTRUCTOR_NOT_CALLED\",\n\t\tmessage: `${input.entityLabel} uses type constructor \"${input.path}\" without arguments. Write ${input.path}(${argumentSpelling(input.descriptor)}).`,\n\t\t...input.source.at(input.span)\n\t});\n}\n//#endregion\nexport { reportTypeConstructorNotCalled as n, isBareTypeConstructor as t };\n\n//# sourceMappingURL=type-constructor-calls-Bfg5ojed.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,iBAAiB,SAAS,MAAM;CACxC,OAAO;EACN;EACA;EACA,GAAG,MAAM;GACR,MAAM,aAAa,QAAQ,cAAc,IAAI;GAC7C,MAAM,QAAQ,SAAS,KAAK,IAAI;IAC/B,OAAO,WAAW,WAAW,KAAK,MAAM;IACxC,KAAK,WAAW,WAAW,KAAK,SAAS;GAC1C,IAAI,WAAW,eAAe,IAAI;GAClC,OAAO;IACN,UAAU,WAAW;IACrB;GACD;EACD;CACD;AACD;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