"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("./PlainValue-b8036b75.js");function Se(a,r,i){if(!i)return a;var s=i.replace(/[\s\S]^/gm,"$&".concat(r,"#"));return"#".concat(s,`
`).concat(r).concat(a)}function K(a,r,i){return i?i.indexOf(`
`)===-1?"".concat(a," #").concat(i):"".concat(a,`
`)+i.replace(/^/gm,"".concat(r||"","#")):a}var _=function a(){f.c(this,a)};function C(a,r,i){if(Array.isArray(a))return a.map(function(n,t){return C(n,String(t),i)});if(a&&typeof a.toJSON=="function"){var s=i&&i.anchors&&i.anchors.get(a);s&&(i.onCreate=function(n){s.res=n,delete i.onCreate});var e=a.toJSON(r,i);return s&&i.onCreate&&i.onCreate(e),e}return(!i||!i.keep)&&typeof a=="bigint"?Number(a):a}var L=function(a){f.j(i,a);var r=f.k(i);function i(s){var e;return f.c(this,i),e=r.call(this),e.value=s,e}return f.b(i,[{key:"toJSON",value:function(e,n){return n&&n.keep?this.value:C(this.value,e,n)}},{key:"toString",value:function(){return String(this.value)}}]),i}(_);function se(a,r,i){for(var s=i,e=r.length-1;e>=0;--e){var n=r[e];if(Number.isInteger(n)&&n>=0){var t=[];t[n]=s,s=t}else{var o={};Object.defineProperty(o,n,{value:s,writable:!0,enumerable:!0,configurable:!0}),s=o}}return a.createNode(s,!1)}var ue=function(r){return r==null||f.a(r)==="object"&&r[Symbol.iterator]().next().done},P=function(a){f.j(i,a);var r=f.k(i);function i(s){var e;return f.c(this,i),e=r.call(this),f.e(f.p(e),"items",[]),e.schema=s,e}return f.b(i,[{key:"addIn",value:function(e,n){if(ue(e))this.add(n);else{var t=f.q(e),o=t[0],u=t.slice(1),l=this.get(o,!0);if(l instanceof i)l.addIn(u,n);else if(l===void 0&&this.schema)this.set(o,se(this.schema,u,n));else throw new Error("Expected YAML collection at ".concat(o,". Remaining path: ").concat(u))}}},{key:"deleteIn",value:function(e){var n=f.q(e),t=n[0],o=n.slice(1);if(o.length===0)return this.delete(t);var u=this.get(t,!0);if(u instanceof i)return u.deleteIn(o);throw new Error("Expected YAML collection at ".concat(t,". Remaining path: ").concat(o))}},{key:"getIn",value:function(e,n){var t=f.q(e),o=t[0],u=t.slice(1),l=this.get(o,!0);return u.length===0?!n&&l instanceof L?l.value:l:l instanceof i?l.getIn(u,n):void 0}},{key:"hasAllNullValues",value:function(){return this.items.every(function(e){if(!e||e.type!=="PAIR")return!1;var n=e.value;return n==null||n instanceof L&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}},{key:"hasIn",value:function(e){var n=f.q(e),t=n[0],o=n.slice(1);if(o.length===0)return this.has(t);var u=this.get(t,!0);return u instanceof i?u.hasIn(o):!1}},{key:"setIn",value:function(e,n){var t=f.q(e),o=t[0],u=t.slice(1);if(u.length===0)this.set(o,n);else{var l=this.get(o,!0);if(l instanceof i)l.setIn(u,n);else if(l===void 0&&this.schema)this.set(o,se(this.schema,u,n));else throw new Error("Expected YAML collection at ".concat(o,". Remaining path: ").concat(u))}}},{key:"toJSON",value:function(){return null}},{key:"toString",value:function(e,n,t,o){var u=this,l=n.blockItem,c=n.flowChars,v=n.isMap,h=n.itemIndent,g=e,p=g.indent,d=g.indentStep,w=g.stringify,b=this.type===f.T.FLOW_MAP||this.type===f.T.FLOW_SEQ||e.inFlow;b&&(h+=d);var m=v&&this.hasAllNullValues();e=Object.assign({},e,{allNullValues:m,indent:h,inFlow:b,type:null});var E=!1,A=!1,k=this.items.reduce(function(I,T,me){var Y;T&&(!E&&T.spaceBefore&&I.push({type:"comment",str:""}),T.commentBefore&&T.commentBefore.match(/^.*$/gm).forEach(function(we){I.push({type:"comment",str:"#".concat(we)})}),T.comment&&(Y=T.comment),b&&(!E&&T.spaceBefore||T.commentBefore||T.comment||T.key&&(T.key.commentBefore||T.key.comment)||T.value&&(T.value.commentBefore||T.value.comment))&&(A=!0)),E=!1;var D=w(T,e,function(){return Y=null},function(){return E=!0});return b&&!A&&D.includes(`
`)&&(A=!0),b&&me<u.items.length-1&&(D+=","),D=K(D,h,Y),E&&(Y||b)&&(E=!1),I.push({type:"item",str:D}),I},[]),y;if(k.length===0)y=c.start+c.end;else if(b){var M=c.start,N=c.end,B=k.map(function(I){return I.str});if(A||B.reduce(function(I,T){return I+T.length+2},2)>i.maxFlowStringSingleLineLength){y=M;var O=f._(B),F;try{for(O.s();!(F=O.n()).done;){var $=F.value;y+=$?`
`.concat(d).concat(p).concat($):`
`}}catch(I){O.e(I)}finally{O.f()}y+=`
`.concat(p).concat(N)}else y="".concat(M," ").concat(B.join(" ")," ").concat(N)}else{var te=k.map(l);y=te.shift();var U=f._(te),ae;try{for(U.s();!(ae=U.n()).done;){var ie=ae.value;y+=ie?`
`.concat(p).concat(ie):`
`}}catch(I){U.e(I)}finally{U.f()}}return this.comment?(y+=`
`+this.comment.replace(/^/gm,"".concat(p,"#")),t&&t()):E&&o&&o(),y}}]),i}(_);f.e(P,"maxFlowStringSingleLineLength",60);function V(a){var r=a instanceof L?a.value:a;return r&&typeof r=="string"&&(r=Number(r)),Number.isInteger(r)&&r>=0?r:null}var Q=function(a){f.j(i,a);var r=f.k(i);function i(){return f.c(this,i),r.apply(this,arguments)}return f.b(i,[{key:"add",value:function(e){this.items.push(e)}},{key:"delete",value:function(e){var n=V(e);if(typeof n!="number")return!1;var t=this.items.splice(n,1);return t.length>0}},{key:"get",value:function(e,n){var t=V(e);if(typeof t=="number"){var o=this.items[t];return!n&&o instanceof L?o.value:o}}},{key:"has",value:function(e){var n=V(e);return typeof n=="number"&&n<this.items.length}},{key:"set",value:function(e,n){var t=V(e);if(typeof t!="number")throw new Error("Expected a valid index, not ".concat(e,"."));this.items[t]=n}},{key:"toJSON",value:function(e,n){var t=[];n&&n.onCreate&&n.onCreate(t);var o=0,u=f._(this.items),l;try{for(u.s();!(l=u.n()).done;){var c=l.value;t.push(C(c,String(o++),n))}}catch(v){u.e(v)}finally{u.f()}return t}},{key:"toString",value:function(e,n,t){return e?f.l(f.m(i.prototype),"toString",this).call(this,e,{blockItem:function(u){return u.type==="comment"?u.str:"- ".concat(u.str)},flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(e.indent||"")+"  "},n,t):JSON.stringify(this)}}]),i}(P),be=function(r,i,s){return i===null?"":f.a(i)!=="object"?String(i):r instanceof _&&s&&s.doc?r.toString({anchors:Object.create(null),doc:s.doc,indent:"",indentStep:s.indentStep,inFlow:!0,inStringifyKey:!0,stringify:s.stringify}):JSON.stringify(i)},S=function(a){f.j(i,a);var r=f.k(i);function i(s){var e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return f.c(this,i),e=r.call(this),e.key=s,e.value=n,e.type=i.Type.PAIR,e}return f.b(i,[{key:"commentBefore",get:function(){return this.key instanceof _?this.key.commentBefore:void 0},set:function(e){if(this.key==null&&(this.key=new L(null)),this.key instanceof _)this.key.commentBefore=e;else{var n="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(n)}}},{key:"addToJSMap",value:function(e,n){var t=C(this.key,"",e);if(n instanceof Map){var o=C(this.value,t,e);n.set(t,o)}else if(n instanceof Set)n.add(t);else{var u=be(this.key,t,e),l=C(this.value,u,e);u in n?Object.defineProperty(n,u,{value:l,writable:!0,enumerable:!0,configurable:!0}):n[u]=l}return n}},{key:"toJSON",value:function(e,n){var t=n&&n.mapAsMap?new Map:{};return this.addToJSMap(n,t)}},{key:"toString",value:function(e,n,t){if(!e||!e.doc)return JSON.stringify(this);var o=e.doc.options,u=o.indent,l=o.indentSeq,c=o.simpleKeys,v=this.key,h=this.value,g=v instanceof _&&v.comment;if(c){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(v instanceof P){var p="With simple keys, collection cannot be used as a key value";throw new Error(p)}}var d=!c&&(!v||g||(v instanceof _?v instanceof P||v.type===f.T.BLOCK_FOLDED||v.type===f.T.BLOCK_LITERAL:f.a(v)==="object")),w=e,b=w.doc,m=w.indent,E=w.indentStep,A=w.stringify;e=Object.assign({},e,{implicitKey:!d,indent:m+E});var k=!1,y=A(v,e,function(){return g=null},function(){return k=!0});if(y=K(y,e.indent,g),!d&&y.length>1024){if(c)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(e.allNullValues&&!c)return this.comment?(y=K(y,e.indent,this.comment),n&&n()):k&&!g&&t&&t(),e.inFlow&&!d?y:"? ".concat(y);y=d?"? ".concat(y,`
`).concat(m,":"):"".concat(y,":"),this.comment&&(y=K(y,e.indent,this.comment),n&&n());var M="",N=null;if(h instanceof _){if(h.spaceBefore&&(M=`
`),h.commentBefore){var B=h.commentBefore.replace(/^/gm,"".concat(e.indent,"#"));M+=`
`.concat(B)}N=h.comment}else h&&f.a(h)==="object"&&(h=b.schema.createNode(h,!0));e.implicitKey=!1,!d&&!this.comment&&h instanceof L&&(e.indentAtStart=y.length+1),k=!1,!l&&u>=2&&!e.inFlow&&!d&&h instanceof Q&&h.type!==f.T.FLOW_SEQ&&!h.tag&&!b.anchors.getName(h)&&(e.indent=e.indent.substr(2));var O=A(h,e,function(){return N=null},function(){return k=!0}),F=" ";if(M||this.comment)F="".concat(M,`
`).concat(e.indent);else if(!d&&h instanceof P){var $=O[0]==="["||O[0]==="{";(!$||O.includes(`
`))&&(F=`
`.concat(e.indent))}else O[0]===`
`&&(F="");return k&&!N&&t&&t(),K(y+F+O,e.indent,N)}}]),i}(_);f.e(S,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var ke=function a(r,i){if(r instanceof q){var s=i.get(r.source);return s.count*s.aliasCount}else if(r instanceof P){var e=0,n=f._(r.items),t;try{for(n.s();!(t=n.n()).done;){var o=t.value,u=a(o,i);u>e&&(e=u)}}catch(v){n.e(v)}finally{n.f()}return e}else if(r instanceof S){var l=a(r.key,i),c=a(r.value,i);return Math.max(l,c)}return 1},q=function(a){f.j(i,a);var r=f.k(i);function i(s){var e;return f.c(this,i),e=r.call(this),e.source=s,e.type=f.T.ALIAS,e}return f.b(i,[{key:"tag",set:function(e){throw new Error("Alias nodes cannot have tags")}},{key:"toJSON",value:function(e,n){if(!n)return C(this.source,e,n);var t=n.anchors,o=n.maxAliasCount,u=t.get(this.source);if(!u||u.res===void 0){var l="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new f.o(this.cstNode,l):new ReferenceError(l)}if(o>=0&&(u.count+=1,u.aliasCount===0&&(u.aliasCount=ke(this.source,t)),u.count*u.aliasCount>o)){var c="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new f.o(this.cstNode,c):new ReferenceError(c)}return u.res}},{key:"toString",value:function(e){return i.stringify(this,e)}}],[{key:"stringify",value:function(e,n){var t=e.range,o=e.source,u=n.anchors,l=n.doc,c=n.implicitKey,v=n.inStringifyKey,h=Object.keys(u).find(function(p){return u[p]===o});if(!h&&v&&(h=l.anchors.getName(o)||l.anchors.newName()),h)return"*".concat(h).concat(c?" ":"");var g=l.anchors.getName(o)?"Alias node must be after source node":"Source node not found for alias node";throw new Error("".concat(g," [").concat(t,"]"))}}]),i}(_);f.e(q,"default",!0);function j(a,r){var i=r instanceof L?r.value:r,s=f._(a),e;try{for(s.s();!(e=s.n()).done;){var n=e.value;if(n instanceof S&&(n.key===r||n.key===i||n.key&&n.key.value===i))return n}}catch(t){s.e(t)}finally{s.f()}}var x=function(a){f.j(i,a);var r=f.k(i);function i(){return f.c(this,i),r.apply(this,arguments)}return f.b(i,[{key:"add",value:function(e,n){e?e instanceof S||(e=new S(e.key||e,e.value)):e=new S(e);var t=j(this.items,e.key),o=this.schema&&this.schema.sortMapEntries;if(t)if(n)t.value=e.value;else throw new Error("Key ".concat(e.key," already set"));else if(o){var u=this.items.findIndex(function(l){return o(e,l)<0});u===-1?this.items.push(e):this.items.splice(u,0,e)}else this.items.push(e)}},{key:"delete",value:function(e){var n=j(this.items,e);if(!n)return!1;var t=this.items.splice(this.items.indexOf(n),1);return t.length>0}},{key:"get",value:function(e,n){var t=j(this.items,e),o=t&&t.value;return!n&&o instanceof L?o.value:o}},{key:"has",value:function(e){return!!j(this.items,e)}},{key:"set",value:function(e,n){this.add(new S(e,n),!0)}},{key:"toJSON",value:function(e,n,t){var o=t?new t:n&&n.mapAsMap?new Map:{};n&&n.onCreate&&n.onCreate(o);var u=f._(this.items),l;try{for(u.s();!(l=u.n()).done;){var c=l.value;c.addToJSMap(n,o)}}catch(v){u.e(v)}finally{u.f()}return o}},{key:"toString",value:function(e,n,t){if(!e)return JSON.stringify(this);var o=f._(this.items),u;try{for(o.s();!(u=o.n()).done;){var l=u.value;if(!(l instanceof S))throw new Error("Map items must all be pairs; found ".concat(JSON.stringify(l)," instead"))}}catch(c){o.e(c)}finally{o.f()}return f.l(f.m(i.prototype),"toString",this).call(this,e,{blockItem:function(v){return v.str},flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:e.indent||""},n,t)}}]),i}(P),le="<<",ce=function(a){f.j(i,a);var r=f.k(i);function i(s){var e;if(f.c(this,i),s instanceof S){var n=s.value;n instanceof Q||(n=new Q,n.items.push(s.value),n.range=s.value.range),e=r.call(this,s.key,n),e.range=s.range}else e=r.call(this,new L(le),new Q);return e.type=S.Type.MERGE_PAIR,f.r(e)}return f.b(i,[{key:"addToJSMap",value:function(e,n){var t=f._(this.value.items),o;try{for(t.s();!(o=t.n()).done;){var u=o.value.source;if(!(u instanceof x))throw new Error("Merge sources must be maps");var l=u.toJSON(null,e,Map),c=f._(l),v;try{for(c.s();!(v=c.n()).done;){var h=f.h(v.value,2),g=h[0],p=h[1];n instanceof Map?n.has(g)||n.set(g,p):n instanceof Set?n.add(g):Object.prototype.hasOwnProperty.call(n,g)||Object.defineProperty(n,g,{value:p,writable:!0,enumerable:!0,configurable:!0})}}catch(d){c.e(d)}finally{c.f()}}}catch(d){t.e(d)}finally{t.f()}return n}},{key:"toString",value:function(e,n){var t=this.value;if(t.items.length>1)return f.l(f.m(i.prototype),"toString",this).call(this,e,n);this.value=t.items[0];var o=f.l(f.m(i.prototype),"toString",this).call(this,e,n);return this.value=t,o}}]),i}(S),Te={defaultType:f.T.BLOCK_LITERAL,lineWidth:76},Oe={trueStr:"true",falseStr:"false"},Ee={asBigInt:!1},Le={nullStr:"null"},W={defaultType:f.T.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function ee(a,r,i){var s=f._(r),e;try{for(s.s();!(e=s.n()).done;){var n=e.value,t=n.format,o=n.test,u=n.resolve;if(o){var l=a.match(o);if(l){var c=u.apply(null,l);return c instanceof L||(c=new L(c)),t&&(c.format=t),c}}}}catch(v){s.e(v)}finally{s.f()}return i&&(a=i(a)),new L(a)}var ve="flow",Z="block",G="quoted",oe=function(r,i){for(var s=r[i+1];s===" "||s==="	";){do s=r[i+=1];while(s&&s!==`
`);s=r[i+1]}return i};function z(a,r,i,s){var e=s.indentAtStart,n=s.lineWidth,t=n===void 0?80:n,o=s.minContentWidth,u=o===void 0?20:o,l=s.onFold,c=s.onOverflow;if(!t||t<0)return a;var v=Math.max(1+u,1+t-r.length);if(a.length<=v)return a;var h=[],g={},p=t-r.length;typeof e=="number"&&(e>t-Math.max(2,u)?h.push(0):p=t-e);var d=void 0,w=void 0,b=!1,m=-1,E=-1,A=-1;i===Z&&(m=oe(a,m),m!==-1&&(p=m+v));for(var k;k=a[m+=1];){if(i===G&&k==="\\"){switch(E=m,a[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}A=m}if(k===`
`)i===Z&&(m=oe(a,m)),p=m+v,d=void 0;else{if(k===" "&&w&&w!==" "&&w!==`
`&&w!=="	"){var y=a[m+1];y&&y!==" "&&y!==`
`&&y!=="	"&&(d=m)}if(m>=p)if(d)h.push(d),p=d+v,d=void 0;else if(i===G){for(;w===" "||w==="	";)w=k,k=a[m+=1],b=!0;var M=m>A+1?m-2:E-1;if(g[M])return a;h.push(M),g[M]=!0,p=M+v,d=void 0}else b=!0}w=k}if(b&&c&&c(),h.length===0)return a;l&&l();for(var N=a.slice(0,h[0]),B=0;B<h.length;++B){var O=h[B],F=h[B+1]||a.length;O===0?N=`
`.concat(r).concat(a.slice(0,F)):(i===G&&g[O]&&(N+="".concat(a[O],"\\")),N+=`
`.concat(r).concat(a.slice(O+1,F)))}return N}var ne=function(r){var i=r.indentAtStart;return i?Object.assign({indentAtStart:i},W.fold):W.fold},X=function(r){return/^(%|---|\.\.\.)/m.test(r)};function Ae(a,r,i){if(!r||r<0)return!1;var s=r-i,e=a.length;if(e<=s)return!1;for(var n=0,t=0;n<e;++n)if(a[n]===`
`){if(n-t>s)return!0;if(t=n+1,e-t<=s)return!1}return!0}function J(a,r){var i=r.implicitKey,s=W.doubleQuoted,e=s.jsonEncoding,n=s.minMultiLineLength,t=JSON.stringify(a);if(e)return t;for(var o=r.indent||(X(a)?"  ":""),u="",l=0,c=0,v=t[c];v;v=t[++c])if(v===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(u+=t.slice(l,c)+"\\ ",c+=1,l=c,v="\\"),v==="\\")switch(t[c+1]){case"u":{u+=t.slice(l,c);var h=t.substr(c+2,4);switch(h){case"0000":u+="\\0";break;case"0007":u+="\\a";break;case"000b":u+="\\v";break;case"001b":u+="\\e";break;case"0085":u+="\\N";break;case"00a0":u+="\\_";break;case"2028":u+="\\L";break;case"2029":u+="\\P";break;default:h.substr(0,2)==="00"?u+="\\x"+h.substr(2):u+=t.substr(c,6)}c+=5,l=c+1}break;case"n":if(i||t[c+2]==='"'||t.length<n)c+=1;else{for(u+=t.slice(l,c)+`

