js-yaml
Version:
YAML 1.2 parser and serializer
1 lines • 282 kB
Source Map (JSON)
{"version":3,"file":"js-yaml.mjs","names":[],"sources":["../src/tag.ts","../src/tag/scalar/str.ts","../src/tag/scalar/null_core.ts","../src/tag/scalar/null_json.ts","../src/tag/scalar/null_yaml11.ts","../src/tag/scalar/bool_core.ts","../src/tag/scalar/bool_json.ts","../src/tag/scalar/bool_yaml11.ts","../src/tag/scalar/int_core.ts","../src/tag/scalar/int_json.ts","../src/tag/scalar/int_yaml11.ts","../src/tag/scalar/float_core.ts","../src/tag/scalar/float_json.ts","../src/tag/scalar/float_yaml11.ts","../src/tag/scalar/merge.ts","../src/tag/scalar/binary.ts","../src/tag/scalar/timestamp.ts","../src/tag/sequence/seq.ts","../src/common/object.ts","../src/tag/sequence/omap.ts","../src/tag/sequence/pairs.ts","../src/tag/mapping/map.ts","../src/tag/mapping/set.ts","../src/schema.ts","../src/tag/mapping/real_map.ts","../src/tag/mapping/legacy_map.ts","../src/common/snippet.ts","../src/common/exception.ts","../src/parser/events.ts","../src/parser/parser_scalar.ts","../src/common/tagname.ts","../src/parser/constructor.ts","../src/parser/parser.ts","../src/load.ts","../src/ast/from_js.ts","../src/ast/visit.ts","../src/ast/styler_defaults.ts","../src/ast/scalar_styler.ts","../src/ast/presenter.ts","../src/dump.ts","../src/ast/from_events.ts","../src/index.ts"],"sourcesContent":["/**\n * Returned by a scalar resolver when the source does not match its tag.\n *\n * @category Tags\n */\nconst NOT_RESOLVED: unique symbol = Symbol('NOT_RESOLVED')\n\n/**\n * Options for {@link defineScalarTag}.\n *\n * @category Tags\n */\ninterface ScalarTagOptions<Result> {\n /**\n * Whether this tag participates in resolving plain scalars without an\n * explicit tag. Default: `false`.\n */\n implicit?: boolean\n\n /**\n * Whether explicit tag names are matched by prefix instead of exact equality.\n * Default: `false`.\n */\n matchByTagPrefix?: boolean\n\n /**\n * Set of `source.charAt(0)` keys for which `resolve` may succeed (a superset\n * of what it really matches). A key is either a single character or '' (empty\n * source). `null` means \"no constraint, always try\". Used by the composer to\n * dispatch implicit scalars by first character without running every resolver.\n */\n implicitFirstChars?: readonly string[] | null\n\n /**\n * Construct a value from scalar text, or return {@link NOT_RESOLVED} when it\n * is invalid for this tag. `isExplicit` is true for an explicit tag and\n * `tagName` is the actual matched name.\n */\n resolve: (source: string, isExplicit: boolean, tagName: string) => Result | typeof NOT_RESOLVED\n\n /**\n * Selects this tag for a JavaScript value when dumping. Use `() => false`\n * for load-only tags.\n */\n identify: (data: any) => boolean\n\n /**\n * A scalar's printed form is text, so `represent` always yields a string.\n * The factory supplies a `String(data)` default when a tag omits it.\n */\n represent?: (data: any) => string\n\n /** Return the tag name to emit for a prefix-matching tag. Defaults to `tagName`. */\n representTagName?: (data: any) => string\n}\n\n/**\n * Normalized scalar tag returned by {@link defineScalarTag}.\n *\n * @category Tags\n */\ninterface ScalarTagDefinition<Result = unknown> extends Required<ScalarTagOptions<Result>> {\n /** Tag name used for schema lookup. */\n tagName: string\n\n /** YAML node kind handled by this tag. */\n nodeKind: 'scalar'\n}\n\n/**\n * Options for {@link defineSequenceTag}.\n *\n * @category Tags\n */\ninterface SequenceTagOptions<Carrier, Result = Carrier> {\n /**\n * Whether explicit tag names are matched by prefix instead of exact equality.\n * Default: `false`.\n */\n matchByTagPrefix?: boolean\n\n /** Create the carrier used while constructing a sequence. */\n create: (tagName: string) => Carrier\n\n /** Add an item to the carrier. Return a non-empty error message to reject it. */\n addItem: (carrier: Carrier, item: unknown, index: number) => void | string\n\n /** Convert the completed carrier to the result. Defaults to the identity function. */\n finalize?: (carrier: Carrier) => Result\n\n /**\n * Selects this tag for a JavaScript value when dumping. Use `() => false`\n * for load-only tags.\n */\n identify: (data: any) => boolean\n\n /** Return the array-like contents to dump. Defaults to the identity function. */\n represent?: (data: any) => ArrayLike<unknown>\n\n /** Return the tag name to emit for a prefix-matching tag. Defaults to `tagName`. */\n representTagName?: (data: any) => string\n}\n\n/**\n * Normalized sequence tag returned by {@link defineSequenceTag}.\n *\n * @category Tags\n */\ninterface SequenceTagDefinition<Carrier = unknown, Result = Carrier> extends Required<SequenceTagOptions<Carrier, Result>> {\n /** Tag name used for schema lookup. */\n tagName: string\n\n /** YAML node kind handled by this tag. */\n nodeKind: 'sequence'\n\n /** Sequence tags do not participate in implicit scalar resolution. */\n implicit: false\n\n /** Whether the carrier is also the final result (`finalize` was omitted). */\n carrierIsResult: boolean\n}\n\n/**\n * Options for {@link defineMappingTag}.\n *\n * @category Tags\n */\ninterface MappingTagOptions<Carrier, Result = Carrier> {\n /**\n * Whether explicit tag names are matched by prefix instead of exact equality.\n * Default: `false`.\n */\n matchByTagPrefix?: boolean\n\n /** Create the carrier used while constructing a mapping. */\n create: (tagName: string) => Carrier\n\n /**\n * Writes a pair. Returns '' on success, a non-empty error message otherwise\n * (key does not fit the representation, value rejected, ...). Always a string\n * so the hot path never allocates an exception wrapper.\n */\n addPair: (carrier: Carrier, key: unknown, value: unknown) => string\n\n /** Return whether the carrier contains a key, for duplicate and merge checks. */\n has: (carrier: Carrier, key: unknown) => boolean\n\n /** Return the keys of a completed result for YAML merge processing. */\n keys: (result: Result) => Iterable<unknown>\n\n /** Return a value from a completed result for YAML merge processing. */\n get: (result: Result, key: unknown) => unknown\n\n /** Convert the completed carrier to the result. Defaults to the identity function. */\n finalize?: (carrier: Carrier) => Result\n\n /**\n * Selects this tag for a JavaScript value when dumping. Use `() => false`\n * for load-only tags.\n */\n identify: (data: any) => boolean\n\n /** Return the mapping entries to dump. Defaults to the identity function. */\n represent?: (data: any) => Map<unknown, unknown>\n\n /** Return the tag name to emit for a prefix-matching tag. Defaults to `tagName`. */\n representTagName?: (data: any) => string\n}\n\n/**\n * Normalized mapping tag returned by {@link defineMappingTag}.\n *\n * @category Tags\n */\ninterface MappingTagDefinition<Carrier = unknown, Result = Carrier> extends Required<MappingTagOptions<Carrier, Result>> {\n /** Tag name used for schema lookup. */\n tagName: string\n\n /** YAML node kind handled by this tag. */\n nodeKind: 'mapping'\n\n /** Mapping tags do not participate in implicit scalar resolution. */\n implicit: false\n\n /** Whether the carrier is also the final result (`finalize` was omitted). */\n carrierIsResult: boolean\n}\n\n/**\n * Any normalized tag definition accepted by {@link Schema}.\n *\n * @category Tags\n */\ntype TagDefinition =\n | ScalarTagDefinition<any>\n | SequenceTagDefinition<any, any>\n | MappingTagDefinition<any, any>\n\n/**\n * Create a normalized scalar tag definition.\n *\n * @category Tags\n */\nfunction defineScalarTag<Result> (tagName: string, options: ScalarTagOptions<Result>): ScalarTagDefinition<Result> {\n return {\n tagName,\n nodeKind: 'scalar',\n implicit: options.implicit ?? false,\n matchByTagPrefix: options.matchByTagPrefix ?? false,\n implicitFirstChars: options.implicitFirstChars ?? null,\n resolve: options.resolve,\n identify: options.identify,\n represent: options.represent ?? (data => String(data)),\n representTagName: options.representTagName ?? (() => tagName)\n }\n}\n\n/**\n * Create a normalized sequence tag definition.\n *\n * @category Tags\n */\nfunction defineSequenceTag<Carrier, Result = Carrier> (tagName: string, options: SequenceTagOptions<Carrier, Result>): SequenceTagDefinition<Carrier, Result> {\n const carrierIsResult = options.finalize === undefined\n\n return {\n tagName,\n nodeKind: 'sequence',\n implicit: false,\n matchByTagPrefix: options.matchByTagPrefix ?? false,\n create: options.create,\n addItem: options.addItem,\n finalize: options.finalize ?? (carrier => carrier as unknown as Result),\n carrierIsResult,\n identify: options.identify,\n represent: options.represent ?? (data => data as ArrayLike<unknown>),\n representTagName: options.representTagName ?? (() => tagName)\n }\n}\n\n/**\n * Create a normalized mapping tag definition.\n *\n * @category Tags\n */\nfunction defineMappingTag<Carrier, Result = Carrier> (tagName: string, options: MappingTagOptions<Carrier, Result>): MappingTagDefinition<Carrier, Result> {\n const carrierIsResult = options.finalize === undefined\n\n return {\n tagName,\n nodeKind: 'mapping',\n implicit: false,\n matchByTagPrefix: options.matchByTagPrefix ?? false,\n create: options.create,\n addPair: options.addPair,\n has: options.has,\n keys: options.keys,\n get: options.get,\n finalize: options.finalize ?? (carrier => carrier as unknown as Result),\n carrierIsResult,\n identify: options.identify,\n represent: options.represent ?? (data => data as Map<unknown, unknown>),\n representTagName: options.representTagName ?? (() => tagName)\n }\n}\n\nexport {\n NOT_RESOLVED,\n defineScalarTag,\n defineSequenceTag,\n defineMappingTag,\n\n type ScalarTagDefinition,\n type SequenceTagDefinition,\n type MappingTagDefinition,\n type TagDefinition,\n type ScalarTagOptions,\n type SequenceTagOptions,\n type MappingTagOptions\n}\n","import { defineScalarTag } from '../../tag.ts'\n\n/** @category Tags */\nconst strTag = defineScalarTag('tag:yaml.org,2002:str', {\n resolve: (source) => source,\n identify: (data) => typeof data === 'string'\n})\n\nexport { strTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst NULL_VALUES = ['', '~', 'null', 'Null', 'NULL']\n\n/** @category Tags */\nconst nullCoreTag = defineScalarTag('tag:yaml.org,2002:null', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: '' (empty), '~', 'null'/'Null'/'NULL'.\n implicitFirstChars: ['', '~', 'n', 'N'],\n resolve: (source) => {\n if (NULL_VALUES.indexOf(source) !== -1) return null\n\n return NOT_RESOLVED\n },\n identify: (object) => object === null,\n represent: () => 'null'\n})\n\nexport { nullCoreTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\n/** @category Tags */\nconst nullJsonTag = defineScalarTag('tag:yaml.org,2002:null', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: null.\n implicitFirstChars: ['n'],\n resolve: (source, isExplicit) => {\n if (source === 'null' || (isExplicit && source === '')) return null\n\n return NOT_RESOLVED\n },\n identify: (object) => object === null,\n represent: () => 'null'\n})\n\nexport { nullJsonTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst NULL_VALUES = ['', '~', 'null', 'Null', 'NULL']\n\n/** @category Tags */\nconst nullYaml11Tag = defineScalarTag('tag:yaml.org,2002:null', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: '' (empty), '~', 'null'/'Null'/'NULL'.\n implicitFirstChars: ['', '~', 'n', 'N'],\n resolve: (source) => {\n if (NULL_VALUES.indexOf(source) !== -1) return null\n\n return NOT_RESOLVED\n },\n identify: (object) => object === null,\n represent: () => 'null'\n})\n\nexport { nullYaml11Tag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst TRUE_VALUES = ['true', 'True', 'TRUE']\nconst FALSE_VALUES = ['false', 'False', 'FALSE']\n\n/** @category Tags */\nconst boolCoreTag = defineScalarTag('tag:yaml.org,2002:bool', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: true/True/TRUE, false/False/FALSE.\n implicitFirstChars: ['t', 'T', 'f', 'F'],\n resolve: (source) => {\n if (TRUE_VALUES.indexOf(source) !== -1) return true\n if (FALSE_VALUES.indexOf(source) !== -1) return false\n\n return NOT_RESOLVED\n },\n identify: (object) => Object.prototype.toString.call(object) === '[object Boolean]',\n represent: (object) => object ? 'true' : 'false'\n})\n\nexport { boolCoreTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst TRUE_VALUES = ['true']\nconst FALSE_VALUES = ['false']\n\n/** @category Tags */\nconst boolJsonTag = defineScalarTag('tag:yaml.org,2002:bool', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: true, false.\n implicitFirstChars: ['t', 'f'],\n resolve: (source) => {\n if (TRUE_VALUES.indexOf(source) !== -1) return true\n if (FALSE_VALUES.indexOf(source) !== -1) return false\n\n return NOT_RESOLVED\n },\n identify: (object) => Object.prototype.toString.call(object) === '[object Boolean]',\n represent: (object) => object ? 'true' : 'false'\n})\n\nexport { boolJsonTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst TRUE_VALUES = ['true', 'True', 'TRUE', 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON']\nconst FALSE_VALUES = ['false', 'False', 'FALSE', 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF']\n\n/** @category Tags */\nconst boolYaml11Tag = defineScalarTag('tag:yaml.org,2002:bool', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs.\n implicitFirstChars: ['y', 'Y', 'n', 'N', 't', 'T', 'f', 'F', 'o', 'O'],\n resolve: (source) => {\n if (TRUE_VALUES.indexOf(source) !== -1) return true\n if (FALSE_VALUES.indexOf(source) !== -1) return false\n\n return NOT_RESOLVED\n },\n identify: (object) => Object.prototype.toString.call(object) === '[object Boolean]',\n represent: (object) => object ? 'true' : 'false'\n})\n\nexport { boolYaml11Tag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\n// YAML 1.2 Core schema implicit resolution:\n// [-+]? [0-9]+ | 0o [0-7]+ | 0x [0-9a-fA-F]+\nconst YAML_INTEGER_IMPLICIT_PATTERN = new RegExp(\n // 0o123\n '^(?:0o[0-7]+' +\n // 0x1A\n '|0x[0-9a-fA-F]+' +\n // 12345\n '|[-+]?[0-9]+)$')\n\n// Explicit `!!int` validation is separate from Core implicit resolution.\nconst YAML_INTEGER_EXPLICIT_PATTERN = new RegExp(\n // 0b1010\n '^(?:[-+]?0b[0-1]+' +\n // 0o123\n '|[-+]?0o[0-7]+' +\n // 0x1A\n '|[-+]?0x[0-9a-fA-F]+' +\n // 12345\n '|[-+]?[0-9]+)$')\n\nfunction parseYamlInteger (source: string) {\n let value = source\n let sign = 1\n\n if (value[0] === '-' || value[0] === '+') {\n if (value[0] === '-') sign = -1\n value = value.slice(1)\n }\n\n if (value.startsWith('0b')) return sign * parseInt(value.slice(2), 2)\n if (value.startsWith('0o')) return sign * parseInt(value.slice(2), 8)\n if (value.startsWith('0x')) return sign * parseInt(value.slice(2), 16)\n\n return sign * parseInt(value, 10)\n}\n\nfunction resolveYamlInteger (source: string, isExplicit: boolean) {\n if (isExplicit) {\n if (!YAML_INTEGER_EXPLICIT_PATTERN.test(source)) return NOT_RESOLVED\n } else if (!YAML_INTEGER_IMPLICIT_PATTERN.test(source)) {\n return NOT_RESOLVED\n }\n\n const result = parseYamlInteger(source)\n return Number.isFinite(result) ? result : NOT_RESOLVED\n}\n\n/** @category Tags */\nconst intCoreTag = defineScalarTag('tag:yaml.org,2002:int', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: optional sign + decimal digit.\n implicitFirstChars: ['-', '+', ...'0123456789'],\n resolve: resolveYamlInteger,\n identify: (object) =>\n // No ancient boxed numbers support\n Number.isInteger(object) &&\n // Negative zero => !!float\n !Object.is(object, -0) &&\n // Exponential form => !!float, round-trip for !!int 1e21 will be broken\n object.toString(10).indexOf('e') < 0,\n represent: (object: number) => object.toString(10)\n})\n\nexport { intCoreTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\n// YAML 1.2 JSON schema implicit resolution:\n// -? ( 0 | [1-9] [0-9]* )\nconst YAML_INTEGER_IMPLICIT_PATTERN = new RegExp(\n '^-?(?:0|[1-9][0-9]*)$')\n\n// Explicit `!!int` validation is separate from JSON implicit resolution.\nconst YAML_INTEGER_EXPLICIT_PATTERN = new RegExp(\n // 0b1010\n '^(?:[-+]?0b[0-1]+' +\n // 0o123\n '|[-+]?0o[0-7]+' +\n // 0x1A\n '|[-+]?0x[0-9a-fA-F]+' +\n // 12345\n '|[-+]?[0-9]+)$')\n\nfunction parseYamlInteger (source: string) {\n let value = source\n let sign = 1\n\n if (value[0] === '-' || value[0] === '+') {\n if (value[0] === '-') sign = -1\n value = value.slice(1)\n }\n\n if (value.startsWith('0b')) return sign * parseInt(value.slice(2), 2)\n if (value.startsWith('0o')) return sign * parseInt(value.slice(2), 8)\n if (value.startsWith('0x')) return sign * parseInt(value.slice(2), 16)\n\n return sign * parseInt(value, 10)\n}\n\nfunction resolveYamlInteger (source: string, isExplicit: boolean) {\n if (isExplicit) {\n if (!YAML_INTEGER_EXPLICIT_PATTERN.test(source)) return NOT_RESOLVED\n } else if (!YAML_INTEGER_IMPLICIT_PATTERN.test(source)) {\n return NOT_RESOLVED\n }\n\n const result = parseYamlInteger(source)\n return Number.isFinite(result) ? result : NOT_RESOLVED\n}\n\n/** @category Tags */\nconst intJsonTag = defineScalarTag('tag:yaml.org,2002:int', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: optional '-' or digit.\n implicitFirstChars: ['-', ...'0123456789'],\n resolve: resolveYamlInteger,\n identify: (object) =>\n // No ancient boxed numbers support\n Number.isInteger(object) &&\n // Negative zero => !!float\n !Object.is(object, -0) &&\n // Exponential form => !!float, round-trip for !!int 1e21 will be broken\n object.toString(10).indexOf('e') < 0,\n represent: (object: number) => object.toString(10)\n})\n\nexport { intJsonTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst YAML_INTEGER_PATTERN = new RegExp(\n // 0b1010\n '^(?:[-+]?0b[0-1_]+' +\n // 0123\n '|[-+]?0[0-7_]+' +\n // 0x1A\n '|[-+]?0x[0-9a-fA-F_]+' +\n // 1:23\n '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+' +\n // 12345\n '|[-+]?(?:0|[1-9][0-9_]*))$')\n\nfunction parseYamlInteger (source: string) {\n let value = source.replace(/_/g, '')\n let sign = 1\n\n if (value[0] === '-' || value[0] === '+') {\n if (value[0] === '-') sign = -1\n value = value.slice(1)\n }\n\n if (value.startsWith('0b')) return sign * parseInt(value.slice(2), 2)\n if (value.startsWith('0x')) return sign * parseInt(value.slice(2), 16)\n\n if (value.includes(':')) {\n let result = 0\n for (const part of value.split(':')) result = result * 60 + Number(part)\n return sign * result\n }\n\n if (value !== '0' && value[0] === '0') return sign * parseInt(value, 8)\n\n return sign * parseInt(value, 10)\n}\n\nfunction resolveYamlInteger (source: string) {\n if (!YAML_INTEGER_PATTERN.test(source)) return NOT_RESOLVED\n\n const result = parseYamlInteger(source)\n return Number.isFinite(result) ? result : NOT_RESOLVED\n}\n\n/** @category Tags */\nconst intYaml11Tag = defineScalarTag('tag:yaml.org,2002:int', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: optional sign + decimal digit.\n implicitFirstChars: ['-', '+', ...'0123456789'],\n resolve: resolveYamlInteger,\n identify: (object) =>\n // No ancient boxed numbers support\n Number.isInteger(object) &&\n // Negative zero => !!float\n !Object.is(object, -0) &&\n // Exponential form => !!float, round-trip for !!int 1e21 will be broken\n object.toString(10).indexOf('e') < 0,\n represent: (object: number) => object.toString(10)\n})\n\nexport { intYaml11Tag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst YAML_FLOAT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^(?:[-+]?[0-9]+(?:\\\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?' +\n // .2e4, .2\n '|[-+]?\\\\.[0-9]+(?:[eE][-+]?[0-9]+)?' +\n // .inf\n '|[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$')\n\nconst YAML_FLOAT_SPECIAL_PATTERN = new RegExp(\n '^(?:' +\n // .inf\n '[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$')\n\nfunction resolveYamlFloat (source: string) {\n if (!YAML_FLOAT_PATTERN.test(source)) return NOT_RESOLVED\n\n let value = source.toLowerCase()\n const sign = value[0] === '-' ? -1 : 1\n\n if ('+-'.includes(value[0])) value = value.slice(1)\n\n if (value === '.inf') return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY\n if (value === '.nan') return NaN\n\n const result = sign * parseFloat(value)\n\n if (Number.isFinite(result) || YAML_FLOAT_SPECIAL_PATTERN.test(source)) return result\n return NOT_RESOLVED\n}\n\nfunction representYamlFloat (object: number) {\n if (isNaN(object)) return '.nan'\n if (object === Number.POSITIVE_INFINITY) return '.inf'\n if (object === Number.NEGATIVE_INFINITY) return '-.inf'\n if (Object.is(object, -0)) return '-0.0'\n\n const result = object.toString(10)\n return /^[-+]?[0-9]+e/.test(result) ? result.replace('e', '.e') : result\n}\n\n/** @category Tags */\nconst floatCoreTag = defineScalarTag('tag:yaml.org,2002:float', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: optional sign, '.', or digit\n // ('.inf'/'.nan' start with '.').\n implicitFirstChars: ['-', '+', '.', ...'0123456789'],\n resolve: resolveYamlFloat,\n identify: (object) =>\n // No ancient boxed numbers support\n typeof object === 'number' &&\n (\n // We land here all numbers, not handled (declined) by !!int `.identify`\n // The same condition as for !!int, but reversed.\n\n // Filter out integers...\n !Number.isInteger(object) ||\n // but allow negative zero\n Object.is(object, -0) ||\n // and integers with exponential form\n object.toString(10).indexOf('e') >= 0\n ),\n represent: representYamlFloat\n})\n\nexport { floatCoreTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\n// YAML 1.2 JSON schema implicit resolution:\n// -? ( 0 | [1-9] [0-9]* ) ( \\. [0-9]* )? ( [eE] [-+]? [0-9]+ )?\nconst YAML_FLOAT_IMPLICIT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^-?(?:0|[1-9][0-9]*)(?:\\\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$')\n\n// Explicit `!!float` validation is separate from JSON implicit resolution.\nconst YAML_FLOAT_EXPLICIT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^(?:[-+]?[0-9]+(?:\\\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?' +\n // .2e4, .2\n '|[-+]?\\\\.[0-9]+(?:[eE][-+]?[0-9]+)?' +\n // .inf\n '|[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$')\n\nfunction resolveYamlFloat (source: string, isExplicit: boolean) {\n if (isExplicit) {\n if (!YAML_FLOAT_EXPLICIT_PATTERN.test(source)) return NOT_RESOLVED\n\n let value = source.toLowerCase()\n const sign = value[0] === '-' ? -1 : 1\n\n if ('+-'.includes(value[0])) value = value.slice(1)\n\n if (value === '.inf') return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY\n if (value === '.nan') return NaN\n\n const result = sign * parseFloat(value)\n return Number.isFinite(result) ? result : NOT_RESOLVED\n }\n\n if (!YAML_FLOAT_IMPLICIT_PATTERN.test(source)) return NOT_RESOLVED\n\n const result = Number(source)\n\n if (Number.isFinite(result)) return result\n return NOT_RESOLVED\n}\n\nfunction representYamlFloat (object: number) {\n if (isNaN(object)) return '.nan'\n if (object === Number.POSITIVE_INFINITY) return '.inf'\n if (object === Number.NEGATIVE_INFINITY) return '-.inf'\n if (Object.is(object, -0)) return '-0.0'\n\n const result = object.toString(10)\n return /^[-+]?[0-9]+e/.test(result) ? result.replace('e', '.e') : result\n}\n\n/** @category Tags */\nconst floatJsonTag = defineScalarTag('tag:yaml.org,2002:float', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: optional '-' or digit.\n implicitFirstChars: ['-', ...'0123456789'],\n resolve: resolveYamlFloat,\n identify: (object) =>\n // No ancient boxed numbers support\n typeof object === 'number' &&\n (\n // We land here all numbers, not handled (declined) by !!int `.identify`\n // The same condition as for !!int, but reversed.\n\n // Filter out integers...\n !Number.isInteger(object) ||\n // but allow negative zero\n Object.is(object, -0) ||\n // and integers with exponential form\n object.toString(10).indexOf('e') >= 0\n ),\n represent: representYamlFloat\n})\n\nexport { floatJsonTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst YAML_FLOAT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\\\.[0-9_]*)(?:[eE][-+][0-9]+)?' +\n // 190:20:30.15\n '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\\\.[0-9_]*' +\n // .inf\n '|[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$')\n\nconst YAML_FLOAT_SPECIAL_PATTERN = new RegExp(\n '^(?:' +\n // .inf\n '[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$')\n\nfunction resolveYamlFloat (source: string) {\n if (!YAML_FLOAT_PATTERN.test(source)) return NOT_RESOLVED\n\n let value = source.toLowerCase().replace(/_/g, '')\n const sign = value[0] === '-' ? -1 : 1\n\n if ('+-'.includes(value[0])) value = value.slice(1)\n\n if (value === '.inf') return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY\n if (value === '.nan') return NaN\n\n let result = 0\n\n if (value.includes(':')) {\n for (const part of value.split(':')) result = result * 60 + Number(part)\n result *= sign\n } else {\n result = sign * parseFloat(value)\n }\n\n if (Number.isFinite(result) || YAML_FLOAT_SPECIAL_PATTERN.test(source)) return result\n return NOT_RESOLVED\n}\n\nfunction representYamlFloat (object: number) {\n if (isNaN(object)) return '.nan'\n if (object === Number.POSITIVE_INFINITY) return '.inf'\n if (object === Number.NEGATIVE_INFINITY) return '-.inf'\n if (Object.is(object, -0)) return '-0.0'\n\n const result = object.toString(10)\n return /^[-+]?[0-9]+e/.test(result) ? result.replace('e', '.e') : result\n}\n\n/** @category Tags */\nconst floatYaml11Tag = defineScalarTag('tag:yaml.org,2002:float', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: optional sign, '.', or digit\n // ('.inf'/'.nan' start with '.').\n implicitFirstChars: ['-', '+', '.', ...'0123456789'],\n resolve: resolveYamlFloat,\n identify: (object) =>\n // No ancient boxed numbers support\n typeof object === 'number' &&\n (\n // We land here all numbers, not handled (declined) by !!int `.identify`\n // The same condition as for !!int, but reversed.\n\n // Filter out integers...\n !Number.isInteger(object) ||\n // but allow negative zero\n Object.is(object, -0) ||\n // and integers with exponential form\n object.toString(10).indexOf('e') >= 0\n ),\n represent: representYamlFloat\n})\n\nexport { floatYaml11Tag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\n/**\n * Enables merge keys in {@link CORE_SCHEMA} when added with\n * {@link Schema.withTags}.\n *\n * @category Tags\n */\nconst mergeTag = defineScalarTag('tag:yaml.org,2002:merge', {\n implicit: true,\n // source.charAt(0) over matched implicit inputs: '<' ('<<').\n implicitFirstChars: ['<'],\n // Merge semantics live in the tag, not in the value: the constructor acts on\n // a key tagged `!!merge`, so `<<` anywhere else is just this string.\n resolve: (source, isExplicit) => {\n if (source === '<<' || (isExplicit && source === '')) return '<<'\n return NOT_RESOLVED\n },\n identify: () => false\n})\n\nexport { mergeTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst BASE64_PATTERN = /^[A-Za-z0-9+/]*={0,2}$/\n\nfunction resolveYamlBinary (source: string) {\n // Strip allowed whitespace first, so validation stays a plain base64 check.\n const input = source.replace(/\\s/g, '')\n if (input.length % 4 !== 0 || !BASE64_PATTERN.test(input)) return NOT_RESOLVED\n\n const binary = atob(input)\n const result = new Uint8Array(binary.length)\n for (let index = 0; index < binary.length; index++) {\n result[index] = binary.charCodeAt(index)\n }\n return result\n}\n\nfunction representYamlBinary (object: Uint8Array) {\n let binary = ''\n for (let index = 0; index < object.length; index++) {\n binary += String.fromCharCode(object[index])\n }\n return btoa(binary)\n}\n\n/**\n * The `!!binary` tag, represented as a `Uint8Array`.\n *\n * @category Tags\n */\nconst binaryTag = defineScalarTag('tag:yaml.org,2002:binary', {\n resolve: resolveYamlBinary,\n identify: (object) => Object.prototype.toString.call(object) === '[object Uint8Array]',\n represent: representYamlBinary\n})\n\nexport { binaryTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst YAML_DATE_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$')\n\nconst YAML_TIMESTAMP_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' +\n '-([0-9][0-9]?)' +\n '-([0-9][0-9]?)' +\n '(?:[Tt]|[ \\\\t]+)' +\n '([0-9][0-9]?)' +\n ':([0-9][0-9])' +\n ':([0-9][0-9])' +\n '(?:\\\\.([0-9]*))?' +\n '(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)' +\n '(?::([0-9][0-9]))?))?$')\n\nfunction makeUtcDate (\n year: number,\n month: number,\n day: number,\n hour = 0,\n minute = 0,\n second = 0,\n fraction = 0\n) {\n const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction))\n\n // Date.UTC() treats years 0..99 as 1900..1999. Restore the parsed YAML year\n // before validating calendar normalization, e.g. reject 0001-02-29.\n date.setUTCFullYear(year, month, day)\n\n return date\n}\n\nfunction resolveYamlTimestamp (source: string) {\n let match = YAML_DATE_REGEXP.exec(source)\n if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(source)\n if (match === null) return NOT_RESOLVED\n\n const year = +(match[1])\n const month = +(match[2]) - 1\n const day = +(match[3])\n\n // Date-only form (`YYYY-MM-DD`) has no time captures.\n if (!match[4]) {\n const date = makeUtcDate(year, month, day)\n // Reject dates that JS would normalize, e.g. 2023-02-29 -> 2023-03-01.\n if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month || date.getUTCDate() !== day) {\n return NOT_RESOLVED\n }\n return date\n }\n\n const hour = +(match[4])\n const minute = +(match[5])\n const second = +(match[6])\n let fraction = 0\n\n // Reject times that JS would normalize into the next minute/hour/day.\n if (hour > 23 || minute > 59 || second > 59) return NOT_RESOLVED\n\n if (match[7]) {\n let value = match[7].slice(0, 3)\n while (value.length < 3) value += '0'\n fraction = +value\n }\n\n const date = makeUtcDate(year, month, day, hour, minute, second, fraction)\n\n // Reject invalid calendar dates before applying timezone offset.\n if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month || date.getUTCDate() !== day) {\n return NOT_RESOLVED\n }\n\n if (match[9]) {\n const offsetHour = +(match[10])\n const offsetMinute = +(match[11] || 0)\n // Reject timezone offsets that JS date arithmetic would otherwise accept.\n if (offsetHour > 23 || offsetMinute > 59) return NOT_RESOLVED\n\n const offset = (offsetHour * 60 + offsetMinute) * 60000\n date.setTime(date.getTime() - (match[9] === '-' ? -offset : offset))\n }\n\n return date\n}\n\n/**\n * The YAML 1.1 `!!timestamp` tag, represented as a JavaScript `Date`.\n *\n * @category Tags\n */\nconst timestampTag = defineScalarTag('tag:yaml.org,2002:timestamp', {\n implicit: true,\n // Both patterns start with a 4-digit year, so source.charAt(0) is always a digit.\n implicitFirstChars: [...'0123456789'],\n resolve: resolveYamlTimestamp,\n identify: (object) => object instanceof Date,\n represent: (object: Date) => object.toISOString()\n})\n\nexport { timestampTag }\n","import { defineSequenceTag } from '../../tag.ts'\n\n/** @category Tags */\nconst seqTag = defineSequenceTag('tag:yaml.org,2002:seq', {\n create: () => [] as unknown[],\n addItem: (container, item) => {\n container.push(item)\n },\n identify: Array.isArray\n})\n\nexport { seqTag }\n","function isPlainObject (data: unknown): boolean {\n if (data === null || typeof data !== 'object' || Array.isArray(data)) return false\n const prototype = Object.getPrototypeOf(data)\n return prototype === null || prototype === Object.prototype\n}\n\n// Project `object` onto `keys`. Absent keys are skipped (so the result can be\n// safely spread over defaults without clobbering them with `undefined`), hence\n// the `Partial` return.\nfunction pick<T extends object, K extends keyof T> (object: T, keys: readonly K[]): Partial<Pick<T, K>> {\n const result: Partial<Pick<T, K>> = {}\n for (const key of keys) {\n if (object[key] !== undefined) result[key] = object[key]\n }\n return result\n}\n\nexport {\n isPlainObject,\n pick\n}\n","import { defineSequenceTag } from '../../tag.ts'\nimport { isPlainObject } from '../../common/object.ts'\n\n/**\n * Provided only for YAML 1.1 compatibility and supported by the loader only.\n * JavaScript has no dedicated class to represent this type, so it cannot be\n * identified and dumped.\n *\n * ```yaml\n * !!omap\n * - one: 1\n * - two: 2\n * ```\n *\n * is loaded as\n *\n * ```javascript\n * [\n * { one: 1 },\n * { two: 2 }\n * ]\n * ```\n *\n * @category Tags\n */\nconst omapTag = defineSequenceTag('tag:yaml.org,2002:omap', {\n create: (): { list: unknown[]; seen: Set<unknown> } => ({ list: [], seen: new Set() }),\n addItem: (carrier, item) => {\n let key: unknown\n\n if (item instanceof Map) {\n if (item.size !== 1) return 'cannot resolve an ordered map item'\n key = item.keys().next().value\n } else if (isPlainObject(item)) {\n const itemKeys = Object.keys(item as Record<string, unknown>)\n if (itemKeys.length !== 1) return 'cannot resolve an ordered map item'\n key = itemKeys[0]\n } else {\n return 'cannot resolve an ordered map item'\n }\n\n if (carrier.seen.has(key)) return 'duplicate key in ordered map'\n carrier.seen.add(key)\n carrier.list.push(item)\n return ''\n },\n finalize: (carrier): unknown[] => carrier.list,\n identify: () => false\n})\n\nexport { omapTag }\n","import { defineSequenceTag } from '../../tag.ts'\n\n/**\n * Provided only for YAML 1.1 compatibility and supported by the loader only.\n * JavaScript has no dedicated class to represent this type, so it cannot be\n * identified and dumped.\n *\n * ```yaml\n * !!pairs\n * - one: 1\n * - two: 2\n * ```\n *\n * is loaded as\n *\n * ```javascript\n * [\n * ['one', 1],\n * ['two', 2]\n * ]\n * ```\n *\n * @category Tags\n */\nconst pairsTag = defineSequenceTag('tag:yaml.org,2002:pairs', {\n create: () => [] as [unknown, unknown][],\n addItem: (container, item) => {\n if (item instanceof Map) {\n if (item.size !== 1) return 'cannot resolve a pairs item'\n\n container.push(item.entries().next().value!)\n return ''\n }\n\n if (Object.prototype.toString.call(item) !== '[object Object]') {\n return 'cannot resolve a pairs item'\n }\n\n const object = item as Record<string, unknown>\n const keys = Object.keys(object)\n\n if (keys.length !== 1) return 'cannot resolve a pairs item'\n\n container.push([keys[0], object[keys[0]]])\n return ''\n },\n identify: () => false\n})\n\nexport { pairsTag }\n","import { defineMappingTag } from '../../tag.ts'\nimport { isPlainObject } from '../../common/object.ts'\n\n/**\n * This is the default mapping implementation. It uses `{}` objects and has only\n * partial functionality due to language limitations. This choice was made\n * because users expect to get JavaScript objects, and it was left unchanged to\n * avoid too many breaking changes in the v5 release.\n *\n * Side effects:\n *\n * - `Object.hasOwn()` checks or `for...of` loops are required for safe use (to\n * avoid falling through to prototypes).\n * - Only scalar string keys are supported properly.\n * - Other scalar keys, such as `null` and numbers, are converted to strings.\n * This is historical behaviour, and it can cause side effects such as\n * problems with `!!merge`.\n *\n * Note that non-string scalar keys may be deprecated in future versions.\n *\n * Ideally, use {@link realMapTag} instead.\n *\n * @category Tags\n */\nconst mapTag = defineMappingTag('tag:yaml.org,2002:map', {\n create: (): Record<string, unknown> => ({}),\n identify: isPlainObject,\n // Dump side: wrap the plain object into the canonical `Map` form the writer\n // walks. Shallow — keys/values stay references to the originals.\n represent: (o: Record<string, unknown>) => {\n const map = new Map<string, unknown>()\n for (const key of Object.keys(o)) map.set(key, o[key])\n return map\n },\n addPair: (container, key, value) => {\n if (key !== null && typeof key === 'object') {\n return 'object-based map does not support complex keys'\n }\n const normalizedKey = String(key)\n if (normalizedKey === '__proto__') {\n // Define as an own data property so a literal `__proto__` key stays data\n // and never invokes the prototype setter.\n Object.defineProperty(container, normalizedKey, {\n value, enumerable: true, configurable: true, writable: true\n })\n } else {\n container[normalizedKey] = value\n }\n return ''\n },\n // hasOwn, not `in`: a plain object inherits `toString` and friends.\n has: (container, key) => {\n if (key !== null && typeof key === 'object') return false\n return Object.prototype.hasOwnProperty.call(container, String(key))\n },\n keys: (container) => Object.keys(container),\n get: (container, key) => {\n const normalizedKey = String(key)\n // key is from `keys()` only. Strong check is not needed, but leave for sure.\n if (!Object.prototype.hasOwnProperty.call(container, normalizedKey)) return null\n return container[normalizedKey]\n }\n})\n\nexport { mapTag, isPlainObject }\n","import { defineMappingTag } from '../../tag.ts'\n\n/**\n * The YAML 1.1 `!!set` tag, represented as a JavaScript `Set`.\n *\n * @category Tags\n */\nconst setTag = defineMappingTag('tag:yaml.org,2002:set', {\n create: () => new Set<unknown>(),\n identify: (data) => data instanceof Set,\n represent: (data: Set<unknown>) => {\n const map = new Map<unknown, null>()\n for (const key of data) map.set(key, null)\n return map\n },\n addPair: (container, key, value) => {\n if (value !== null) return 'cannot resolve a set item'\n container.add(key)\n return ''\n },\n has: (container, key) => container.has(key),\n keys: (container) => container.keys(),\n get: () => null\n})\n\nexport { setTag }\n","import {\n NOT_RESOLVED,\n type MappingTagDefinition,\n type ScalarTagDefinition,\n type SequenceTagDefinition,\n type TagDefinition\n} from './tag.ts'\nimport { strTag } from './tag/scalar/str.ts'\nimport { nullCoreTag } from './tag/scalar/null_core.ts'\nimport { nullJsonTag } from './tag/scalar/null_json.ts'\nimport { nullYaml11Tag } from './tag/scalar/null_yaml11.ts'\nimport { boolCoreTag } from './tag/scalar/bool_core.ts'\nimport { boolJsonTag } from './tag/scalar/bool_json.ts'\nimport { boolYaml11Tag } from './tag/scalar/bool_yaml11.ts'\nimport { intCoreTag } from './tag/scalar/int_core.ts'\nimport { intJsonTag } from './tag/scalar/int_json.ts'\nimport { intYaml11Tag } from './tag/scalar/int_yaml11.ts'\nimport { floatCoreTag } from './tag/scalar/float_core.ts'\nimport { floatJsonTag } from './tag/scalar/float_json.ts'\nimport { floatYaml11Tag } from './tag/scalar/float_yaml11.ts'\nimport { mergeTag } from './tag/scalar/merge.ts'\nimport { binaryTag } from './tag/scalar/binary.ts'\nimport { timestampTag } from './tag/scalar/timestamp.ts'\nimport { seqTag } from './tag/sequence/seq.ts'\nimport { omapTag } from './tag/sequence/omap.ts'\nimport { pairsTag } from './tag/sequence/pairs.ts'\nimport { mapTag } from './tag/mapping/map.ts'\nimport { setTag } from './tag/mapping/set.ts'\n\ninterface TagDefinitionMap {\n scalar: Record<string, ScalarTagDefinition>\n sequence: Record<string, SequenceTagDefinition>\n mapping: Record<string, MappingTagDefinition>\n}\n\ninterface TagDefinitionListMap {\n scalar: ScalarTagDefinition[]\n sequence: SequenceTagDefinition[]\n mapping: MappingTagDefinition[]\n}\n\nfunction createTagDefinitionMap (): TagDefinitionMap {\n return {\n scalar: Object.create(null),\n sequence: Object.create(null),\n mapping: Object.create(null)\n }\n}\n\nfunction createTagDefinitionListMap (): TagDefinitionListMap {\n return {\n scalar: [],\n sequence: [],\n mapping: []\n }\n}\n\nfunction compileTags (tags: readonly TagDefinition[]) {\n const result: TagDefinition[] = []\n\n for (const tag of tags) {\n let index = result.length\n\n for (let previousIndex = 0; previousIndex < result.length; previousIndex++) {\n const previous = result[previousIndex]\n\n if (previous.nodeKind === tag.nodeKind &&\n previous.tagName === tag.tagName &&\n previous.matchByTagPrefix === tag.matchByTagPrefix) {\n index = previousIndex\n break\n }\n }\n\n result[index] = tag\n }\n\n return result\n}\n\n/**\n * Controls tag resolution when loading and type selection when dumping.\n *\n * @category Schemas\n */\nclass Schema {\n readonly tags: readonly TagDefinition[]\n /** @internal */\n readonly implicitScalarTags: readonly ScalarTagDefinition[]\n\n /**\n * Dispatch implicit scalar resolvers by `source.charAt(0)`. Each bucket holds\n * the resolvers that may match that key, in schema order; a key absent from\n * the map uses\n * {@link Schema.implicitScalarAnyFirstChar}\n * (resolvers that declared no first-char constraint, so they apply to any\n * first character).\n */\n private readonly implicitScalarByFirstChar: ReadonlyMap<string, readonly ScalarTagDefinition[]>\n private readonly implicitScalarAnyFirstChar: readonly ScalarTagDefinition[]\n\n /**\n * The default scalar tag (`!!str`), resolved once so the composer's fallback\n * for unresolved plain scalars avoids a keyed lookup per scalar.\n *\n * @internal\n */\n readonly defaultScalarTag: ScalarTagDefinition\n\n /**\n * The default container tags (`!!seq` / `!!map`), used by the dumper: when a\n * value is identified by its default tag, the tag is implicit and not\n * printed. Undefined if the schema does not define them (then such values\n * can't be dumped).\n *\n * @internal\n */\n readonly defaultSequenceTag: SequenceTagDefinition | undefined\n /** @internal */\n readonly defaultMappingTag: MappingTagDefinition | undefined\n private readonly exact: TagDefinitionMap\n private readonly prefix: TagDefinitionListMap\n\n constructor (tags: readonly TagDefinition[]) {\n const compiledTags = compileTags(tags)\n const implicitScalarTags: ScalarTagDefinition[] = []\n const exact = createTagDefinitionMap()\n const prefix = createTagDefinitionListMap()\n\n for (const tag of compiledTags) {\n if (tag.nodeKind === 'scalar' && tag.implicit) {\n if (tag.matchByTagPrefix) {\n throw new Error('Implicit scalar tags cannot match by tag prefix')\n }\n\n implicitScalarTags.push(tag)\n }\n\n switch (tag.nodeKind) {\n case 'scalar':\n if (tag.matchByTagPrefix) prefix.scalar.push(tag)\n else exact.scalar[tag.tagName] = tag\n break\n case 'sequence':\n if (tag.matchByTagPrefix) prefix.sequence.push(tag)\n else exact.sequence[tag.tagName] = tag\n break\n case 'mapping':\n if (tag.matchByTagPrefix) prefix.mapping.push(tag)\n else exact.mapping[tag.tagName] = tag\n break\n }\n }\n\n const implicitScalarAnyFirstChar = implicitScalarTags.filter(tag => tag.implicitFirstChars === null)\n\n const keys = new Set<string>()\n for (const tag of implicitScalarTags) {\n if (tag.implicitFirstChars !== null) {\n for (const key of tag.implicitFirstChars) keys.add(key)\n }\n }\n\n const implicitScalarByFirstChar = new Map<string, ScalarTagDefinition[]>()\n for (const key of keys) {\n implicitScalarByFirstChar.set(key, implicitScalarTags.filter(tag =>\n tag.implicitFirstChars === null || tag.implicitFirstChars.indexOf(key) !== -1))\n }\n\n const defaultScalarTag = exact.scalar['tag:yaml.org,2002:str']\n if (!defaultScalarTag) throw new Error('schema does not define the default scalar tag (tag:yaml.org,2002:str)')\n\n this.tags = compiledTags\n this.implicitScalarTags = implicitScalarTags\n this.implicitScalarByFirstChar = implicitScalarByFirstChar\n this.implicitScalarAnyFirstChar = implicitScalarAnyFirstChar\n this.defaultScalarTag = defaultScalarTag\n this.defaultSequenceTag = exact.sequence['tag:yaml.org,2002:seq']\n this.defaultMappingTag = exact.mapping['tag:yaml.org,2002:map']\n this.exact = exact\n this.prefix = prefix\n }\n\n /** @internal */\n lookupScalarTag (tagName: string): ScalarTagDefinition | undefined {\n const exactTag = this.exact.scalar[tagName]\n if (exactTag) return exactTag\n\n for (const tag of this.prefix.scalar) {\n if (tagName.startsWith(tag.tagName)) return tag\n }\n\n return undefined\n }\n\n /** @internal */\n lookupSequenceTag (tagName: string): SequenceTagDefinition | undefined {\n const exactTag = this.exact.sequence[tagName]\n if (exactTag) return exactTag\n\n for (const tag of this.prefix.sequence) {\n if (tagName.startsWith(tag.tagName)) return tag\n }\n\n return undefined\n }\n\n /** @internal */\n lookupMappingTag (tagName: string): MappingTagDefinition | undefined {\n const exactTag = this.exact.mapping[tagName]\n if (exactTag) return exactTag\n\n for (const tag of this.prefix.mapping) {\n if (tagName.startsWith(tag.tagName)) return tag\n }\n\n return undefined\n }\n\n /** @internal */\n resolveImplicitScalarTag (source: string): { value: unknown, tag: ScalarTagDefinition } {\n const candidates = this.implicitScalarByFirstChar.get(source.charAt(0)) ??\n this.implicitScalarAnyFirstChar\n\n for (const tag of candidates) {\n const value = tag.resolve(source, false, tag.tagName)\n if (value !== NOT_RESOLVED) return { value, tag }\n }\n\n const tag = this.defaultScalarTag\n return { value: tag.resolve(source, false, tag.tagName), tag }\n }\n\n /**\n * Creates a new schema with the specified tags added. If a tag already\n * exists, it is replaced by the specified tag.\n *\n * @example\n *\n * ```javascript\n * import { CORE_SCHEMA, mergeTag, realMapTag } from 'js-yaml'\n *\n * const schema = CORE_SCHEMA.withTags(mergeTag, realMapTag)\n * ```\n */\n withTags (...tags: Array<TagDefinition | readonly TagDefinition[]>): Schema {\n let flatTags: TagDefinition[] = []\n for (const tag of tags) flatTags = flatTags.concat(tag)\n\n return new Schema([...this.tags, ...flatTags])\n }\n}\n\n/**\n * The YAML 1.2 Failsafe Schema: strings, sequences, and mappings.\n *\n * @category Schemas\n */\nconst FAILSAFE_SCHEMA = new Schema([\n strTag,\n seqTag,\n mapTag\n])\n\n/**\n * The YAML 1.2 JSON Schema. It uses JSON scalar forms while retaining YAML\n * collection syntax.\n *\n * @category Schemas\n */\nconst JSON_SCHEMA = new Schema([\n ...FAILSAFE_SCHEMA.tags,\n nullJsonTag,\n boolJsonTag,\n intJsonTag,\n floatJsonTag\n])\n\n/**\n * The default schema for the loaders. Note, {@link CORE_SCHEMA} comes\n * without the `!!merge` tag. You can easily enable it if needed.\n *\n * @example\n * Enable {@link mergeTag}:\n *\n * ```javascript\n * import { load, CORE_SCHEMA, mergeTag } from 'js-yaml'\n *\n * try {\n * load(data, { schema: CORE_SCHEMA.withTags(mergeTag) })\n * } catch (e) {\n * console.error(e)\n * }\n * ```\n *\n * @category Schemas\n */\nconst CORE_SCHEMA = new Schema([\n ...FAILSAFE_SCHEMA.tags,\n nullCoreTag,\n boolCoreTag,\n intCoreTag,\n floatCoreTag\n])\n\n/**\n * YAML 1.1-compatible schema.\n *\n * @category Schemas\n */\nconst YAML11_SCHEMA = new Schema([\n ...FAILSAFE_SCHEMA.tags,\n nullYaml11Tag,\n boolYaml11Tag,\n intYaml11Tag,\n floatYaml11Tag,\n timestampTag,\n mergeTag,\n binaryTag,\n omapTag,\n pairsTag,\n setTag\n])\n\n/**\n * The dumper schema for maximum compatibility. It combines all supported type\n * variants from YAML 1.1 and YAML 1.2 so strings matching any of them are\n * quoted. This makes the generated YAML more compatible with other parsers.\n *\n * The schema is based on YAML 1.1, but extends `!!int` and `!!float` to accept\n * both YAML 1.1 and Core Schema forms, since Core Schema supports some forms\n * that YAML 1.1 does not.\n *\n * @category Schemas\n */\nconst DUMP_SCHEMA = YAML11_SCHEMA.withTags(\n {\n ...intYaml11Tag,\n resolve: (source, isExplicit, tagName) => {\n const result = intYaml11Tag.resolve(source, isExplicit, tagName)\n return result === NOT_RESOLVED ? intCoreTag.resolve(source, isExplicit, tagName) : result\n }\n },\n {\n ...floatYaml11Tag,\n resolve: (source, isExplicit, tagName) => {\n const result = floatYaml11Tag.resolve(source, isExplicit, tagName)\n return result === NOT_RESOLVED ? floatCoreTag.resolve(source, isExplicit, tagName) : result\n }\n }\n)\n\nexport {\n Schema,\n FAILSAFE_SCHEMA,\n JSON_SCHEMA,\n CORE_SCHEMA,\n YAML11_SCHEMA,\n DUMP_SCHEMA\n}\n","import { defineMappingTag } from '../../tag.ts'\nimport { isPlainObject } from '../../common/object.ts'\n\n/**\n * Recommended when non-string keys are actually needed. It uses native\n * JavaScript `Map` objects, so keys keep their constructed types instead of\n * being converted to strings.\n *\n * It is not the default to avoid widespread breaking changes in existing\n * projects. `Map` has a different access API and does not pass deep equality\n * checks against `{}`-based fixtures. Alongside the other changes in v5,\n * making it the default was considered too disruptive.\n *\n * If these differences are acceptable for your project, we recommend using\n * {@link realMapTag} to guarantee the absence of problems and side effects.\n *\n * @example\n * Enable {@link realMapTag}:\n *\n * ```javascript\n * import { load, CORE_SCHEMA, realMapTag } from 'js-yaml'\n *\n * try {\n * load(data, { schema: CORE_SCHEMA.withTags(realMapTag) })\n * } catch (e) {\n * console.error(e)\n * }\n * ```\n *\n * @category Tags\n */\nconst realMapTag = defineMappingTag('tag:yaml.org,2002:map', {\n create: () => new Map<unknown, unknown>(),\n addPair: (container: Map<unknown, unknown>, key, value) => {\n container.set(key, value)\n return ''\n },\n has: (container: Map<unknown, unknown>, key) => container.has(key),\n keys: (container: Map<unknown, unknown>) => container.keys(),\n get: (container: Map<unknown, unknown>, key) => container.get(key),\n // Dump side: handle both a real `Map` and a plain object, so this tag fully\n // replaces the default map representation when dumping too.\n identify: (data) => data instanceof Map || isPlainObject(data),\n // Dump side: the canonical mapping form is a `Map`. A real `Map` passes\n // through untouched (keys keep their type); a plain object is wrapped\n // shallowly. Lossless — nothing is stringified.\n represent: (data) => {\n if (data instanceof Map) return data\n const map = new Map<unknown, unknown>()\n const obj = data as Record<string, unknown>\n for (const key of Object.keys(obj)) map.set(key, obj[key])\n return map\n }\n})\n\nexport { realMapTag }\n","import { defineMappingTag } from '../../tag.ts'\nimport { isPlainObject } from '../../common/object.ts'\n\n// Coerce a constructed key into the string identity a `{}` representation uses.\n// Returns null for a nested array key (an array element that is itself an\n// array), which would otherwise blow up exponentially when stringified via\n// aliases.\nfunction normalizeKey (key: unknown): string | null {\n if (Array.isArray(key)) {\n const array = Array.prototype.slice.call(key) as unknown[]\n\n for (let index = 0; index < array.length; index++) {\n if (Array.isArray(array[index])) return null\n\n if (typeof array[index] === 'object' &&\n Object.prototype.toString.call(array[index]) === '[object Object]') {\n array[index] = '[object Object]'\n }\n }\n\n return String(array)\n }\n\n if (typeof key === 'object' &&\n Object.prototype.toString.call(key) === '[object Object]') {\n return '[object Object]'\n }\n\n return String(key)\n}\n\n/**\n * This implementation exists solely to reproduce v4 behavior exactly. Its use\n * is strongly discouraged. If complex or non-string keys are needed, use\n * {@link realMapTag} instead.\n *\n * @category Tags\n */\nconst legacyMapTag = defineMappingTag('tag:yaml.org,2002:map', {\n create: (): Record<string, unknown> => ({}),\n identify: isPlainObject,\n // Dump side: wrap the plain object into the canonical `Map` form the writer\n // walks. Shallow — keys/values stay references to the originals.\n represent: (o: Record<string, unknown>) => {\n const map = new Map<string, unknown>()\n for (const key of Object.keys(o)) map.set(key, o[key])\n return map\n },\n addPair: (container, key, value) => {\n const normalizedKey = normalizeKey(key)\n if (normalizedKey === null) return 'nested arrays are not supported inside keys'\n if (normalizedKey === '__proto__') {\n // Define as an own data property so a literal `__proto__` key stays data\n // and never invokes the prototype setter.\n Object.defineProperty(container, normalizedKey, {\n value, enumerable: true, configurable: true, writable: true\n })\n } else {\n container[normalizedKey] = value\n }\n return ''\n },\n // hasOwn, not `in`: a plain object inherits `toString` and friends.\n has: (container, key) => {\n const normalizedKey = normalizeKey(key)\n return normalizedKey !== null && Object.prototype.hasOwnProperty.call(container, normalizedKey)\n },\n keys: (container) => Object.keys(container),\n get: (container, key) => {\n const normalizedKey = String(key)\n // key is from `keys()` only. Strong check is not needed, but leave for sure.\n if (!Object.prototype.hasOwnProperty.call(container, normalizedKey)) return null\n return container[normalizedKey]\n }\n})\n\nexport { legacyMapTag, isPlainObject }\n","export interface SnippetMark {\n name?: string | null\n buffer: string\n position: number\n line: number\n column: number\n snippet?: string | null\n}\n\ninterface SnippetOptions {\n maxLength?: number\n indent?: number\n linesBefore?: number\n linesAfter?: number\n}\n\nconst DEFAULT_SNIPPET_OPTIONS: Required<SnippetOptions> = {\n maxLength: 79,\n indent: 1,\n linesBefore: 3,\n linesAfter: 2\n}\n\n// get snippet for a single line, respecting maxLength\nfunction getLine (buffer: string, lineStart: number, lineEnd: number, position: number, maxLineLength: number) {\n let head = ''\n let tail = ''\n const maxHalfLength = Math.floor(maxLineLength / 2) - 1\n\n if (position - lineStart > maxHalfLength) {\n head = ' ... '\n lineStart = position - maxHalfLength + head.length\n }\n\n if (lineEnd - position > maxHalfLength) {\n tail = ' ...'\n lineEnd = position + maxHalfLength - tail.length\n }\n\n return {\n str: head + buffer.slice(lineStart, lineEnd).replace(/\\t/g, '→') + tail,\n pos: position - lineStart + head.length // relative position\n }\n}\n\nfunction padStart (string: string, max: number) {\n // max() protects from negativa value, to avoid exception.\n return ' '.repeat(Math.max(max - string.length, 0)) + string\n}\n\nfunction makeSnippet (mark: SnippetMark, options?: SnippetOptions) {\n if (!mark.buffer) return null\n\n const opts = { ...DEFAULT_SNIPPET_OPTIONS, ...options }\n\n const re = /\\r?\\n|\\r|\\0/g\n const lineStarts = [0]\n const lineEnds: number[] = []\n let match: RegExpExecArray | null\n let foundLineNo = -1\n\n while ((match = re.exec(mark.buffer))) {\n lineEnds.push(match.index)\n lineStarts.push(match.index + match[0].length)\n\n if (mark.position <= match.index && foundLineNo < 0) {\n foundLineNo = lineStarts.length - 2\n }\n }\n\n if (foundLineNo < 0) foundLineNo = lineStarts.length - 1\n\n let result = ''\n const lineNoLength = Math.min(mark.line + opts.linesAfter, lineEnds.length).toString().length\n const maxLineLength = opts.maxLength - (opts.indent + lineNoLength + 3)\n\n for (let i = 1; i <= opts.linesBefore; i++) {\n if (foundLineNo - i < 0) break\n const line = getLine(\n mark.buffer,\n lineStarts[foundLineNo - i],\n lineEnds[foundLineNo - i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),\n maxLineLength\n )\n result = `${' '.repeat(opts.indent)}${padStart((mark.line - i + 1).toString(), lineNoLength)} | ${line.str}\\n${result}`\n }\n\n const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength)\n result += `${' '.repeat(opts.indent)}${padStart((mark.line + 1).toString(), lineNoLength)} | ${line.str}\\n`\n result += `${'-'.repeat(opts.indent + lineNoLength + 3 + line.pos)}^\\n`\n\n for (let i = 1; i <= opts.linesAfter; i++) {\n if (foundLineNo + i >= lineEnds.length) break\n const line = getLine(\n mark.buffer,\n lineStarts[foundLineNo + i],\n lineEnds[foundLineNo + i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),\n maxLineLength\n )\n result += `${' '.repeat(opts.indent)}${padStart((mark.line + i + 1).toString(), lineNoLength)} | ${line.str}\\n`\n }\n\n return result.replace(/\\n$/, '')\n}\n\nexport default makeSnippet\n","import makeSnippet, { type SnippetMark } from './snippet.ts'\n\n// YAML error class. http://stackoverflow.com/questions/8458984\n//\nfunction formatError (exception: YAMLException, compact?: boolean) {\n let where = ''\n\n if (!exception.mark) return exception.reason\n\n if (exception.mark.name) {\n where += `in \"${exception.mark.name}\" `\n }\n\n where += `(${exception.mark.line + 1}:${exception.mark.column + 1})`\n\n if (!compact && exception.mark.snippet) {\n where += `\\n\\n${exception.mark.snippet}`\n }\n\n return `${exception.reason} ${where}`\n}\n\n/**\n * A YAML error. Unlike an ordinary `Error`, it adds a source snippet showing\n * the location of the problem to the error message, when available.\n *\n * @category Main\n */\nclass YAMLException extends Error {\n reason: string\n mark?: SnippetMark\n\n /**\n * Optional `mark` contains source snippet data. Usually, use\n * {@link YAMLException.throwAt} instead of passing it directly.\n */\n constructor (reason: string, mark?: SnippetMark) {\n super()\n\n this.name = 'YAMLException'\n this.reason = reason\n this.mark = mark\n this.message = formatError(this, false)\n\n // Guard for ancient browsers\n if (Error.captureStackTrace) {\n // Include stack trace in error object,\n Error.captureStackTrace(this, this.constructor)\n }\n }\n\n /**\n * Returns the formatted error, omitting the source snippet in compact mode.\n */\n toString (compact?: boolean) {\n return `${this.name}: ${formatError(this, compact)}`\n }\n\n /**\n * Builds a YAMLException with a source snippet and throws it. `source` is\n * the raw input text; `position` is an offset into it.\n */\n static throwAt (source: string, position: number, message: string, filename = ''): never {\n let line = 0\n let lineStart = 0\n\n for (let index = 0; index < position; index++) {\n const ch = source.charCodeAt(index)\n\n if (ch === 0x0A/* LF */) {\n line++\n lineStart = index + 1\n } else if (ch === 0x0D/* CR */) {\n line++\n if (source.charCodeAt(index + 1) === 0x0A/* LF */) index++\n lineStart = index + 1\n }\n }\n\n const mark: SnippetMark = {\n name: filename,\n buffer: source,\n position,\n line,\n column: position - lineStart\n }\n\n mark.snippet = makeSnippet(mark)\n throw new YAMLException(message, mark)\n }\n}\n\nexport { YAMLException }\n","/** @category Events */\nconst EVENT_ID = {\n DOCUMENT: 1,\n SEQUENCE: 2,\n MAPPING: 3,\n SCALAR: 4,\n ALIAS: 5,\n POP: 6\n} as const\n\n/** @category Events */\ntype EventId = typeof EVENT_ID[keyof typeof EVENT_ID]\n\n/** @category Nodes */\nconst SCALAR_STYLE = {\n PLAIN: 1,\n SINGLE_QUOTED: 2,\n DOUBLE_QUOTED: 3,\n LITERAL_BLOCK: 4,\n FOLDED_BLOCK: 5\n} as const\n\n/** @category Nodes */\ntype ScalarStyle = typeof SCALAR_STYLE[keyof typeof SCALAR_STYLE]\n\n/** @category Nodes */\nconst COLLECTION_STYLE = {\n BLOCK: 1,\n FLOW: 2\n} as const\n\n/** @category Nodes */\ntype CollectionStyle = typeof COLLECTION_STYLE[keyof typeof COLLECTION_STYLE]\n\n/** @category Nodes */\nconst CHOMPING_MODE = {\n CLIP: 1,\n STRIP: 2,\n KEEP: 3\n} as const\n\n/** @category Nodes */\ntype ChompingMode = typeof CHOMPING_MODE[keyof typeof CHOMPING_MODE]\n\n/** @category Events */\ntype DocumentDirective =\n { kind: 'yaml', version: string } |\n { kind: 'tag', handle: string, prefix: string }\n\ntype TagHandlers = Record<string, string>\n\n/** @category Events */\ninterface DocumentEvent {\n type: typeof EVENT_ID.DOCUMENT\n explicitStart: boolean\n explicitEnd: boolean\n directives: DocumentDirective[]\n}\n\n/** @category Events */\ninterface SequenceEvent {\n type: typeof EVENT_ID.SEQUENCE\n start: number\n anchorStart: number\n anchorEnd: number\n tagStart: number\n tagEnd: number\n style: CollectionStyle\n}\n\n/** @category Events */\ninterface MappingEvent {\n type: typeof EVENT_ID.MAPPING\n start: number\n anchorStart: number\n anchorEnd: number\n tagStart: number\n tagEnd: number\n style: CollectionStyle\n}\n\n/**\n * A scalar whose decoded value can be read with {@link getScalarValue}.\n *\n * @category Events\n */\ninterface ScalarEvent {\n type: typeof EVENT_ID.SCALAR\n valueStart: number\n valueEnd: number\n anchorStart: number\n anchorEnd: number\n tagStart: number\n tagEnd: number\n style: ScalarStyle\n chomping: ChompingMode\n indent: number\n fast: boolean\n}\n\n/** @category Events */\ninterface AliasEvent {\n type: typeof EVENT_ID.ALIAS\n anchorStart: number\n anchorEnd: number\n}\n\n/**\n * Closes the most recently opened document, sequence, or mapping.\n *\n * @category Events\n */\ninterface PopEvent {\n type: typeof EVENT_ID.POP\n}\n\n/**\n * Source ranges are zero-based and end-exclusive; `-1` means absent.\n *\n * @category Events\n */\ntype Event =\n DocumentEvent |\n SequenceEvent |\n MappingEvent |\n ScalarEvent |\n AliasEvent |\n PopEvent\n\nexport {\n EVENT_ID,\n SCALAR_STYLE,\n COLLECTION_STYLE,\n CHOMPING_MODE,\n\n type EventId,\n type ScalarStyle,\n type CollectionStyle,\n type ChompingMode,\n\n type DocumentDirective,\n type TagHandlers,\n type DocumentEvent,\n type SequenceEvent,\n type MappingEvent,\n type ScalarEvent,\n type AliasEvent,\n type PopEvent,\n type Event\n}\n","import {\n SCALAR_STYLE,\n CHOMPING_MODE,\n type ScalarEvent\n} from './events.ts'\n\nconst NO_RANGE = -1\n\n// --- character helpers (mirrors src/loader.ts, kept self-contained here) ---\n\nfunction simpleEscapeSequence (c: number) {\n switch (c) {\n case 0x30/* 0 */: return '\\x00'\n case 0x61/* a */: return '\\x07'\n case 0x62/* b */: return '\\x08'\n case 0x74/* t */: return '\\x09'\n case 0x09/* Tab */: return '\\x09'\n case 0x6E/* n */: return '\\x0A'\n case 0x76/* v */: return '\\x0B'\n case 0x66/* f */: return '\\x0C'\n case 0x72/* r */: return '\\x0D'\n case 0x65/* e */: return '\\x1B'\n case 0x20/* Space */: return ' '\n case 0x22/* \" */: return '\\x22'\n case 0x2F/* / */: return '/'\n case 0x5C/* \\ */: return '\\x5C'\n case 0x4E/* N */: return '\\x85'\n case 0x5F/* _ */: return '\\xA0'\n case 0x4C/* L */: return '\\u2028'\n case 0x50/* P */: return '\\u2029'\n default: return ''\n }\n}\n\nconst simpleEscapeCheck = new Array(256)\nconst simpleEscapeMap = new Array(256)\nfor (let i = 0; i < 256; i++) {\n simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0\n simpleEscapeMap[i] = simpleEscapeSequence(i)\n}\n\nfunction charFromCodepoint (c: number) {\n if (c <= 0xFFFF) {\n return String.fromCharCode(c)\n }\n return String.fromCharCode(\n ((c - 0x010000) >> 10) + 0xD800,\n ((c - 0x010000) & 0x03FF) + 0xDC00\n )\n}\n\nfunction fromHexCode (c: number) {\n if (c >= 0x30/* 0 */ && c <= 0x39/* 9 */) return c - 0x30\n const lc = c | 0x20\n // Double-quoted scalar ranges are validated by parser.ts before cooking.\n return lc - 0x61 + 10\n}\n\nfunction escapedHexLen (c: number) {\n if (c === 0x78/* x */) return 2\n if (c === 0x75/* u */) return 4\n // Double-quoted scalar ranges are validated by parser.ts before cooking.\n return 8\n}\n\n// --- line folding helpers ---\n\n// Skip a run of line breaks plus the leading whitespace of the following\n// lines, returning the number of line breaks consumed and the new position.\nfunction skipFoldedBreaks (input: string, position: number, end: number) {\n let breaks = 0\n\n while (position < end) {\n const ch = input.charCodeAt(position)\n\n if (ch === 0x0A/* LF */) {\n breaks++\n position++\n } else if (ch === 0x0D/* CR */) {\n breaks++\n position++\n if (input.charCodeAt(position) === 0x0A/* LF */) position++\n } else if (ch === 0x20/* Space */ || ch === 0x09/* Tab */) {\n position++\n } else {\n break\n }\n }\n\n return { position, breaks }\n}\n\n// Folding of line breaks between content chunks: a single break becomes a\n// space, several breaks become (count - 1) newlines.\nfunction foldedBreaks (count: number) {\n if (count === 1) return ' '\n // Called only after skipFoldedBreaks() consumed at least one line break.\n return '\\n'.repeat(count - 1)\n}\n\n// --- per-style extractors ---\n\nfunction getPlainValue (input: string, start: number, end: number) {\n let result = ''\n let position = start\n let captureStart = start\n let captureEnd = start\n\n while (position < end) {\n const ch = input.charCodeAt(position)\n\n if (ch === 0x0A/* LF */ || ch === 0x0D/* CR */) {\n result += input.slice(captureStart, captureEnd)\n const fold = skipFoldedBreaks(input, position, end)\n result += foldedBreaks(fold.breaks)\n position = captureStart = captureEnd = fold.position\n } else {\n position++\n if (ch !== 0x20/* Space */ && ch !== 0x09/* Tab */) captureEnd = position\n }\n }\n\n return result + input.slice(captureStart, captureEnd)\n}\n\nfunction getSingleQuotedValue (input: string, start: number, end: number) {\n let result = ''\n let position = start\n let captureStart = start\n let captureEnd = start\n\n while (position < end) {\n const ch = input.charCodeAt(position)\n\n if (ch === 0x27/* ' */) {\n // Within the stored range every quote is part of an escaped '' pair.\n result += input.slice(captureStart, position) + \"'\"\n position += 2\n captureStart = captureEnd = position\n } else if (ch === 0x0A/* LF */ || ch === 0x0D/* CR */) {\n result += input.slice(captureStart, captureEnd)\n const fold = skipFoldedBreaks(input, position, end)\n result += foldedBreaks(fold.breaks)\n position = captureStart = captureEnd = fold.position\n } else {\n position++\n if (ch !== 0x20/* Space */ && ch !== 0x09/* Tab */) captureEnd = position\n }\n }\n\n // Whitespace right before the closing quote is significant (it is only\n // stripped when followed by a line break).\n return result + input.slice(captureStart, end)\n}\n\nfunction getDoubleQuotedValue (input: string, start: number, end: number) {\n let result = ''\n let position = start\n let captureStart = start\n let captureEnd = start\n\n while (position < end) {\n const ch = input.charCodeAt(position)\n\n if (ch === 0x5C/* \\ */) {\n result += input.slice(captureStart, position)\n position++\n const escaped = input.charCodeAt(position)\n\n if (escaped === 0x0A/* LF */ || escaped === 0x0D/* CR */) {\n // Escaped line break: a line continuation that joins with nothing.\n position = skipFoldedBreaks(input, position, end).position\n } else if (escaped < 256 && simpleEscapeCheck[escaped]) {\n result += simpleEscapeMap[escaped]\n position++\n } else {\n // parser.ts has already rejected unknown escapes and invalid hex digits.\n let hexLength = escapedHexLen(escaped)\n let hexResult = 0\n\n for (; hexLength > 0; hexLength--) {\n position++\n const digit = fromHexCode(input.charCodeAt(position))\n hexResult = (hexResult << 4) + digit\n }\n\n result += charFromCodepoint(hexResult)\n position++\n }\n\n captureStart = captureEnd = position\n } else if (ch === 0x0A/* LF */ || ch === 0x0D/* CR */) {\n result += input.slice(captureStart, captureEnd)\n const fold = skipFoldedBreaks(input, position, end)\n result += foldedBreaks(fold.breaks)\n position = captureStart = captureEnd = fold.position\n } else {\n position++\n if (ch !== 0x20/* Space */ && ch !== 0x09/* Tab */) captureEnd = position\n }\n }\n\n return result + input.slice(captureStart, end)\n}\n\nfunction getBlockValue (\n input: string,\n start: number,\n end: number,\n indent: number,\n chomping: number,\n folded: boolean\n) {\n const textIndent = indent < 0 ? 0 : indent\n // The range starts at column 0 of the first line and includes every line\n // break, including those of trailing blank lines.\n const region = input.slice(start, end).replace(/\\r\\n?/g, '\\n')\n // An empty range is a block with no lines at all (e.g. an empty `|+`) and\n // must stay empty; a naive split would invent a phantom blank line. Otherwise\n // a trailing line break leaves a trailing '' from split() that is not a real\n // line (just the terminator of the last one), so drop it. Interior blank\n // lines are kept.\n const lines = region === ''\n ? []\n : (region.endsWith('\\n') ? region.slice(0, -1) : region).split('\\n')\n\n let result = ''\n let didReadContent = false\n let emptyLines = 0\n let atMoreIndented = false\n\n for (const line of lines) {\n // Whitespace beyond the content indentation is part of the content, so the\n // indentation scan stops at textIndent. A line is empty only when nothing\n // remains after the (capped) indentation.\n // indent < 0 means no content line was detected (a wholly blank block), so\n // every line is an empty line.\n let column = 0\n while (column < textIndent && line.charCodeAt(column) === 0x20/* Space */) column++\n\n if (indent < 0 || column >= line.length) {\n emptyLines++\n continue\n }\n\n const content = line.slice(textIndent)\n const first = content.charCodeAt(0)\n\n if (folded) {\n if (first === 0x20/* Space */ || first === 0x09/* Tab */) {\n // More-indented lines are not folded.\n atMoreIndented = true\n result += '\\n'.repeat(didReadContent ? 1 + emptyLines : emptyLines)\n } else if (atMoreIndented) {\n atMoreIndented = false\n result += '\\n'.repeat(emptyLines + 1)\n } else if (emptyLines === 0) {\n if (didReadContent) result += ' '\n } else {\n result += '\\n'.repeat(emptyLines)\n }\n } else {\n result += '\\n'.repeat(didReadContent ? 1 + emptyLines : emptyLines)\n }\n\n result += content\n didReadContent = true\n emptyLines = 0\n }\n\n if (chomping === CHOMPING_MODE.KEEP) {\n result += '\\n'.repeat(didReadContent ? 1 + emptyLines : emptyLines)\n } else if (chomping !== CHOMPING_MODE.STRIP) {\n if (didReadContent) result += '\\n'\n }\n\n return result\n}\n\n/**\n * Decodes the scalar referenced by event offsets in `input`.\n *\n * @category Events\n */\nfunction getScalarValue (input: string, scalar: ScalarEvent): string {\n if (scalar.valueStart === NO_RANGE) return ''\n\n const { valueStart, valueEnd } = scalar\n\n // Fast path: the parser marked this scalar as a verbatim slice of the input\n // (single-line plain / quoted with no escapes or folded breaks), so the\n // per-style char loop below would just reproduce the slice.\n if (scalar.fast) return input.slice(valueStart, valueEnd)\n\n switch (scalar.style) {\n case SCALAR_STYLE.SINGLE_QUOTED:\n return getSingleQuotedValue(input, valueStart, valueEnd)\n case SCALAR_STYLE.DOUBLE_QUOTED:\n return getDoubleQuotedValue(input, valueStart, valueEnd)\n case SCALAR_STYLE.LITERAL_BLOCK:\n return getBlockValue(input, valueStart, valueEnd, scalar.indent, scalar.chomping, false)\n case SCALAR_STYLE.FOLDED_BLOCK:\n return getBlockValue(input, valueStart, valueEnd, scalar.indent, scalar.chomping, true)\n default:\n return getPlainValue(input, valueStart, valueEnd)\n }\n}\n\nexport {\n getScalarValue\n}\n","const DEFAULT_TAG_HANDLERS: Readonly<Record<string, string>> = Object.assign(\n Object.create(null),\n {\n '!': '!',\n '!!': 'tag:yaml.org,2002:'\n }\n)\n\nfunction tagPercentEncode (source: string) {\n return encodeURI(source).replace(/!/g, '%21')\n}\n\nfunction tagNameFull (rawTag: string, tagHandlers?: Readonly<Record<string, string>>) {\n if (rawTag.startsWith('!<') && rawTag.endsWith('>')) {\n return decodeURIComponent(rawTag.slice(2, -1))\n }\n\n const handleEnd = rawTag.indexOf('!', 1)\n const handle = handleEnd === -1 ? '!' : rawTag.slice(0, handleEnd + 1)\n const prefix = tagHandlers?.[handle] ?? DEFAULT_TAG_HANDLERS[handle] ?? handle\n\n return decodeURIComponent(prefix) + decodeURIComponent(rawTag.slice(handle.length))\n}\n\nfunction tagNameShort (fullTag: string) {\n let tag = fullTag\n\n if (tag.charCodeAt(0) === 0x21) {\n tag = tag.slice(1)\n return `!${tagPercentEncode(tag)}`\n }\n\n if (tag.slice(0, 18) === 'tag:yaml.org,2002:') {\n return `!!${tagPercentEncode(tag.slice(18))}`\n }\n\n return `!<${tagPercentEncode(tag)}>`\n}\n\nexport {\n tagNameFull,\n tagNameShort\n}\n","import {\n EVENT_ID,\n SCALAR_STYLE,\n type Event,\n type TagHandlers,\n type MappingEvent,\n type ScalarEvent,\n type SequenceEvent\n} from './events.ts'\nimport { getScalarValue } from './parser_scalar.ts'\nimport { CORE_SCHEMA, type Schema } from '../schema.ts'\nimport {\n NOT_RESOLVED,\n type MappingTagDefinition,\n type ScalarTagDefinition,\n type SequenceTagDefinition\n} from '../tag.ts'\nimport { YAMLException } from '../common/exception.ts'\nimport { tagNameFull } from '../common/tagname.ts'\n\nconst NO_RANGE = -1\n\nconst MERGE_TAG_NAME = 'tag:yaml.org,2002:merge'\n\ninterface DocumentFrame {\n kind: 'document'\n position: number\n value: unknown\n hasValue: boolean\n}\n\ninterface SequenceFrame {\n kind: 'sequence'\n position: number\n value: any\n tag: SequenceTagDefinition<any, any>\n anchor: Anchor | null\n index: number\n}\n\ninterface MappingFrame {\n kind: 'mapping'\n position: number\n value: any\n tag: MappingTagDefinition<any, any>\n anchor: Anchor | null\n key: unknown\n keyPosition: number\n hasKey: boolean\n // The key slot drops its tag, but `<<` is recognized by tag, not by value.\n keyIsMerge: boolean\n // Keys brought in by a merge that an explicit pair is still allowed to\n // override. Lazily allocated: stays null for mappings without `<<`.\n overridable: Set<unknown> | null\n}\n\ntype Frame = DocumentFrame | SequenceFrame | MappingFrame\n\ntype AnyTag = ScalarTagDefinition | SequenceTagDefinition<any, any> | MappingTagDefinition<any, any>\n\ninterface ValueAndTag {\n value: unknown\n tag: AnyTag\n}\n\ninterface Anchor {\n value: unknown\n tag: AnyTag\n isValueFinal: boolean\n}\n\n/** @category Events */\ninterface ConstructorOptions {\n /** Source text referenced by offsets in `events`. */\n source: string\n filename?: string\n\n /**\n * Schema to use.\n *\n * @defaultValue {@link CORE_SCHEMA}\n */\n schema?: Schema\n\n /**\n * Enables compatibility with `JSON.parse` behavior. Duplicate keys in a\n * mapping override values instead of throwing an error.\n *\n * @defaultValue `false`\n */\n json?: boolean\n\n /**\n * Maximum total number of keys processed by merge (`<<`) across one load\n * call. Each member of a merge sequence also counts as one key. Set to `-1`\n * to disable the limit.\n *\n * @defaultValue `10000`\n */\n maxTotalMergeKeys?: number\n\n /**\n * Maximum number of alias nodes (`*ref`) per document. Set to `0` to reject\n * all aliases, or to `-1` for no limit.\n *\n * @defaultValue `-1`\n */\n maxAliases?: number\n}\n\n// `source` is input data, not config — so it has no default here.\nconst DEFAULT_CONSTRUCTOR_OPTIONS: Required<Omit<ConstructorOptions, 'source'>> = {\n filename: '',\n schema: CORE_SCHEMA,\n json: false,\n maxTotalMergeKeys: 10000,\n maxAliases: -1\n}\n\ninterface ConstructorState extends Required<ConstructorOptions> {\n events: Event[]\n documents: unknown[]\n eventIndex: number\n position: number\n frames: Frame[]\n anchors: Map<string, Anchor>\n // Mapping tag each sequence element was built with, keyed by the element\n // itself. Needed by `<<` merge, which sees only the finished element values.\n nodeTags: Map<unknown, MappingTagDefinition<any, any>>\n tagHandlers: TagHandlers\n totalMergeKeys: number\n aliasCount: number\n}\n\nfunction eventPosition (event: Event) {\n if ('tagStart' in event && event.tagStart !== NO_RANGE) return event.tagStart\n if ('anchorStart' in event && event.anchorStart !== NO_RANGE) return event.anchorStart\n if ('valueStart' in event && event.valueStart !== NO_RANGE) return event.valueStart\n if ('start' in event) return event.start\n return 0\n}\n\nfunction throwError (state: ConstructorState, message: string): never {\n YAMLException.throwAt(state.source, state.position, message, state.filename)\n}\n\nfunction finalizeCollection (\n state: ConstructorState,\n position: number,\n tag: SequenceTagDefinition<any, any> | MappingTagDefinition<any, any>,\n carrier: unknown\n) {\n try {\n return tag.finalize(carrier)\n } catch (error) {\n if (error instanceof YAMLException) throw error\n YAMLException.throwAt(\n state.source,\n position,\n error instanceof Error ? error.message : String(error),\n state.filename\n )\n }\n}\n\nfunction constructScalar (\n state: ConstructorState,\n event: ScalarEvent\n): ValueAndTag {\n const source = getScalarValue(state.source, event)\n const rawTag = event.tagStart === NO_RANGE\n ? ''\n : state.source.slice(event.tagStart, event.tagEnd)\n const strTag = state.schema.defaultScalarTag\n\n if (rawTag !== '') {\n if (rawTag === '!') return { value: source, tag: strTag }\n\n const tagName = tagNameFull(rawTag, state.tagHandlers)\n const scalarTag = state.schema.lookupScalarTag(tagName)\n\n if (scalarTag) {\n const result = scalarTag.resolve(source, true, tagName)\n\n if (result === NOT_RESOLVED) {\n throwError(state, `cannot resolve a node with !<${tagName}> explicit tag`)\n }\n\n return { value: result, tag: scalarTag }\n }\n\n // An empty node carrying a collection tag (e.g. `!!map`, `!!seq`) is emitted\n // by the parser as a scalar event, since there is no collection syntax to key\n // off. Resolve it here by the explicit tag's kind into an empty collection.\n const collectionTagDef =\n state.schema.lookupMappingTag(tagName) ??\n state.schema.lookupSequenceTag(tagName)\n\n if (collectionTagDef) {\n if (source !== '') {\n throwError(state, `cannot resolve a node with !<${tagName}> explicit tag`)\n }\n\n const carrier = collectionTagDef.create(tagName)\n const value = collectionTagDef.carrierIsResult\n ? carrier\n : finalizeCollection(state, state.position, collectionTagDef, carrier)\n return { value, tag: collectionTagDef }\n }\n\n throwError(state, `unknown scalar tag !<${tagName}>`)\n }\n\n if (event.style === SCALAR_STYLE.PLAIN) {\n return state.schema.resolveImplicitScalarTag(source)\n }\n\n return { value: strTag.resolve(source, false, strTag.tagName), tag: strTag }\n}\n\nfunction collectionTagName (\n state: ConstructorState,\n event: SequenceEvent | MappingEvent,\n defaultTagName: string\n) {\n const rawTag = event.tagStart === NO_RANGE\n ? ''\n : state.source.slice(event.tagStart, event.tagEnd)\n const tagName = rawTag === '' || rawTag === '!'\n ? defaultTagName\n : tagNameFull(rawTag, state.tagHandlers)\n\n return tagName\n}\n\n// A merge source must be a mapping; every mapping tag exposes the read side.\nfunction isMappingTag (tag: AnyTag): tag is MappingTagDefinition<any, any> {\n return tag.nodeKind === 'mapping'\n}\n\nfunction chargeMergeWork (state: ConstructorState) {\n state.totalMergeKeys++\n\n if (state.maxTotalMergeKeys !== -1 && state.totalMergeKeys > state.maxTotalMergeKeys) {\n throwError(state, `merge keys exceeded maxTotalMergeKeys (${state.maxTotalMergeKeys})`)\n }\n}\n\n// Fold the keys of one mapping source into the target frame, honoring merge\n// precedence: an already-present key (explicit or from an earlier source) wins.\nfunction mergeKeys (state: ConstructorState, frame: MappingFrame, source: unknown, sourceTag: MappingTagDefinition<any, any>) {\n // Count the source mapping itself to bound sequences of empty mappings.\n chargeMergeWork(state)\n\n for (const sourceKey of sourceTag.keys(source)) {\n chargeMergeWork(state)\n\n if (frame.tag.has(frame.value, sourceKey)) continue\n\n const err = frame.tag.addPair(frame.value, sourceKey, sourceTag.get(source, sourceKey))\n if (err) throwError(state, err)\n\n frame.overridable ??= new Set()\n frame.overridable.add(sourceKey)\n }\n}\n\n// The value of a `<<` key: either a mapping (fold its keys) or a sequence of\n// mappings (fold each). Sequence elements arrive as bare values, so the tag each\n// was built with comes from `nodeTags`; a miss means it is not a mapping (a\n// scalar, a nested sequence, or a value some sequence tag synthesized itself).\nfunction mergeSource (state: ConstructorState, frame: MappingFrame, source: unknown, sourceTag: AnyTag) {\n state.position = frame.keyPosition\n\n if (isMappingTag(sourceTag)) {\n mergeKeys(state, frame, source, sourceTag)\n } else if (sourceTag.nodeKind === 'sequence' && Array.isArray(source)) {\n // The current merge budget is sufficient; this hard cap only further limits\n // the attack vector, so there is no reason to expose it as a public option.\n if (source.length > 100) {\n throwError(state, 'abnormal merge sequence size')\n }\n\n for (const element of source) {\n const elementTag = state.nodeTags.get(element)\n if (!elementTag) {\n throwError(state, 'cannot merge mappings; the provided source object is unacceptable')\n }\n mergeKeys(state, frame, element, elementTag)\n }\n } else {\n throwError(state, 'cannot merge mappings; the provided source object is unacceptable')\n }\n}\n\nfunction addMappingValue (state: ConstructorState, frame: MappingFrame, key: unknown, value: unknown, tag: AnyTag) {\n state.position = frame.keyPosition\n\n // `<<` is intercepted before dedup, so a repeated merge key is allowed.\n if (frame.keyIsMerge) {\n mergeSource(state, frame, value, tag)\n return\n }\n\n if (!state.json && frame.tag.has(frame.value, key) && !frame.overridable?.has(key)) {\n throwError(state, 'duplicated mapping key')\n }\n\n const err = frame.tag.addPair(frame.value, key, value)\n if (err) throwError(state, err)\n frame.overridable?.delete(key)\n}\n\nfunction addValue (state: ConstructorState, value: unknown, tag: AnyTag) {\n const frame = state.frames[state.frames.length - 1]!\n\n if (frame.kind === 'document') {\n frame.value = value\n frame.hasValue = true\n } else if (frame.kind === 'sequence') {\n // Any element may later be folded in by a `<<` merge, which by then has no\n // way to tell what built it.\n if (isMappingTag(tag)) state.nodeTags.set(value, tag)\n const err = frame.tag.addItem(frame.value, value, frame.index++)\n if (err) throwError(state, err)\n } else if (frame.hasKey) {\n const key = frame.key\n frame.key = undefined\n frame.hasKey = false\n addMappingValue(state, frame, key, value, tag)\n } else {\n frame.key = value\n frame.keyPosition = state.position\n frame.hasKey = true\n frame.keyIsMerge = tag.tagName === MERGE_TAG_NAME\n }\n}\n\nfunction storeAnchor (\n state: ConstructorState,\n event: ScalarEvent | SequenceEvent | MappingEvent,\n value: unknown,\n tag: AnyTag,\n isValueFinal: boolean\n): Anchor | null {\n if (event.anchorStart !== NO_RANGE) {\n const anchor = {\n value,\n tag,\n isValueFinal\n }\n state.anchors.set(state.source.slice(event.anchorStart, event.anchorEnd), anchor)\n return anchor\n }\n\n return null\n}\n\n/**\n * Constructs JavaScript documents directly from parser events, without an\n * intermediate AST.\n *\n * @category Events\n */\nfunction constructFromEvents (events: Event[], options: ConstructorOptions): unknown[] {\n const state: ConstructorState = {\n ...DEFAULT_CONSTRUCTOR_OPTIONS,\n ...options,\n events,\n documents: [],\n eventIndex: 0,\n position: 0,\n frames: [],\n anchors: new Map(),\n nodeTags: new Map(),\n tagHandlers: Object.create(null),\n totalMergeKeys: 0,\n aliasCount: 0\n }\n\n while (state.eventIndex < state.events.length) {\n const event = state.events[state.eventIndex++]\n state.position = eventPosition(event)\n\n switch (event.type) {\n case EVENT_ID.DOCUMENT:\n state.anchors = new Map()\n state.nodeTags = new Map()\n state.aliasCount = 0\n state.tagHandlers = Object.create(null)\n for (const directive of event.directives) {\n if (directive.kind === 'tag') state.tagHandlers[directive.handle] = directive.prefix\n }\n state.frames.push({ kind: 'document', position: state.position, value: undefined, hasValue: false })\n break\n\n case EVENT_ID.SCALAR: {\n const { value, tag } = constructScalar(state, event)\n storeAnchor(state, event, value, tag, true)\n addValue(state, value, tag)\n break\n }\n\n case EVENT_ID.SEQUENCE: {\n const tagName = collectionTagName(state, event, 'tag:yaml.org,2002:seq')\n const tag = state.schema.lookupSequenceTag(tagName)\n if (!tag) throwError(state, `unknown sequence tag !<${tagName}>`)\n\n const value = tag.create(tagName)\n const anchor = storeAnchor(state, event, value, tag, tag.carrierIsResult)\n\n state.frames.push({\n kind: 'sequence', position: state.position, value, tag, anchor, index: 0\n })\n break\n }\n\n case EVENT_ID.MAPPING: {\n const tagName = collectionTagName(state, event, 'tag:yaml.org,2002:map')\n const tag = state.schema.lookupMappingTag(tagName)\n if (!tag) throwError(state, `unknown mapping tag !<${tagName}>`)\n\n const value = tag.create(tagName)\n const anchor = storeAnchor(state, event, value, tag, tag.carrierIsResult)\n state.frames.push({\n kind: 'mapping',\n position: state.position,\n value,\n tag,\n anchor,\n key: undefined,\n keyPosition: state.position,\n hasKey: false,\n keyIsMerge: false,\n overridable: null\n })\n break\n }\n\n case EVENT_ID.ALIAS: {\n if (state.maxAliases !== -1 && ++state.aliasCount > state.maxAliases) {\n throwError(state, `aliases exceeded maxAliases (${state.maxAliases})`)\n }\n\n const name = state.source.slice(event.anchorStart, event.anchorEnd)\n const anchor = state.anchors.get(name)\n if (!anchor) {\n throwError(state, `unidentified alias \"${name}\"`)\n }\n if (!anchor.isValueFinal) {\n throwError(state, `recursive alias \"${name}\" is not supported for tag ${anchor.tag.tagName} because it uses finalize()`)\n }\n addValue(state, anchor.value, anchor.tag)\n break\n }\n\n case EVENT_ID.POP: {\n const frame = state.frames.pop()!\n\n if (frame.kind === 'mapping' && frame.hasKey) {\n state.position = frame.keyPosition\n throwError(state, 'incomplete mapping pair in event stream')\n }\n\n if (frame.kind === 'document') {\n state.documents.push(frame.value)\n } else {\n const value = frame.tag.carrierIsResult\n ? frame.value\n : finalizeCollection(state, frame.position, frame.tag, frame.value)\n if (frame.anchor) {\n frame.anchor.value = value\n frame.anchor.isValueFinal = true\n }\n addValue(state, value, frame.tag)\n }\n break\n }\n }\n }\n\n return state.documents\n}\n\nexport {\n constructFromEvents,\n DEFAULT_CONSTRUCTOR_OPTIONS,\n type ConstructorOptions\n}\n","import {\n EVENT_ID,\n SCALAR_STYLE,\n COLLECTION_STYLE,\n CHOMPING_MODE,\n type Event,\n type ScalarStyle,\n type CollectionStyle,\n type ChompingMode,\n type DocumentDirective,\n type TagHandlers\n} from './events.ts'\nimport { YAMLException } from '../common/exception.ts'\n\nconst NO_RANGE = -1\nconst HAS_OWN = Object.prototype.hasOwnProperty\n\nconst CONTEXT_FLOW_IN = 1\nconst CONTEXT_FLOW_OUT = 2\nconst CONTEXT_BLOCK_IN = 3\nconst CONTEXT_BLOCK_OUT = 4\n\n// eslint-disable-next-line no-control-regex\nconst PATTERN_NON_PRINTABLE = /[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_FLOW_INDICATORS = /[,\\[\\]{}]/\n// YAML 1.2.2, [91] c-tag-handle.\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/\n// YAML 1.2.2, [39] ns-uri-char.\n// eslint-disable-next-line no-useless-escape\nconst NS_URI_CHAR = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]])`\n// YAML 1.2.2, [40] ns-tag-char = ns-uri-char - \"!\" - c-flow-indicator.\n// eslint-disable-next-line no-useless-escape\nconst NS_TAG_CHAR = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\\-#;/?:@&=+$.~*'()_])`\nconst PATTERN_TAG_URI = new RegExp(`^(?:${NS_URI_CHAR})*$`)\n// YAML 1.2.2, [99] c-ns-shorthand-tag suffix part.\nconst PATTERN_TAG_SUFFIX = new RegExp(`^(?:${NS_TAG_CHAR})+$`)\n// YAML 1.2.2, [93] ns-tag-prefix.\nconst PATTERN_TAG_PREFIX = new RegExp(`^(?:!(?:${NS_URI_CHAR})*|${NS_TAG_CHAR}(?:${NS_URI_CHAR})*)$`)\n\ntype NodeContext =\n typeof CONTEXT_FLOW_IN | typeof CONTEXT_FLOW_OUT |\n typeof CONTEXT_BLOCK_IN | typeof CONTEXT_BLOCK_OUT\n\ninterface NodeProperties {\n anchorStart: number\n anchorEnd: number\n tagStart: number\n tagEnd: number\n}\n\ninterface ParserSnapshot {\n position: number\n line: number\n lineStart: number\n lineIndent: number\n firstTabInLine: number\n eventsLength: number\n}\n\n/** @category Events */\ninterface ParserOptions {\n /**\n * File path used in error messages.\n *\n * @defaultValue `null`\n */\n filename?: string\n\n /**\n * Maximum nesting depth for collections. Aliases are not taken into account.\n *\n * @defaultValue `100`\n */\n maxDepth?: number\n}\n\nconst DEFAULT_PARSER_OPTIONS: Required<ParserOptions> = {\n filename: '',\n maxDepth: 100\n}\n\ninterface ParserState extends Required<ParserOptions> {\n input: string\n length: number\n position: number\n line: number\n lineStart: number\n lineIndent: number\n firstTabInLine: number\n depth: number\n directives: DocumentDirective[]\n tagHandlers: TagHandlers\n events: Event[]\n}\n\nfunction addDocumentEvent (\n state: ParserState,\n explicitStart: boolean,\n explicitEnd: boolean\n) {\n state.events.push({\n type: EVENT_ID.DOCUMENT,\n explicitStart,\n explicitEnd,\n directives: state.directives\n })\n}\n\nfunction addSequenceEvent (\n state: ParserState,\n start: number,\n anchorStart: number,\n anchorEnd: number,\n tagStart: number,\n tagEnd: number,\n style: CollectionStyle\n) {\n state.events.push({\n type: EVENT_ID.SEQUENCE,\n start,\n anchorStart,\n anchorEnd,\n tagStart,\n tagEnd,\n style\n })\n}\n\nfunction addMappingEvent (\n state: ParserState,\n start: number,\n anchorStart: number,\n anchorEnd: number,\n tagStart: number,\n tagEnd: number,\n style: CollectionStyle\n) {\n state.events.push({\n type: EVENT_ID.MAPPING,\n start,\n anchorStart,\n anchorEnd,\n tagStart,\n tagEnd,\n style\n })\n}\n\nfunction insertFlowPairMappingEvent (state: ParserState, snapshot: ParserSnapshot) {\n state.events.splice(snapshot.eventsLength, 0, {\n type: EVENT_ID.MAPPING,\n start: snapshot.position,\n anchorStart: NO_RANGE,\n anchorEnd: NO_RANGE,\n tagStart: NO_RANGE,\n tagEnd: NO_RANGE,\n style: COLLECTION_STYLE.FLOW\n })\n}\n\nfunction addScalarEvent (\n state: ParserState,\n valueStart: number,\n valueEnd: number,\n anchorStart: number,\n anchorEnd: number,\n tagStart: number,\n tagEnd: number,\n style: ScalarStyle,\n chomping: ChompingMode = CHOMPING_MODE.CLIP,\n indent = -1,\n fast = false\n) {\n state.events.push({\n type: EVENT_ID.SCALAR,\n valueStart,\n valueEnd,\n anchorStart,\n anchorEnd,\n tagStart,\n tagEnd,\n style,\n chomping,\n indent,\n fast\n })\n}\n\nfunction addAliasEvent (\n state: ParserState,\n anchorStart: number,\n anchorEnd: number\n) {\n state.events.push({\n type: EVENT_ID.ALIAS,\n anchorStart,\n anchorEnd\n })\n}\n\nfunction addPopEvent (state: ParserState) {\n state.events.push({ type: EVENT_ID.POP })\n}\n\nfunction addEmptyScalarEvent (state: ParserState) {\n addScalarEvent(\n state,\n NO_RANGE,\n NO_RANGE,\n NO_RANGE,\n NO_RANGE,\n NO_RANGE,\n NO_RANGE,\n SCALAR_STYLE.PLAIN\n )\n}\n\nfunction emptyProperties (): NodeProperties {\n return {\n anchorStart: NO_RANGE,\n anchorEnd: NO_RANGE,\n tagStart: NO_RANGE,\n tagEnd: NO_RANGE\n }\n}\n\nfunction snapshotState (state: ParserState): ParserSnapshot {\n return {\n position: state.position,\n line: state.line,\n lineStart: state.lineStart,\n lineIndent: state.lineIndent,\n firstTabInLine: state.firstTabInLine,\n eventsLength: state.events.length\n }\n}\n\nfunction restoreState (state: ParserState, snapshot: ParserSnapshot) {\n state.position = snapshot.position\n state.line = snapshot.line\n state.lineStart = snapshot.lineStart\n state.lineIndent = snapshot.lineIndent\n state.firstTabInLine = snapshot.firstTabInLine\n state.events.length = snapshot.eventsLength\n}\n\nfunction throwError (state: ParserState, message: string): never {\n YAMLException.throwAt(state.input.slice(0, state.length), state.position, message, state.filename)\n}\n\nfunction isEol (c: number) {\n return c === 0x0A/* LF */ || c === 0x0D/* CR */\n}\n\nfunction isWhiteSpace (c: number) {\n return c === 0x09/* Tab */ || c === 0x20/* Space */\n}\n\nfunction isWsOrEol (c: number) {\n return isWhiteSpace(c) || isEol(c)\n}\n\nfunction isWsOrEolOrEnd (c: number) {\n return c === 0 || isWsOrEol(c)\n}\n\nfunction isFlowIndicator (c: number) {\n return c === 0x2C/* , */ ||\n c === 0x5B/* [ */ ||\n c === 0x5D/* ] */ ||\n c === 0x7B/* { */ ||\n c === 0x7D/* } */\n}\n\nfunction fromDecimalCode (c: number) {\n return c >= 0x30/* 0 */ && c <= 0x39/* 9 */ ? c - 0x30 : -1\n}\n\nfunction fromHexCode (c: number) {\n if (c >= 0x30/* 0 */ && c <= 0x39/* 9 */) return c - 0x30\n const lc = c | 0x20\n if (lc >= 0x61/* a */ && lc <= 0x66/* f */) return lc - 0x61 + 10\n return -1\n}\n\nfunction escapedHexLen (c: number) {\n if (c === 0x78/* x */) return 2\n if (c === 0x75/* u */) return 4\n if (c === 0x55/* U */) return 8\n return 0\n}\n\nfunction isSimpleEscape (c: number) {\n return c === 0x30/* 0 */ ||\n c === 0x61/* a */ ||\n c === 0x62/* b */ ||\n c === 0x74/* t */ ||\n c === 0x09/* Tab */ ||\n c === 0x6E/* n */ ||\n c === 0x76/* v */ ||\n c === 0x66/* f */ ||\n c === 0x72/* r */ ||\n c === 0x65/* e */ ||\n c === 0x20/* Space */ ||\n c === 0x22/* \" */ ||\n c === 0x2F/* / */ ||\n c === 0x5C/* \\ */ ||\n c === 0x4E/* N */ ||\n c === 0x5F/* _ */ ||\n c === 0x4C/* L */ ||\n c === 0x50/* P */\n}\n\n// Precondition: state.position points at LF or CR.\nfunction consumeLineBreak (state: ParserState) {\n const ch = state.input.charCodeAt(state.position)\n\n if (ch === 0x0A/* LF */) {\n state.position++\n } else {\n state.position++\n if (state.input.charCodeAt(state.position) === 0x0A/* LF */) state.position++\n }\n\n state.line++\n state.lineStart = state.position\n state.lineIndent = 0\n state.firstTabInLine = -1\n}\n\nfunction skipSeparationSpace (state: ParserState, allowComments: boolean) {\n let lineBreaks = 0\n let ch = state.input.charCodeAt(state.position)\n let hasSeparation = state.position === state.lineStart ||\n isWsOrEol(state.input.charCodeAt(state.position - 1))\n\n while (ch !== 0) {\n while (isWhiteSpace(ch)) {\n hasSeparation = true\n if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {\n state.firstTabInLine = state.position\n }\n ch = state.input.charCodeAt(++state.position)\n }\n\n if (allowComments && hasSeparation && ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position) }\n while (!isEol(ch) && ch !== 0)\n }\n\n if (!isEol(ch)) break\n\n consumeLineBreak(state)\n lineBreaks++\n hasSeparation = true\n ch = state.input.charCodeAt(state.position)\n\n while (ch === 0x20/* Space */) {\n state.lineIndent++\n ch = state.input.charCodeAt(++state.position)\n }\n }\n\n return lineBreaks\n}\n\nfunction testDocumentSeparator (state: ParserState, position = state.position) {\n const ch = state.input.charCodeAt(position)\n\n if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&\n ch === state.input.charCodeAt(position + 1) &&\n ch === state.input.charCodeAt(position + 2)) {\n const following = state.input.charCodeAt(position + 3)\n return following === 0 || isWsOrEol(following)\n }\n\n return false\n}\n\nfunction skipByteOrderMark (state: ParserState) {\n if (state.position === state.lineStart &&\n state.input.charCodeAt(state.position) === 0xFEFF) {\n state.position++\n state.lineStart = state.position\n }\n}\n\nfunction testDocumentBoundary (state: ParserState) {\n if (state.position !== state.lineStart) return false\n\n // Fast path: most document boundaries do not have a BOM.\n if (testDocumentSeparator(state)) return true\n if (state.input.charCodeAt(state.position) !== 0xFEFF) return false\n\n // BOM-prefixed boundaries are rare, so snapshot/restore overhead is negligible.\n const snapshot = snapshotState(state)\n\n skipByteOrderMark(state)\n skipSeparationSpace(state, true)\n\n const ch = state.input.charCodeAt(state.position)\n const result = state.position === state.lineStart &&\n (ch === 0x25/* % */ || (ch === 0x2D/* - */ && testDocumentSeparator(state)))\n\n restoreState(state, snapshot)\n return result\n}\n\nfunction skipUntilLineEnd (state: ParserState) {\n let ch = state.input.charCodeAt(state.position)\n\n while (ch !== 0 && !isEol(ch)) {\n ch = state.input.charCodeAt(++state.position)\n }\n}\n\nfunction checkPrintable (state: ParserState, start: number, end: number) {\n if (PATTERN_NON_PRINTABLE.test(state.input.slice(start, end))) {\n throwError(state, 'the stream contains non-printable characters')\n }\n}\n\nfunction readTagProperty (state: ParserState, props: NodeProperties, inFlow: boolean) {\n if (state.input.charCodeAt(state.position) !== 0x21/* ! */) return false\n if (props.tagStart !== NO_RANGE) throwError(state, 'duplication of a tag property')\n\n const start = state.position\n let isVerbatim = false\n let isNamed = false\n let tagHandle = '!'\n let ch = state.input.charCodeAt(++state.position)\n\n if (ch === 0x3C/* < */) {\n isVerbatim = true\n ch = state.input.charCodeAt(++state.position)\n } else if (ch === 0x21/* ! */) {\n isNamed = true\n tagHandle = '!!'\n ch = state.input.charCodeAt(++state.position)\n }\n\n let suffixStart = state.position\n let tagName\n\n if (isVerbatim) {\n while (ch !== 0 && ch !== 0x3E/* > */) ch = state.input.charCodeAt(++state.position)\n if (ch !== 0x3E/* > */) throwError(state, 'unexpected end of the stream within a verbatim tag')\n tagName = state.input.slice(suffixStart, state.position)\n state.position++\n } else {\n while (ch !== 0 && !isWsOrEol(ch) && !(inFlow && isFlowIndicator(ch))) {\n if (ch === 0x21/* ! */) {\n if (!isNamed) {\n tagHandle = state.input.slice(suffixStart - 1, state.position + 1)\n if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, 'named tag handle cannot contain such characters')\n isNamed = true\n suffixStart = state.position + 1\n } else {\n throwError(state, 'tag suffix cannot contain exclamation marks')\n }\n }\n\n ch = state.input.charCodeAt(++state.position)\n }\n\n tagName = state.input.slice(suffixStart, state.position)\n if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, 'tag suffix cannot contain flow indicator characters')\n }\n\n if (tagName && !(isVerbatim ? PATTERN_TAG_URI.test(tagName) : PATTERN_TAG_SUFFIX.test(tagName))) {\n throwError(state, `tag name cannot contain such characters: ${tagName}`)\n }\n try {\n decodeURIComponent(tagName)\n } catch {\n throwError(state, `tag name is malformed: ${tagName}`)\n }\n\n if (!isVerbatim && tagHandle !== '!' && tagHandle !== '!!' && !HAS_OWN.call(state.tagHandlers, tagHandle)) {\n throwError(state, `undeclared tag handle \"${tagHandle}\"`)\n }\n\n props.tagStart = start\n props.tagEnd = state.position\n return true\n}\n\nfunction readAnchorProperty (state: ParserState, props: NodeProperties) {\n if (state.input.charCodeAt(state.position) !== 0x26/* & */) return false\n if (props.anchorStart !== NO_RANGE) throwError(state, 'duplication of an anchor property')\n\n state.position++\n const start = state.position\n\n while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position)) && !isFlowIndicator(state.input.charCodeAt(state.position))) {\n state.position++\n }\n\n if (state.position === start) throwError(state, 'name of an anchor node must contain at least one character')\n\n props.anchorStart = start\n props.anchorEnd = state.position\n return true\n}\n\nfunction readAlias (state: ParserState, props: NodeProperties) {\n if (state.input.charCodeAt(state.position) !== 0x2A/* * */) return false\n if (props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE) {\n throwError(state, 'alias node should not have any properties')\n }\n\n state.position++\n const start = state.position\n\n while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position)) && !isFlowIndicator(state.input.charCodeAt(state.position))) {\n state.position++\n }\n\n if (state.position === start) throwError(state, 'name of an alias node must contain at least one character')\n\n addAliasEvent(state, start, state.position)\n return true\n}\n\nfunction readFlowScalarBreak (state: ParserState, nodeIndent: number) {\n skipSeparationSpace(state, false)\n\n if (state.lineIndent < nodeIndent) {\n throwError(state, 'deficient indentation')\n }\n}\n\nfunction readSingleQuotedScalar (state: ParserState, nodeIndent: number, props: NodeProperties) {\n if (state.input.charCodeAt(state.position) !== 0x27/* ' */) return false\n\n state.position++\n const start = state.position\n // A single-quoted scalar is sliceable verbatim when it has no '' escape pairs\n // and no folded line breaks (see getScalarValue fast path).\n let simple = true\n\n while (state.input.charCodeAt(state.position) !== 0) {\n const ch = state.input.charCodeAt(state.position)\n\n if (ch === 0x27/* ' */) {\n if (state.input.charCodeAt(state.position + 1) === 0x27/* ' */) {\n simple = false\n state.position += 2\n continue\n }\n\n const end = state.position\n state.position++\n addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, SCALAR_STYLE.SINGLE_QUOTED, CHOMPING_MODE.CLIP, -1, simple)\n return true\n }\n\n if (isEol(ch)) {\n simple = false\n readFlowScalarBreak(state, nodeIndent)\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a single quoted scalar')\n } else if (ch !== 0x09/* Tab */ && ch < 0x20) {\n throwError(state, 'expected valid JSON character')\n } else {\n state.position++\n }\n }\n\n throwError(state, 'unexpected end of the stream within a single quoted scalar')\n}\n\nfunction readDoubleQuotedScalar (state: ParserState, nodeIndent: number, props: NodeProperties) {\n if (state.input.charCodeAt(state.position) !== 0x22/* \" */) return false\n\n state.position++\n const start = state.position\n // A double-quoted scalar is sliceable verbatim when it has no \\ escapes and\n // no folded line breaks (see getScalarValue fast path).\n let simple = true\n\n while (state.input.charCodeAt(state.position) !== 0) {\n const ch = state.input.charCodeAt(state.position)\n\n if (ch === 0x22/* \" */) {\n const end = state.position\n state.position++\n addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, SCALAR_STYLE.DOUBLE_QUOTED, CHOMPING_MODE.CLIP, -1, simple)\n return true\n }\n\n if (ch === 0x5C/* \\ */) {\n simple = false\n const escaped = state.input.charCodeAt(++state.position)\n\n if (isEol(escaped)) {\n readFlowScalarBreak(state, nodeIndent)\n } else if (isSimpleEscape(escaped)) {\n state.position++\n } else {\n let hexLength = escapedHexLen(escaped)\n\n if (hexLength === 0) throwError(state, 'unknown escape sequence')\n\n while (hexLength-- > 0) {\n state.position++\n if (fromHexCode(state.input.charCodeAt(state.position)) < 0) {\n throwError(state, 'expected hexadecimal character')\n }\n }\n state.position++\n }\n } else if (isEol(ch)) {\n simple = false\n readFlowScalarBreak(state, nodeIndent)\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a double quoted scalar')\n } else if (ch !== 0x09/* Tab */ && ch < 0x20) {\n throwError(state, 'expected valid JSON character')\n } else {\n state.position++\n }\n }\n\n throwError(state, 'unexpected end of the stream within a double quoted scalar')\n}\n\nfunction readBlockScalar (state: ParserState, parentIndent: number, props: NodeProperties) {\n const ch = state.input.charCodeAt(state.position)\n let chomping: ChompingMode = CHOMPING_MODE.CLIP\n let indent = -1\n let detectedIndent = false\n\n if (ch !== 0x7C/* | */ && ch !== 0x3E/* > */) return false\n\n const style = ch === 0x7C/* | */ ? SCALAR_STYLE.LITERAL_BLOCK : SCALAR_STYLE.FOLDED_BLOCK\n state.position++\n\n while (state.input.charCodeAt(state.position) !== 0) {\n const current = state.input.charCodeAt(state.position)\n const digit = fromDecimalCode(current)\n\n if (current === 0x2B/* + */ || current === 0x2D/* - */) {\n if (chomping !== CHOMPING_MODE.CLIP) throwError(state, 'repeat of a chomping mode identifier')\n chomping = current === 0x2B/* + */ ? CHOMPING_MODE.KEEP : CHOMPING_MODE.STRIP\n state.position++\n } else if (digit >= 0) {\n if (digit === 0) {\n throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one')\n }\n if (detectedIndent) throwError(state, 'repeat of an indentation width identifier')\n indent = parentIndent + digit - 1\n detectedIndent = true\n state.position++\n } else {\n break\n }\n }\n\n let hadWhitespace = false\n while (isWhiteSpace(state.input.charCodeAt(state.position))) {\n hadWhitespace = true\n state.position++\n }\n if (hadWhitespace && state.input.charCodeAt(state.position) === 0x23/* # */) skipUntilLineEnd(state)\n\n if (isEol(state.input.charCodeAt(state.position))) {\n consumeLineBreak(state)\n } else if (state.input.charCodeAt(state.position) !== 0) {\n throwError(state, 'a line break is expected')\n }\n\n let contentIndent = detectedIndent ? indent : -1\n let maxLeadingIndent = 0\n const valueStart = state.position\n let valueEnd = state.position\n\n while (state.input.charCodeAt(state.position) !== 0) {\n const linePosition = state.position\n let column = 0\n\n while (state.input.charCodeAt(linePosition + column) === 0x20/* Space */) column++\n\n const first = state.input.charCodeAt(linePosition + column)\n if (first === 0) {\n // End of input acts as a line terminator, but there is no line break to\n // include here. A final all-spaces line still counts: when the block has a\n // content indent, the spaces beyond it are real content; in a wholly blank\n // block (contentIndent < 0) the spaces form a blank line that chomping must\n // see, exactly as it would if the line ended with a break. Capture the line\n // in both cases; otherwise the block ends at the start of this empty line.\n if (contentIndent >= 0) {\n if (column > contentIndent) valueEnd = linePosition + column\n } else if (column > 0) {\n valueEnd = linePosition + column\n }\n break\n }\n if (testDocumentBoundary(state)) break\n\n if (!detectedIndent && contentIndent === -1 && isEol(first)) {\n maxLeadingIndent = Math.max(maxLeadingIndent, column)\n }\n\n if (!detectedIndent && contentIndent === -1 && !isEol(first)) {\n if (first === 0x09/* Tab */ && column < parentIndent) {\n state.position = linePosition + column\n throwError(state, 'tab characters must not be used in indentation')\n }\n if (column < maxLeadingIndent) {\n state.position = linePosition + column\n throwError(state, 'bad indentation of a mapping entry')\n }\n }\n\n if (contentIndent === -1 && first !== 0 && !isEol(first) && column < parentIndent) {\n state.lineIndent = column\n state.position = linePosition + column\n break\n }\n\n if (!detectedIndent && first !== 0 && !isEol(first) && contentIndent === -1) {\n contentIndent = column\n }\n\n const requiredIndent = contentIndent === -1 ? parentIndent + 1 : contentIndent\n if (first !== 0 && !isEol(first) && column < requiredIndent) {\n state.lineIndent = column\n state.position = linePosition + column\n break\n }\n\n skipUntilLineEnd(state)\n valueEnd = state.position\n if (isEol(state.input.charCodeAt(state.position))) {\n consumeLineBreak(state)\n // Include the line break in the range so trailing blank lines are\n // preserved. This is what lets cook tell apart an empty `|+` (range \"\",\n // value \"\") from a `|+` with one blank line (range \"\\n\", value \"\\n\").\n // De-indent and chomping are applied later in getScalarValue.\n valueEnd = state.position\n }\n }\n\n checkPrintable(state, valueStart, valueEnd)\n addScalarEvent(\n state,\n valueStart,\n valueEnd,\n props.anchorStart,\n props.anchorEnd,\n props.tagStart,\n props.tagEnd,\n style,\n chomping,\n contentIndent\n )\n return true\n}\n\nfunction canStartPlainScalar (state: ParserState, nodeContext: NodeContext) {\n const ch = state.input.charCodeAt(state.position)\n const inFlow = nodeContext === CONTEXT_FLOW_IN\n\n if (ch === 0 ||\n isWsOrEol(ch) ||\n ch === 0x23/* # */ ||\n ch === 0x26/* & */ ||\n ch === 0x2A/* * */ ||\n ch === 0x21/* ! */ ||\n ch === 0x7C/* | */ ||\n ch === 0x3E/* > */ ||\n ch === 0x27/* ' */ ||\n ch === 0x22/* \" */ ||\n ch === 0x25/* % */ ||\n ch === 0x40/* @ */ ||\n ch === 0x60/* ` */ ||\n (inFlow && isFlowIndicator(ch))) {\n return false\n }\n\n if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {\n const following = state.input.charCodeAt(state.position + 1)\n if (isWsOrEolOrEnd(following) || (inFlow && isFlowIndicator(following))) return false\n }\n\n return true\n}\n\nfunction readPlainScalar (state: ParserState, nodeIndent: number, nodeContext: NodeContext, props: NodeProperties) {\n if (!canStartPlainScalar(state, nodeContext)) return false\n\n const start = state.position\n let end = state.position\n let ch = state.input.charCodeAt(state.position)\n const inFlow = nodeContext === CONTEXT_FLOW_IN\n // A single-line plain scalar is sliceable verbatim: the parser already trims\n // trailing whitespace from the range, so no folding is needed (see\n // getScalarValue fast path). Folded line breaks make it non-simple.\n let multiline = false\n\n while (ch !== 0) {\n if (testDocumentBoundary(state)) break\n\n if (ch === 0x3A/* : */) {\n const following = state.input.charCodeAt(state.position + 1)\n if (isWsOrEolOrEnd(following) || (inFlow && isFlowIndicator(following))) break\n } else if (ch === 0x23/* # */) {\n const preceding = state.input.charCodeAt(state.position - 1)\n if (isWsOrEol(preceding)) break\n } else if (inFlow && isFlowIndicator(ch)) {\n break\n } else if (isEol(ch)) {\n const savedPosition = state.position\n const savedLine = state.line\n const savedLineStart = state.lineStart\n const savedLineIndent = state.lineIndent\n\n skipSeparationSpace(state, false)\n\n if (state.lineIndent >= nodeIndent) {\n multiline = true\n ch = state.input.charCodeAt(state.position)\n continue\n }\n\n state.position = savedPosition\n state.line = savedLine\n state.lineStart = savedLineStart\n state.lineIndent = savedLineIndent\n break\n }\n\n if (!isWhiteSpace(ch)) end = state.position + 1\n ch = state.input.charCodeAt(++state.position)\n }\n\n if (end === start) return false\n\n checkPrintable(state, start, end)\n addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, SCALAR_STYLE.PLAIN, CHOMPING_MODE.CLIP, -1, !multiline)\n return true\n}\n\nfunction findBlockMappingColon (state: ParserState) {\n let position = state.position\n let flowLevel = 0\n\n while (position < state.length) {\n const ch = state.input.charCodeAt(position)\n\n if (isEol(ch)) return -1\n if (ch === 0x23/* # */ && isWsOrEol(state.input.charCodeAt(position - 1))) return -1\n\n if ((ch === 0x2A/* * */ || ch === 0x26/* & */) && position === state.position) {\n do { position++ }\n while (state.input.charCodeAt(position) !== 0 &&\n !isWsOrEol(state.input.charCodeAt(position)) &&\n !isFlowIndicator(state.input.charCodeAt(position)))\n continue\n }\n\n if (ch === 0x5B/* [ */ || ch === 0x7B/* { */) {\n flowLevel++\n } else if (ch === 0x5D/* ] */ || ch === 0x7D/* } */) {\n if (flowLevel > 0) flowLevel--\n } else if (flowLevel === 0 && ch === 0x3A/* : */ && isWsOrEol(state.input.charCodeAt(position + 1))) {\n return position\n }\n\n if ((flowLevel > 0 || position === state.position) &&\n (ch === 0x27/* ' */ || ch === 0x22/* \" */)) {\n const quote = ch\n position++\n\n while (position < state.length && state.input.charCodeAt(position) !== quote) {\n if (state.input.charCodeAt(position) === 0x5C/* \\ */ && quote === 0x22/* \" */) position++\n position++\n }\n }\n\n position++\n }\n\n return -1\n}\n\nfunction skipFlowSeparationSpace (state: ParserState, nodeIndent: number) {\n const startLine = state.line\n skipSeparationSpace(state, true)\n\n if ((state.line > startLine && state.lineIndent < nodeIndent) ||\n (state.firstTabInLine !== -1 && state.lineIndent < nodeIndent)) {\n throwError(state, 'deficient indentation')\n }\n}\n\nfunction readFlowCollection (state: ParserState, nodeIndent: number, props: NodeProperties) {\n const ch = state.input.charCodeAt(state.position)\n const isMapping = ch === 0x7B/* { */\n const start = state.position\n let readNext = true\n\n if (ch !== 0x5B/* [ */ && ch !== 0x7B/* { */) return false\n\n const terminator = isMapping ? 0x7D/* } */ : 0x5D/* ] */\n\n if (isMapping) {\n addMappingEvent(state, start, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE.FLOW)\n } else {\n addSequenceEvent(state, start, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE.FLOW)\n }\n\n state.position++\n\n while (state.input.charCodeAt(state.position) !== 0) {\n skipFlowSeparationSpace(state, nodeIndent)\n\n let ch = state.input.charCodeAt(state.position)\n\n if (ch === terminator) {\n state.position++\n addPopEvent(state)\n return true\n } else if (!readNext) {\n throwError(state, 'missed comma between flow collection entries')\n } else if (ch === 0x2C/* , */) {\n throwError(state, \"expected the node content, but found ','\")\n }\n\n let isPair = false\n let isExplicitPair = false\n\n if (ch === 0x3F/* ? */ && isWsOrEol(state.input.charCodeAt(state.position + 1))) {\n isPair = isExplicitPair = true\n state.position += 1\n skipFlowSeparationSpace(state, nodeIndent)\n }\n\n const entryLine = state.line\n const entryStart = snapshotState(state)\n\n const keyWasRead = parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)\n skipFlowSeparationSpace(state, nodeIndent)\n\n ch = state.input.charCodeAt(state.position)\n\n if ((isMapping || isExplicitPair || state.line === entryLine) && ch === 0x3A/* : */) {\n isPair = true\n state.position++\n skipFlowSeparationSpace(state, nodeIndent)\n if (!isMapping) {\n insertFlowPairMappingEvent(state, entryStart)\n if (!keyWasRead) addEmptyScalarEvent(state)\n } else if (!keyWasRead) {\n addEmptyScalarEvent(state)\n }\n if (!parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)) {\n addEmptyScalarEvent(state)\n }\n skipFlowSeparationSpace(state, nodeIndent)\n if (!isMapping) addPopEvent(state)\n } else if (isMapping && isPair) {\n if (!keyWasRead) addEmptyScalarEvent(state)\n addEmptyScalarEvent(state)\n } else if (isMapping) {\n addEmptyScalarEvent(state)\n } else if (isPair) {\n insertFlowPairMappingEvent(state, entryStart)\n if (!keyWasRead) addEmptyScalarEvent(state)\n addEmptyScalarEvent(state)\n addPopEvent(state)\n }\n\n ch = state.input.charCodeAt(state.position)\n\n if (ch === 0x2C/* , */) {\n readNext = true\n state.position++\n } else {\n readNext = false\n }\n }\n\n throwError(state, 'unexpected end of the stream within a flow collection')\n}\n\nfunction readBlockSequence (state: ParserState, nodeIndent: number, props: NodeProperties) {\n if (state.firstTabInLine !== -1 || state.input.charCodeAt(state.position) !== 0x2D/* - */ || !isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) {\n return false\n }\n\n addSequenceEvent(state, state.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE.BLOCK)\n\n while (state.input.charCodeAt(state.position) === 0x2D/* - */ && isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) {\n if (state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine\n throwError(state, 'tab characters must not be used in indentation')\n }\n\n const entryLine = state.line\n state.position++\n\n const hadBreak = skipSeparationSpace(state, true) > 0\n if (state.firstTabInLine !== -1 &&\n state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) {\n throwError(state, 'bad indentation of a sequence entry')\n }\n\n if (hadBreak && state.lineIndent <= nodeIndent) {\n addEmptyScalarEvent(state)\n } else {\n parseNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true)\n }\n\n skipSeparationSpace(state, true)\n\n if (state.lineIndent < nodeIndent || state.position >= state.length) break\n if (state.lineIndent > nodeIndent) throwError(state, 'bad indentation of a sequence entry')\n if (state.line === entryLine &&\n state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) {\n throwError(state, 'bad indentation of a sequence entry')\n }\n }\n\n addPopEvent(state)\n return true\n}\n\nfunction readBlockMapping (state: ParserState, nodeIndent: number, flowIndent: number, props: NodeProperties) {\n let atExplicitKey = false\n let detected = false\n let mappingOpened = false\n let pendingExplicitKey = false\n\n if (state.firstTabInLine !== -1) return false\n\n let ch = state.input.charCodeAt(state.position)\n\n while (ch !== 0) {\n if (!atExplicitKey && state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine\n throwError(state, 'tab characters must not be used in indentation')\n }\n\n const following = state.input.charCodeAt(state.position + 1)\n const entryLine = state.line\n\n if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && isWsOrEolOrEnd(following)) {\n if (!mappingOpened) {\n addMappingEvent(state, state.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE.BLOCK)\n mappingOpened = true\n }\n\n if (ch === 0x3F/* ? */) {\n if (atExplicitKey) addEmptyScalarEvent(state)\n detected = true\n atExplicitKey = true\n } else if (atExplicitKey) {\n atExplicitKey = false\n } else {\n addEmptyScalarEvent(state)\n detected = true\n atExplicitKey = false\n }\n\n state.position += 1\n pendingExplicitKey = true\n } else {\n // An explicit key awaiting its value, followed by an implicit key, means\n // the explicit key's value is empty. Emit it now (append-only) so it is\n // ordered before the implicit key node read just below.\n if (atExplicitKey) {\n addEmptyScalarEvent(state)\n atExplicitKey = false\n }\n\n const beforeKey = snapshotState(state)\n\n if (!parseNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {\n break\n }\n\n if (state.line === entryLine) {\n ch = state.input.charCodeAt(state.position)\n\n while (isWhiteSpace(ch)) {\n ch = state.input.charCodeAt(++state.position)\n }\n\n if (ch === 0x3A/* : */) {\n ch = state.input.charCodeAt(++state.position)\n\n if (!isWsOrEolOrEnd(ch)) {\n throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping')\n }\n\n if (!mappingOpened) {\n restoreState(state, beforeKey)\n addMappingEvent(state, beforeKey.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE.BLOCK)\n mappingOpened = true\n // The key, the `:` and the space after it were already validated\n // above, before the rollback. Re-reading the same input cannot\n // fail, so just consume it again without error checks.\n parseNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)\n\n ch = state.input.charCodeAt(state.position)\n while (isWhiteSpace(ch)) {\n ch = state.input.charCodeAt(++state.position)\n }\n\n state.position++\n }\n\n detected = true\n atExplicitKey = false\n pendingExplicitKey = false\n } else if (detected) {\n throwError(state, \"expected ':' after a mapping key\")\n } else {\n // Not a mapping. If outer properties are pending, roll back so the\n // caller re-reads this node with them attached (events are append-only).\n if (props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE) {\n restoreState(state, beforeKey)\n return false\n }\n return true\n }\n } else if (detected) {\n throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key')\n } else {\n if (props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE) {\n restoreState(state, beforeKey)\n return false\n }\n return true\n }\n }\n\n if (parseNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, pendingExplicitKey)) {\n pendingExplicitKey = false\n }\n\n if (!atExplicitKey) {\n if (pendingExplicitKey) {\n addEmptyScalarEvent(state)\n pendingExplicitKey = false\n }\n }\n\n skipSeparationSpace(state, true)\n ch = state.input.charCodeAt(state.position)\n\n if ((state.line === entryLine || state.lineIndent > nodeIndent) && ch !== 0) {\n throwError(state, 'bad indentation of a mapping entry')\n } else if (state.lineIndent < nodeIndent) {\n break\n }\n }\n\n if (!detected) return false\n if (atExplicitKey) addEmptyScalarEvent(state)\n if (mappingOpened) addPopEvent(state)\n return true\n}\n\nfunction parseNode (\n state: ParserState,\n parentIndent: number,\n nodeContext: NodeContext,\n allowToSeek: boolean,\n allowCompact: boolean,\n allowPropertyMapping = true\n): boolean {\n if (state.depth >= state.maxDepth) {\n throwError(state, `nesting exceeded maxDepth (${state.maxDepth})`)\n }\n\n state.depth++\n\n let indentStatus = 1\n let atNewLine = false\n let hasContent = false\n let propertyStart: ParserSnapshot | null = null\n const props = emptyProperties()\n\n let allowBlockScalars = nodeContext === CONTEXT_BLOCK_OUT || nodeContext === CONTEXT_BLOCK_IN\n let allowBlockCollections = allowBlockScalars\n const allowBlockStyles = allowBlockScalars\n\n if (allowToSeek && skipSeparationSpace(state, true)) {\n atNewLine = true\n\n if (state.lineIndent > parentIndent) {\n indentStatus = 1\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0\n } else {\n indentStatus = -1\n }\n }\n\n if (indentStatus === 1) {\n while (true) {\n const ch = state.input.charCodeAt(state.position)\n const propertyState = snapshotState(state)\n\n if (atNewLine &&\n indentStatus !== 1 &&\n (ch === 0x21/* ! */ || ch === 0x26/* & */)) {\n break\n }\n\n if (atNewLine &&\n allowBlockStyles &&\n (props.tagStart !== NO_RANGE || props.anchorStart !== NO_RANGE) &&\n (ch === 0x21/* ! */ || ch === 0x26/* & */)) {\n const fallbackState = snapshotState(state)\n const flowIndent = parentIndent + 1\n const mappingIndent = state.position - state.lineStart\n\n if (readBlockMapping(state, mappingIndent, flowIndent, props) &&\n state.events[fallbackState.eventsLength]?.type === EVENT_ID.MAPPING) {\n state.depth--\n return true\n }\n\n restoreState(state, fallbackState)\n }\n\n if (atNewLine &&\n ((ch === 0x21/* ! */ && props.tagStart !== NO_RANGE) ||\n (ch === 0x26/* & */ && props.anchorStart !== NO_RANGE))) {\n break\n }\n\n if (!readTagProperty(state, props, nodeContext === CONTEXT_FLOW_IN) && !readAnchorProperty(state, props)) {\n break\n }\n\n if (propertyStart === null) propertyStart = propertyState\n\n if (skipSeparationSpace(state, true)) {\n atNewLine = true\n allowBlockCollections = allowBlockStyles\n\n if (state.lineIndent > parentIndent) {\n indentStatus = 1\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0\n } else {\n indentStatus = -1\n }\n } else {\n allowBlockCollections = false\n }\n }\n }\n\n if (allowBlockCollections) {\n allowBlockCollections = atNewLine || allowCompact\n }\n\n if (indentStatus === 1 || nodeContext === CONTEXT_BLOCK_OUT) {\n const flowIndent = nodeContext === CONTEXT_FLOW_IN || nodeContext === CONTEXT_FLOW_OUT\n ? parentIndent\n : parentIndent + 1\n const blockIndent = state.position - state.lineStart\n\n if (indentStatus === 1) {\n if ((allowBlockCollections &&\n (readBlockSequence(state, blockIndent, props) ||\n readBlockMapping(state, blockIndent, flowIndent, props))) ||\n readFlowCollection(state, flowIndent, props)) {\n hasContent = true\n } else {\n const ch = state.input.charCodeAt(state.position)\n\n if (propertyStart !== null && allowPropertyMapping && allowBlockStyles && !allowBlockCollections &&\n ch !== 0x7C/* | */ && ch !== 0x3E/* > */) {\n const fallbackState = snapshotState(state)\n const propertyIndent = propertyStart.position - propertyStart.lineStart\n\n restoreState(state, propertyStart)\n\n if (readBlockMapping(state, propertyIndent, flowIndent, emptyProperties()) &&\n state.events[fallbackState.eventsLength]?.type === EVENT_ID.MAPPING) {\n hasContent = true\n } else {\n restoreState(state, fallbackState)\n }\n }\n\n if (!hasContent &&\n ((allowBlockScalars && readBlockScalar(state, flowIndent, props)) ||\n readSingleQuotedScalar(state, flowIndent, props) ||\n readDoubleQuotedScalar(state, flowIndent, props) ||\n readAlias(state, props) ||\n readPlainScalar(state, flowIndent, nodeContext, props))) {\n hasContent = true\n }\n }\n } else if (indentStatus === 0) {\n hasContent = allowBlockCollections && readBlockSequence(state, blockIndent, props)\n }\n }\n\n allowBlockScalars = allowBlockScalars && !hasContent\n\n if (!hasContent && (props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE || allowBlockScalars)) {\n addScalarEvent(\n state,\n NO_RANGE,\n NO_RANGE,\n props.anchorStart,\n props.anchorEnd,\n props.tagStart,\n props.tagEnd,\n SCALAR_STYLE.PLAIN\n )\n hasContent = true\n }\n\n state.depth--\n return hasContent || props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE\n}\n\nfunction readDirective (state: ParserState) {\n if (state.lineIndent > 0 || state.input.charCodeAt(state.position) !== 0x25/* % */) return false\n\n state.position++\n const nameStart = state.position\n\n while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position))) state.position++\n\n const name = state.input.slice(nameStart, state.position)\n const args: string[] = []\n\n if (name.length === 0) throwError(state, 'directive name must not be less than one character in length')\n\n while (state.input.charCodeAt(state.position) !== 0 && !isEol(state.input.charCodeAt(state.position))) {\n while (isWhiteSpace(state.input.charCodeAt(state.position))) state.position++\n if (state.input.charCodeAt(state.position) === 0x23/* # */ || isEol(state.input.charCodeAt(state.position)) || state.input.charCodeAt(state.position) === 0) break\n\n const start = state.position\n while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position))) state.position++\n args.push(state.input.slice(start, state.position))\n }\n\n if (isEol(state.input.charCodeAt(state.position))) consumeLineBreak(state)\n\n if (name === 'YAML') {\n if (state.directives.some(directive => directive.kind === 'yaml')) throwError(state, 'duplication of %YAML directive')\n if (args.length !== 1) throwError(state, 'YAML directive accepts exactly one argument')\n\n const match = /^([0-9]+)\\.([0-9]+)$/.exec(args[0])\n if (match === null) throwError(state, 'ill-formed argument of the YAML directive')\n if (parseInt(match[1], 10) !== 1) throwError(state, 'unacceptable YAML version of the document')\n\n state.directives.push({ kind: 'yaml', version: args[0] })\n } else if (name === 'TAG') {\n if (args.length !== 2) throwError(state, 'TAG directive accepts exactly two arguments')\n\n const [handle, prefix] = args\n if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, 'ill-formed tag handle (first argument) of the TAG directive')\n if (HAS_OWN.call(state.tagHandlers, handle)) throwError(state, `there is a previously declared suffix for \"${handle}\" tag handle`)\n if (!PATTERN_TAG_PREFIX.test(prefix)) throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive')\n try {\n decodeURIComponent(prefix)\n } catch {\n throwError(state, `tag prefix is malformed: ${prefix}`)\n }\n\n state.tagHandlers[handle] = prefix\n state.directives.push({ kind: 'tag', handle, prefix })\n }\n\n return true\n}\n\nfunction readDocument (state: ParserState) {\n state.directives = []\n state.tagHandlers = Object.create(null)\n let hasDirectives = false\n\n skipSeparationSpace(state, true)\n\n while (readDirective(state)) {\n hasDirectives = true\n skipSeparationSpace(state, true)\n }\n\n let explicitStart = false\n let explicitEnd = false\n let allowCompact = true\n\n if (state.lineIndent === 0 &&\n state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 2) === 0x2D/* - */ &&\n isWsOrEolOrEnd(state.input.charCodeAt(state.position + 3))) {\n explicitStart = true\n const markerLine = state.line\n state.position += 3\n skipSeparationSpace(state, true)\n allowCompact = state.line > markerLine\n } else if (hasDirectives) {\n throwError(state, 'directives end mark is expected')\n }\n\n const documentEventIndex = state.events.length\n if (!explicitStart &&\n state.position === state.lineStart &&\n state.input.charCodeAt(state.position) === 0x2E/* . */ &&\n testDocumentSeparator(state)) {\n state.position += 3\n skipSeparationSpace(state, true)\n return\n }\n\n addDocumentEvent(state, explicitStart, false)\n if (!parseNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, allowCompact, allowCompact)) {\n addEmptyScalarEvent(state)\n }\n skipSeparationSpace(state, true)\n\n if (state.position === state.lineStart && testDocumentSeparator(state)) {\n explicitEnd = state.input.charCodeAt(state.position) === 0x2E/* . */\n if (explicitEnd) {\n const markerLine = state.line\n state.position += 3\n skipSeparationSpace(state, true)\n if (state.line === markerLine && state.position < state.length) {\n throwError(state, 'end of the stream or a document separator is expected')\n }\n }\n }\n\n const documentEvent = state.events[documentEventIndex]\n if (documentEvent?.type === EVENT_ID.DOCUMENT) documentEvent.explicitEnd = explicitEnd\n\n addPopEvent(state)\n\n if (!explicitEnd &&\n state.position < state.length &&\n !testDocumentBoundary(state)) {\n throwError(state, 'end of the stream or a document separator is expected')\n }\n}\n\n/**\n * Parses YAML into a flat event stream referencing source text by offsets.\n *\n * @category Events\n */\nfunction parseEvents (input: string, options: ParserOptions): Event[] {\n const length = input.length\n const state: ParserState = {\n ...DEFAULT_PARSER_OPTIONS,\n ...options,\n input: `${input}\\0`,\n length,\n position: 0,\n line: 0,\n lineStart: 0,\n lineIndent: 0,\n firstTabInLine: -1,\n depth: 0,\n directives: [],\n tagHandlers: Object.create(null),\n events: []\n }\n\n const nullpos = input.indexOf('\\0')\n if (nullpos !== -1) YAMLException.throwAt(input, nullpos, 'null byte is not allowed in input', state.filename)\n\n while (state.position < state.length) {\n skipByteOrderMark(state)\n skipSeparationSpace(state, true)\n if (state.position >= state.length) break\n const documentStart = state.position\n readDocument(state)\n if (state.position === documentStart) {\n // Internal progress guard: if readDocument() ever returns without\n // consuming input, stop here instead of looping forever.\n /* c8 ignore next */\n throwError(state, 'can not read a document')\n }\n }\n\n return state.events\n}\n\nexport {\n parseEvents,\n DEFAULT_PARSER_OPTIONS,\n type ParserOptions\n}\n","import { YAMLException } from './common/exception.ts'\nimport { pick } from './common/object.ts'\nimport {\n constructFromEvents,\n DEFAULT_CONSTRUCTOR_OPTIONS,\n type ConstructorOptions\n} from './parser/constructor.ts'\nimport {\n parseEvents,\n DEFAULT_PARSER_OPTIONS,\n type ParserOptions\n} from './parser/parser.ts'\n\n// `source` is supplied by `loadDocuments` itself, not by the public caller.\n/** @category Main */\ninterface LoadOptions extends ParserOptions, Omit<ConstructorOptions, 'source'> {}\n\n/** @inline */\ntype LoadAllIterator = (document: unknown) => void\n\nconst DEFAULT_LOAD_OPTIONS: Required<LoadOptions> = {\n ...DEFAULT_PARSER_OPTIONS,\n ...DEFAULT_CONSTRUCTOR_OPTIONS\n}\n\nfunction loadDocuments (input: string, options: LoadOptions = {}) {\n const opts = { ...DEFAULT_LOAD_OPTIONS, ...options }\n const source = String(input)\n\n const PARSER_OPT_KEYS = Object.keys(DEFAULT_PARSER_OPTIONS) as\n (keyof typeof DEFAULT_PARSER_OPTIONS)[]\n const CONSTRUCTOR_OPT_KEYS = Object.keys(DEFAULT_CONSTRUCTOR_OPTIONS) as\n (keyof typeof DEFAULT_CONSTRUCTOR_OPTIONS)[]\n\n const events = parseEvents(source, pick(opts, PARSER_OPT_KEYS))\n return constructFromEvents(events, { ...pick(opts, CONSTRUCTOR_OPT_KEYS), source })\n}\n\n/**\n * Same as {@link load}, but understands multi-document sources.\n * Returns an array of documents.\n *\n * @category Main\n */\nfunction loadAll (input: string, options?: LoadOptions): unknown[]\n\n/**\n * @deprecated Iterator is not supported.\n */\nfunction loadAll (input: string, iterator: null, options?: LoadOptions): unknown[]\n\n/**\n * @deprecated Iterator is not supported.\n */\nfunction loadAll (input: string, iterator: LoadAllIterator, options?: LoadOptions): void\nfunction loadAll (\n input: string,\n iteratorOrOptions?: LoadAllIterator | LoadOptions | null,\n options?: LoadOptions\n) {\n let iterator: LoadAllIterator | null = null\n\n if (typeof iteratorOrOptions === 'function') {\n iterator = iteratorOrOptions\n } else if (iteratorOrOptions !== null && typeof iteratorOrOptions === 'object') {\n options = iteratorOrOptions\n }\n\n const documents = loadDocuments(input, options)\n\n if (iterator === null) return documents\n for (const document of documents) iterator(document)\n}\n\n/**\n * Parses `string` as a single YAML document. Throws {@link YAMLException} on\n * error. This function does not understand multi-document or empty sources; it\n * throws an exception on those.\n *\n * > [!NOTE]\n * > 1. When processing untrusted input, see the\n * > [security considerations](../docs/safety.md).\n * > 2. All exceptions MUST be caught, not just {@link YAMLException}.\n * > 3. The default {@link CORE_SCHEMA} comes without the `!!merge` tag. You can\n * > easily enable it if needed.\n * > 4. The default {@link mapTag} is `{}`-object based, with known limitations\n * > (see description). For full compatibility use {@link realMapTag}\n * > instead (it uses native JS `Map`).\n *\n * @example\n * Enable {@link mergeTag} and {@link realMapTag}:\n *\n * ```javascript\n * import { load, CORE_SCHEMA, mergeTag, realMapTag } from 'js-yaml'\n *\n * try {\n * load(data, { schema: CORE_SCHEMA.withTags(mergeTag, realMapTag) })\n * } catch (e) {\n * console.error(e)\n * }\n * ```\n *\n * @category Main\n */\nfunction load (input: string, options?: LoadOptions) {\n const documents = loadDocuments(input, options)\n\n if (documents.length === 0) throw new YAMLException('expected a document, but the input is empty')\n if (documents.length === 1) return documents[0]\n\n throw new YAMLException('expected a single document in the stream, but found more')\n}\n\nexport {\n load,\n loadAll,\n type LoadOptions\n}\n","// JS value graph → AST. Knows tags (`identify` / `represent`). A single\n// identity-`Map` walk handles dedup: a repeat occurrence of an object (including\n// a cycle) becomes an `alias`, and the first occurrence gets an `anchor`.\n\nimport { YAMLException } from '../common/exception.ts'\nimport { type Schema } from '../schema.ts'\nimport { type TagDefinition } from '../tag.ts'\nimport { tagNameShort } from '../common/tagname.ts'\nimport { COLLECTION_STYLE, SCALAR_STYLE } from '../parser/events.ts'\nimport {\n type Document,\n type Node,\n type ScalarNode,\n type SequenceNode,\n type MappingNode\n} from './nodes.ts'\n\n/** @category AST */\ninterface FromJsOptions {\n /** Inlines duplicate objects instead of converting them into references. */\n noRefs?: boolean\n\n /**\n * Skips unrepresentable values instead of throwing. Invalid mapping pairs\n * and sequence items are skipped; `undefined` sequence items become `null`.\n */\n skipInvalid?: boolean\n}\n\n// A match candidate. `implicitTag` means the tag is not printed (implicit\n// scalars and the default str/seq/map tags).\ninterface RepresentType {\n tag: TagDefinition\n implicitTag: boolean\n}\n\n// Returned by `build` when no tag matched.\nconst INVALID = Symbol('INVALID')\n\ninterface FromJsState {\n representTypes: RepresentType[]\n noRefs: boolean\n skipInvalid: boolean\n\n // Already-built collection values → their node, for anchor/alias dedup.\n refs: Map<unknown, Node>\n refCounter: number\n}\n\nfunction buildRepresentTypes (schema: Schema): RepresentType[] {\n const defaultTags = new Set<TagDefinition>([\n schema.defaultScalarTag,\n schema.defaultSequenceTag,\n schema.defaultMappingTag\n ].filter((t): t is TagDefinition => t !== undefined))\n\n // Default container/str tags go last so a more specific tag identifying the\n // same JS value (e.g. a custom tag on a plain object) wins.\n const implicitScalars = schema.implicitScalarTags\n const explicitTags = schema.tags.filter(t =>\n !(t.nodeKind === 'scalar' && t.implicit) && !defaultTags.has(t))\n const defaultTagsLast = schema.tags.filter(t => defaultTags.has(t))\n\n return [\n ...implicitScalars.map(tag => ({ tag, implicitTag: true })),\n ...explicitTags.map(tag => ({ tag, implicitTag: false })),\n ...defaultTagsLast.map(tag => ({ tag, implicitTag: true }))\n ]\n}\n\n// First tag whose `identify` accepts `object`.\nfunction matchTag (state: FromJsState, object: unknown): { tag: TagDefinition, tagName: string, implicitTag: boolean } | null {\n for (let index = 0, length = state.representTypes.length; index < length; index += 1) {\n const { tag, implicitTag } = state.representTypes[index]\n\n if (tag.identify(object)) {\n let tagName: string\n if (tag.matchByTagPrefix) {\n tagName = tag.representTagName(object)\n } else {\n tagName = tag.tagName\n }\n return { tag, tagName, implicitTag }\n }\n }\n\n return null\n}\n\n// Build a node for `object`, or INVALID when no tag matches. `undefined` never\n// throws (caller decides: null in a sequence, skip in a mapping, '' at root);\n// any other unrepresentable value throws unless `skipInvalid`.\nfunction build (state: FromJsState, object: unknown): Node | typeof INVALID {\n if (!state.noRefs && object !== null && typeof object === 'object') {\n const existing = state.refs.get(object)\n if (existing) {\n if (existing.anchor === undefined) existing.anchor = `ref_${state.refCounter++}`\n return { kind: 'alias', anchor: existing.anchor }\n }\n }\n\n const matched = matchTag(state, object)\n\n if (!matched) {\n if (object === undefined) return INVALID\n if (state.skipInvalid) return INVALID\n throw new YAMLException(`unacceptable kind of an object to dump ${Object.prototype.toString.call(object)}`)\n }\n\n const { tag, tagName, implicitTag } = matched\n const nodeTagName = implicitTag ? tagName : tagNameShort(tagName)\n\n if (tag.nodeKind === 'scalar') {\n const node: ScalarNode = {\n kind: 'scalar',\n tag: nodeTagName,\n tagged: !implicitTag,\n style: SCALAR_STYLE.PLAIN,\n value: tag.represent(object)\n }\n return node\n }\n\n if (tag.nodeKind === 'sequence') {\n const container = tag.represent(object)\n const node: SequenceNode = {\n kind: 'sequence',\n tag: nodeTagName,\n tagged: !implicitTag,\n style: COLLECTION_STYLE.BLOCK,\n items: []\n }\n if (!state.noRefs) state.refs.set(object, node)\n\n for (let index = 0, length = container.length; index < length; index += 1) {\n let item = build(state, container[index])\n // An invalid element becomes null; a still-invalid null then skips/throws.\n if (item === INVALID && container[index] === undefined) item = build(state, null)\n if (item === INVALID) continue\n node.items.push(item)\n }\n return node\n }\n\n // mapping — the canonical form is always a `Map`.\n const map = tag.represent(object)\n const node: MappingNode = {\n kind: 'mapping',\n tag: nodeTagName,\n tagged: !implicitTag,\n style: COLLECTION_STYLE.BLOCK,\n items: []\n }\n if (!state.noRefs) state.refs.set(object, node)\n\n for (const [objectKey, objectValue] of map) {\n const key = build(state, objectKey)\n if (key === INVALID) continue // invalid key skips the pair\n const value = build(state, objectValue)\n if (value === INVALID) continue // invalid value skips the pair\n node.items.push({ key, value })\n }\n return node\n}\n\n/**\n * Convert JS object to AST. A JS value is one YAML document. An unrepresentable\n * root becomes an empty document, which the presenter renders as an empty\n * string.\n *\n * @category AST\n */\nfunction jsToAst (input: unknown, schema: Schema, options: FromJsOptions = {}): Document[] {\n const state: FromJsState = {\n representTypes: buildRepresentTypes(schema),\n noRefs: options.noRefs ?? false,\n skipInvalid: options.skipInvalid ?? false,\n refs: new Map(),\n refCounter: 0\n }\n\n const root = build(state, input)\n return [{ contents: root === INVALID ? null : root, directives: [] }]\n}\n\nexport {\n jsToAst,\n type FromJsOptions\n}\n","// Depth-first AST traversal. Mirrors the `kind` walk of the presenter and the\n// `from_*` builders, but stays read-oriented: nodes are plain objects, so a\n// visitor mutates them in place. Control signals let it prune or stop the walk.\n\nimport {\n type Node,\n type Document\n} from './nodes.ts'\n\n// Returned by a visitor to control the walk; anything else (incl. `undefined`)\n// descends as usual.\n/**\n * Return from a visitor to stop the whole traversal.\n *\n * @category AST\n */\nconst VISIT_BREAK = Symbol('visit:break')\n\n/**\n * Return from a visitor to skip the current node's children.\n *\n * @category AST\n */\nconst VISIT_SKIP = Symbol('visit:skip')\n\n/** @inline */\ntype VisitControl = typeof VISIT_BREAK | typeof VISIT_SKIP | undefined | void\n\n/**\n * Traversal-derived position of the current node. Kept off the node itself: a\n * node may sit in several places (alias/dedup reuse), so depth/role belong to\n * the walk, not the node. {@link VisitContext.parent} `kind` +\n * {@link VisitContext.isKey} pin the exact slot.\n *\n * @category AST\n */\ninterface VisitContext {\n /** 0 = document content root */\n depth: number\n\n /** Enclosing sequence/mapping, null at the root */\n parent: Node | null\n\n /** Node sits in a mapping key position */\n isKey: boolean\n}\n\n/** @category AST */\ntype Visitor = (node: Node, ctx: VisitContext) => VisitControl\n\n// Returns `true` once `VISIT_BREAK` was seen, so callers can unwind the walk.\nfunction visitNode (node: Node, visitor: Visitor, ctx: VisitContext): boolean {\n const control = visitor(node, ctx)\n if (control === VISIT_BREAK) return true\n if (control === VISIT_SKIP) return false\n\n const depth = ctx.depth + 1\n\n switch (node.kind) {\n case 'sequence':\n for (const item of node.items) {\n if (visitNode(item, visitor, { depth, parent: node, isKey: false })) return true\n }\n break\n case 'mapping':\n for (const { key, value } of node.items) {\n if (visitNode(key, visitor, { depth, parent: node, isKey: true })) return true\n if (visitNode(value, visitor, { depth, parent: node, isKey: false })) return true\n }\n break\n }\n\n return false\n}\n\n/**\n * Walk every node in the documents, calling {@link Visitor} once per\n * node (pre-order).\n *\n * @category AST\n */\nfunction visit (documents: Document[], visitor: Visitor): void {\n for (const doc of documents) {\n if (doc.contents && visitNode(doc.contents, visitor, { depth: 0, parent: null, isKey: false })) return\n }\n}\n\nexport {\n visit,\n VISIT_BREAK,\n VISIT_SKIP,\n type Visitor,\n type VisitContext\n}\n","import { SCALAR_STYLE, type ScalarStyle } from '../parser/events.ts'\nimport { type ScalarLayout } from './scalar_styler.ts'\n\nfunction hasBit (mask: number, bit: number): boolean { return (mask & (1 << bit)) !== 0 }\n\n// This should eventually be a presenter option, but collection styling,\n// especially key layout, must be designed first to decide whether scalar and\n// collection width limits should share an option or be configured separately.\nconst MIN_SCALAR_CONTENT_WIDTH = 40\n\n/**\n * Default scalar styling rules in application order.\n * See [Scalar styling](../../docs/scalar_styling.md) for usage details.\n *\n * @category AST\n */\nconst DEFAULT_SCALAR_STYLE_RULES = {\n applyQuoteFlowKeysOption,\n doubleQuoteForInvisibles,\n doubleQuoteWhitespaceOnly,\n applyForceQuotesOption,\n tryLongOrMultilineAsBlock,\n quoteInvalidPlain,\n fallbackToDoubleQuoted\n} as const\n\nfunction _preferredQuotedStyle (layout: ScalarLayout): ScalarStyle {\n if (layout.presenterOptions.quoteStyle === 'single' &&\n hasBit(layout.allowedStylesMask, SCALAR_STYLE.SINGLE_QUOTED)) {\n return SCALAR_STYLE.SINGLE_QUOTED\n }\n\n return SCALAR_STYLE.DOUBLE_QUOTED\n}\n\nfunction applyQuoteFlowKeysOption (layout: ScalarLayout): void {\n if (!layout.presenterOptions.quoteFlowKeys) return\n\n // quoteFlowKeys applies only to plain scalar keys in flow mappings.\n if (!layout.isKey || !layout.flowOnly || layout.style !== SCALAR_STYLE.PLAIN) return\n\n layout.style = SCALAR_STYLE.DOUBLE_QUOTED\n}\n\nfunction doubleQuoteForInvisibles (layout: ScalarLayout): void {\n if (layout.style === SCALAR_STYLE.PLAIN &&\n /[\\t\\x7F-\\xA0\\u2028\\u2029\\uFEFF\\uFFFE\\uFFFF]/.test(layout.node.value)) {\n layout.style = SCALAR_STYLE.DOUBLE_QUOTED\n }\n}\n\nfunction doubleQuoteWhitespaceOnly (layout: ScalarLayout): void {\n // Block styles normally make multiline structure easier to see, but\n // whitespace-only content turns that structure into visually empty lines,\n // so force double quotes for this special case.\n if (layout.style === SCALAR_STYLE.PLAIN && /^\\s+$/.test(layout.node.value)) {\n layout.style = SCALAR_STYLE.DOUBLE_QUOTED\n }\n}\n\nfunction applyForceQuotesOption (layout: ScalarLayout): void {\n if (!layout.presenterOptions.forceQuotes) return\n\n // forceQuotes applies only to plain values, not to mapping keys.\n if (layout.isKey || layout.style !== SCALAR_STYLE.PLAIN) return\n\n layout.style = layout.node.value.includes('\\n')\n ? SCALAR_STYLE.DOUBLE_QUOTED\n : _preferredQuotedStyle(layout)\n}\n\nfunction tryLongOrMultilineAsBlock (layout: ScalarLayout): void {\n if (layout.style !== SCALAR_STYLE.PLAIN || layout.isKey) return\n\n const value = layout.node.value\n const multiline = value.indexOf('\\n') !== -1\n\n // Literal and folded block style bits are always set together, so checking\n // either one is sufficient.\n if (!hasBit(layout.allowedStylesMask, SCALAR_STYLE.LITERAL_BLOCK)) {\n if (multiline) layout.style = SCALAR_STYLE.DOUBLE_QUOTED\n return\n }\n\n const w = layout.presenterOptions.lineWidth\n\n if (w === -1) {\n if (multiline) layout.style = SCALAR_STYLE.LITERAL_BLOCK\n return\n }\n\n const availableWidth = Math.max(\n Math.min(w, MIN_SCALAR_CONTENT_WIDTH),\n w - layout.shiftOfContent\n )\n\n let position = 0\n let shouldFold = false\n\n // Check whether at least one line exceeds the width budget\n // and can be split at a space.\n while (position <= value.length) {\n let lineEnd = value.length\n\n const nextLineBreak = value.indexOf('\\n', position)\n\n if (nextLineBreak !== -1) lineEnd = nextLineBreak\n\n const line = value.slice(position, lineEnd)\n\n if (line.length > availableWidth &&\n line[0] !== ' ' &&\n / [^ \\t]/.test(line)) {\n shouldFold = true\n }\n\n if (nextLineBreak === -1) break\n position = nextLineBreak + 1\n }\n\n if (shouldFold) {\n layout.style = SCALAR_STYLE.FOLDED_BLOCK\n } else if (multiline) {\n layout.style = SCALAR_STYLE.LITERAL_BLOCK\n }\n}\n\nfunction quoteInvalidPlain (layout: ScalarLayout): void {\n if (layout.style === SCALAR_STYLE.PLAIN &&\n !hasBit(layout.allowedStylesMask, SCALAR_STYLE.PLAIN)) {\n layout.style = _preferredQuotedStyle(layout)\n }\n}\n\nfunction fallbackToDoubleQuoted (layout: ScalarLayout): void {\n if (!hasBit(layout.allowedStylesMask, layout.style)) {\n layout.style = SCALAR_STYLE.DOUBLE_QUOTED\n }\n}\n\nexport { MIN_SCALAR_CONTENT_WIDTH, DEFAULT_SCALAR_STYLE_RULES }\n","import { SCALAR_STYLE, type ScalarStyle } from '../parser/events.ts'\nimport { type Node, type ScalarNode } from './nodes.ts'\nimport { type PresenterOptions } from './presenter.ts'\nimport { MIN_SCALAR_CONTENT_WIDTH } from './styler_defaults.ts'\n\n/** Scalar presentation state passed to styling rules. @category AST */\ninterface ScalarLayout {\n readonly node: Readonly<ScalarNode>\n readonly parent: Readonly<Node> | null\n readonly level: number\n readonly isKey: boolean\n readonly flowOnly: boolean\n readonly shiftOfParent: number\n readonly shiftOfContent: number\n readonly shiftOfFirstLine: number\n readonly presenterOptions: Readonly<Required<PresenterOptions>>\n /**\n * Bit mask of allowed styles; each bit corresponds to a {@link SCALAR_STYLE}\n * value.\n */\n allowedStylesMask: number\n /**\n * Selected output style, which styling rules may modify. To avoid overriding\n * earlier decisions, a rule should normally modify it only while it is\n * {@link SCALAR_STYLE.PLAIN}.\n */\n style: ScalarStyle\n}\n\n/** Function signature for scalar styling rules. @category AST */\ntype ScalarStyleRule = (layout: ScalarLayout) => void\n\nfunction setBit (mask: number, bit: number): number { return mask | (1 << bit) }\n\n// YAML 1.2.2 character productions.\n// https://yaml.org/spec/1.2.2/#51-character-set\nconst SRC_C_PRINTABLE = '[\\\\x09\\\\x0A\\\\x0D\\\\x20-\\\\x7E\\\\x85\\\\xA0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u{10000}-\\\\u{10FFFF}]'\nconst SRC_B_CHAR = '[\\\\n\\\\r]'\nconst SRC_C_BYTE_ORDER_MARK = '\\\\uFEFF'\nconst SRC_S_WHITE = '[ \\\\t]'\nconst SRC_NB_CHAR = `(?:(?!(?:${SRC_B_CHAR}|${SRC_C_BYTE_ORDER_MARK}))${SRC_C_PRINTABLE})`\nconst SRC_NS_CHAR = `(?:(?!${SRC_S_WHITE})${SRC_NB_CHAR})`\n\n// YAML 1.2.2 [2] nb-json.\nconst SRC_NB_JSON = '[\\\\x09\\\\x20-\\\\uD7FF\\\\uE000-\\\\uFFFF\\\\u{10000}-\\\\u{10FFFF}]'\n\n// YAML 1.2.2 indicator productions.\n// https://yaml.org/spec/1.2.2/#54-indicator-characters\nconst SRC_C_INDICATOR = '[-?:,\\\\[\\\\]{}#&*!|>\\'\"%@`]'\nconst SRC_C_FLOW_INDICATOR = '[,\\\\[\\\\]{}]'\n\n// YAML 1.2.2 [127]-[129] ns-plain-safe(c).\n// https://yaml.org/spec/1.2.2/#733-plain-style\nconst SRC_NS_PLAIN_SAFE_FLOW_OUT = SRC_NS_CHAR\nconst SRC_NS_PLAIN_SAFE_FLOW_IN = `(?:(?!${SRC_C_FLOW_INDICATOR})${SRC_NS_CHAR})`\n\n// YAML 1.2.2 [126] ns-plain-first(c).\nconst SRC_NS_PLAIN_FIRST_FLOW_OUT =\n `(?:(?:(?!${SRC_C_INDICATOR})${SRC_NS_CHAR})|[?:-](?=${SRC_NS_PLAIN_SAFE_FLOW_OUT}))`\nconst SRC_NS_PLAIN_FIRST_FLOW_IN =\n `(?:(?:(?!${SRC_C_INDICATOR})${SRC_NS_CHAR})|[?:-](?=${SRC_NS_PLAIN_SAFE_FLOW_IN}))`\n\n// YAML 1.2.2 [130] ns-plain-char(c).\n// The production itself requires lookbehind, so these regexps require ES2018 lookbehind support.\n// const SRC_NS_PLAIN_CHAR_FLOW_OUT =\n// `(?:(?:(?![:#])${SRC_NS_PLAIN_SAFE_FLOW_OUT})|(?<=${SRC_NS_CHAR})#|:(?=${SRC_NS_PLAIN_SAFE_FLOW_OUT}))`\n// const SRC_NS_PLAIN_CHAR_FLOW_IN =\n// `(?:(?:(?![:#])${SRC_NS_PLAIN_SAFE_FLOW_IN})|(?<=${SRC_NS_CHAR})#|:(?=${SRC_NS_PLAIN_SAFE_FLOW_IN}))`\n\n// ES2015-compatible alternative without lookbehind: consume each run of hashes\n// together with the preceding non-hash ns-plain-char.\nconst SRC_NS_PLAIN_CHAR_FLOW_OUT =\n `(?:(?:(?![:#])${SRC_NS_PLAIN_SAFE_FLOW_OUT})|:(?=${SRC_NS_PLAIN_SAFE_FLOW_OUT}))#*`\nconst SRC_NS_PLAIN_CHAR_FLOW_IN =\n `(?:(?:(?![:#])${SRC_NS_PLAIN_SAFE_FLOW_IN})|:(?=${SRC_NS_PLAIN_SAFE_FLOW_IN}))#*`\n\n// YAML 1.2.2 [132] nb-ns-plain-in-line(c).\nconst SRC_NB_NS_PLAIN_IN_LINE_FLOW_OUT = `(?:${SRC_S_WHITE}*${SRC_NS_PLAIN_CHAR_FLOW_OUT})*`\nconst SRC_NB_NS_PLAIN_IN_LINE_FLOW_IN = `(?:${SRC_S_WHITE}*${SRC_NS_PLAIN_CHAR_FLOW_IN})*`\n\n// YAML 1.2.2 [133] ns-plain-one-line(c).\nconst SRC_NS_PLAIN_ONE_LINE_FLOW_OUT =\n `${SRC_NS_PLAIN_FIRST_FLOW_OUT}#*${SRC_NB_NS_PLAIN_IN_LINE_FLOW_OUT}`\nconst SRC_NS_PLAIN_ONE_LINE_FLOW_IN =\n `${SRC_NS_PLAIN_FIRST_FLOW_IN}#*${SRC_NB_NS_PLAIN_IN_LINE_FLOW_IN}`\nconst SRC_NS_PLAIN_ONE_LINE_BLOCK_KEY = SRC_NS_PLAIN_ONE_LINE_FLOW_OUT\nconst SRC_NS_PLAIN_ONE_LINE_FLOW_KEY = SRC_NS_PLAIN_ONE_LINE_FLOW_IN\n\n// YAML 1.2.2 [134] s-ns-plain-next-line(n,c).\n// ScalarNode.value contains the folded value, not the source text: one source\n// line break became a space, while k > 1 breaks became k - 1 LF characters.\n// The space case is already accepted by [132]; each remaining run of LFs\n// therefore represents a transition to the next non-empty content line in [134].\nconst SRC_S_NS_PLAIN_NEXT_LINE_FLOW_OUT =\n `\\\\n+${SRC_NS_PLAIN_CHAR_FLOW_OUT}${SRC_NB_NS_PLAIN_IN_LINE_FLOW_OUT}`\nconst SRC_S_NS_PLAIN_NEXT_LINE_FLOW_IN =\n `\\\\n+${SRC_NS_PLAIN_CHAR_FLOW_IN}${SRC_NB_NS_PLAIN_IN_LINE_FLOW_IN}`\n\n// YAML 1.2.2 [135] ns-plain-multi-line(n,c).\nconst SRC_NS_PLAIN_MULTI_LINE_FLOW_OUT =\n `${SRC_NS_PLAIN_ONE_LINE_FLOW_OUT}(?:${SRC_S_NS_PLAIN_NEXT_LINE_FLOW_OUT})*`\nconst SRC_NS_PLAIN_MULTI_LINE_FLOW_IN =\n `${SRC_NS_PLAIN_ONE_LINE_FLOW_IN}(?:${SRC_S_NS_PLAIN_NEXT_LINE_FLOW_IN})*`\n\n// YAML 1.2.2 [131] ns-plain(n,c).\nconst NS_PLAIN_FLOW_OUT = new RegExp(`^(?:${SRC_NS_PLAIN_MULTI_LINE_FLOW_OUT})$`, 'u')\nconst NS_PLAIN_FLOW_IN = new RegExp(`^(?:${SRC_NS_PLAIN_MULTI_LINE_FLOW_IN})$`, 'u')\nconst NS_PLAIN_BLOCK_KEY = new RegExp(`^(?:${SRC_NS_PLAIN_ONE_LINE_BLOCK_KEY})$`, 'u')\nconst NS_PLAIN_FLOW_KEY = new RegExp(`^(?:${SRC_NS_PLAIN_ONE_LINE_FLOW_KEY})$`, 'u')\n\n// YAML 1.2.2 [118]-[125], projected to ScalarNode.value: doubled quotes\n// are already decoded, and flow folding represents content line feeds as LF.\nconst NB_SINGLE_ONE_LINE = new RegExp(`^(?:${SRC_NB_JSON})*$`, 'u')\nconst NB_SINGLE_MULTI_LINE = new RegExp(`^(?:${SRC_NB_JSON}|\\\\n)*$`, 'u')\n\n// YAML 1.2.2 [170]-[182], projected to ScalarNode.value: source line breaks\n// are normalized to LF; every other content character must be nb-char.\nconst BLOCK_SCALAR_CONTENT = new RegExp(`^(?:${SRC_NB_CHAR}|\\\\n)*$`, 'u')\n\n// YAML 1.2.2 [206] c-forbidden.\n// https://yaml.org/spec/1.2.2/#912-document-markers\nconst C_FORBIDDEN_FIRST_LINE = /^(?:---|\\.\\.\\.)(?=$|[ \\t\\n\\r])/\nconst C_FORBIDDEN_CONTENT = /^(?:---|\\.\\.\\.)(?=$|[ \\t\\n\\r])/m\n\nfunction canUsePlain (layout: ScalarLayout): boolean {\n const str = layout.node.value\n\n // Allow null to be rendered as an empty scalar; its tag is checked below.\n if (str !== '') {\n const nsPlain = layout.isKey\n ? (layout.flowOnly ? NS_PLAIN_FLOW_KEY : NS_PLAIN_BLOCK_KEY)\n : (layout.flowOnly ? NS_PLAIN_FLOW_IN : NS_PLAIN_FLOW_OUT)\n\n if (!nsPlain.test(str)) return false\n if (layout.shiftOfFirstLine === 0 && C_FORBIDDEN_FIRST_LINE.test(str)) return false\n\n if (layout.shiftOfContent === 0) {\n const firstLineBreak = str.indexOf('\\n')\n\n if (firstLineBreak !== -1) {\n const content = str.slice(firstLineBreak + 1)\n\n if (C_FORBIDDEN_CONTENT.test(content)) return false\n }\n }\n }\n\n // Outside the plain-syntax BNF: preserve the node tag under implicit resolution.\n const resolvedTag = layout.presenterOptions.schema.resolveImplicitScalarTag(str).tag.tagName\n\n if (!layout.node.tagged && resolvedTag !== layout.node.tag) return false\n\n // Outside YAML 1.2.2: preserve YAML 1.1 !!value semantics.\n // https://yaml.org/type/value.html\n if (!layout.node.tagged && str === '=' &&\n resolvedTag === layout.presenterOptions.schema.defaultScalarTag.tagName) return false\n\n return true\n}\n\nfunction canUseSingleQuoted (layout: ScalarLayout): boolean {\n const str = layout.node.value\n const nbSingleText = layout.isKey ? NB_SINGLE_ONE_LINE : NB_SINGLE_MULTI_LINE\n\n if (!nbSingleText.test(str)) return false\n\n // [123]-[125] exclude trailing and leading s-white around a folded break;\n // single-quoted style has no escape that could preserve it.\n if (/[ \\t]\\n|\\n[ \\t]/.test(str)) return false\n\n // A decoded LF is rendered through flow folding. At zero continuation\n // indentation, c-forbidden would terminate the quoted scalar.\n if (!layout.isKey && layout.shiftOfContent === 0) {\n const firstLineBreak = str.indexOf('\\n')\n\n if (firstLineBreak !== -1 &&\n C_FORBIDDEN_CONTENT.test(str.slice(firstLineBreak + 1))) return false\n }\n\n return true\n}\n\nfunction canUseBlock (layout: ScalarLayout): boolean {\n if (layout.flowOnly || !BLOCK_SCALAR_CONTENT.test(layout.node.value)) return false\n\n const contentIndent = layout.shiftOfContent - layout.shiftOfParent\n\n if (contentIndent < 1) return false\n\n // A leading space requires [163] c-indentation-indicator. Its value is 1-9.\n if (contentIndent > 9 && /^\\n* /.test(layout.node.value)) return false\n\n // Block content starts on its own line, so every zero-indented content line\n // is subject to [206] c-forbidden.\n if (layout.shiftOfContent === 0 && C_FORBIDDEN_CONTENT.test(layout.node.value)) return false\n\n return true\n}\n\nfunction detectAllowedStyles (layout: ScalarLayout): void {\n // [107] Double-quoted style can express arbitrary strings through escape sequences.\n let mask = setBit(0, SCALAR_STYLE.DOUBLE_QUOTED)\n\n if (canUsePlain(layout)) mask = setBit(mask, SCALAR_STYLE.PLAIN)\n if (canUseSingleQuoted(layout)) mask = setBit(mask, SCALAR_STYLE.SINGLE_QUOTED)\n\n if (canUseBlock(layout)) {\n mask = setBit(setBit(mask, SCALAR_STYLE.LITERAL_BLOCK), SCALAR_STYLE.FOLDED_BLOCK)\n }\n\n layout.allowedStylesMask = mask\n}\n\nfunction renderScalar (layout: ScalarLayout): string {\n switch (layout.style) {\n case SCALAR_STYLE.PLAIN:\n return renderPlain(layout)\n case SCALAR_STYLE.SINGLE_QUOTED:\n return renderSingleQuoted(layout)\n case SCALAR_STYLE.LITERAL_BLOCK:\n return renderLiteralBlock(layout)\n case SCALAR_STYLE.FOLDED_BLOCK:\n return renderFoldedBlock(layout)\n case SCALAR_STYLE.DOUBLE_QUOTED:\n return renderDoubleQuoted(layout)\n }\n}\n\nfunction renderPlain (layout: ScalarLayout): string {\n return encodeFlowBreaks(layout.node.value, layout.shiftOfContent)\n}\n\nfunction renderSingleQuoted (layout: ScalarLayout): string {\n const value = encodeFlowBreaks(layout.node.value, layout.shiftOfContent)\n return `'${value.replace(/'/g, \"''\")}'`\n}\n\nfunction renderLiteralBlock (layout: ScalarLayout): string {\n const value = layout.node.value\n\n return '|' + blockHeader(value, layout.shiftOfParent, layout.shiftOfContent) +\n dropEndingNewline(indentString(value, layout.shiftOfContent))\n}\n\nfunction renderFoldedBlock (layout: ScalarLayout): string {\n const value = layout.node.value\n const w = layout.presenterOptions.lineWidth\n let availableWidth = Infinity\n\n if (w !== -1) {\n availableWidth = Math.max(\n Math.min(w, MIN_SCALAR_CONTENT_WIDTH),\n w - layout.shiftOfContent\n )\n }\n\n return '>' + blockHeader(value, layout.shiftOfParent, layout.shiftOfContent) +\n dropEndingNewline(indentString(\n foldBlockScalar(value, availableWidth),\n layout.shiftOfContent\n ))\n}\n\nfunction renderDoubleQuoted (layout: ScalarLayout): string {\n return `\"${escapeString(layout.node.value)}\"`\n}\n\n// Flow scalars fold line breaks: a run of k source line breaks reparses to k-1\n// literal LF characters. Encode each run of p literal LF characters as p+1\n// breaks and indent the following content line.\nfunction encodeFlowBreaks (string: string, shiftOfContent: number): string {\n let nextLF = string.indexOf('\\n')\n if (nextLF === -1) return string\n\n const pad = ' '.repeat(shiftOfContent)\n let result = string.slice(0, nextLF)\n\n const lineRe = /(\\n+)([^\\n]*)/g\n lineRe.lastIndex = nextLF\n let match\n\n while ((match = lineRe.exec(string))) {\n const breaks = match[1].length\n const line = match[2]\n result += '\\n'.repeat(breaks + 1) + pad + line\n }\n\n return result\n}\n\n// Indents every line in a string. Empty lines (\\n only) are not indented.\nfunction indentString (string: string, spaces: number): string {\n const indent = ' '.repeat(spaces)\n let position = 0\n let result = ''\n const length = string.length\n\n while (position < length) {\n let line\n const next = string.indexOf('\\n', position)\n\n if (next === -1) {\n line = string.slice(position)\n position = length\n } else {\n line = string.slice(position, next + 1)\n position = next + 1\n }\n\n if (line.length && line !== '\\n') result += indent\n\n result += line\n }\n\n return result\n}\n\nfunction needIndentIndicator (string: string): boolean {\n return /^\\n* /.test(string)\n}\n\nfunction blockHeader (string: string, shiftOfParent: number, shiftOfContent: number): string {\n const indentIndicator = needIndentIndicator(string)\n ? String(shiftOfContent - shiftOfParent)\n : ''\n\n // The string '\\n' counts as a trailing empty line.\n const clip = string[string.length - 1] === '\\n'\n const keep = clip && (string[string.length - 2] === '\\n' || string === '\\n')\n const chomp = keep ? '+' : (clip ? '' : '-')\n\n return `${indentIndicator}${chomp}\\n`\n}\n\n// The presenter adds its own trailing newline.\nfunction dropEndingNewline (string: string): string {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string\n}\n\nfunction isMoreIndented (char: string): boolean {\n return char === ' ' || char === '\\t'\n}\n\nfunction foldLine (line: string, width: number): string {\n if (line === '' || isMoreIndented(line[0])) return line\n\n const breakRe = / [^ \\t]/g\n let match\n let start = 0\n let end\n let curr = 0\n let next = 0\n let result = ''\n\n while ((match = breakRe.exec(line))) {\n next = match.index\n\n if (next - start > width) {\n end = (curr > start) ? curr : next\n result += `\\n${line.slice(start, end)}`\n start = end + 1\n }\n\n curr = next\n }\n\n result += '\\n'\n\n if (line.length - start > width && curr > start) {\n result += `${line.slice(start, curr)}\\n${line.slice(curr + 1)}`\n } else {\n result += line.slice(start)\n }\n\n return result.slice(1)\n}\n\nfunction foldBlockScalar (string: string, width: number): string {\n const lineRe = /(\\n+)([^\\n]*)/g\n\n let nextLF = string.indexOf('\\n')\n if (nextLF === -1) nextLF = string.length\n lineRe.lastIndex = nextLF\n\n let result = foldLine(string.slice(0, nextLF), width)\n let prevMoreIndented = string[0] === '\\n' || isMoreIndented(string[0])\n let moreIndented\n let match\n\n while ((match = lineRe.exec(string))) {\n const prefix = match[1]\n const line = match[2]\n\n moreIndented = line !== '' && isMoreIndented(line[0])\n result += prefix +\n ((!prevMoreIndented && !moreIndented && line !== '') ? '\\n' : '') +\n foldLine(line, width)\n prevMoreIndented = moreIndented\n }\n\n return result\n}\n\n// Characters escaped in Double-Quoted Style:\n//\n// - the inverse of YAML 1.2.2 [1] c-printable;\n// - TAB, LF and CR, which c-printable includes;\n// - NEL, NBSP, LS, PS and BOM, which are escaped to make invisible content\n// visible;\n// - double quote and backslash, which must be escaped because they have\n// syntactic meaning.\n//\n// In Unicode mode, the surrogate range matches unpaired surrogates but does not\n// match either code unit of a valid surrogate pair.\n// https://yaml.org/spec/1.2.2/#rule-c-printable\nconst CHARACTERS_TO_ESCAPE =\n /[\"\\\\\\x00-\\x1F\\x7F-\\xA0\\u2028\\u2029\\uD800-\\uDFFF\\uFEFF\\uFFFE\\uFFFF]/gu\n\nfunction escapeCharacter (character: string): string {\n switch (character) {\n case '\\x00': return '\\\\0'\n case '\\x07': return '\\\\a'\n case '\\x08': return '\\\\b'\n case '\\x09': return '\\\\t'\n case '\\x0A': return '\\\\n'\n case '\\x0B': return '\\\\v'\n case '\\x0C': return '\\\\f'\n case '\\x0D': return '\\\\r'\n case '\\x1B': return '\\\\e'\n case '\"': return '\\\\\"'\n case '\\\\': return '\\\\\\\\'\n case '\\x85': return '\\\\N'\n case '\\xA0': return '\\\\_'\n case '\\u2028': return '\\\\L'\n case '\\u2029': return '\\\\P'\n }\n\n const code = character.charCodeAt(0)\n const hex = code.toString(16).toUpperCase()\n\n if (code <= 0xFF) return `\\\\x${'0'.repeat(2 - hex.length)}${hex}`\n\n return `\\\\u${'0'.repeat(4 - hex.length)}${hex}`\n}\n\nfunction escapeString (string: string): string {\n return string.replace(CHARACTERS_TO_ESCAPE, escapeCharacter)\n}\n\nexport {\n detectAllowedStyles,\n renderScalar,\n type ScalarLayout,\n type ScalarStyleRule\n}\n","// AST → text. Walks the node `kind`; the scalar machinery (style selection,\n// quoting, folding) is driven by node text, not by sniffing a JS value.\n\nimport { YAMLException } from '../common/exception.ts'\nimport { tagNameShort } from '../common/tagname.ts'\nimport { COLLECTION_STYLE, SCALAR_STYLE } from '../parser/events.ts'\nimport { type Schema } from '../schema.ts'\nimport {\n type Node,\n type Document,\n type ScalarNode,\n type SequenceNode,\n type MappingNode\n} from './nodes.ts'\nimport {\n detectAllowedStyles,\n renderScalar,\n type ScalarLayout,\n type ScalarStyleRule\n} from './scalar_styler.ts'\nimport { DEFAULT_SCALAR_STYLE_RULES } from './styler_defaults.ts'\n\nconst CHAR_LINE_FEED = 0x0A /* LF */\n\n/** @category AST */\ninterface PresenterOptions {\n /** Schema used when selecting a safe scalar style. */\n schema: Schema\n\n /**\n * Indentation width in spaces.\n *\n * @defaultValue `2`\n */\n indent?: number\n\n /**\n * Does not add an indentation level to array elements when enabled.\n *\n * @defaultValue `false`\n */\n seqNoIndent?: boolean\n\n /**\n * Allows a nested collection to start on the same line after `-`.\n *\n * @defaultValue `true`\n */\n seqInlineFirst?: boolean\n\n /**\n * Preferred line width for folding. Unbreakable and more-indented lines may\n * exceed it. Set to `-1` for unlimited width.\n *\n * @defaultValue `80`\n */\n lineWidth?: number\n\n /**\n * Adds spaces inside flow collection brackets: `{a: 1}` becomes `{ a: 1 }`.\n *\n * @defaultValue `false`\n */\n flowBracketPadding?: boolean\n\n /**\n * Omits the space after commas in flow collections: `[1, 2]` becomes\n * `[1,2]`.\n *\n * @defaultValue `false`\n */\n flowSkipCommaSpace?: boolean\n\n /**\n * Omits the space after `:` in flow mappings: `{\"a\": 1}` becomes `{\"a\":1}`.\n *\n * This forces `quoteFlowKeys`; otherwise `a:1` would be parsed as a single\n * plain scalar instead of a mapping entry.\n *\n * @defaultValue `false`\n */\n flowSkipColonSpace?: boolean\n\n /**\n * Quotes flow mapping keys: `{a: 1}` becomes `{\"a\": 1}`.\n *\n * @defaultValue `false`\n */\n quoteFlowKeys?: boolean\n\n /**\n * Quoting style to use when a string needs quotes.\n *\n * @defaultValue `'single'`\n */\n quoteStyle?: 'single' | 'double'\n\n /**\n * Quotes all non-key strings using {@link quoteStyle}.\n *\n * @defaultValue `false`\n */\n forceQuotes?: boolean\n\n /**\n * Customizes how strings are rendered as plain, quoted, literal, or folded\n * scalars. Rules are applied in array order; providing this option replaces\n * the {@link DEFAULT_SCALAR_STYLE_RULES default rules}.\n *\n * @defaultValue `Object.values(DEFAULT_SCALAR_STYLE_RULES)`\n */\n scalarStyleRules?: readonly ScalarStyleRule[]\n\n /**\n * Prints an explicit tag before an anchor: `&ref_0 !!set` becomes\n * `!!set &ref_0`.\n *\n * @defaultValue `false`\n */\n tagBeforeAnchor?: boolean\n}\n\nconst DEFAULT_PRESENTER_OPTIONS: Required<Omit<PresenterOptions, 'schema'>> = {\n indent: 2,\n seqNoIndent: false,\n seqInlineFirst: true,\n lineWidth: 80,\n flowBracketPadding: false,\n flowSkipCommaSpace: false,\n flowSkipColonSpace: false,\n quoteFlowKeys: false,\n quoteStyle: 'single',\n forceQuotes: false,\n scalarStyleRules: Object.keys(DEFAULT_SCALAR_STYLE_RULES)\n .map(name => Reflect.get(DEFAULT_SCALAR_STYLE_RULES, name)),\n tagBeforeAnchor: false\n}\n\ninterface PresenterState extends Required<PresenterOptions> {\n defaultScalarTagName: string\n openEnded: boolean\n}\n\nfunction nodeTagShort (node: ScalarNode | SequenceNode | MappingNode) {\n return node.tagged ? node.tag : tagNameShort(node.tag)\n}\n\nfunction createPresenterState (options: PresenterOptions): PresenterState {\n const opts = {\n ...DEFAULT_PRESENTER_OPTIONS,\n ...options\n }\n\n if (opts.flowSkipColonSpace) {\n opts.quoteFlowKeys = true\n }\n\n return {\n ...opts,\n defaultScalarTagName: opts.schema.defaultScalarTag.tagName,\n openEnded: false\n }\n}\n\nfunction generateNextLine (state: PresenterState, level: number) {\n return `\\n${' '.repeat(state.indent * level)}`\n}\n\nfunction scalarLayout (state: PresenterState, node: ScalarNode, parent: Readonly<Node> | null, level: number,\n isKey: boolean, flowOnly: boolean): ScalarLayout {\n const shiftOfParent = level === 0 ? -1 : state.indent * (level - 1)\n const shiftOfContent = state.indent * Math.max(1, level)\n\n return {\n node,\n parent,\n level,\n isKey,\n flowOnly,\n shiftOfParent,\n shiftOfContent,\n shiftOfFirstLine: level === 0 ? 0 : state.indent * level,\n presenterOptions: state,\n allowedStylesMask: 0,\n style: node.style\n }\n}\n\nfunction writeFlowSequence (state: PresenterState, level: number, node: SequenceNode) {\n let result = ''\n\n for (let index = 0, length = node.items.length; index < length; index += 1) {\n const item = writeNode(state, level, node.items[index], node, {}).text\n if (index > 0) result += `,${!state.flowSkipCommaSpace ? ' ' : ''}`\n result += item\n }\n\n const pad = state.flowBracketPadding && node.items.length > 0 ? ' ' : ''\n return `[${pad}${result}${pad}]`\n}\n\nfunction writeBlockSequence (state: PresenterState, level: number, node: SequenceNode, compact: boolean) {\n let result = ''\n\n for (let index = 0, length = node.items.length; index < length; index += 1) {\n const item = writeNode(state, level + 1, node.items[index], node,\n { block: true, compact: state.seqInlineFirst, isblockseq: true }).text\n\n if (!compact || result !== '') {\n result += generateNextLine(state, level)\n }\n\n // No trailing space when the value renders empty (e.g. null → '').\n if (item === '' || CHAR_LINE_FEED === item.charCodeAt(0)) {\n result += '-'\n } else {\n result += '- '\n }\n\n result += item\n }\n\n return result\n}\n\nfunction writeFlowMapping (state: PresenterState, level: number, node: MappingNode) {\n let result = ''\n\n for (const { key, value } of node.items) {\n let pairBuffer = ''\n if (result !== '') pairBuffer += `,${!state.flowSkipCommaSpace ? ' ' : ''}`\n\n const keyRender = writeNode(state, level, key, node, { iskey: true })\n const keyText = keyRender.text\n\n const valueText = writeNode(state, level, value, node, {}).text\n // No separating space when the value renders empty (e.g. null → '').\n const sep = state.flowSkipColonSpace || valueText === '' ? '' : ' '\n\n // An alias or a property-only scalar must be separated from `:` because the\n // colon can otherwise be consumed as part of the alias/anchor/tag name.\n const keyIsBareProps = key.kind === 'scalar' && keyRender.noBody &&\n (key.tagged || key.anchor !== undefined)\n const keyColonSep = key.kind === 'alias' || keyIsBareProps ? ' ' : ''\n\n pairBuffer += `${keyText}${keyColonSep}:${sep}${valueText}`\n\n result += pairBuffer\n }\n\n const pad = state.flowBracketPadding && result !== '' ? ' ' : ''\n return `{${pad}${result}${pad}}`\n}\n\nfunction writeBlockMapping (state: PresenterState, level: number, node: MappingNode, compact: boolean) {\n let result = ''\n\n for (let index = 0, length = node.items.length; index < length; index += 1) {\n let pairBuffer = ''\n\n if (!compact || result !== '') {\n pairBuffer += generateNextLine(state, level)\n }\n\n const { key, value } = node.items[index]\n\n // A block key — a block collection (mapping/sequence) or a block scalar\n // (literal/folded) — can't sit on a `key:` line, so it's written with block\n // context and the pair takes the explicit `? key / : value` form. A simple\n // scalar key stays inline (flow-vs-block is invisible there).\n const keyIsBlock =\n ((key.kind === 'mapping' || key.kind === 'sequence') &&\n key.style === COLLECTION_STYLE.BLOCK && key.items.length !== 0) ||\n (key.kind === 'scalar' &&\n (key.style === SCALAR_STYLE.LITERAL_BLOCK || key.style === SCALAR_STYLE.FOLDED_BLOCK))\n\n // The `?`/`:` indicators shift content right like a `-`, so a block key or\n // value that stays on the indicator line keeps its indentation under\n // seqNoIndent (`isblockseq`). One that drops to its own line (tag/anchor)\n // collapses to the parent indent, so leave the flag off there.\n const keyRender = keyIsBlock\n ? writeNode(state, level + 1, key, node,\n { block: true, compact: true, isblockseq: !cannotBeCompact(state, key, level + 1) })\n : writeNode(state, level + 1, key, node, { block: true, compact: true, iskey: true })\n const keyText = keyRender.text\n\n // Block key, over-long key, or multiline scalar key forces explicit form.\n // Multiline isn't a spec requirement — just matches pyyaml's simple-key rule.\n const keyHasLineBreak = key.kind === 'scalar' && key.value.indexOf('\\n') !== -1\n\n // YAML limits an implicit key to 1024 Unicode code points. `length` counts\n // UTF-16 code units, never fewer than code points, so it is a cheap safe\n // precheck. The `u` regexp then counts each [\\s\\S] match as one code point.\n const keyIsTooLong = keyText.length > 1024 && /^[\\s\\S]{1025}/u.test(keyText)\n const explicitPair = keyIsBlock || keyHasLineBreak || keyIsTooLong\n\n if (explicitPair) {\n if (keyText && CHAR_LINE_FEED === keyText.charCodeAt(0)) {\n pairBuffer += '?'\n } else {\n pairBuffer += '? '\n }\n }\n\n pairBuffer += keyText\n\n if (explicitPair) {\n pairBuffer += generateNextLine(state, level)\n }\n\n const valueText = writeNode(state, level + 1, value, node,\n { block: true, compact: explicitPair, isblockseq: explicitPair && !cannotBeCompact(state, value, level + 1) }).text\n\n // Keep a space before the colon when the key text ends in a leading\n // property rather than scalar content, so the colon can't be read as part\n // of it. Two cases: an inline alias key (`*b : v`), and an empty scalar key\n // whose whole text is its anchor/tag (`&a :`, `!!str :`) — without the\n // space `&a:` reparses as an anchored value, dropping the null key.\n const keyIsBareProps = key.kind === 'scalar' && keyRender.noBody &&\n (key.tagged || key.anchor !== undefined)\n const keyColonSep = !explicitPair && (key.kind === 'alias' || keyIsBareProps) ? ' ' : ''\n\n // No trailing space when the value renders empty (e.g. null → '').\n if (valueText === '' || CHAR_LINE_FEED === valueText.charCodeAt(0)) {\n pairBuffer += `${keyColonSep}:`\n } else {\n pairBuffer += `${keyColonSep}: `\n }\n\n pairBuffer += valueText\n\n result += pairBuffer\n }\n\n return result\n}\n\n// Where a node sits relative to its parent — drives layout/style decisions.\n// All flags default to false (the flow-context, non-key, non-compact case).\ninterface NodeContext {\n block?: boolean // block context (vs flow); propagates downward\n compact?: boolean // may start on the current line (no leading newline)\n iskey?: boolean // node is a mapping key\n isblockseq?: boolean // content follows an indicator (`-`, or `?`/`:` in an\n // explicit pair) that already shifted it right; keeps\n // its indentation under seqNoIndent\n}\n\ninterface NodeRender {\n text: string\n noBody: boolean\n}\n\n// A node can't sit compact on its parent's indicator (`-`/`?`/`:`) line when it\n// carries leading props (tag/anchor) that would collide with the indicator, or\n// when the indent step is too narrow for the 2-char indicator. Such a node drops\n// to its own line; a block collection that does so also collapses its seqNoIndent\n// indentation back to the parent.\nfunction cannotBeCompact (state: PresenterState, node: Node, level: number) {\n if (node.kind === 'alias') return true\n return node.tagged || node.anchor !== undefined || (state.indent < 2 && level > 0)\n}\n\nfunction writeNode (state: PresenterState, level: number, node: Node,\n parent: Readonly<Node> | null, ctx: NodeContext): NodeRender {\n if (node.kind === 'alias') {\n state.openEnded = false\n return { text: `*${node.anchor}`, noBody: false }\n }\n\n const { block = false, iskey = false, isblockseq = false } = ctx\n let compact = ctx.compact ?? false\n\n const hasAnchor = node.anchor !== undefined\n\n if (cannotBeCompact(state, node, level)) {\n compact = false\n }\n\n let body: string\n let shouldPrintTag = node.tagged\n const useBlockCollection = block &&\n (node.kind === 'mapping' || node.kind === 'sequence') &&\n node.style === COLLECTION_STYLE.BLOCK && node.items.length !== 0\n\n if (node.kind === 'mapping') {\n if (useBlockCollection) {\n body = writeBlockMapping(state, level, node, compact)\n } else {\n body = writeFlowMapping(state, level, node)\n }\n } else if (node.kind === 'sequence') {\n if (useBlockCollection) {\n if (state.seqNoIndent && !isblockseq && level > 0) {\n body = writeBlockSequence(state, level - 1, node, compact)\n } else {\n body = writeBlockSequence(state, level, node, compact)\n }\n } else {\n body = writeFlowSequence(state, level, node)\n }\n } else {\n const layout = scalarLayout(state, node, parent, level, iskey, !block)\n\n detectAllowedStyles(layout)\n for (const rule of state.scalarStyleRules) rule(layout)\n\n body = renderScalar(layout)\n state.openEnded =\n (layout.style === SCALAR_STYLE.LITERAL_BLOCK || layout.style === SCALAR_STYLE.FOLDED_BLOCK) &&\n (node.value === '\\n' || node.value.endsWith('\\n\\n'))\n\n // A flow sequence entry cannot be completely empty. Print the semantic tag\n // as the node property that explicitly indicates the entry's existence.\n shouldPrintTag = node.tagged ||\n (body === '' && layout.flowOnly && parent?.kind === 'sequence' && !hasAnchor) ||\n (layout.style !== SCALAR_STYLE.PLAIN && node.tag !== state.defaultScalarTagName)\n }\n\n // A flow collection ends with its closing indicator, not with its last child.\n if ((node.kind === 'mapping' || node.kind === 'sequence') && !useBlockCollection) {\n state.openEnded = false\n }\n\n // An indicator plus its mandatory separator occupies 2 columns. For wider\n // indentation, pad a compact block collection so its first item starts at\n // the same column as the following items.\n if (useBlockCollection && compact && level > 0 && state.indent > 2) {\n body = `${' '.repeat(state.indent - 2)}${body}`\n }\n\n const noBody = body === ''\n let text = body\n\n if (shouldPrintTag || hasAnchor) {\n const props: string[] = []\n const tag = shouldPrintTag ? nodeTagShort(node) : null\n const anchor = hasAnchor ? `&${node.anchor}` : null\n\n if (state.tagBeforeAnchor) {\n if (tag !== null) props.push(tag)\n if (anchor !== null) props.push(anchor)\n } else {\n if (anchor !== null) props.push(anchor)\n if (tag !== null) props.push(tag)\n }\n\n // No separator when the body is empty (e.g. `&anchor` on a null node) or\n // already starts on its own line.\n const sep = body === '' || body.charCodeAt(0) === CHAR_LINE_FEED ? '' : ' '\n text = `${props.join(' ')}${sep}${body}`\n }\n\n return { text, noBody }\n}\n\n// A bare (untagged, unanchored) non-empty block collection: writeNode renders it\n// in compact form with its first item on the opening line. That works mid-stream,\n// but right after a `---` the first item must drop to the next line. A tag/anchor\n// already forces the body onto its own line, so those stay on the `---` line.\nfunction rootStartsOwnLine (node: Node) {\n return (node.kind === 'sequence' || node.kind === 'mapping') &&\n node.style === COLLECTION_STYLE.BLOCK &&\n node.items.length !== 0 &&\n !node.tagged &&\n node.anchor === undefined\n}\n\nfunction writeDocumentDirectives (doc: Document) {\n let result = ''\n\n for (const directive of doc.directives) {\n if (directive.kind === 'yaml') {\n result += `%YAML ${directive.version}\\n`\n continue\n }\n\n const { handle, prefix } = directive\n result += `%TAG ${handle} ${prefix}\\n`\n }\n\n return result\n}\n\n/**\n * Build YAML from AST.\n *\n * @category AST\n */\nfunction present (documents: Document[], options: PresenterOptions): string {\n const state = createPresenterState(options)\n let result = ''\n let previousEnded = false\n\n for (let index = 0; index < documents.length; index += 1) {\n const doc = documents[index]\n state.openEnded = false\n const directives = writeDocumentDirectives(doc)\n const hasDirectives = directives !== ''\n const marker = doc.explicitStart || hasDirectives || (index > 0 && !previousEnded)\n\n result += directives\n\n if (doc.contents === null) {\n if (marker) result += '---\\n'\n } else if (marker) {\n const body = writeNode(state, 0, doc.contents, null, { block: true, compact: true }).text\n // Content shares the `---` line, except: an empty render (no separator at\n // all), a bare block collection (wraps to the next line), or directives\n // forcing `---` onto its own line.\n const sep = body === '' ? '' : (hasDirectives || rootStartsOwnLine(doc.contents) ? '\\n' : ' ')\n result += `---${sep}${body}\\n`\n } else {\n result += writeNode(state, 0, doc.contents, null, { block: true, compact: true }).text + '\\n'\n }\n\n previousEnded = doc.explicitEnd || state.openEnded\n if (previousEnded) {\n result += '...\\n'\n }\n }\n\n return result\n}\n\nexport {\n DEFAULT_PRESENTER_OPTIONS,\n present,\n type PresenterOptions\n}\n","import { DUMP_SCHEMA, type Schema } from './schema.ts'\nimport { COLLECTION_STYLE } from './parser/events.ts'\nimport { jsToAst } from './ast/from_js.ts'\nimport { visit, VISIT_SKIP } from './ast/visit.ts'\nimport { type Document } from './ast/nodes.ts'\nimport {\n DEFAULT_PRESENTER_OPTIONS,\n present,\n type PresenterOptions\n} from './ast/presenter.ts'\nimport { pick } from './common/object.ts'\n\n/** @category Main */\ninterface DumpOptions extends Omit<PresenterOptions, 'schema'> {\n /**\n * Schema to use.\n *\n * @defaultValue {@link DUMP_SCHEMA}\n */\n schema?: Schema\n\n /**\n * Skips invalid types instead of throwing. Invalid mapping pairs and sequence\n * items are skipped; `undefined` sequence items are serialized as `null`.\n *\n * @defaultValue `false`\n */\n skipInvalid?: boolean\n\n /**\n * Inlines duplicate objects instead of converting them into references.\n *\n * @defaultValue `false`\n */\n noRefs?: boolean\n\n /**\n * Nesting level at which collections switch from block to flow style. Set to\n * `-1` to never switch automatically.\n *\n * @defaultValue `-1`\n */\n flowLevel?: number\n\n /**\n * Sorts mapping keys when `true`. A function can be provided to define the\n * sort order.\n *\n * @defaultValue `false`\n * @deprecated Use {@link transform} to reorder mapping items.\n */\n sortKeys?: boolean | ((a: any, b: any) => number)\n\n /**\n * Mutates the generated AST before it is rendered.\n *\n * @example Sort mapping keys:\n *\n * ```typescript\n * import { dump, visit } from 'js-yaml'\n *\n * dump(value, {\n * transform: documents => visit(documents, node => {\n * if (node.kind === 'mapping') node.items.sort((a, b) => {\n * const x = a.key.kind === 'scalar' ? a.key.value : ''\n * const y = b.key.kind === 'scalar' ? b.key.value : ''\n * return x.localeCompare(y)\n * })\n * })\n * })\n * ```\n */\n transform?: (documents: Document[]) => void\n}\n\nconst DEFAULT_DUMP_OPTIONS: Required<DumpOptions> = {\n ...DEFAULT_PRESENTER_OPTIONS,\n schema: DUMP_SCHEMA,\n skipInvalid: false,\n noRefs: false,\n flowLevel: -1,\n sortKeys: false,\n transform: () => {}\n}\n\nfunction defaultCompareFn (a: any, b: any) {\n const x = String(a)\n const y = String(b)\n\n if (x < y) return -1\n if (x > y) return 1\n return 0\n}\n\n/**\n * Serializes JS object as a YAML document. By default it can dump every\n * supported YAML type, so it throws an exception if you try to dump regexps or\n * functions. However, you can disable exceptions by setting the\n * {@link DumpOptions.skipInvalid} option to `true`.\n *\n * @category Main\n */\nfunction dump (input: any, options: DumpOptions = {}) {\n const opts = { ...DEFAULT_DUMP_OPTIONS, ...options }\n\n const documents = jsToAst(input, opts.schema, {\n noRefs: opts.noRefs,\n skipInvalid: opts.skipInvalid\n })\n\n // flowLevel: every node at this depth switches to flow; the presenter forces\n // everything below into flow too, so the walk stops there.\n if (opts.flowLevel >= 0) {\n visit(documents, (node, ctx) => {\n if (ctx.depth < opts.flowLevel) return\n if (node.kind === 'sequence' || node.kind === 'mapping') {\n node.style = COLLECTION_STYLE.FLOW\n }\n return VISIT_SKIP\n })\n }\n\n if (opts.sortKeys) {\n const compareFn = opts.sortKeys === true ? defaultCompareFn : opts.sortKeys\n\n visit(documents, node => {\n if (node.kind !== 'mapping') return\n\n node.items.sort((a, b) => compareFn(\n a.key.kind === 'scalar' ? a.key.value : '',\n b.key.kind === 'scalar' ? b.key.value : ''\n ))\n })\n }\n\n opts.transform(documents)\n\n const PRESENTER_OPT_KEYS = Object.keys(DEFAULT_PRESENTER_OPTIONS) as\n (keyof typeof DEFAULT_PRESENTER_OPTIONS)[]\n\n return present(documents, { ...pick(opts, PRESENTER_OPT_KEYS), schema: opts.schema })\n}\n\nexport {\n dump,\n\n type DumpOptions\n}\n","// Parser events → AST. The second entry into the AST world (the first being\n// `jsToAst`): instead of building JS values like the constructor, it mirrors the\n// same document/sequence/mapping frame walk and emits `Node`s that keep the\n// original styles, tags and anchors, so parsed YAML can be re-dumped faithfully.\n\nimport {\n EVENT_ID,\n SCALAR_STYLE,\n type CollectionStyle,\n type Event,\n type MappingEvent,\n type ScalarEvent,\n type SequenceEvent\n} from '../parser/events.ts'\nimport { getScalarValue } from '../parser/parser_scalar.ts'\nimport { type Schema } from '../schema.ts'\nimport {\n type Node,\n type Document,\n type ScalarNode,\n type SequenceNode,\n type MappingNode,\n type AliasNode\n} from './nodes.ts'\n\nconst NO_RANGE = -1\n\ninterface DocumentFrame {\n kind: 'document'\n doc: Document\n}\n\ninterface SequenceFrame {\n kind: 'sequence'\n node: SequenceNode\n}\n\ninterface MappingFrame {\n kind: 'mapping'\n node: MappingNode\n key: Node | null\n}\n\ntype Frame = DocumentFrame | SequenceFrame | MappingFrame\n\n/** @category AST */\ninterface FromEventsOptions {\n /** Source text referenced by offsets in `events`. */\n source: string\n\n /** Schema used to resolve implicit scalar tags. */\n schema: Schema\n}\n\ninterface FromEventsState {\n source: string\n schema: Schema\n eventIndex: number\n position: number\n frames: Frame[]\n documents: Document[]\n}\n\nfunction eventPosition (event: Event) {\n if ('tagStart' in event && event.tagStart !== NO_RANGE) return event.tagStart\n if ('anchorStart' in event && event.anchorStart !== NO_RANGE) return event.anchorStart\n if ('valueStart' in event && event.valueStart !== NO_RANGE) return event.valueStart\n if ('start' in event) return event.start\n return 0\n}\n\nfunction rawTag (state: FromEventsState, event: ScalarEvent | SequenceEvent | MappingEvent) {\n return event.tagStart === NO_RANGE\n ? ''\n : state.source.slice(event.tagStart, event.tagEnd)\n}\n\nfunction anchorName (state: FromEventsState, event: ScalarEvent | SequenceEvent | MappingEvent) {\n return event.anchorStart === NO_RANGE\n ? undefined\n : state.source.slice(event.anchorStart, event.anchorEnd)\n}\n\nfunction buildScalar (state: FromEventsState, event: ScalarEvent): ScalarNode {\n const value = getScalarValue(state.source, event)\n const raw = rawTag(state, event)\n\n let tag: string\n let tagged = false\n if (raw !== '') {\n tagged = true\n tag = raw\n } else if (event.style === SCALAR_STYLE.PLAIN) {\n tag = state.schema.resolveImplicitScalarTag(value).tag.tagName\n } else {\n tag = state.schema.defaultScalarTag.tagName\n }\n\n return { kind: 'scalar', tag, tagged, style: event.style, anchor: anchorName(state, event), value }\n}\n\nfunction buildCollection (\n state: FromEventsState,\n event: SequenceEvent | MappingEvent,\n defaultTagName: string\n): { tag: string, tagged: boolean, style: CollectionStyle, anchor?: string } {\n const raw = rawTag(state, event)\n\n let tag: string\n let tagged = false\n if (raw === '') {\n tag = defaultTagName\n } else {\n tag = raw\n tagged = true\n }\n\n return { tag, tagged, style: event.style, anchor: anchorName(state, event) }\n}\n\nfunction addNode (state: FromEventsState, node: Node) {\n const frame = state.frames[state.frames.length - 1]\n\n if (frame.kind === 'document') {\n frame.doc.contents = node\n } else if (frame.kind === 'sequence') {\n frame.node.items.push(node)\n } else if (frame.key) {\n frame.node.items.push({ key: frame.key, value: node })\n frame.key = null\n } else {\n frame.key = node\n }\n}\n\n/**\n * Builds an AST from parser events\n *\n * @category AST\n */\nfunction eventsToAst (events: Event[], options: FromEventsOptions): Document[] {\n const state: FromEventsState = {\n source: options.source,\n schema: options.schema,\n eventIndex: 0,\n position: 0,\n frames: [],\n documents: []\n }\n\n while (state.eventIndex < events.length) {\n const event = events[state.eventIndex++]\n state.position = eventPosition(event)\n\n switch (event.type) {\n case EVENT_ID.DOCUMENT: {\n const doc: Document = {\n contents: null,\n explicitStart: event.explicitStart,\n explicitEnd: event.explicitEnd,\n directives: event.directives\n }\n state.frames.push({ kind: 'document', doc })\n break\n }\n\n case EVENT_ID.SCALAR:\n addNode(state, buildScalar(state, event))\n break\n\n case EVENT_ID.SEQUENCE: {\n const { tag, tagged, style, anchor } = buildCollection(state, event, 'tag:yaml.org,2002:seq')\n const node: SequenceNode = { kind: 'sequence', tag, tagged, style, anchor, items: [] }\n state.frames.push({ kind: 'sequence', node })\n break\n }\n\n case EVENT_ID.MAPPING: {\n const { tag, tagged, style, anchor } = buildCollection(state, event, 'tag:yaml.org,2002:map')\n const node: MappingNode = { kind: 'mapping', tag, tagged, style, anchor, items: [] }\n state.frames.push({ kind: 'mapping', node, key: null })\n break\n }\n\n case EVENT_ID.ALIAS: {\n const name = state.source.slice(event.anchorStart, event.anchorEnd)\n const node: AliasNode = { kind: 'alias', anchor: name }\n addNode(state, node)\n break\n }\n\n case EVENT_ID.POP: {\n const frame = state.frames.pop()!\n if (frame.kind === 'mapping' && frame.key) {\n throw new Error('incomplete mapping pair in event stream')\n }\n if (frame.kind === 'document') {\n state.documents.push(frame.doc)\n } else {\n addNode(state, frame.node)\n }\n break\n }\n }\n }\n\n return state.documents\n}\n\nexport {\n eventsToAst,\n type FromEventsOptions\n}\n","export {\n Schema,\n FAILSAFE_SCHEMA,\n JSON_SCHEMA,\n CORE_SCHEMA,\n YAML11_SCHEMA,\n DUMP_SCHEMA\n} from './schema.ts'\n\nexport {\n NOT_RESOLVED,\n defineScalarTag,\n defineSequenceTag,\n defineMappingTag,\n type ScalarTagDefinition,\n type SequenceTagDefinition,\n type MappingTagDefinition,\n type TagDefinition,\n type ScalarTagOptions,\n type SequenceTagOptions,\n type MappingTagOptions\n} from './tag.ts'\n\nexport { strTag } from './tag/scalar/str.ts'\nexport { nullCoreTag } from './tag/scalar/null_core.ts'\nexport { nullJsonTag } from './tag/scalar/null_json.ts'\nexport { nullYaml11Tag } from './tag/scalar/null_yaml11.ts'\nexport { boolCoreTag } from './tag/scalar/bool_core.ts'\nexport { boolJsonTag } from './tag/scalar/bool_json.ts'\nexport { boolYaml11Tag } from './tag/scalar/bool_yaml11.ts'\nexport { intCoreTag } from './tag/scalar/int_core.ts'\nexport { intJsonTag } from './tag/scalar/int_json.ts'\nexport { intYaml11Tag } from './tag/scalar/int_yaml11.ts'\nexport { floatCoreTag } from './tag/scalar/float_core.ts'\nexport { floatJsonTag } from './tag/scalar/float_json.ts'\nexport { floatYaml11Tag } from './tag/scalar/float_yaml11.ts'\nexport { mergeTag } from './tag/scalar/merge.ts'\nexport { binaryTag } from './tag/scalar/binary.ts'\nexport { timestampTag } from './tag/scalar/timestamp.ts'\n\nexport { seqTag } from './tag/sequence/seq.ts'\nexport { omapTag } from './tag/sequence/omap.ts'\nexport { pairsTag } from './tag/sequence/pairs.ts'\n\nexport { mapTag } from './tag/mapping/map.ts'\nexport { realMapTag } from './tag/mapping/real_map.ts'\nexport { legacyMapTag } from './tag/mapping/legacy_map.ts'\nexport { setTag } from './tag/mapping/set.ts'\n\nexport { load, loadAll, type LoadOptions } from './load.ts'\nexport { dump, type DumpOptions } from './dump.ts'\nexport { YAMLException } from './common/exception.ts'\n\nexport {\n EVENT_ID,\n SCALAR_STYLE,\n COLLECTION_STYLE,\n CHOMPING_MODE,\n type EventId,\n type ScalarStyle,\n type CollectionStyle,\n type ChompingMode,\n\n type DocumentDirective,\n type DocumentEvent,\n type SequenceEvent,\n type MappingEvent,\n type ScalarEvent,\n type AliasEvent,\n type PopEvent,\n type Event\n} from './parser/events.ts'\n\nexport {\n parseEvents,\n type ParserOptions\n} from './parser/parser.ts'\n\nexport { getScalarValue } from './parser/parser_scalar.ts'\n\nexport {\n constructFromEvents,\n type ConstructorOptions\n} from './parser/constructor.ts'\n\nexport { eventsToAst, type FromEventsOptions } from './ast/from_events.ts'\nexport { jsToAst, type FromJsOptions } from './ast/from_js.ts'\nexport { present, type PresenterOptions } from './ast/presenter.ts'\nexport { type ScalarLayout, type ScalarStyleRule } from './ast/scalar_styler.ts'\nexport { DEFAULT_SCALAR_STYLE_RULES } from './ast/styler_defaults.ts'\n\nexport {\n visit,\n VISIT_BREAK,\n VISIT_SKIP,\n type Visitor,\n type VisitContext\n} from './ast/visit.ts'\n\nexport {\n type Node,\n type Document,\n type NodeBase,\n type ScalarNode,\n type SequenceNode,\n type MappingNode,\n type AliasNode\n} from './ast/nodes.ts'\n\n// Deprecated compatibility exports\n\nimport { EVENT_ID, SCALAR_STYLE, COLLECTION_STYLE, CHOMPING_MODE } from './parser/events.ts'\n\n/** @deprecated Use `EVENT_ID.DOCUMENT` instead. @internal */\nexport const EVENT_DOCUMENT = EVENT_ID.DOCUMENT\n/** @deprecated Use `EVENT_ID.SEQUENCE` instead. @internal */\nexport const EVENT_SEQUENCE = EVENT_ID.SEQUENCE\n/** @deprecated Use `EVENT_ID.MAPPING` instead. @internal */\nexport const EVENT_MAPPING = EVENT_ID.MAPPING\n/** @deprecated Use `EVENT_ID.SCALAR` instead. @internal */\nexport const EVENT_SCALAR = EVENT_ID.SCALAR\n/** @deprecated Use `EVENT_ID.ALIAS` instead. @internal */\nexport const EVENT_ALIAS = EVENT_ID.ALIAS\n/** @deprecated Use `EVENT_ID.POP` instead. @internal */\nexport const EVENT_POP = EVENT_ID.POP\n/** @deprecated Use `SCALAR_STYLE.PLAIN` instead. @internal */\nexport const SCALAR_STYLE_PLAIN = SCALAR_STYLE.PLAIN\n/** @deprecated Use `SCALAR_STYLE.SINGLE_QUOTED` instead. @internal */\nexport const SCALAR_STYLE_SINGLE_QUOTED = SCALAR_STYLE.SINGLE_QUOTED\n/** @deprecated Use `SCALAR_STYLE.DOUBLE_QUOTED` instead. @internal */\nexport const SCALAR_STYLE_DOUBLE_QUOTED = SCALAR_STYLE.DOUBLE_QUOTED\n/** @deprecated Use `SCALAR_STYLE.LITERAL_BLOCK` instead. @internal */\nexport const SCALAR_STYLE_LITERAL_BLOCK = SCALAR_STYLE.LITERAL_BLOCK\n/** @deprecated Use `SCALAR_STYLE.FOLDED_BLOCK` instead. @internal */\nexport const SCALAR_STYLE_FOLDED_BLOCK = SCALAR_STYLE.FOLDED_BLOCK\n/** @deprecated Use `COLLECTION_STYLE.BLOCK` instead. @internal */\nexport const COLLECTION_STYLE_BLOCK = COLLECTION_STYLE.BLOCK\n/** @deprecated Use `COLLECTION_STYLE.FLOW` instead. @internal */\nexport const COLLECTION_STYLE_FLOW = COLLECTION_STYLE.FLOW\n/** @deprecated Use `CHOMPING_MODE.CLIP` instead. @internal */\nexport const CHOMPING_CLIP = CHOMPING_MODE.CLIP\n/** @deprecated Use `CHOMPING_MODE.STRIP` instead. @internal */\nexport const CHOMPING_STRIP = CHOMPING_MODE.STRIP\n/** @deprecated Use `CHOMPING_MODE.KEEP` instead. @internal */\nexport const CHOMPING_KEEP = CHOMPING_MODE.KEEP\n"],"mappings":";;;;;;;AAKA,IAAM,eAA8B,OAAO,cAAc;;;;;;AAsMzD,SAAS,gBAAyB,SAAiB,SAAgE;CACjH,OAAO;EACL;EACA,UAAU;EACV,UAAU,QAAQ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AuCpG,IAAM,yBAAkD;CACtD,UAAU;CACV,UAAU;AACZ;AAgBA,SAAS,iBACP,OACA,eACA,aACA;CACA,MAAM,OAAO,KAAK;EAChB,MAAM,SAAS;EACf;EACA;EACA,YAAY,MAAM;CACpB,CAAC;AACH;AAEA,SAAS,iBACP,OACA,OACA,aACA,WACA,UACA,QACA,OACA;CACA,MAAM,OAAO,KAAK;EAChB,MAAM,SAAS;EACf;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH;AAEA,SAAS,gBACP,OACA,OACA,aACA,WACA,UACA,QACA,OACA;CACA,MAAM,OAAO,KAAK;EAChB,MAAM,SAAS;EACf;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH;AAEA,SAAS,2BAA4B,OAAoB,UAA0B;CACjF,MAAM,OAAO,OAAO,SAAS,cAAc,GAAG;EAC5C,MAAM,SAAS;EACf,OAAO,SAAS;EAChB,aAAa;EACb,WAAW;EACX,UAAU;EACV,QAAQ;EACR,OAAO,iBAAiB;CAC1B,CAAC;AACH;AAEA,SAAS,eACP,OACA,YACA,UACA,aACA,WACA,UACA,QACA,OACA,WAAyB,cAAc,MACvC,SAAS,IACT,OAAO,OACP;CACA,MAAM,OAAO,KAAK;EAChB,MAAM,SAAS;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH;AAEA,SAAS,cACP,OACA,aACA,WACA;CACA,MAAM,OAAO,KAAK;EAChB,MAAM,SAAS;EACf;EACA;CACF,CAAC;AACH;AAEA,SAAS,YAAa,OAAoB;CACxC,MAAM,OAAO,KAAK,EAAE,MAAM,SAAS,IAAI,CAAC;AAC1C;AAEA,SAAS,oBAAqB,OAAoB;CAChD,eACE,OACA,YACA,YACA,YACA,YACA,YACA,YACA,aAAa,KACf;AACF;AAEA,SAAS,kBAAmC;CAC1C,OAAO;EACL,aAAa;EACb,WAAW;EACX,UAAU;EACV,QAAQ;CACV;AACF;AAEA,SAAS,cAAe,OAAoC;CAC1D,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