import { d as defaultTagPrefix, _ as _createForOfIteratorHelper, a as _typeof, b as _createClass, c as _classCallCheck, e as _defineProperty, Y as YAMLSyntaxError, T as Type, f as YAMLWarning, g as YAMLSemanticError, h as _slicedToArray, i as YAMLError, j as _inherits, k as _createSuper } from './PlainValue-b8036b75.js';
import { parse as parse$1 } from './parse-cst.js';
import { b as binaryOptions, a as boolOptions, i as intOptions, n as nullOptions, s as strOptions, N as Node, P as Pair, S as Scalar, c as stringifyString, A as Alias, Y as YAMLSeq, d as YAMLMap, M as Merge, C as Collection, r as resolveNode, e as isEmptyPath, t as toJSON, f as addComment } from './resolveSeq-492ab440.js';
import { S as Schema } from './Schema-e94716c8.js';
import { w as warn } from './warnings-df54cb69.js';
var defaultOptions = {
anchorPrefix: 'a',
customTags: null,
indent: 2,
indentSeq: true,
keepCstNodes: false,
keepNodeTypes: true,
keepBlobsInJSON: true,
mapAsMap: false,
maxAliasCount: 100,
prettyErrors: false,
// TODO Set true in v2
simpleKeys: false,
version: '1.2'
};
var scalarOptions = {
get binary() {
return binaryOptions;
},
set binary(opt) {
Object.assign(binaryOptions, opt);
},
get bool() {
return boolOptions;
},
set bool(opt) {
Object.assign(boolOptions, opt);
},
get int() {
return intOptions;
},
set int(opt) {
Object.assign(intOptions, opt);
},
get null() {
return nullOptions;
},
set null(opt) {
Object.assign(nullOptions, opt);
},
get str() {
return strOptions;
},
set str(opt) {
Object.assign(strOptions, opt);
}
};
var documentOptions = {
'1.0': {
schema: 'yaml-1.1',
merge: true,
tagPrefixes: [{
handle: '!',
prefix: defaultTagPrefix
}, {
handle: '!!',
prefix: 'tag:private.yaml.org,2002:'
}]
},
1.1: {
schema: 'yaml-1.1',
merge: true,
tagPrefixes: [{
handle: '!',
prefix: '!'
}, {
handle: '!!',
prefix: defaultTagPrefix
}]
},
1.2: {
schema: 'core',
merge: false,
tagPrefixes: [{
handle: '!',
prefix: '!'
}, {
handle: '!!',
prefix: defaultTagPrefix
}]
}
};
function stringifyTag(doc, tag) {
if ((doc.version || doc.options.version) === '1.0') {
var priv = tag.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);
if (priv) return '!' + priv[1];
var vocab = tag.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);
stringify: stringify$1 // Requiring directly in nodes would create circular dependencies
};
var chompKeep = false;
var contentComment = null;
if (this.contents) {
if (this.contents instanceof Node) {
if (this.contents.spaceBefore && (hasDirectives || this.directivesEndMarker)) lines.push('');
if (this.contents.commentBefore) lines.push(this.contents.commentBefore.replace(/^/gm, '#')); // top-level block scalars need to be indented if followed by a comment
ctx.forceBlockIndent = !!this.comment;
contentComment = this.contents.comment;
}
var onChompKeep = contentComment ? null : function () {
return chompKeep = true;
};
var body = stringify$1(this.contents, ctx, function () {