`;t[c+2]==="\\"&&t[c+3]==="n"&&t[c+4]!=='"';)u+=`
`,c+=2;u+=o,t[c+2]===" "&&(u+="\\"),c+=1,l=c+1}break;default:c+=1}return u=l?u+t.slice(l):t,i?u:z(u,o,G,ne(r))}function he(a,r){if(r.implicitKey){if(/\n/.test(a))return J(a,r)}else if(/[ \t]\n|\n[ \t]/.test(a))return J(a,r);var i=r.indent||(X(a)?"  ":""),s="'"+a.replace(/'/g,"''").replace(/\n+/g,`$&
`.concat(i))+"'";return r.implicitKey?s:z(s,i,ve,ne(r))}function H(a,r,i,s){var e=a.comment,n=a.type,t=a.value;if(/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return J(t,r);var o=r.indent||(r.forceBlockIndent||X(t)?"  ":""),u=o?"2":"1",l=n===f.T.BLOCK_FOLDED?!1:n===f.T.BLOCK_LITERAL?!0:!Ae(t,W.fold.lineWidth,o.length),c=l?"|":">";if(!t)return c+`
`;var v="",h="";if(t=t.replace(/[\n\t ]*$/,function(p){var d=p.indexOf(`
`);return d===-1?c+="-":(t===p||d!==p.length-1)&&(c+="+",s&&s()),h=p.replace(/\n$/,""),""}).replace(/^[\n ]*/,function(p){p.indexOf(" ")!==-1&&(c+=u);var d=p.match(/ +$/);return d?(v=p.slice(0,-d[0].length),d[0]):(v=p,"")}),h&&(h=h.replace(/\n+(?!\n|$)/g,"$&".concat(o))),v&&(v=v.replace(/\n+/g,"$&".concat(o))),e&&(c+=" #"+e.replace(/ ?[\r\n]+/g," "),i&&i()),!t)return"".concat(c).concat(u,`
`).concat(o).concat(h);if(l)return t=t.replace(/\n+/g,"$&".concat(o)),"".concat(c,`
`).concat(o).concat(v).concat(t).concat(h);t=t.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,"$&".concat(o));var g=z("".concat(v).concat(t).concat(h),o,Z,W.fold);return"".concat(c,`
`).concat(o).concat(g)}function Me(a,r,i,s){var e=a.comment,n=a.type,t=a.value,o=r.actualString,u=r.implicitKey,l=r.indent,c=r.inFlow;if(u&&/[\n[\]{},]/.test(t)||c&&/[[\]{},]/.test(t))return J(t,r);if(!t||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(t))return u||c||t.indexOf(`
`)===-1?t.indexOf('"')!==-1&&t.indexOf("'")===-1?he(t,r):J(t,r):H(a,r,i,s);if(!u&&!c&&n!==f.T.PLAIN&&t.indexOf(`
`)!==-1)return H(a,r,i,s);if(l===""&&X(t))return r.forceBlockIndent=!0,H(a,r,i,s);var v=t.replace(/\n+/g,`$&
`.concat(l));if(o){var h=r.doc.schema.tags,g=ee(v,h,h.scalarFallback).value;if(typeof g!="string")return J(t,r)}var p=u?v:z(v,l,ve,ne(r));return e&&!c&&(p.indexOf(`
`)!==-1||e.indexOf(`
`)!==-1)?(i&&i(),Se(p,l,e)):p}function Ne(a,r,i,s){var e=W.defaultType,n=r.implicitKey,t=r.inFlow,o=a,u=o.type,l=o.value;typeof l!="string"&&(l=String(l),a=Object.assign({},a,{value:l}));var c=function(g){switch(g){case f.T.BLOCK_FOLDED:case f.T.BLOCK_LITERAL:return H(a,r,i,s);case f.T.QUOTE_DOUBLE:return J(l,r);case f.T.QUOTE_SINGLE:return he(l,r);case f.T.PLAIN:return Me(a,r,i,s);default:return null}};(u!==f.T.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(l)||(n||t)&&(u===f.T.BLOCK_FOLDED||u===f.T.BLOCK_LITERAL))&&(u=f.T.QUOTE_DOUBLE);var v=c(u);if(v===null&&(v=c(e),v===null))throw new Error("Unsupported default string type ".concat(e));return v}function Ie(a){var r=a.format,i=a.minFractionDigits,s=a.tag,e=a.value;if(typeof e=="bigint")return String(e);if(!isFinite(e))return isNaN(e)?".nan":e<0?"-.inf":".inf";var n=JSON.stringify(e);if(!r&&i&&(!s||s==="tag:yaml.org,2002:float")&&/^\d/.test(n)){var t=n.indexOf(".");t<0&&(t=n.length,n+=".");for(var o=i-(n.length-t-1);o-- >0;)n+="0"}return n}function pe(a,r){var i,s;switch(r.type){case f.T.FLOW_MAP:i="}",s="flow map";break;case f.T.FLOW_SEQ:i="]",s="flow sequence";break;default:a.push(new f.g(r,"Not a flow collection!?"));return}for(var e,n=r.items.length-1;n>=0;--n){var t=r.items[n];if(!t||t.type!==f.T.COMMENT){e=t;break}}if(e&&e.char!==i){var o="Expected ".concat(s," to end with ").concat(i),u;typeof e.offset=="number"?(u=new f.g(r,o),u.offset=e.offset+1):(u=new f.g(e,o),e.range&&e.range.end&&(u.offset=e.range.end-e.range.start)),a.push(u)}}function ge(a,r){var i=r.context.src[r.range.start-1];if(i!==`
`&&i!=="	"&&i!==" "){var s="Comments must be separated from other tokens by white space characters";a.push(new f.g(r,s))}}function de(a,r){var i=String(r),s=i.substr(0,8)+"..."+i.substr(-8);return new f.g(a,'The "'.concat(s,'" key is too long'))}function ye(a,r){var i=f._(r),s;try{for(i.s();!(s=i.n()).done;){var e=s.value,n=e.afterKey,t=e.before,o=e.comment,u=a.items[t];u?(n&&u.value&&(u=u.value),o===void 0?(n||!u.commentBefore)&&(u.spaceBefore=!0):u.commentBefore?u.commentBefore+=`
`+o:u.commentBefore=o):o!==void 0&&(a.comment?a.comment+=`
`+o:a.comment=o)}}catch(l){i.e(l)}finally{i.f()}}function re(a,r){var i=r.strValue;return i?typeof i=="string"?i:(i.errors.forEach(function(s){s.source||(s.source=r),a.errors.push(s)}),i.str):""}function _e(a,r){var i=r.tag,s=i.handle,e=i.suffix,n=a.tagPrefixes.find(function(u){return u.handle===s});if(!n){var t=a.getDefaults().tagPrefixes;if(t&&(n=t.find(function(u){return u.handle===s})),!n)throw new f.g(r,"The ".concat(s," tag handle is non-default and was not declared."))}if(!e)throw new f.g(r,"The ".concat(s," tag has no suffix."));if(s==="!"&&(a.version||a.options.version)==="1.0"){if(e[0]==="^")return a.warnings.push(new f.f(r,"YAML 1.0 ^ tag expansion is not supported")),e;if(/[:/]/.test(e)){var o=e.match(/^([a-z0-9-]+)\/(.*)/i);return o?"tag:".concat(o[1],".yaml.org,2002:").concat(o[2]):"tag:".concat(e)}}return n.prefix+decodeURIComponent(e)}function Pe(a,r){var i=r.tag,s=r.type,e=!1;if(i){var n=i.handle,t=i.suffix,o=i.verbatim;if(o){if(o!=="!"&&o!=="!!")return o;var u="Verbatim tags aren't resolved, so ".concat(o," is invalid.");a.errors.push(new f.g(r,u))}else if(n==="!"&&!t)e=!0;else try{return _e(a,r)}catch(l){a.errors.push(l)}}switch(s){case f.T.BLOCK_FOLDED:case f.T.BLOCK_LITERAL:case f.T.QUOTE_DOUBLE:case f.T.QUOTE_SINGLE:return f.n.STR;case f.T.FLOW_MAP:case f.T.MAP:return f.n.MAP;case f.T.FLOW_SEQ:case f.T.SEQ:return f.n.SEQ;case f.T.PLAIN:return e?f.n.STR:null;default:return null}}function fe(a,r,i){var s=a.schema.tags,e=[],n=f._(s),t;try{for(n.s();!(t=n.n()).done;){var o=t.value;if(o.tag===i)if(o.test)e.push(o);else{var u=o.resolve(a,r);return u instanceof P?u:new L(u)}}}catch(c){n.e(c)}finally{n.f()}var l=re(a,r);return typeof l=="string"&&e.length>0?ee(l,e,s.scalarFallback):null}function Be(a){var r=a.type;switch(r){case f.T.FLOW_MAP:case f.T.MAP:return f.n.MAP;case f.T.FLOW_SEQ:case f.T.SEQ:return f.n.SEQ;default:return f.n.STR}}function Fe(a,r,i){try{var s=fe(a,r,i);if(s)return i&&r.tag&&(s.tag=i),s}catch(u){return u.source||(u.source=r),a.errors.push(u),null}try{var e=Be(r);if(!e)throw new Error("The tag ".concat(i," is unavailable"));var n="The tag ".concat(i," is unavailable, falling back to ").concat(e);a.warnings.push(new f.f(r,n));var t=fe(a,r,e);return t.tag=i,t}catch(u){var o=new f.o(r,u.message);return o.stack=u.stack,a.errors.push(o),null}}var Ce=function(r){if(!r)return!1;var i=r.type;return i===f.T.MAP_KEY||i===f.T.MAP_VALUE||i===f.T.SEQ_ITEM};function Re(a,r){var i={before:[],after:[]},s=!1,e=!1,n=Ce(r.context.parent)?r.context.parent.props.concat(r.props):r.props,t=f._(n),o;try{for(t.s();!(o=t.n()).done;){var u=o.value,l=u.start,c=u.end;switch(r.context.src[l]){case f.C.COMMENT:{if(!r.commentHasRequiredWhitespace(l)){var v="Comments must be separated from other tokens by white space characters";a.push(new f.g(r,v))}var h=r.header,g=r.valueRange,p=g&&(l>g.start||h&&l>h.start)?i.after:i.before;p.push(r.context.src.slice(l+1,c));break}case f.C.ANCHOR:if(s){var d="A node can have at most one anchor";a.push(new f.g(r,d))}s=!0;break;case f.C.TAG:if(e){var w="A node can have at most one tag";a.push(new f.g(r,w))}e=!0;break}}}catch(b){t.e(b)}finally{t.f()}return{comments:i,hasAnchor:s,hasTag:e}}function Je(a,r){var i=a.anchors,s=a.errors,e=a.schema;if(r.type===f.T.ALIAS){var n=r.rawValue,t=i.getNode(n);if(!t){var o="Aliased anchor not found: ".concat(n);return s.push(new f.o(r,o)),null}var u=new q(t);return i._cstAliases.push(u),u}var l=Pe(a,r);if(l)return Fe(a,r,l);if(r.type!==f.T.PLAIN){var c="Failed to resolve ".concat(r.type," node here");return s.push(new f.Y(r,c)),null}try{var v=re(a,r);return ee(v,e.tags,e.tags.scalarFallback)}catch(h){return h.source||(h.source=r),s.push(h),null}}function R(a,r){if(!r)return null;r.error&&a.errors.push(r.error);var i=Re(a.errors,r),s=i.comments,e=i.hasAnchor,n=i.hasTag;if(e){var t=a.anchors,o=r.anchor,u=t.getNode(o);u&&(t.map[t.newName(o)]=u),t.map[o]=r}if(r.type===f.T.ALIAS&&(e||n)){var l="An alias node must not specify any properties";a.errors.push(new f.g(r,l))}var c=Je(a,r);if(c){c.range=[r.range.start,r.range.end],a.options.keepCstNodes&&(c.cstNode=r),a.options.keepNodeTypes&&(c.type=r.type);var v=s.before.join(`
`);v&&(c.commentBefore=c.commentBefore?"".concat(c.commentBefore,`
`).concat(v):v);var h=s.after.join(`
`);h&&(c.comment=c.comment?"".concat(c.comment,`
`).concat(h):h)}return r.resolved=c}function We(a,r){if(r.type!==f.T.MAP&&r.type!==f.T.FLOW_MAP){var i="A ".concat(r.type," node cannot be resolved as a mapping");return a.errors.push(new f.Y(r,i)),null}var s=r.type===f.T.FLOW_MAP?je(a,r):De(a,r),e=s.comments,n=s.items,t=new x;t.items=n,ye(t,e);for(var o=!1,u=0;u<n.length;++u){var l=n[u].key;if(l instanceof P&&(o=!0),a.schema.merge&&l&&l.value===le){n[u]=new ce(n[u]);var c=n[u].value.items,v=null;c.some(function(w){if(w instanceof q){var b=w.source.type;return b===f.T.MAP||b===f.T.FLOW_MAP?!1:v="Merge nodes aliases can only point to maps"}return v="Merge nodes can only have Alias nodes as values"}),v&&a.errors.push(new f.g(r,v))}else for(var h=u+1;h<n.length;++h){var g=n[h].key;if(l===g||l&&g&&Object.prototype.hasOwnProperty.call(l,"value")&&l.value===g.value){var p='Map keys must be unique; "'.concat(l,'" is repeated');a.errors.push(new f.g(r,p));break}}}if(o&&!a.options.mapAsMap){var d="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";a.warnings.push(new f.f(r,d))}return r.resolved=t,t}var Ke=function(r){var i=r.context,s=i.lineStart,e=i.node,n=i.src,t=r.props;if(t.length===0)return!1;var o=t[0].start;if(e&&o>e.valueRange.start||n[o]!==f.C.COMMENT)return!1;for(var u=s;u<o;++u)if(n[u]===`
`)return!1;return!0};function Qe(a,r){if(!!Ke(a)){var i=a.getPropValue(0,f.C.COMMENT,!0),s=!1,e=r.value.commentBefore;if(e&&e.startsWith(i))r.value.commentBefore=e.substr(i.length+1),s=!0;else{var n=r.value.comment;!a.node&&n&&n.startsWith(i)&&(r.value.comment=n.substr(i.length+1),s=!0)}s&&(r.comment=i)}}function De(a,r){for(var i=[],s=[],e=void 0,n=null,t=0;t<r.items.length;++t){var o=r.items[t];switch(o.type){case f.T.BLANK_LINE:i.push({afterKey:!!e,before:s.length});break;case f.T.COMMENT:i.push({afterKey:!!e,before:s.length,comment:o.comment});break;case f.T.MAP_KEY:e!==void 0&&s.push(new S(e)),o.error&&a.errors.push(o.error),e=R(a,o.node),n=null;break;case f.T.MAP_VALUE:{if(e===void 0&&(e=null),o.error&&a.errors.push(o.error),!o.context.atLineStart&&o.node&&o.node.type===f.T.MAP&&!o.node.context.atLineStart){var u="Nested mappings are not allowed in compact mappings";a.errors.push(new f.g(o.node,u))}var l=o.node;if(!l&&o.props.length>0){l=new f.P(f.T.PLAIN,[]),l.context={parent:o,src:o.context.src};var c=o.range.start+1;if(l.range={start:c,end:c},l.valueRange={start:c,end:c},typeof o.range.origStart=="number"){var v=o.range.origStart+1;l.range.origStart=l.range.origEnd=v,l.valueRange.origStart=l.valueRange.origEnd=v}}var h=new S(e,R(a,l));Qe(o,h),s.push(h),e&&typeof n=="number"&&o.range.start>n+1024&&a.errors.push(de(r,e)),e=void 0,n=null}break;default:e!==void 0&&s.push(new S(e)),e=R(a,o),n=o.range.start,o.error&&a.errors.push(o.error);e:for(var g=t+1;;++g){var p=r.items[g];switch(p&&p.type){case f.T.BLANK_LINE:case f.T.COMMENT:continue e;case f.T.MAP_VALUE:break e;default:{var d="Implicit map keys need to be followed by map values";a.errors.push(new f.g(o,d));break e}}}if(o.valueRangeContainsNewline){var w="Implicit map keys need to be on a single line";a.errors.push(new f.g(o,w))}}}return e!==void 0&&s.push(new S(e)),{comments:i,items:s}}function je(a,r){for(var i=[],s=[],e=void 0,n=!1,t="{",o=0;o<r.items.length;++o){var u=r.items[o];if(typeof u.char=="string"){var l=u.char,c=u.offset;if(l==="?"&&e===void 0&&!n){n=!0,t=":";continue}if(l===":"){if(e===void 0&&(e=null),t===":"){t=",";continue}}else if(n&&(e===void 0&&l!==","&&(e=null),n=!1),e!==void 0&&(s.push(new S(e)),e=void 0,l===",")){t=":";continue}if(l==="}"){if(o===r.items.length-1)continue}else if(l===t){t=":";continue}var v="Flow map contains an unexpected ".concat(l),h=new f.Y(r,v);h.offset=c,a.errors.push(h)}else u.type===f.T.BLANK_LINE?i.push({afterKey:!!e,before:s.length}):u.type===f.T.COMMENT?(ge(a.errors,u),i.push({afterKey:!!e,before:s.length,comment:u.comment})):e===void 0?(t===","&&a.errors.push(new f.g(u,"Separator , missing in flow map")),e=R(a,u)):(t!==","&&a.errors.push(new f.g(u,"Indicator : missing in flow map entry")),s.push(new S(e,R(a,u))),e=void 0,n=!1)}return pe(a.errors,r),e!==void 0&&s.push(new S(e)),{comments:i,items:s}}function qe(a,r){if(r.type!==f.T.SEQ&&r.type!==f.T.FLOW_SEQ){var i="A ".concat(r.type," node cannot be resolved as a sequence");return a.errors.push(new f.Y(r,i)),null}var s=r.type===f.T.FLOW_SEQ?Ue(a,r):$e(a,r),e=s.comments,n=s.items,t=new Q;if(t.items=n,ye(t,e),!a.options.mapAsMap&&n.some(function(u){return u instanceof S&&u.key instanceof P})){var o="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";a.warnings.push(new f.f(r,o))}return r.resolved=t,t}function $e(a,r){for(var i=[],s=[],e=0;e<r.items.length;++e){var n=r.items[e];switch(n.type){case f.T.BLANK_LINE:i.push({before:s.length});break;case f.T.COMMENT:i.push({comment:n.comment,before:s.length});break;case f.T.SEQ_ITEM:if(n.error&&a.errors.push(n.error),s.push(R(a,n.node)),n.hasProps){var t="Sequence items cannot have tags or anchors before the - indicator";a.errors.push(new f.g(n,t))}break;default:n.error&&a.errors.push(n.error),a.errors.push(new f.Y(n,"Unexpected ".concat(n.type," node in sequence")))}}return{comments:i,items:s}}function Ue(a,r){for(var i=[],s=[],e=!1,n=void 0,t=null,o="[",u=null,l=0;l<r.items.length;++l){var c=r.items[l];if(typeof c.char=="string"){var v=c.char,h=c.offset;if(v!==":"&&(e||n!==void 0)&&(e&&n===void 0&&(n=o?s.pop():null),s.push(new S(n)),e=!1,n=void 0,t=null),v===o)o=null;else if(!o&&v==="?")e=!0;else if(o!=="["&&v===":"&&n===void 0){if(o===","){if(n=s.pop(),n instanceof S){var g="Chaining flow sequence pairs is invalid",p=new f.g(r,g);p.offset=h,a.errors.push(p)}if(!e&&typeof t=="number"){var d=c.range?c.range.start:c.offset;d>t+1024&&a.errors.push(de(r,n));for(var w=u.context.src,b=t;b<d;++b)if(w[b]===`
`){var m="Implicit keys of flow sequence pairs need to be on a single line";a.errors.push(new f.g(u,m));break}}}else n=null;t=null,e=!1,o=null}else if(o==="["||v!=="]"||l<r.items.length-1){var E="Flow sequence contains an unexpected ".concat(v),A=new f.Y(r,E);A.offset=h,a.errors.push(A)}}else if(c.type===f.T.BLANK_LINE)i.push({before:s.length});else if(c.type===f.T.COMMENT)ge(a.errors,c),i.push({comment:c.comment,before:s.length});else{if(o){var k="Expected a ".concat(o," in flow sequence");a.errors.push(new f.g(c,k))}var y=R(a,c);n===void 0?(s.push(y),u=c):(s.push(new S(n,y)),n=void 0),t=c.range.start,o=","}}return pe(a.errors,r),n!==void 0&&s.push(new S(n)),{comments:i,items:s}}exports.A=q;exports.C=P;exports.M=ce;exports.N=_;exports.P=S;exports.S=L;exports.Y=Q;exports.a=Oe;exports.b=Te;exports.c=Ne;exports.d=x;exports.e=ue;exports.f=K;exports.g=We;exports.h=qe;exports.i=Ee;exports.j=re;exports.k=Ie;exports.l=j;exports.n=Le;exports.r=R;exports.s=W;exports.t=C;
//# sourceMappingURL=resolveSeq-492ab440.js.map
