(q)
| 742 | `)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===` |
| 743 | `)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let K=this.pos-1,_;do _=this.buffer[++K];while(_===" "||q&&_==="\t");let z=K-this.pos;if(z>0)yield this.buffer.substr(this.pos,z),this.pos=K;return z}*pushUntil(q){let K=this.pos,_=this.buffer[K];while(!q(_))_=this.buffer[++K];return yield*this.pushToIndex(K,!1)}}CR_.Lexer=p44});var fh1=m((xR_)=>{class B44{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let K=0,_=this.lineStarts.length;while(K<_){let Y=K+_>>1;if(this.lineStarts[Y]<q)K=Y+1;else _=Y}if(this.lineStarts[K]===q)return{line:K+1,col:1};if(K===0)return{line:0,col:q};let z=this.lineStarts[K-1];return{line:K,col:q-z+1}}}}xR_.LineCounter=B44});var Zh1=m((pR_)=>{var uR_=U6("process"),g44=bG8(),mR_=Dh1();function q76(q,K){for(let _=0;_<q.length;++_)if(q[_].type===K)return!0;return!1}function F44(q){for(let K=0;K<q.length;++K)switch(q[K].type){case"space":case"comment":case"newline":break;default:return K}return-1}function Q44(q){switch(q?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function IG8(q){switch(q.type){case"document":return q.start;case"block-map":{let K=q.items[q.items.length-1];return K.sep??K.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function Xv6(q){if(q.length===0)return[];let K=q.length;q:while(--K>=0)switch(q[K].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++K]?.type==="space");return q.splice(K,q.length)}function U44(q){if(q.start.type==="flow-seq-start"){for(let K of q.items)if(K.sep&&!K.value&&!q76(K.start,"explicit-key-ind")&&!q76(K.sep,"map-value-ind")){if(K.key)K.value=K.key;if(delete K.key,Q44(K.value))if(K.value.end)Array.prototype.push.apply(K.value.end,K.sep);else K.value.end=K.sep;else Array.prototype.push.apply(K.start,K.sep);delete K.sep}}}class d44{constructor(q){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new mR_.Lexer,this.onNewLine=q}*parse(q,K=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let _ of this.lexer.lex(q,K))yield*this.next(_);if(!K)yield*this.end()}*next(q){if(this.source=q,uR_.env.LOG_TOKENS)console.log("|",g44.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let K=g44.tokenType(q);if(!K){let _=`Not a YAML token: ${q}`;yield*this.pop({type:"error",offset:this.offset,message:_,source:q}),this.offset+=q.length}else if(K==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=K,yield*this.step(),K){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+q.length);break;case"space":if(this.atNewLine&&q[0]===" ")this.indent+=q.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=q.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=q.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let q=this.peek(1);if(this.type==="doc-end"&&(!q||q.type!=="doc-end")){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!q)return yield*this.stream();switch(q.type){case"document":return yield*this.document(q);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(q);case"block-scalar":return yield*this.blockScalar(q);case"block-map":return yield*this.blockMap(q);case"block-seq":return yield*this.blockSequence(q);case"flow-collection":return yield*this.flowCollection(q);case"doc-end":return yield*this.documentEnd(q)}yield*this.pop()}peek(q){return this.stack[this.stack.length-q]}*pop(q){let K=q??this.stack.pop();if(!K)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield K;else{let _=this.peek(1);if(K.type==="block-scalar")K.indent="indent"in _?_.indent:0;else if(K.type==="flow-collection"&&_.type==="document")K.indent=0;if(K.type==="flow-collection")U44(K);switch(_.type){case"document":_.value=K;break;case"block-scalar":_.props.push(K);break;case"block-map":{let z=_.items[_.items.length-1];if(z.value){_.items.push({start:[],key:K,sep:[]}),this.onKeyLine=!0;return}else if(z.sep)z.value=K;else{Object.assign(z,{key:K,sep:[]}),this.onKeyLine=!z.explicitKey;return}break}case"block-seq":{let z=_.items[_.items.length-1];if(z.value)_.items.push({start:[],value:K});else z.value=K;break}case"flow-collection":{let z=_.items[_.items.length-1];if(!z||z.value)_.items.push({start:[],key:K,sep:[]});else if(z.sep)z.value=K;else Object.assign(z,{key:K,sep:[]});return}default:yield*this.pop(),yield*this.pop(K)}if((_.type==="document"||_.type==="block-map"||_.type==="block-seq")&&(K.type==="block-map"||K.type==="block-seq")){let z=K.items[K.items.length-1];if(z&&!z.sep&&!z.value&&z.start.length>0&&F44(z.start)===-1&&(K.indent===0||z.start.every((Y)=>Y.type!=="comment"||Y.indent<K.indent))){if(_.type==="document")_.end=z.start;else _.items.push({start:z.start});K.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(F44(q.start)!==-1)yield*this.pop(),yield*this.step();else q.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":q.start.push(this.sourceToken);return}let K=this.startBlockValue(q);if(K)this.stack.push(K);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(q){if(this.type==="map-value-ind"){let K=IG8(this.peek(2)),_=Xv6(K),z;if(q.end)z=q.end,z.push(this.sourceToken),delete q.end;else z=[this.sourceToken];let Y={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:_,key:q,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Y}else yield*this.lineEnd(q)}*blockScalar(q){switch(this.type){case"space":case"comment":case"newline":q.props.push(this.sourceToken);return;case"scalar":if(q.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let K=this.source.indexOf(` |
| 744 | `)+1;while(K!==0)this.onNewLine(this.offset+K),K=this.source.indexOf(` |
| 745 | `,K)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let K=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,K.value){let _="end"in K.value?K.value.end:void 0;if((Array.isArray(_)?_[_.length-1]:void 0)?.type==="comment")_?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if(K.sep)K.sep.push(this.sourceToken);else K.start.push(this.sourceToken);return;case"space":case"comment":if(K.value)q.items.push({start:[this.sourceToken]});else if(K.sep)K.sep.push(this.sourceToken);else{if(this.atIndentedComment(K.start,q.indent)){let z=q.items[q.items.length-2]?.value?.end;if(Array.isArray(z)){Array.prototype.push.apply(z,K.start),z.push(this.sourceToken),q.items.pop();return}}K.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let _=!this.onKeyLine&&this.indent===q.indent,z=_&&(K.sep||K.explicitKey)&&this.type!=="seq-item-ind",Y=[];if(z&&K.sep&&!K.value){let $=[];for(let A=0;A<K.sep.length;++A){let O=K.sep[A];switch(O.type){case"newline":$.push(A);break;case"space":break;case"comment":if(O.indent>q.indent)$.length=0;break;default:$.length=0}}if($.length>=2)Y=K.sep.splice($[1])}switch(this.type){case"anchor":case"tag":if(z||K.value)Y.push(this.sourceToken),q.items.push({start:Y}),this.onKeyLine=!0;else if(K.sep)K.sep.push(this.sourceToken);else K.start.push(this.sourceToken);return;case"explicit-key-ind":if(!K.sep&&!K.explicitKey)K.start.push(this.sourceToken),K.explicitKey=!0;else if(z||K.value)Y.push(this.sourceToken),q.items.push({start:Y,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(K.explicitKey)if(!K.sep)if(q76(K.start,"newline"))Object.assign(K,{key:null,sep:[this.sourceToken]});else{let $=Xv6(K.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:null,sep:[this.sourceToken]}]})}else if(K.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(q76(K.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Y,key:null,sep:[this.sourceToken]}]});else if(Q44(K.key)&&!q76(K.sep,"newline")){let $=Xv6(K.start),A=K.key,O=K.sep;O.push(this.sourceToken),delete K.key,delete K.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:A,sep:O}]})}else if(Y.length>0)K.sep=K.sep.concat(Y,this.sourceToken);else K.sep.push(this.sourceToken);else if(!K.sep)Object.assign(K,{key:null,sep:[this.sourceToken]});else if(K.value||z)q.items.push({start:Y,key:null,sep:[this.sourceToken]});else if(q76(K.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else K.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let $=this.flowScalar(this.type);if(z||K.value)q.items.push({start:Y,key:$,sep:[]}),this.onKeyLine=!0;else if(K.sep)this.stack.push($);else Object.assign(K,{key:$,sep:[]}),this.onKeyLine=!0;return}default:{let $=this.startBlockValue(q);if($){if($.type==="block-seq"){if(!K.explicitKey&&K.sep&&!q76(K.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(_)q.items.push({start:Y});this.stack.push($);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let K=q.items[q.items.length-1];switch(this.type){case"newline":if(K.value){let _="end"in K.value?K.value.end:void 0;if((Array.isArray(_)?_[_.length-1]:void 0)?.type==="comment")_?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else K.start.push(this.sourceToken);return;case"space":case"comment":if(K.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(K.start,q.indent)){let z=q.items[q.items.length-2]?.value?.end;if(Array.isArray(z)){Array.prototype.push.apply(z,K.start),z.push(this.sourceToken),q.items.pop();return}}K.start.push(this.sourceToken)}return;case"anchor":case"tag":if(K.value||this.indent<=q.indent)break;K.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if(K.value||q76(K.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else K.start.push(this.sourceToken);return}if(this.indent>q.indent){let _=this.startBlockValue(q);if(_){this.stack.push(_);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let K=q.items[q.items.length-1];if(this.type==="flow-error-end"){let _;do yield*this.pop(),_=this.peek(1);while(_&&_.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!K||K.sep)q.items.push({start:[this.sourceToken]});else K.start.push(this.sourceToken);return;case"map-value-ind":if(!K||K.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(K.sep)K.sep.push(this.sourceToken);else Object.assign(K,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!K||K.value)q.items.push({start:[this.sourceToken]});else if(K.sep)K.sep.push(this.sourceToken);else K.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let z=this.flowScalar(this.type);if(!K||K.value)q.items.push({start:[],key:z,sep:[]});else if(K.sep)this.stack.push(z);else Object.assign(K,{key:z,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let _=this.startBlockValue(q);if(_)this.stack.push(_);else yield*this.pop(),yield*this.step()}else{let _=this.peek(2);if(_.type==="block-map"&&(this.type==="map-value-ind"&&_.indent===q.indent||this.type==="newline"&&!_.items[_.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&_.type!=="flow-collection"){let z=IG8(_),Y=Xv6(z);U44(q);let $=q.end.splice(1,q.end.length);$.push(this.sourceToken);let A={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:Y,key:q,sep:$}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=A}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let K=this.source.indexOf(` |
| 746 | `)+1;while(K!==0)this.onNewLine(this.offset+K),K=this.source.indexOf(` |
| 747 | `,K)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let K=IG8(q),_=Xv6(K);return _.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let K=IG8(q),_=Xv6(K);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,K){if(this.type!=="comment")return!1;if(this.indent<=K)return!1;return q.every((_)=>_.type==="newline"||_.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}pR_.Parser=d44});var r44=m((nR_)=>{var c44=Oh1(),gR_=jn6(),Wn6=Hn6(),FR_=fR1(),UR_=uY(),QR_=fh1(),l44=Zh1();function n44(q){let K=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||K&&new QR_.LineCounter||null,prettyErrors:K}}function dR_(q,K={}){let{lineCounter:_,prettyErrors:z}=n44(K),Y=new l44.Parser(_?.addNewLine),$=new c44.Composer(K),A=Array.from($.compose(Y.parse(q)));if(z&&_)for(let O of A)O.errors.forEach(Wn6.prettifyError(q,_)),O.warnings.forEach(Wn6.prettifyError(q,_));if(A.length>0)return A;return Object.assign([],{empty:!0},$.streamInfo())}function i44(q,K={}){let{lineCounter:_,prettyErrors:z}=n44(K),Y=new l44.Parser(_?.addNewLine),$=new c44.Composer(K),A=null;for(let O of $.compose(Y.parse(q),!0,q.length))if(!A)A=O;else if(A.options.logLevel!=="silent"){A.errors.push(new Wn6.YAMLParseError(O.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&_)A.errors.forEach(Wn6.prettifyError(q,_)),A.warnings.forEach(Wn6.prettifyError(q,_));return A}function cR_(q,K,_){let z=void 0;if(typeof K==="function")z=K;else if(_===void 0&&K&&typeof K==="object")_=K;let Y=i44(q,_);if(!Y)return null;if(Y.warnings.forEach(($)=>FR_.warn(Y.options.logLevel,$)),Y.errors.length>0)if(Y.options.logLevel!=="silent")throw Y.errors[0];else Y.errors=[];return Y.toJS(Object.assign({reviver:z},_))}function lR_(q,K,_){let z=null;if(typeof K==="function"||Array.isArray(K))z=K;else if(_===void 0&&K)_=K;if(typeof _==="string")_=_.length;if(typeof _==="number"){let Y=Math.round(_);_=Y<1?void 0:Y>8?{indent:8}:{indent:Y}}if(q===void 0){let{keepUndefined:Y}=_??K??{};if(!Y)return}if(UR_.isDocument(q)&&!z)return q.toString(_);return new gR_.Document(q,z,_).toString(_)}nR_.parse=cR_;nR_.parseAllDocuments=dR_;nR_.parseDocument=i44;nR_.stringify=lR_});var a44=m((jh_)=>{var sR_=Oh1(),tR_=jn6(),eR_=lR1(),Gh1=Hn6(),qh_=rl6(),K76=uY(),Kh_=a16(),_h_=DX(),zh_=t16(),Yh_=e16(),$h_=bG8(),Ah_=Dh1(),Oh_=fh1(),wh_=Zh1(),uG8=r44(),o44=nl6();jh_.Composer=sR_.Composer;jh_.Document=tR_.Document;jh_.Schema=eR_.Schema;jh_.YAMLError=Gh1.YAMLError;jh_.YAMLParseError=Gh1.YAMLParseError;jh_.YAMLWarning=Gh1.YAMLWarning;jh_.Alias=qh_.Alias;jh_.isAlias=K76.isAlias;jh_.isCollection=K76.isCollection;jh_.isDocument=K76.isDocument;jh_.isMap=K76.isMap;jh_.isNode=K76.isNode;jh_.isPair=K76.isPair;jh_.isScalar=K76.isScalar;jh_.isSeq=K76.isSeq;jh_.Pair=Kh_.Pair;jh_.Scalar=_h_.Scalar;jh_.YAMLMap=zh_.YAMLMap;jh_.YAMLSeq=Yh_.YAMLSeq;jh_.CST=$h_;jh_.Lexer=Ah_.Lexer;jh_.LineCounter=Oh_.LineCounter;jh_.Parser=wh_.Parser;jh_.parse=uG8.parse;jh_.parseAllDocuments=uG8.parseAllDocuments;jh_.parseDocument=uG8.parseDocument;jh_.stringify=uG8.stringify;jh_.visit=o44.visit;jh_.visitAsync=o44.visitAsync});function Dn6(q){if(typeof Bun<"u")return Bun.YAML.parse(q);return a44().parse(q)}function Fh_(q){let K=q.split(` |
no test coverage detected