@mcp-com-ai/shared-utils 1.0.1-beta.260912 → 1.0.1-beta.260914
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -0
- package/dist/config.js +126 -126
- package/dist/errors.js +2 -2
- package/dist/home.d.ts +13 -0
- package/dist/home.js +1 -1
- package/dist/index.js +176 -176
- package/dist/logger.js +38 -38
- package/dist/runtime.js +1 -1
- package/dist/secrets.js +1 -1
- package/package.json +56 -56
package/dist/config.js
CHANGED
|
@@ -1,140 +1,140 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
`)}}
|
|
4
|
-
`)?
|
|
2
|
+
var kr=Object.create;var{getPrototypeOf:Ar,defineProperty:tn,getOwnPropertyNames:Or}=Object;var sn=Object.prototype.hasOwnProperty;function qr(e){return this[e]}var Er,Cr,Lr=(e,t,s)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?Er??=new WeakMap:Cr??=new WeakMap,r=i.get(e);if(r)return r}s=e!=null?kr(Ar(e)):{};let o=t||!e||!e.__esModule||!sn.call(e,"default")?tn(s,"default",{value:e,enumerable:!0}):s;if(e&&typeof e==="object"||typeof e==="function"){for(let a of Or(e))if(!sn.call(o,a))tn(o,a,{get:qr.bind(e,a),enumerable:!0})}if(n)i.set(e,o);return o};var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var He=import.meta.require;var O=g(function(to){var Kt=Symbol.for("yaml.alias"),hn=Symbol.for("yaml.document"),Ge=Symbol.for("yaml.map"),dn=Symbol.for("yaml.pair"),jt=Symbol.for("yaml.scalar"),We=Symbol.for("yaml.seq"),Y=Symbol.for("yaml.node.type"),Gr=(e)=>!!e&&typeof e==="object"&&e[Y]===Kt,Wr=(e)=>!!e&&typeof e==="object"&&e[Y]===hn,Qr=(e)=>!!e&&typeof e==="object"&&e[Y]===Ge,Xr=(e)=>!!e&&typeof e==="object"&&e[Y]===dn,pn=(e)=>!!e&&typeof e==="object"&&e[Y]===jt,zr=(e)=>!!e&&typeof e==="object"&&e[Y]===We;function mn(e){if(e&&typeof e==="object")switch(e[Y]){case Ge:case We:return!0}return!1}function Zr(e){if(e&&typeof e==="object")switch(e[Y]){case Kt:case Ge:case jt:case We:return!0}return!1}var eo=(e)=>(pn(e)||mn(e))&&!!e.anchor;to.ALIAS=Kt;to.DOC=hn;to.MAP=Ge;to.NODE_TYPE=Y;to.PAIR=dn;to.SCALAR=jt;to.SEQ=We;to.hasAnchor=eo;to.isAlias=Gr;to.isCollection=mn;to.isDocument=Wr;to.isMap=Qr;to.isNode=Zr;to.isPair=Xr;to.isScalar=pn;to.isSeq=zr});var Ae=g(function(wo){var T=O(),I=Symbol("break visit"),gn=Symbol("skip children"),j=Symbol("remove node");function Qe(e,t){let s=yn(t);if(T.isDocument(e)){if(fe(null,e.contents,s,Object.freeze([e]))===j)e.contents=null}else fe(null,e,s,Object.freeze([]))}Qe.BREAK=I;Qe.SKIP=gn;Qe.REMOVE=j;function fe(e,t,s,n){let i=bn(e,t,s,n);if(T.isNode(i)||T.isPair(i))return wn(e,n,i),fe(e,i,s,n);if(typeof i!=="symbol"){if(T.isCollection(t)){n=Object.freeze(n.concat(t));for(let r=0;r<t.items.length;++r){let o=fe(r,t.items[r],s,n);if(typeof o==="number")r=o-1;else if(o===I)return I;else if(o===j)t.items.splice(r,1),r-=1}}else if(T.isPair(t)){n=Object.freeze(n.concat(t));let r=fe("key",t.key,s,n);if(r===I)return I;else if(r===j)t.key=null;let o=fe("value",t.value,s,n);if(o===I)return I;else if(o===j)t.value=null}}return i}async function Xe(e,t){let s=yn(t);if(T.isDocument(e)){if(await he(null,e.contents,s,Object.freeze([e]))===j)e.contents=null}else await he(null,e,s,Object.freeze([]))}Xe.BREAK=I;Xe.SKIP=gn;Xe.REMOVE=j;async function he(e,t,s,n){let i=await bn(e,t,s,n);if(T.isNode(i)||T.isPair(i))return wn(e,n,i),he(e,i,s,n);if(typeof i!=="symbol"){if(T.isCollection(t)){n=Object.freeze(n.concat(t));for(let r=0;r<t.items.length;++r){let o=await he(r,t.items[r],s,n);if(typeof o==="number")r=o-1;else if(o===I)return I;else if(o===j)t.items.splice(r,1),r-=1}}else if(T.isPair(t)){n=Object.freeze(n.concat(t));let r=await he("key",t.key,s,n);if(r===I)return I;else if(r===j)t.key=null;let o=await he("value",t.value,s,n);if(o===I)return I;else if(o===j)t.value=null}}return i}function yn(e){if(typeof e==="object"&&(e.Collection||e.Node||e.Value))return Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e);return e}function bn(e,t,s,n){if(typeof s==="function")return s(e,t,n);if(T.isMap(t))return s.Map?.(e,t,n);if(T.isSeq(t))return s.Seq?.(e,t,n);if(T.isPair(t))return s.Pair?.(e,t,n);if(T.isScalar(t))return s.Scalar?.(e,t,n);if(T.isAlias(t))return s.Alias?.(e,t,n);return}function wn(e,t,s){let n=t[t.length-1];if(T.isCollection(n))n.items[e]=s;else if(T.isPair(n))if(e==="key")n.key=s;else n.value=s;else if(T.isDocument(n))n.contents=s;else{let i=T.isAlias(n)?"alias":"scalar";throw Error(`Cannot replace node with ${i} parent`)}}wo.visit=Qe;wo.visitAsync=Xe});var Ut=g(function(Oo){var Sn=O(),No=Ae(),ko={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ao=(e)=>e.replace(/[!,[\]{}]/g,(t)=>ko[t]);class _{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},_.defaultYaml,e),this.tags=Object.assign({},_.defaultTags,t)}clone(){let e=new _(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new _(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:_.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},_.defaultTags);break}return e}add(e,t){if(this.atNextDocument)this.yaml={explicit:_.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},_.defaultTags),this.atNextDocument=!1;let s=e.trim().split(/[ \t]+/),n=s.shift();switch(n){case"%TAG":{if(s.length!==2){if(t(0,"%TAG directive should contain exactly two parts"),s.length<2)return!1}let[i,r]=s;return this.tags[i]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=s;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;else{let r=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,r),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let r=e.slice(2,-1);if(r==="!"||r==="!!")return t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null;if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return r}let[,s,n]=e.match(/^(.*!)([^!]*)$/s);if(!n)t(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(n)}catch(r){return t(String(r)),null}if(s==="!")return e;return t(`Could not resolve tag: ${e}`),null}tagString(e){for(let[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+Ao(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),n;if(e&&s.length>0&&Sn.isNode(e.contents)){let i={};No.visit(e.contents,(r,o)=>{if(Sn.isNode(o)&&o.tag)i[o.tag]=!0}),n=Object.keys(i)}else n=[];for(let[i,r]of s){if(i==="!!"&&r==="tag:yaml.org,2002:")continue;if(!e||n.some((o)=>o.startsWith(r)))t.push(`%TAG ${i} ${r}`)}return t.join(`
|
|
3
|
+
`)}}_.defaultYaml={explicit:!1,version:"1.2"};_.defaultTags={"!!":"tag:yaml.org,2002:"};Oo.Directives=_});var ze=g(function(To){var vn=O(),Eo=Ae();function Co(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(s)}return!0}function Nn(e){let t=new Set;return Eo.visit(e,{Value(s,n){if(n.anchor)t.add(n.anchor)}}),t}function kn(e,t){for(let s=1;;++s){let n=`${e}${s}`;if(!t.has(n))return n}}function Lo(e,t){let s=[],n=new Map,i=null;return{onAnchor:(r)=>{s.push(r),i??(i=Nn(e));let o=kn(t,i);return i.add(o),o},setAnchors:()=>{for(let r of s){let o=n.get(r);if(typeof o==="object"&&o.anchor&&(vn.isScalar(o.node)||vn.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}To.anchorIsValid=Co;To.anchorNames=Nn;To.createNodeAnchors=Lo;To.findNewAnchor=kn});var Yt=g(function(xo){function Oe(e,t,s,n){if(n&&typeof n==="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],a=Oe(e,n,String(i),o);if(a===void 0)delete n[i];else if(a!==o)n[i]=a}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=Oe(e,n,i,r);if(o===void 0)n.delete(i);else if(o!==r)n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=Oe(e,n,i,i);if(r===void 0)n.delete(i);else if(r!==i)n.delete(i),n.add(r)}else for(let[i,r]of Object.entries(n)){let o=Oe(e,n,i,r);if(o===void 0)delete n[i];else if(o!==r)n[i]=o}return e.call(t,s,n)}xo.applyReviver=Oe});var G=g(function(Do){var Bo=O();function An(e,t,s){if(Array.isArray(e))return e.map((n,i)=>An(n,String(i),s));if(e&&typeof e.toJSON==="function"){if(!s||!Bo.hasAnchor(e))return e.toJSON(t,s);let n={aliasCount:0,count:1,res:void 0};s.anchors.set(e,n),s.onCreate=(r)=>{n.res=r,delete s.onCreate};let i=e.toJSON(t,s);if(s.onCreate)s.onCreate(i);return i}if(typeof e==="bigint"&&!s?.keep)return Number(e);return e}Do.toJS=An});var Ze=g(function(jo){var Fo=Yt(),On=O(),Ko=G();class qn{constructor(e){Object.defineProperty(this,On.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:n,reviver:i}={}){if(!On.isDocument(e))throw TypeError("A document argument is required");let r={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s==="number"?s:100},o=Ko.toJS(this,"",r);if(typeof n==="function")for(let{count:a,res:l}of r.anchors.values())n(l,a);return typeof i==="function"?Fo.applyReviver(i,{"":o},"",o):o}}jo.NodeBase=qn});var qe=g(function(Go){var Yo=ze(),Vo=Ae(),de=O(),Jo=Ze(),Ho=G();class En extends Jo.NodeBase{constructor(e){super(de.ALIAS);this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let s;if(t?.aliasResolveCache)s=t.aliasResolveCache;else if(s=[],Vo.visit(e,{Node:(i,r)=>{if(de.isAlias(r)||de.hasAnchor(r))s.push(r)}}),t)t.aliasResolveCache=s;let n=void 0;for(let i of s){if(i===this)break;if(i.anchor===this.source)n=i}return n}toJSON(e,t){if(!t)return{source:this.source};let{anchors:s,doc:n,maxAliasCount:i}=t,r=this.resolve(n,t);if(!r){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(a)}let o=s.get(r);if(!o)Ho.toJS(r,null,t),o=s.get(r);if(o?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0){if(o.count+=1,o.aliasCount===0)o.aliasCount=et(n,r,s);if(o.count*o.aliasCount>i)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return o.res}toString(e,t,s){let n=`*${this.source}`;if(e){if(Yo.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(i)}if(e.implicitKey)return`${n} `}return n}}function et(e,t,s){if(de.isAlias(t)){let n=t.resolve(e),i=s&&n&&s.get(n);return i?i.count*i.aliasCount:0}else if(de.isCollection(t)){let n=0;for(let i of t.items){let r=et(e,i,s);if(r>n)n=r}return n}else if(de.isPair(t)){let n=et(e,t.key,s),i=et(e,t.value,s);return Math.max(n,i)}return 1}Go.Alias=En});var E=g(function(ea){var Qo=O(),Xo=Ze(),zo=G(),Zo=(e)=>!e||typeof e!=="function"&&typeof e!=="object";class ne extends Xo.NodeBase{constructor(e){super(Qo.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:zo.toJS(this.value,e,t)}toString(){return String(this.value)}}ne.BLOCK_FOLDED="BLOCK_FOLDED";ne.BLOCK_LITERAL="BLOCK_LITERAL";ne.PLAIN="PLAIN";ne.QUOTE_DOUBLE="QUOTE_DOUBLE";ne.QUOTE_SINGLE="QUOTE_SINGLE";ea.Scalar=ne;ea.isScalarValue=Zo});var Ee=g(function(aa){var na=qe(),ie=O(),Cn=E(),ia="tag:yaml.org,2002:";function ra(e,t,s){if(t){let n=s.filter((r)=>r.tag===t),i=n.find((r)=>!r.format)??n[0];if(!i)throw Error(`Tag ${t} not found`);return i}return s.find((n)=>n.identify?.(e)&&!n.format)}function oa(e,t,s){if(ie.isDocument(e))e=e.contents;if(ie.isNode(e))return e;if(ie.isPair(e)){let u=s.schema[ie.MAP].createNode?.(s.schema,null,s);return u.items.push(e),u}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)e=e.valueOf();let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=s,l=void 0;if(n&&e&&typeof e==="object")if(l=a.get(e),l)return l.anchor??(l.anchor=i(e)),new na.Alias(l.anchor);else l={anchor:null,node:null},a.set(e,l);if(t?.startsWith("!!"))t=ia+t.slice(2);let c=ra(e,t,o.tags);if(!c){if(e&&typeof e.toJSON==="function")e=e.toJSON();if(!e||typeof e!=="object"){let u=new Cn.Scalar(e);if(l)l.node=u;return u}c=e instanceof Map?o[ie.MAP]:(Symbol.iterator in Object(e))?o[ie.SEQ]:o[ie.MAP]}if(r)r(c),delete s.onTagObj;let d=c?.createNode?c.createNode(s.schema,e,s):typeof c?.nodeClass?.from==="function"?c.nodeClass.from(s.schema,e,s):new Cn.Scalar(e);if(t)d.tag=t;else if(!c.default)d.tag=c.tag;if(l)l.node=d;return d}aa.createNode=oa});var tt=g(function(fa){var ca=Ee(),U=O(),ua=Ze();function Vt(e,t,s){let n=s;for(let i=t.length-1;i>=0;--i){let r=t[i];if(typeof r==="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return ca.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var Ln=(e)=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class Tn extends ua.NodeBase{constructor(e,t){super(e);Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(e)t.schema=e;if(t.items=t.items.map((s)=>U.isNode(s)||U.isPair(s)?s.clone(e):s),this.range)t.range=this.range.slice();return t}addIn(e,t){if(Ln(e))this.add(t);else{let[s,...n]=e,i=this.get(s,!0);if(U.isCollection(i))i.addIn(n,t);else if(i===void 0&&this.schema)this.set(s,Vt(this.schema,n,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}deleteIn(e){let[t,...s]=e;if(s.length===0)return this.delete(t);let n=this.get(t,!0);if(U.isCollection(n))return n.deleteIn(s);else throw Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){let[s,...n]=e,i=this.get(s,!0);if(n.length===0)return!t&&U.isScalar(i)?i.value:i;else return U.isCollection(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every((t)=>{if(!U.isPair(t))return!1;let s=t.value;return s==null||e&&U.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[t,...s]=e;if(s.length===0)return this.has(t);let n=this.get(t,!0);return U.isCollection(n)?n.hasIn(s):!1}setIn(e,t){let[s,...n]=e;if(n.length===0)this.set(s,t);else{let i=this.get(s,!0);if(U.isCollection(i))i.setIn(n,t);else if(i===void 0&&this.schema)this.set(s,Vt(this.schema,n,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}}fa.Collection=Tn;fa.collectionFromPath=Vt;fa.isEmptyPath=Ln});var Ce=g(function(ya){var ma=(e)=>e.replace(/^(?!$)(?: $)?/gm,"#");function Jt(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}var ga=(e,t,s)=>e.endsWith(`
|
|
4
|
+
`)?Jt(s,t):s.includes(`
|
|
5
5
|
`)?`
|
|
6
|
-
`+
|
|
7
|
-
`){if(
|
|
8
|
-
`&&
|
|
9
|
-
`&&
|
|
10
|
-
${
|
|
11
|
-
${
|
|
12
|
-
`);
|
|
13
|
-
`){if(
|
|
6
|
+
`+Jt(s,t):(e.endsWith(" ")?"":" ")+s;ya.indentComment=Jt;ya.lineComment=ga;ya.stringifyComment=ma});var Pn=g(function(Na){function va(e,t,s="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return e;if(i<r)r=0;let l=Math.max(1+r,1+i-t.length);if(e.length<=l)return e;let c=[],d={},u=i-t.length;if(typeof n==="number")if(n>i-Math.max(2,r))c.push(0);else u=i-n;let f=void 0,m=void 0,y=!1,h=-1,p=-1,w=-1;if(s==="block"){if(h=In(e,h,t.length),h!==-1)u=h+l}for(let v;v=e[h+=1];){if(s==="quoted"&&v==="\\"){switch(p=h,e[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}w=h}if(v===`
|
|
7
|
+
`){if(s==="block")h=In(e,h,t.length);u=h+t.length+l,f=void 0}else{if(v===" "&&m&&m!==" "&&m!==`
|
|
8
|
+
`&&m!=="\t"){let N=e[h+1];if(N&&N!==" "&&N!==`
|
|
9
|
+
`&&N!=="\t")f=h}if(h>=u)if(f)c.push(f),u=f+l,f=void 0;else if(s==="quoted"){while(m===" "||m==="\t")m=v,v=e[h+=1],y=!0;let N=h>w+1?h-2:p-1;if(d[N])return e;c.push(N),d[N]=!0,u=N+l,f=void 0}else y=!0}m=v}if(y&&a)a();if(c.length===0)return e;if(o)o();let S=e.slice(0,c[0]);for(let v=0;v<c.length;++v){let N=c[v],k=c[v+1]||e.length;if(N===0)S=`
|
|
10
|
+
${t}${e.slice(0,k)}`;else{if(s==="quoted"&&d[N])S+=`${e[N]}\\`;S+=`
|
|
11
|
+
${t}${e.slice(N+1,k)}`}}return S}function In(e,t,s){let n=t,i=t+1,r=e[i];while(r===" "||r==="\t")if(t<i+s)r=e[++t];else{do r=e[++t];while(r&&r!==`
|
|
12
|
+
`);n=t,i=t+1,r=e[i]}return n}Na.FOLD_BLOCK="block";Na.FOLD_FLOW="flow";Na.FOLD_QUOTED="quoted";Na.foldFlowLines=va});var Te=g(function(Ta){var D=E(),W=Pn(),nt=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),it=(e)=>/^(%|---|\.\.\.)/m.test(e);function Ea(e,t,s){if(!t||t<0)return!1;let n=t-s,i=e.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(e[r]===`
|
|
13
|
+
`){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function Le(e,t){let s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(it(e)?" ":""),o="",a=0;for(let l=0,c=s[l];c;c=s[++l]){if(c===" "&&s[l+1]==="\\"&&s[l+2]==="n")o+=s.slice(a,l)+"\\ ",l+=1,a=l,c="\\";if(c==="\\")switch(s[l+1]){case"u":{o+=s.slice(a,l);let d=s.substr(l+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:if(d.substr(0,2)==="00")o+="\\x"+d.substr(2);else o+=s.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||s[l+2]==='"'||s.length<i)l+=1;else{o+=s.slice(a,l)+`
|
|
14
14
|
|
|
15
|
-
`;while(
|
|
16
|
-
`,
|
|
17
|
-
`)||/[ \t]\n|\n[ \t]/.test(
|
|
18
|
-
${
|
|
15
|
+
`;while(s[l+2]==="\\"&&s[l+3]==="n"&&s[l+4]!=='"')o+=`
|
|
16
|
+
`,l+=2;if(o+=r,s[l+2]===" ")o+="\\";l+=1,a=l+1}break;default:l+=1}}return o=a?o+s.slice(a):s,n?o:W.foldFlowLines(o,r,W.FOLD_QUOTED,nt(t,!1))}function Ht(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
17
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Le(e,t);let s=t.indent||(it(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
+
${s}`)+"'";return t.implicitKey?n:W.foldFlowLines(n,s,W.FOLD_FLOW,nt(t,!1))}function pe(e,t){let{singleQuote:s}=t.options,n;if(s===!1)n=Le;else{let i=e.includes('"'),r=e.includes("'");if(i&&!r)n=Ht;else if(r&&!i)n=Le;else n=s?Ht:Le}return n(e,t)}var Gt;try{Gt=new RegExp(`(^|(?<!
|
|
19
19
|
))
|
|
20
20
|
+(?!
|
|
21
|
-
|$)`,"g")}catch{
|
|
21
|
+
|$)`,"g")}catch{Gt=/\n+(?!\n|$)/g}function st({comment:e,type:t,value:s},n,i,r){let{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(s))return pe(s,n);let c=n.indent||(n.forceBlockIndent||it(s)?" ":""),d=o==="literal"?!0:o==="folded"||t===D.Scalar.BLOCK_FOLDED?!1:t===D.Scalar.BLOCK_LITERAL?!0:!Ea(s,l,c.length);if(!s)return d?`|
|
|
22
22
|
`:`>
|
|
23
|
-
`;let
|
|
24
|
-
`&&
|
|
25
|
-
`);if(
|
|
26
|
-
`)
|
|
27
|
-
`)
|
|
28
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${
|
|
29
|
-
${
|
|
30
|
-
${
|
|
31
|
-
`)||
|
|
32
|
-
`)?
|
|
33
|
-
`))return
|
|
34
|
-
${
|
|
35
|
-
${
|
|
36
|
-
${
|
|
37
|
-
`:"",
|
|
38
|
-
${
|
|
39
|
-
`&&
|
|
23
|
+
`;let u,f;for(f=s.length;f>0;--f){let k=s[f-1];if(k!==`
|
|
24
|
+
`&&k!=="\t"&&k!==" ")break}let m=s.substring(f),y=m.indexOf(`
|
|
25
|
+
`);if(y===-1)u="-";else if(s===m||y!==m.length-1){if(u="+",r)r()}else u="";if(m){if(s=s.slice(0,-m.length),m[m.length-1]===`
|
|
26
|
+
`)m=m.slice(0,-1);m=m.replace(Gt,`$&${c}`)}let h=!1,p,w=-1;for(p=0;p<s.length;++p){let k=s[p];if(k===" ")h=!0;else if(k===`
|
|
27
|
+
`)w=p;else break}let S=s.substring(0,w<p?w+1:p);if(S)s=s.substring(S.length),S=S.replace(/\n+/g,`$&${c}`);let N=(h?c?"2":"1":"")+u;if(e){if(N+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i)i()}if(!d){let k=s.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),A=!1,q=nt(n,!0);if(o!=="folded"&&t!==D.Scalar.BLOCK_FOLDED)q.onOverflow=()=>{A=!0};let b=W.foldFlowLines(`${S}${k}${m}`,c,W.FOLD_BLOCK,q);if(!A)return`>${N}
|
|
29
|
+
${c}${b}`}return s=s.replace(/\n+/g,`$&${c}`),`|${N}
|
|
30
|
+
${c}${S}${s}${m}`}function Ca(e,t,s,n){let{type:i,value:r}=e,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:d}=t;if(a&&r.includes(`
|
|
31
|
+
`)||d&&/[[\]{},]/.test(r))return pe(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||d||!r.includes(`
|
|
32
|
+
`)?pe(r,t):st(e,t,s,n);if(!a&&!d&&i!==D.Scalar.PLAIN&&r.includes(`
|
|
33
|
+
`))return st(e,t,s,n);if(it(r)){if(l==="")return t.forceBlockIndent=!0,st(e,t,s,n);else if(a&&l===c)return pe(r,t)}let u=r.replace(/\n+/g,`$&
|
|
34
|
+
${l}`);if(o){let f=(h)=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(u),{compat:m,tags:y}=t.doc.schema;if(y.some(f)||m?.some(f))return pe(r,t)}return a?u:W.foldFlowLines(u,l,W.FOLD_FLOW,nt(t,!1))}function La(e,t,s,n){let{implicitKey:i,inFlow:r}=t,o=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;if(a!==D.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value))a=D.Scalar.QUOTE_DOUBLE}let l=(d)=>{switch(d){case D.Scalar.BLOCK_FOLDED:case D.Scalar.BLOCK_LITERAL:return i||r?pe(o.value,t):st(o,t,s,n);case D.Scalar.QUOTE_DOUBLE:return Le(o.value,t);case D.Scalar.QUOTE_SINGLE:return Ht(o.value,t);case D.Scalar.PLAIN:return Ca(o,t,s,n);default:return null}},c=l(a);if(c===null){let{defaultKeyType:d,defaultStringType:u}=t.options,f=i&&d||u;if(c=l(f),c===null)throw Error(`Unsupported default string type ${f}`)}return c}Ta.stringifyString=La});var Ie=g(function(Ra){var Pa=ze(),Q=O(),_a=Ce(),Ma=Te();function xa(e,t){let s=Object.assign({blockQuote:!0,commentString:_a.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),n;switch(s.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent==="number"?" ".repeat(s.indent):" ",inFlow:n,options:s}}function $a(e,t){if(t.tag){let i=e.filter((r)=>r.tag===t.tag);if(i.length>0)return i.find((r)=>r.format===t.format)??i[0]}let s=void 0,n;if(Q.isScalar(t)){n=t.value;let i=e.filter((r)=>r.identify?.(n));if(i.length>1){let r=i.filter((o)=>o.test);if(r.length>0)i=r}s=i.find((r)=>r.format===t.format)??i.find((r)=>!r.format)}else n=t,s=e.find((i)=>i.nodeClass&&n instanceof i.nodeClass);if(!s){let i=n?.constructor?.name??(n===null?"null":typeof n);throw Error(`Tag not resolved for ${i} value`)}return s}function Ba(e,t,{anchors:s,doc:n}){if(!n.directives)return"";let i=[],r=(Q.isScalar(e)||Q.isCollection(e))&&e.anchor;if(r&&Pa.anchorIsValid(r))s.add(r),i.push(`&${r}`);let o=e.tag??(t.default?null:t.tag);if(o)i.push(n.directives.tagString(o));return i.join(" ")}function Da(e,t,s,n){if(Q.isPair(e))return e.toString(t,s,n);if(Q.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(t.resolvedAliases)t.resolvedAliases.add(e);else t.resolvedAliases=new Set([e]);e=e.resolve(t.doc)}}let i=void 0,r=Q.isNode(e)?e:t.doc.createNode(e,{onTagObj:(l)=>i=l});i??(i=$a(t.doc.schema.tags,r));let o=Ba(r,i,t);if(o.length>0)t.indentAtStart=(t.indentAtStart??0)+o.length+1;let a=typeof i.stringify==="function"?i.stringify(r,t,s,n):Q.isScalar(r)?Ma.stringifyString(r,t,s,n):r.toString(t,s,n);if(!o)return a;return Q.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
35
|
+
${t.indent}${a}`}Ra.createStringifyContext=xa;Ra.stringify=Da});var xn=g(function(Ua){var V=O(),_n=E(),Mn=Ie(),Pe=Ce();function ja({key:e,value:t},s,n,i){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:u}}=s,f=V.isNode(e)&&e.comment||null;if(u){if(f)throw Error("With simple keys, key nodes cannot have comments");if(V.isCollection(e)||!V.isNode(e)&&typeof e==="object")throw Error("With simple keys, collection cannot be used as a key value")}let m=!u&&(!e||f&&t==null&&!s.inFlow||V.isCollection(e)||(V.isScalar(e)?e.type===_n.Scalar.BLOCK_FOLDED||e.type===_n.Scalar.BLOCK_LITERAL:typeof e==="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!m&&(u||!r),indent:a+l});let y=!1,h=!1,p=Mn.stringify(e,s,()=>y=!0,()=>h=!0);if(!m&&!s.inFlow&&p.length>1024){if(u)throw Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(s.inFlow){if(r||t==null){if(y&&n)n();return p===""?"?":m?`? ${p}`:p}}else if(r&&!u||t==null&&m){if(p=`? ${p}`,f&&!y)p+=Pe.lineComment(p,s.indent,c(f));else if(h&&i)i();return p}if(y)f=null;if(m){if(f)p+=Pe.lineComment(p,s.indent,c(f));p=`? ${p}
|
|
36
|
+
${a}:`}else if(p=`${p}:`,f)p+=Pe.lineComment(p,s.indent,c(f));let w,S,v;if(V.isNode(t))w=!!t.spaceBefore,S=t.commentBefore,v=t.comment;else if(w=!1,S=null,v=null,t&&typeof t==="object")t=o.createNode(t);if(s.implicitKey=!1,!m&&!f&&V.isScalar(t))s.indentAtStart=p.length+1;if(h=!1,!d&&l.length>=2&&!s.inFlow&&!m&&V.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor)s.indent=s.indent.substring(2);let N=!1,k=Mn.stringify(t,s,()=>N=!0,()=>h=!0),A=" ";if(f||w||S){if(A=w?`
|
|
37
|
+
`:"",S){let q=c(S);A+=`
|
|
38
|
+
${Pe.indentComment(q,s.indent)}`}if(k===""&&!s.inFlow){if(A===`
|
|
39
|
+
`&&v)A=`
|
|
40
40
|
|
|
41
41
|
`}else A+=`
|
|
42
|
-
${
|
|
43
|
-
`),
|
|
44
|
-
${
|
|
45
|
-
`)A="";if(
|
|
46
|
-
${
|
|
47
|
-
`}}if(
|
|
48
|
-
`+
|
|
49
|
-
`)),
|
|
50
|
-
${
|
|
51
|
-
`;return`${
|
|
52
|
-
${
|
|
53
|
-
`:" ")}return
|
|
54
|
-
${
|
|
55
|
-
${Z.comment}`:H.comment}H=X}q.items[U]=Vq.isPair(H)?H:new J$.Pair(H)}else $("Expected a sequence for this tag");return q}function e2(q,$,U){let{replacer:H}=U,X=new KX.YAMLSeq(q);X.tag="tag:yaml.org,2002:pairs";let Z=0;if($&&Symbol.iterator in Object($))for(let z of $){if(typeof H==="function")z=H.call($,String(Z++),z);let J,Q;if(Array.isArray(z))if(z.length===2)J=z[0],Q=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let G=Object.keys(z);if(G.length===1)J=G[0],Q=z[J];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else J=z;X.items.push(J$.createPair(J,Q,U))}return X}var NX={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:t2,createNode:e2};jX.createPairs=e2;jX.pairs=NX;jX.resolvePairs=t2});var G$=L((fX)=>{var q9=w(),Q$=c(),x0=n(),EX=o(),$9=Rq();class Z0 extends EX.YAMLSeq{constructor(){super();this.add=x0.YAMLMap.prototype.add.bind(this),this.delete=x0.YAMLMap.prototype.delete.bind(this),this.get=x0.YAMLMap.prototype.get.bind(this),this.has=x0.YAMLMap.prototype.has.bind(this),this.set=x0.YAMLMap.prototype.set.bind(this),this.tag=Z0.tag}toJSON(q,$){if(!$)return super.toJSON(q);let U=new Map;if($?.onCreate)$.onCreate(U);for(let H of this.items){let X,Z;if(q9.isPair(H))X=Q$.toJS(H.key,"",$),Z=Q$.toJS(H.value,X,$);else X=Q$.toJS(H,"",$);if(U.has(X))throw Error("Ordered maps must not include duplicate keys");U.set(X,Z)}return U}static from(q,$,U){let H=$9.createPairs(q,$,U),X=new this;return X.items=H.items,X}}Z0.tag="tag:yaml.org,2002:omap";var gX={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:Z0,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let U=$9.resolvePairs(q,$),H=[];for(let{key:X}of U.items)if(q9.isScalar(X))if(H.includes(X.value))$(`Ordered maps must not include duplicate keys: ${X.value}`);else H.push(X.value);return Object.assign(new Z0,U)},createNode:(q,$,U)=>Z0.from(q,$,U)};fX.YAMLOMap=Z0;fX.omap=gX});var z9=L((xX)=>{var U9=N();function H9({value:q,source:$},U){if($&&(q?X9:Z9).test.test($))return $;return q?U.options.trueStr:U.options.falseStr}var X9={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new U9.Scalar(!0),stringify:H9},Z9={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new U9.Scalar(!1),stringify:H9};xX.falseTag=Z9;xX.trueTag=X9});var J9=L((lX)=>{var vX=N(),T$=O0(),mX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:T$.stringifyNumber},pX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():T$.stringifyNumber(q)}},dX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new vX.Scalar(parseFloat(q.replace(/_/g,""))),U=q.indexOf(".");if(U!==-1){let H=q.substring(U+1).replace(/_/g,"");if(H[H.length-1]==="0")$.minFractionDigits=H.length}return $},stringify:T$.stringifyNumber};lX.float=dX;lX.floatExp=pX;lX.floatNaN=mX});var G9=L((tX)=>{var Q9=O0(),h0=(q)=>typeof q==="bigint"||Number.isInteger(q);function Fq(q,$,U,{intAsBigInt:H}){let X=q[0];if(X==="-"||X==="+")$+=1;if(q=q.substring($).replace(/_/g,""),H){switch(U){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let z=BigInt(q);return X==="-"?BigInt(-1)*z:z}let Z=parseInt(q,U);return X==="-"?-1*Z:Z}function Y$(q,$,U){let{value:H}=q;if(h0(H)){let X=H.toString($);return H<0?"-"+U+X.substr(1):U+X}return Q9.stringifyNumber(q)}var iX={identify:h0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,U)=>Fq(q,2,2,U),stringify:(q)=>Y$(q,2,"0b")},rX={identify:h0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,U)=>Fq(q,1,8,U),stringify:(q)=>Y$(q,8,"0")},nX={identify:h0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,U)=>Fq(q,0,10,U),stringify:Q9.stringifyNumber},oX={identify:h0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,U)=>Fq(q,2,16,U),stringify:(q)=>Y$(q,16,"0x")};tX.int=nX;tX.intBin=iX;tX.intHex=oX;tX.intOct=rX});var W$=L((XZ)=>{var Aq=w(),Pq=i(),Mq=n();class z0 extends Mq.YAMLMap{constructor(q){super(q);this.tag=z0.tag}add(q){let $;if(Aq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new Pq.Pair(q.key,null);else $=new Pq.Pair(q,null);if(!Mq.findPair(this.items,$.key))this.items.push($)}get(q,$){let U=Mq.findPair(this.items,q);return!$&&Aq.isPair(U)?Aq.isScalar(U.key)?U.key.value:U.key:U}set(q,$){if(typeof $!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof $}`);let U=Mq.findPair(this.items,q);if(U&&!$)this.items.splice(this.items.indexOf(U),1);else if(!U&&$)this.items.push(new Pq.Pair(q))}toJSON(q,$){return super.toJSON(q,$,Set)}toString(q,$,U){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),$,U);else throw Error("Set items must all have null values")}static from(q,$,U){let{replacer:H}=U,X=new this(q);if($&&Symbol.iterator in Object($))for(let Z of $){if(typeof H==="function")Z=H.call($,Z,Z);X.items.push(Pq.createPair(Z,null,U))}return X}}z0.tag="tag:yaml.org,2002:set";var HZ={collection:"map",identify:(q)=>q instanceof Set,nodeClass:z0,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,U)=>z0.from(q,$,U),resolve(q,$){if(Aq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new z0,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};XZ.YAMLSet=z0;XZ.set=HZ});var B$=L((TZ)=>{var JZ=O0();function I$(q,$){let U=q[0],H=U==="-"||U==="+"?q.substring(1):q,X=(z)=>$?BigInt(z):Number(z),Z=H.replace(/_/g,"").split(":").reduce((z,J)=>z*X(60)+X(J),X(0));return U==="-"?X(-1)*Z:Z}function T9(q){let{value:$}=q,U=(z)=>z;if(typeof $==="bigint")U=(z)=>BigInt(z);else if(isNaN($)||!isFinite($))return JZ.stringifyNumber(q);let H="";if($<0)H="-",$*=U(-1);let X=U(60),Z=[$%X];if($<60)Z.unshift(0);else if($=($-Z[0])/X,Z.unshift($%X),$>=60)$=($-Z[0])/X,Z.unshift($);return H+Z.map((z)=>String(z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var QZ={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,$,{intAsBigInt:U})=>I$(q,U),stringify:T9},GZ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>I$(q,!1),stringify:T9},Y9={identify:(q)=>q instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(q){let $=q.match(Y9.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,U,H,X,Z,z,J]=$.map(Number),Q=$[7]?Number(($[7]+"00").substr(1,3)):0,G=Date.UTC(U,H-1,X,Z||0,z||0,J||0,Q),I=$[8];if(I&&I!=="Z"){let T=I$(I,!1);if(Math.abs(T)<30)T*=60;G-=60000*T}return new Date(G)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};TZ.floatTime=GZ;TZ.intTime=QZ;TZ.timestamp=Y9});var I9=L((AZ)=>{var BZ=_0(),_Z=Lq(),LZ=L0(),OZ=y0(),DZ=z$(),W9=z9(),_$=J9(),wq=G9(),VZ=Qq(),RZ=G$(),FZ=Rq(),PZ=W$(),L$=B$(),MZ=[BZ.map,LZ.seq,OZ.string,_Z.nullTag,W9.trueTag,W9.falseTag,wq.intBin,wq.intOct,wq.int,wq.intHex,_$.floatNaN,_$.floatExp,_$.float,DZ.binary,VZ.merge,RZ.omap,FZ.pairs,PZ.set,L$.intTime,L$.floatTime,L$.timestamp];AZ.schema=MZ});var M9=L((gZ)=>{var O9=_0(),KZ=Lq(),D9=L0(),NZ=y0(),jZ=tq(),O$=q$(),D$=U$(),SZ=r2(),bZ=o2(),V9=z$(),u0=Qq(),R9=G$(),F9=Rq(),B9=I9(),P9=W$(),Kq=B$(),_9=new Map([["core",SZ.schema],["failsafe",[O9.map,D9.seq,NZ.string]],["json",bZ.schema],["yaml11",B9.schema],["yaml-1.1",B9.schema]]),L9={binary:V9.binary,bool:jZ.boolTag,float:O$.float,floatExp:O$.floatExp,floatNaN:O$.floatNaN,floatTime:Kq.floatTime,int:D$.int,intHex:D$.intHex,intOct:D$.intOct,intTime:Kq.intTime,map:O9.map,merge:u0.merge,null:KZ.nullTag,omap:R9.omap,pairs:F9.pairs,seq:D9.seq,set:P9.set,timestamp:Kq.timestamp},CZ={"tag:yaml.org,2002:binary":V9.binary,"tag:yaml.org,2002:merge":u0.merge,"tag:yaml.org,2002:omap":R9.omap,"tag:yaml.org,2002:pairs":F9.pairs,"tag:yaml.org,2002:set":P9.set,"tag:yaml.org,2002:timestamp":Kq.timestamp};function EZ(q,$,U){let H=_9.get($);if(H&&!q)return U&&!H.includes(u0.merge)?H.concat(u0.merge):H.slice();let X=H;if(!X)if(Array.isArray(q))X=[];else{let Z=Array.from(_9.keys()).filter((z)=>z!=="yaml11").map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${Z} or define customTags array`)}if(Array.isArray(q))for(let Z of q)X=X.concat(Z);else if(typeof q==="function")X=q(X.slice());if(U)X=X.concat(u0.merge);return X.reduce((Z,z)=>{let J=typeof z==="string"?L9[z]:z;if(!J){let Q=JSON.stringify(z),G=Object.keys(L9).map((I)=>JSON.stringify(I)).join(", ");throw Error(`Unknown custom tag ${Q}; use one of ${G}`)}if(!Z.includes(J))Z.push(J);return Z},[])}gZ.coreKnownTags=CZ;gZ.getTags=EZ});var F$=L((vZ)=>{var V$=w(),kZ=_0(),xZ=L0(),hZ=y0(),Nq=M9(),uZ=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class R${constructor({compat:q,customTags:$,merge:U,resolveKnownTags:H,schema:X,sortMapEntries:Z,toStringDefaults:z}){this.compat=Array.isArray(q)?Nq.getTags(q,"compat"):q?Nq.getTags(null,q):null,this.name=typeof X==="string"&&X||"core",this.knownTags=H?Nq.coreKnownTags:{},this.tags=Nq.getTags($,this.name,U),this.toStringOptions=z??null,Object.defineProperty(this,V$.MAP,{value:kZ.map}),Object.defineProperty(this,V$.SCALAR,{value:hZ.string}),Object.defineProperty(this,V$.SEQ,{value:xZ.seq}),this.sortMapEntries=typeof Z==="function"?Z:Z===!0?uZ:null}clone(){let q=Object.create(R$.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}vZ.Schema=R$});var A9=L((lZ)=>{var pZ=w(),P$=E0(),v0=S0();function dZ(q,$){let U=[],H=$.directives===!0;if($.directives!==!1&&q.directives){let Q=q.directives.toString(q);if(Q)U.push(Q),H=!0;else if(q.directives.docStart)H=!0}if(H)U.push("---");let X=P$.createStringifyContext(q,$),{commentString:Z}=X.options;if(q.commentBefore){if(U.length!==1)U.unshift("");let Q=Z(q.commentBefore);U.unshift(v0.indentComment(Q,""))}let z=!1,J=null;if(q.contents){if(pZ.isNode(q.contents)){if(q.contents.spaceBefore&&H)U.push("");if(q.contents.commentBefore){let I=Z(q.contents.commentBefore);U.push(v0.indentComment(I,""))}X.forceBlockIndent=!!q.comment,J=q.contents.comment}let Q=J?void 0:()=>z=!0,G=P$.stringify(q.contents,X,()=>J=null,Q);if(J)G+=v0.lineComment(G,"",Z(J));if((G[0]==="|"||G[0]===">")&&U[U.length-1]==="---")U[U.length-1]=`--- ${G}`;else U.push(G)}else U.push(P$.stringify(q.contents,X));if(q.directives?.docEnd)if(q.comment){let Q=Z(q.comment);if(Q.includes(`
|
|
56
|
-
`))
|
|
42
|
+
${s.indent}`}else if(!m&&V.isCollection(t)){let q=k[0],b=k.indexOf(`
|
|
43
|
+
`),C=b!==-1,J=s.inFlow??t.flow??t.items.length===0;if(C||!J){let ue=!1;if(C&&(q==="&"||q==="!")){let L=k.indexOf(" ");if(q==="&"&&L!==-1&&L<b&&k[L+1]==="!")L=k.indexOf(" ",L+1);if(L===-1||b<L)ue=!0}if(!ue)A=`
|
|
44
|
+
${s.indent}`}}else if(k===""||k[0]===`
|
|
45
|
+
`)A="";if(p+=A+k,s.inFlow){if(N&&n)n()}else if(v&&!N)p+=Pe.lineComment(p,s.indent,c(v));else if(h&&i)i();return p}Ua.stringifyPair=ja});var Wt=g(function(Ha){var $n=He("process");function Va(e,...t){if(e==="debug")console.log(...t)}function Ja(e,t){if(e==="debug"||e==="warn")if(typeof $n.emitWarning==="function")$n.emitWarning(t);else console.warn(t)}Ha.debug=Va;Ha.warn=Ja});var lt=g(function(Xa){var at=O(),Bn=E(),rt="<<",ot={identify:(e)=>e===rt||typeof e==="symbol"&&e.description===rt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Bn.Scalar(Symbol(rt)),{addToJSMap:Dn}),stringify:()=>rt},Qa=(e,t)=>(ot.identify(t)||at.isScalar(t)&&(!t.type||t.type===Bn.Scalar.PLAIN)&&ot.identify(t.value))&&e?.doc.schema.tags.some((s)=>s.tag===ot.tag&&s.default);function Dn(e,t,s){let n=Rn(e,s);if(at.isSeq(n))for(let i of n.items)Qt(e,t,i);else if(Array.isArray(n))for(let i of n)Qt(e,t,i);else Qt(e,t,n)}function Qt(e,t,s){let n=Rn(e,s);if(!at.isMap(n))throw Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,e,Map);for(let[r,o]of i)if(t instanceof Map){if(!t.has(r))t.set(r,o)}else if(t instanceof Set)t.add(r);else if(!Object.prototype.hasOwnProperty.call(t,r))Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function Rn(e,t){return e&&at.isAlias(t)?t.resolve(e.doc,e):t}Xa.addMergeToJSMap=Dn;Xa.isMergeKey=Qa;Xa.merge=ot});var zt=g(function(rl){var tl=Wt(),Fn=lt(),sl=Ie(),Kn=O(),Xt=G();function nl(e,t,{key:s,value:n}){if(Kn.isNode(s)&&s.addToJSMap)s.addToJSMap(e,t,n);else if(Fn.isMergeKey(e,s))Fn.addMergeToJSMap(e,t,n);else{let i=Xt.toJS(s,"",e);if(t instanceof Map)t.set(i,Xt.toJS(n,i,e));else if(t instanceof Set)t.add(i);else{let r=il(s,i,e),o=Xt.toJS(n,r,e);if(r in t)Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});else t[r]=o}}return t}function il(e,t,s){if(t===null)return"";if(typeof t!=="object")return String(t);if(Kn.isNode(e)&&s?.doc){let n=sl.createStringifyContext(s.doc,{});n.anchors=new Set;for(let r of s.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!s.mapKeyWarned){let r=JSON.stringify(i);if(r.length>40)r=r.substring(0,36)+'..."';tl.warn(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return i}return JSON.stringify(t)}rl.addPairToJSMap=nl});var X=g(function(ul){var jn=Ee(),al=xn(),ll=zt(),ct=O();function cl(e,t,s){let n=jn.createNode(e,void 0,s),i=jn.createNode(t,void 0,s);return new ut(n,i)}class ut{constructor(e,t=null){Object.defineProperty(this,ct.NODE_TYPE,{value:ct.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;if(ct.isNode(t))t=t.clone(e);if(ct.isNode(s))s=s.clone(e);return new ut(t,s)}toJSON(e,t){let s=t?.mapAsMap?new Map:{};return ll.addPairToJSMap(t,s,this)}toString(e,t,s){return e?.doc?al.stringifyPair(this,e,t,s):JSON.stringify(this)}}ul.Pair=ut;ul.createPair=cl});var Zt=g(function(gl){var re=O(),Un=Ie(),ft=Ce();function dl(e,t,s){return(t.inFlow??e.flow?ml:pl)(e,t,s)}function pl({comment:e,items:t},s,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=s,d=Object.assign({},s,{indent:r,type:null}),u=!1,f=[];for(let y=0;y<t.length;++y){let h=t[y],p=null;if(re.isNode(h)){if(!u&&h.spaceBefore)f.push("");if(ht(s,f,h.commentBefore,u),h.comment)p=h.comment}else if(re.isPair(h)){let S=re.isNode(h.key)?h.key:null;if(S){if(!u&&S.spaceBefore)f.push("");ht(s,f,S.commentBefore,u)}}u=!1;let w=Un.stringify(h,d,()=>p=null,()=>u=!0);if(p)w+=ft.lineComment(w,r,c(p));if(u&&p)u=!1;f.push(n+w)}let m;if(f.length===0)m=i.start+i.end;else{m=f[0];for(let y=1;y<f.length;++y){let h=f[y];m+=h?`
|
|
46
|
+
${l}${h}`:`
|
|
47
|
+
`}}if(e){if(m+=`
|
|
48
|
+
`+ft.indentComment(c(e),l),a)a()}else if(u&&o)o();return m}function ml({items:e},t,{flowChars:s,itemIndent:n}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=t;n+=r;let l=Object.assign({},t,{indent:n,inFlow:!0,type:null}),c=!1,d=0,u=[];for(let y=0;y<e.length;++y){let h=e[y],p=null;if(re.isNode(h)){if(h.spaceBefore)u.push("");if(ht(t,u,h.commentBefore,!1),h.comment)p=h.comment}else if(re.isPair(h)){let S=re.isNode(h.key)?h.key:null;if(S){if(S.spaceBefore)u.push("");if(ht(t,u,S.commentBefore,!1),S.comment)c=!0}let v=re.isNode(h.value)?h.value:null;if(v){if(v.comment)p=v.comment;if(v.commentBefore)c=!0}else if(h.value==null&&S?.comment)p=S.comment}if(p)c=!0;let w=Un.stringify(h,l,()=>p=null);if(c||(c=u.length>d||w.includes(`
|
|
49
|
+
`)),y<e.length-1)w+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)c||(c=u.reduce((S,v)=>S+v.length+2,2)+(w.length+2)>t.options.lineWidth);if(c)w+=","}if(p)w+=ft.lineComment(w,n,a(p));u.push(w),d=u.length}let{start:f,end:m}=s;if(u.length===0)return f+m;else{if(!c){let y=u.reduce((h,p)=>h+p.length+2,2);c=t.options.lineWidth>0&&y>t.options.lineWidth}if(c){let y=f;for(let h of u)y+=h?`
|
|
50
|
+
${r}${i}${h}`:`
|
|
51
|
+
`;return`${y}
|
|
52
|
+
${i}${m}`}else return`${f}${o}${u.join(" ")}${o}${m}`}}function ht({indent:e,options:{commentString:t}},s,n,i){if(n&&i)n=n.replace(/^\n+/,"");if(n){let r=ft.indentComment(t(n),e);s.push(r.trimStart())}}gl.stringifyCollection=dl});var Z=g(function(Nl){var bl=Zt(),wl=zt(),Sl=tt(),z=O(),dt=X(),vl=E();function _e(e,t){let s=z.isScalar(t)?t.value:t;for(let n of e)if(z.isPair(n)){if(n.key===t||n.key===s)return n;if(z.isScalar(n.key)&&n.key.value===s)return n}return}class Yn extends Sl.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(z.MAP,e);this.items=[]}static from(e,t,s){let{keepUndefined:n,replacer:i}=s,r=new this(e),o=(a,l)=>{if(typeof i==="function")l=i.call(t,a,l);else if(Array.isArray(i)&&!i.includes(a))return;if(l!==void 0||n)r.items.push(dt.createPair(a,l,s))};if(t instanceof Map)for(let[a,l]of t)o(a,l);else if(t&&typeof t==="object")for(let a of Object.keys(t))o(a,t[a]);if(typeof e.sortMapEntries==="function")r.items.sort(e.sortMapEntries);return r}add(e,t){let s;if(z.isPair(e))s=e;else if(!e||typeof e!=="object"||!("key"in e))s=new dt.Pair(e,e?.value);else s=new dt.Pair(e.key,e.value);let n=_e(this.items,s.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${s.key} already set`);if(z.isScalar(n.value)&&vl.isScalarValue(s.value))n.value.value=s.value;else n.value=s.value}else if(i){let r=this.items.findIndex((o)=>i(s,o)<0);if(r===-1)this.items.push(s);else this.items.splice(r,0,s)}else this.items.push(s)}delete(e){let t=_e(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let n=_e(this.items,e)?.value;return(!t&&z.isScalar(n)?n.value:n)??void 0}has(e){return!!_e(this.items,e)}set(e,t){this.add(new dt.Pair(e,t),!0)}toJSON(e,t,s){let n=s?new s:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(n);for(let i of this.items)wl.addPairToJSMap(t,n,i);return n}toString(e,t,s){if(!e)return JSON.stringify(this);for(let n of this.items)if(!z.isPair(n))throw Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);if(!e.allNullValues&&this.hasAllNullValues(!1))e=Object.assign({},e,{allNullValues:!0});return bl.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}}Nl.YAMLMap=Yn;Nl.findPair=_e});var me=g(function(El){var Ol=O(),Vn=Z(),ql={collection:"map",default:!0,nodeClass:Vn.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!Ol.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,s)=>Vn.YAMLMap.from(e,t,s)};El.map=ql});var ee=g(function(Ml){var Ll=Ee(),Tl=Zt(),Il=tt(),mt=O(),Pl=E(),_l=G();class Jn extends Il.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(mt.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){let t=pt(e);if(typeof t!=="number")return!1;return this.items.splice(t,1).length>0}get(e,t){let s=pt(e);if(typeof s!=="number")return;let n=this.items[s];return!t&&mt.isScalar(n)?n.value:n}has(e){let t=pt(e);return typeof t==="number"&&t<this.items.length}set(e,t){let s=pt(e);if(typeof s!=="number")throw Error(`Expected a valid index, not ${e}.`);let n=this.items[s];if(mt.isScalar(n)&&Pl.isScalarValue(t))n.value=t;else this.items[s]=t}toJSON(e,t){let s=[];if(t?.onCreate)t.onCreate(s);let n=0;for(let i of this.items)s.push(_l.toJS(i,String(n++),t));return s}toString(e,t,s){if(!e)return JSON.stringify(this);return Tl.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t})}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t)){let r=0;for(let o of t){if(typeof n==="function"){let a=t instanceof Set?o:String(r++);o=n.call(t,a,o)}i.items.push(Ll.createNode(o,void 0,s))}}return i}}function pt(e){let t=mt.isScalar(e)?e.value:e;if(t&&typeof t==="string")t=Number(t);return typeof t==="number"&&Number.isInteger(t)&&t>=0?t:null}Ml.YAMLSeq=Jn});var ge=g(function(Dl){var $l=O(),Hn=ee(),Bl={collection:"seq",default:!0,nodeClass:Hn.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!$l.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,s)=>Hn.YAMLSeq.from(e,t,s)};Dl.seq=Bl});var Me=g(function(jl){var Fl=Te(),Kl={identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify(e,t,s,n){return t=Object.assign({actualString:!0},t),Fl.stringifyString(e,t,s,n)}};jl.string=Kl});var gt=g(function(Yl){var Gn=E(),Wn={identify:(e)=>e==null,createNode:()=>new Gn.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Gn.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&Wn.test.test(e)?e:t.options.nullStr};Yl.nullTag=Wn});var es=g(function(Hl){var Jl=E(),Qn={identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(e)=>new Jl.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},s){if(e&&Qn.test.test(e)){let n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?s.options.trueStr:s.options.falseStr}};Hl.boolTag=Qn});var ye=g(function(Ql){function Wl({format:e,minFractionDigits:t,tag:s,value:n}){if(typeof n==="bigint")return String(n);let i=typeof n==="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!s||s==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");if(o<0)o=r.length,r+=".";let a=t-(r.length-o-1);while(a-- >0)r+="0"}return r}Ql.stringifyNumber=Wl});var ss=g(function(sc){var zl=E(),ts=ye(),Zl={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ts.stringifyNumber},ec={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():ts.stringifyNumber(e)}},tc={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new zl.Scalar(parseFloat(e)),s=e.indexOf(".");if(s!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-s-1;return t},stringify:ts.stringifyNumber};sc.float=tc;sc.floatExp=ec;sc.floatNaN=Zl});var is=g(function(cc){var Xn=ye(),yt=(e)=>typeof e==="bigint"||Number.isInteger(e),ns=(e,t,s,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),s);function zn(e,t,s){let{value:n}=e;if(yt(n)&&n>=0)return s+n.toString(t);return Xn.stringifyNumber(e)}var oc={identify:(e)=>yt(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>ns(e,2,8,s),stringify:(e)=>zn(e,8,"0o")},ac={identify:yt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>ns(e,0,10,s),stringify:Xn.stringifyNumber},lc={identify:(e)=>yt(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>ns(e,2,16,s),stringify:(e)=>zn(e,16,"0x")};cc.int=ac;cc.intHex=lc;cc.intOct=oc});var Zn=g(function(wc){var dc=me(),pc=gt(),mc=ge(),gc=Me(),yc=es(),rs=ss(),os=is(),bc=[dc.map,mc.seq,gc.string,pc.nullTag,yc.boolTag,os.intOct,os.int,os.intHex,rs.floatNaN,rs.floatExp,rs.float];wc.schema=bc});var ti=g(function(Ec){var vc=E(),Nc=me(),kc=ge();function ei(e){return typeof e==="bigint"||Number.isInteger(e)}var bt=({value:e})=>JSON.stringify(e),Ac=[{identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify:bt},{identify:(e)=>e==null,createNode:()=>new vc.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:bt},{identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(e)=>e==="true",stringify:bt},{identify:ei,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>ei(e)?e.toString():JSON.stringify(e)},{identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(e)=>parseFloat(e),stringify:bt}],Oc={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},qc=[Nc.map,kc.seq].concat(Ac,Oc);Ec.schema=qc});var ls=g(function(Ic){var xe=He("buffer"),as=E(),Lc=Te(),Tc={identify:(e)=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof xe.Buffer==="function")return xe.Buffer.from(e,"base64");else if(typeof atob==="function"){let s=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(s.length);for(let i=0;i<s.length;++i)n[i]=s.charCodeAt(i);return n}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:s},n,i,r){if(!s)return"";let o=s,a;if(typeof xe.Buffer==="function")a=o instanceof xe.Buffer?o.toString("base64"):xe.Buffer.from(o.buffer).toString("base64");else if(typeof btoa==="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=as.Scalar.BLOCK_LITERAL),t!==as.Scalar.QUOTE_DOUBLE){let l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),d=Array(c);for(let u=0,f=0;u<c;++u,f+=l)d[u]=a.substr(f,l);a=d.join(t===as.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return Lc.stringifyString({comment:e,type:t,value:a},n,i,r)}};Ic.binary=Tc});var St=g(function($c){var wt=O(),cs=X(),_c=E(),Mc=ee();function si(e,t){if(wt.isSeq(e))for(let s=0;s<e.items.length;++s){let n=e.items[s];if(wt.isPair(n))continue;else if(wt.isMap(n)){if(n.items.length>1)t("Each pair must have its own sequence indicator");let i=n.items[0]||new cs.Pair(new _c.Scalar(null));if(n.commentBefore)i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
54
|
+
${i.key.commentBefore}`:n.commentBefore;if(n.comment){let r=i.value??i.key;r.comment=r.comment?`${n.comment}
|
|
55
|
+
${r.comment}`:n.comment}n=i}e.items[s]=wt.isPair(n)?n:new cs.Pair(n)}else t("Expected a sequence for this tag");return e}function ni(e,t,s){let{replacer:n}=s,i=new Mc.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){if(typeof n==="function")o=n.call(t,String(r++),o);let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(cs.createPair(a,l,s))}return i}var xc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:si,createNode:ni};$c.createPairs=ni;$c.pairs=xc;$c.resolvePairs=si});var fs=g(function(jc){var ii=O(),us=G(),$e=Z(),Fc=ee(),ri=St();class oe extends Fc.YAMLSeq{constructor(){super();this.add=$e.YAMLMap.prototype.add.bind(this),this.delete=$e.YAMLMap.prototype.delete.bind(this),this.get=$e.YAMLMap.prototype.get.bind(this),this.has=$e.YAMLMap.prototype.has.bind(this),this.set=$e.YAMLMap.prototype.set.bind(this),this.tag=oe.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;if(t?.onCreate)t.onCreate(s);for(let n of this.items){let i,r;if(ii.isPair(n))i=us.toJS(n.key,"",t),r=us.toJS(n.value,i,t);else i=us.toJS(n,"",t);if(s.has(i))throw Error("Ordered maps must not include duplicate keys");s.set(i,r)}return s}static from(e,t,s){let n=ri.createPairs(e,t,s),i=new this;return i.items=n.items,i}}oe.tag="tag:yaml.org,2002:omap";var Kc={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:oe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let s=ri.resolvePairs(e,t),n=[];for(let{key:i}of s.items)if(ii.isScalar(i))if(n.includes(i.value))t(`Ordered maps must not include duplicate keys: ${i.value}`);else n.push(i.value);return Object.assign(new oe,s)},createNode:(e,t,s)=>oe.from(e,t,s)};jc.YAMLOMap=oe;jc.omap=Kc});var ui=g(function(Vc){var oi=E();function ai({value:e,source:t},s){if(t&&(e?li:ci).test.test(t))return t;return e?s.options.trueStr:s.options.falseStr}var li={identify:(e)=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new oi.Scalar(!0),stringify:ai},ci={identify:(e)=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new oi.Scalar(!1),stringify:ai};Vc.falseTag=ci;Vc.trueTag=li});var fi=g(function(zc){var Gc=E(),hs=ye(),Wc={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:hs.stringifyNumber},Qc={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():hs.stringifyNumber(e)}},Xc={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new Gc.Scalar(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){let n=e.substring(s+1).replace(/_/g,"");if(n[n.length-1]==="0")t.minFractionDigits=n.length}return t},stringify:hs.stringifyNumber};zc.float=Xc;zc.floatExp=Qc;zc.floatNaN=Wc});var di=g(function(ou){var hi=ye(),Be=(e)=>typeof e==="bigint"||Number.isInteger(e);function vt(e,t,s,{intAsBigInt:n}){let i=e[0];if(i==="-"||i==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),n){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let o=BigInt(e);return i==="-"?BigInt(-1)*o:o}let r=parseInt(e,s);return i==="-"?-1*r:r}function ds(e,t,s){let{value:n}=e;if(Be(n)){let i=n.toString(t);return n<0?"-"+s+i.substr(1):s+i}return hi.stringifyNumber(e)}var su={identify:Be,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>vt(e,2,2,s),stringify:(e)=>ds(e,2,"0b")},nu={identify:Be,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>vt(e,1,8,s),stringify:(e)=>ds(e,8,"0")},iu={identify:Be,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>vt(e,0,10,s),stringify:hi.stringifyNumber},ru={identify:Be,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>vt(e,2,16,s),stringify:(e)=>ds(e,16,"0x")};ou.int=iu;ou.intBin=su;ou.intHex=ru;ou.intOct=nu});var ps=g(function(hu){var At=O(),Nt=X(),kt=Z();class ae extends kt.YAMLMap{constructor(e){super(e);this.tag=ae.tag}add(e){let t;if(At.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new Nt.Pair(e.key,null);else t=new Nt.Pair(e,null);if(!kt.findPair(this.items,t.key))this.items.push(t)}get(e,t){let s=kt.findPair(this.items,e);return!t&&At.isPair(s)?At.isScalar(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=kt.findPair(this.items,e);if(s&&!t)this.items.splice(this.items.indexOf(s),1);else if(!s&&t)this.items.push(new Nt.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);else throw Error("Set items must all have null values")}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let r of t){if(typeof n==="function")r=n.call(t,r,r);i.items.push(Nt.createPair(r,null,s))}return i}}ae.tag="tag:yaml.org,2002:set";var fu={collection:"map",identify:(e)=>e instanceof Set,nodeClass:ae,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>ae.from(e,t,s),resolve(e,t){if(At.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new ae,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};hu.YAMLSet=ae;hu.set=fu});var gs=g(function(bu){var mu=ye();function ms(e,t){let s=e[0],n=s==="-"||s==="+"?e.substring(1):e,i=(o)=>t?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return s==="-"?i(-1)*r:r}function pi(e){let{value:t}=e,s=(o)=>o;if(typeof t==="bigint")s=(o)=>BigInt(o);else if(isNaN(t)||!isFinite(t))return mu.stringifyNumber(e);let n="";if(t<0)n="-",t*=s(-1);let i=s(60),r=[t%i];if(t<60)r.unshift(0);else if(t=(t-r[0])/i,r.unshift(t%i),t>=60)t=(t-r[0])/i,r.unshift(t);return n+r.map((o)=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var gu={identify:(e)=>typeof e==="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:s})=>ms(e,s),stringify:pi},yu={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(e)=>ms(e,!1),stringify:pi},mi={identify:(e)=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(mi.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,n,i,r,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0,c=Date.UTC(s,n-1,i,r||0,o||0,a||0,l),d=t[8];if(d&&d!=="Z"){let u=ms(d,!1);if(Math.abs(u)<30)u*=60;c-=60000*u}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};bu.floatTime=yu;bu.intTime=gu;bu.timestamp=mi});var yi=g(function(Pu){var Nu=me(),ku=gt(),Au=ge(),Ou=Me(),qu=ls(),gi=ui(),ys=fi(),Ot=di(),Eu=lt(),Cu=fs(),Lu=St(),Tu=ps(),bs=gs(),Iu=[Nu.map,Au.seq,Ou.string,ku.nullTag,gi.trueTag,gi.falseTag,Ot.intBin,Ot.intOct,Ot.int,Ot.intHex,ys.floatNaN,ys.floatExp,ys.float,qu.binary,Eu.merge,Cu.omap,Lu.pairs,Tu.set,bs.intTime,bs.floatTime,bs.timestamp];Pu.schema=Iu});var Ei=g(function(Ku){var vi=me(),Mu=gt(),Ni=ge(),xu=Me(),$u=es(),ws=ss(),Ss=is(),Bu=Zn(),Du=ti(),ki=ls(),De=lt(),Ai=fs(),Oi=St(),bi=yi(),qi=ps(),qt=gs(),wi=new Map([["core",Bu.schema],["failsafe",[vi.map,Ni.seq,xu.string]],["json",Du.schema],["yaml11",bi.schema],["yaml-1.1",bi.schema]]),Si={binary:ki.binary,bool:$u.boolTag,float:ws.float,floatExp:ws.floatExp,floatNaN:ws.floatNaN,floatTime:qt.floatTime,int:Ss.int,intHex:Ss.intHex,intOct:Ss.intOct,intTime:qt.intTime,map:vi.map,merge:De.merge,null:Mu.nullTag,omap:Ai.omap,pairs:Oi.pairs,seq:Ni.seq,set:qi.set,timestamp:qt.timestamp},Ru={"tag:yaml.org,2002:binary":ki.binary,"tag:yaml.org,2002:merge":De.merge,"tag:yaml.org,2002:omap":Ai.omap,"tag:yaml.org,2002:pairs":Oi.pairs,"tag:yaml.org,2002:set":qi.set,"tag:yaml.org,2002:timestamp":qt.timestamp};function Fu(e,t,s){let n=wi.get(t);if(n&&!e)return s&&!n.includes(De.merge)?n.concat(De.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let r=Array.from(wi.keys()).filter((o)=>o!=="yaml11").map((o)=>JSON.stringify(o)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(let r of e)i=i.concat(r);else if(typeof e==="function")i=e(i.slice());if(s)i=i.concat(De.merge);return i.reduce((r,o)=>{let a=typeof o==="string"?Si[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Si).map((d)=>JSON.stringify(d)).join(", ");throw Error(`Unknown custom tag ${l}; use one of ${c}`)}if(!r.includes(a))r.push(a);return r},[])}Ku.coreKnownTags=Ru;Ku.getTags=Fu});var ks=g(function(Gu){var vs=O(),Yu=me(),Vu=ge(),Ju=Me(),Et=Ei(),Hu=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Ns{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:n,schema:i,sortMapEntries:r,toStringDefaults:o}){this.compat=Array.isArray(e)?Et.getTags(e,"compat"):e?Et.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=n?Et.coreKnownTags:{},this.tags=Et.getTags(t,this.name,s),this.toStringOptions=o??null,Object.defineProperty(this,vs.MAP,{value:Yu.map}),Object.defineProperty(this,vs.SCALAR,{value:Ju.string}),Object.defineProperty(this,vs.SEQ,{value:Vu.seq}),this.sortMapEntries=typeof r==="function"?r:r===!0?Hu:null}clone(){let e=Object.create(Ns.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}Gu.Schema=Ns});var Ci=g(function(zu){var Qu=O(),As=Ie(),Re=Ce();function Xu(e,t){let s=[],n=t.directives===!0;if(t.directives!==!1&&e.directives){let l=e.directives.toString(e);if(l)s.push(l),n=!0;else if(e.directives.docStart)n=!0}if(n)s.push("---");let i=As.createStringifyContext(e,t),{commentString:r}=i.options;if(e.commentBefore){if(s.length!==1)s.unshift("");let l=r(e.commentBefore);s.unshift(Re.indentComment(l,""))}let o=!1,a=null;if(e.contents){if(Qu.isNode(e.contents)){if(e.contents.spaceBefore&&n)s.push("");if(e.contents.commentBefore){let d=r(e.contents.commentBefore);s.push(Re.indentComment(d,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let l=a?void 0:()=>o=!0,c=As.stringify(e.contents,i,()=>a=null,l);if(a)c+=Re.lineComment(c,"",r(a));if((c[0]==="|"||c[0]===">")&&s[s.length-1]==="---")s[s.length-1]=`--- ${c}`;else s.push(c)}else s.push(As.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let l=r(e.comment);if(l.includes(`
|
|
56
|
+
`))s.push("..."),s.push(Re.indentComment(l,""));else s.push(`... ${l}`)}else s.push("...");else{let l=e.comment;if(l&&o)l=l.replace(/^\n+/,"");if(l){if((!o||a)&&s[s.length-1]!=="")s.push("");s.push(Re.indentComment(r(l),""))}}return s.join(`
|
|
57
57
|
`)+`
|
|
58
|
-
`}
|
|
59
|
-
`;
|
|
58
|
+
`}zu.stringifyDocument=Xu});var Fe=g(function(lf){var ef=qe(),be=tt(),M=O(),tf=X(),sf=G(),nf=ks(),rf=Ci(),Os=ze(),of=Yt(),af=Ee(),qs=Ut();class Es{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,M.NODE_TYPE,{value:M.DOC});let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(s===void 0&&t)s=t,t=void 0;let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:r}=i;if(s?._directives){if(this.directives=s._directives.atDocument(),this.directives.yaml.explicit)r=this.directives.yaml.version}else this.directives=new qs.Directives({version:r});this.setSchema(r,s),this.contents=e===void 0?null:this.createNode(e,n,s)}clone(){let e=Object.create(Es.prototype,{[M.NODE_TYPE]:{value:M.DOC}});if(e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives)e.directives=this.directives.clone();if(e.schema=this.schema.clone(),e.contents=M.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range)e.range=this.range.slice();return e}add(e){if(we(this.contents))this.contents.add(e)}addIn(e,t){if(we(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let s=Os.anchorNames(this);e.anchor=!t||s.has(t)?Os.findNewAnchor(t||"a",s):t}return new ef.Alias(e.anchor)}createNode(e,t,s){let n=void 0;if(typeof t==="function")e=t.call({"":e},"",e),n=t;else if(Array.isArray(t)){let h=(w)=>typeof w==="number"||w instanceof String||w instanceof Number,p=t.filter(h).map(String);if(p.length>0)t=t.concat(p);n=t}else if(s===void 0&&t)s=t,t=void 0;let{aliasDuplicateObjects:i,anchorPrefix:r,flow:o,keepUndefined:a,onTagObj:l,tag:c}=s??{},{onAnchor:d,setAnchors:u,sourceObjects:f}=Os.createNodeAnchors(this,r||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:d,onTagObj:l,replacer:n,schema:this.schema,sourceObjects:f},y=af.createNode(e,c,m);if(o&&M.isCollection(y))y.flow=!0;return u(),y}createPair(e,t,s={}){let n=this.createNode(e,null,s),i=this.createNode(t,null,s);return new tf.Pair(n,i)}delete(e){return we(this.contents)?this.contents.delete(e):!1}deleteIn(e){if(be.isEmptyPath(e)){if(this.contents==null)return!1;return this.contents=null,!0}return we(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return M.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){if(be.isEmptyPath(e))return!t&&M.isScalar(this.contents)?this.contents.value:this.contents;return M.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return M.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){if(be.isEmptyPath(e))return this.contents!==void 0;return M.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){if(this.contents==null)this.contents=be.collectionFromPath(this.schema,[e],t);else if(we(this.contents))this.contents.set(e,t)}setIn(e,t){if(be.isEmptyPath(e))this.contents=t;else if(this.contents==null)this.contents=be.collectionFromPath(this.schema,Array.from(e),t);else if(we(this.contents))this.contents.setIn(e,t)}setSchema(e,t={}){if(typeof e==="number")e=String(e);let s;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new qs.Directives({version:"1.1"});s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new qs.Directives({version:e});s={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;s=null;break;default:{let n=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new nf.Schema(Object.assign(s,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:n,onAnchor:i,reviver:r}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof n==="number"?n:100},a=sf.toJS(this.contents,t??"",o);if(typeof i==="function")for(let{count:l,res:c}of o.anchors.values())i(c,l);return typeof r==="function"?of.applyReviver(r,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return rf.stringifyDocument(this,e)}}function we(e){if(M.isCollection(e))return!0;throw Error("Expected a YAML collection as document contents")}lf.Document=Es});var Ke=g(function(ff){class Ct extends Error{constructor(e,t,s,n){super();this.name=e,this.code=s,this.message=n,this.pos=t}}class Li extends Ct{constructor(e,t,s){super("YAMLParseError",e,t,s)}}class Ti extends Ct{constructor(e,t,s){super("YAMLWarning",e,t,s)}}var uf=(e,t)=>(s)=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map((a)=>t.linePos(a));let{line:n,col:i}=s.linePos[0];s.message+=` at line ${n}, column ${i}`;let r=i-1,o=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80)o=o.substring(0,79)+"\u2026";if(n>1&&/^ *$/.test(o.substring(0,r))){let a=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);if(a.length>80)a=a.substring(0,79)+`\u2026
|
|
59
|
+
`;o=a+o}if(/[^ ]/.test(o)){let a=1,l=s.linePos[1];if(l?.line===n&&l.col>i)a=Math.max(1,Math.min(l.col-i,80-r));let c=" ".repeat(r)+"^".repeat(a);s.message+=`:
|
|
60
60
|
|
|
61
|
-
${
|
|
62
|
-
${
|
|
63
|
-
`}};
|
|
64
|
-
`))return!0;if(
|
|
65
|
-
`+
|
|
66
|
-
`+
|
|
67
|
-
`+A.comment;else
|
|
68
|
-
`+
|
|
69
|
-
`+
|
|
70
|
-
`+
|
|
71
|
-
`.repeat(Math.max(1,
|
|
72
|
-
`;for(let
|
|
73
|
-
`;else if(
|
|
74
|
-
`;else if(!
|
|
75
|
-
`)
|
|
61
|
+
${o}
|
|
62
|
+
${c}
|
|
63
|
+
`}};ff.YAMLError=Ct;ff.YAMLParseError=Li;ff.YAMLWarning=Ti;ff.prettifyError=uf});var je=g(function(yf){function gf(e,{flow:t,indicator:s,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,d=a,u="",f="",m=!1,y=!1,h=null,p=null,w=null,S=null,v=null,N=null,k=null;for(let b of e){if(y){if(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma")r(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");y=!1}if(h){if(c&&b.type!=="comment"&&b.type!=="newline")r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation");h=null}switch(b.type){case"space":if(!t&&(s!=="doc-start"||n?.type!=="flow-collection")&&b.source.includes("\t"))h=b;d=!0;break;case"comment":{if(!d)r(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=b.source.substring(1)||" ";if(!u)u=C;else u+=f+C;f="",c=!1;break}case"newline":if(c){if(u)u+=b.source;else if(!N||s!=="seq-item-ind")l=!0}else f+=b.source;if(c=!0,m=!0,p||w)S=b;d=!0;break;case"anchor":if(p)r(b,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(b.source.endsWith(":"))r(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);p=b,k??(k=b.offset),c=!1,d=!1,y=!0;break;case"tag":{if(w)r(b,"MULTIPLE_TAGS","A node can have at most one tag");w=b,k??(k=b.offset),c=!1,d=!1,y=!0;break}case s:if(p||w)r(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`);if(N)r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${t??"collection"}`);N=b,c=s==="seq-item-ind"||s==="explicit-key-ind",d=!1;break;case"comma":if(t){if(v)r(b,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);v=b,c=!1,d=!1;break}default:r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),c=!1,d=!1}}let A=e[e.length-1],q=A?A.offset+A.source.length:i;if(y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!==""))r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(h&&(c&&h.indent<=o||n?.type==="block-map"||n?.type==="block-seq"))r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:v,found:N,spaceBefore:l,comment:u,hasNewline:m,anchor:p,tag:w,newlineAfterProp:S,end:q,start:k??q}}yf.resolveProps=gf});var Lt=g(function(wf){function Cs(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
64
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let s of t.start)if(s.type==="newline")return!0;if(t.sep){for(let s of t.sep)if(s.type==="newline")return!0}if(Cs(t.key)||Cs(t.value))return!0}return!1;default:return!0}}wf.containsNewline=Cs});var Ls=g(function(kf){var vf=Lt();function Nf(e,t,s){if(t?.type==="flow-collection"){let n=t.end[0];if(n.indent===e&&(n.source==="]"||n.source==="}")&&vf.containsNewline(t))s(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}kf.flowIndentCheck=Nf});var Ts=g(function(qf){var Ii=O();function Of(e,t,s){let{uniqueKeys:n}=e.options;if(n===!1)return!1;let i=typeof n==="function"?n:(r,o)=>r===o||Ii.isScalar(r)&&Ii.isScalar(o)&&r.value===o.value;return t.some((r)=>i(r.key,s))}qf.mapIncludes=Of});var $i=g(function(Pf){var Pi=X(),Cf=Z(),_i=je(),Lf=Lt(),Mi=Ls(),Tf=Ts(),xi="All mapping items must start at the same column";function If({composeNode:e,composeEmptyNode:t},s,n,i,r){let a=new(r?.nodeClass??Cf.YAMLMap)(s.schema);if(s.atRoot)s.atRoot=!1;let l=n.offset,c=null;for(let d of n.items){let{start:u,key:f,sep:m,value:y}=d,h=_i.resolveProps(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),p=!h.found;if(p){if(f){if(f.type==="block-seq")i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in f&&f.indent!==n.indent)i(l,"BAD_INDENT",xi)}if(!h.anchor&&!h.tag&&!m){if(c=h.end,h.comment)if(a.comment)a.comment+=`
|
|
65
|
+
`+h.comment;else a.comment=h.comment;continue}if(h.newlineAfterProp||Lf.containsNewline(f))i(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(h.found?.indent!==n.indent)i(l,"BAD_INDENT",xi);s.atKey=!0;let w=h.end,S=f?e(s,f,h,i):t(s,w,u,null,h,i);if(s.schema.compat)Mi.flowIndentCheck(n.indent,f,i);if(s.atKey=!1,Tf.mapIncludes(s,a.items,S))i(w,"DUPLICATE_KEY","Map keys must be unique");let v=_i.resolveProps(m??[],{indicator:"map-value-ind",next:y,offset:S.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=v.end,v.found){if(p){if(y?.type==="block-map"&&!v.hasNewline)i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(s.options.strict&&h.start<v.found.offset-1024)i(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let N=y?e(s,y,v,i):t(s,l,m,null,v,i);if(s.schema.compat)Mi.flowIndentCheck(n.indent,y,i);l=N.range[2];let k=new Pi.Pair(S,N);if(s.options.keepSourceTokens)k.srcToken=d;a.items.push(k)}else{if(p)i(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(v.comment)if(S.comment)S.comment+=`
|
|
66
|
+
`+v.comment;else S.comment=v.comment;let N=new Pi.Pair(S);if(s.options.keepSourceTokens)N.srcToken=d;a.items.push(N)}}if(c&&c<l)i(c,"IMPOSSIBLE","Map comment with trailing content");return a.range=[n.offset,l,c??l],a}Pf.resolveBlockMap=If});var Bi=g(function(Df){var Mf=ee(),xf=je(),$f=Ls();function Bf({composeNode:e,composeEmptyNode:t},s,n,i,r){let a=new(r?.nodeClass??Mf.YAMLSeq)(s.schema);if(s.atRoot)s.atRoot=!1;if(s.atKey)s.atKey=!1;let l=n.offset,c=null;for(let{start:d,value:u}of n.items){let f=xf.resolveProps(d,{indicator:"seq-item-ind",next:u,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)if(u?.type==="block-seq")i(f.end,"BAD_INDENT","All sequence items must start at the same column");else i(l,"MISSING_CHAR","Sequence item without - indicator");else{if(c=f.end,f.comment)a.comment=f.comment;continue}let m=u?e(s,u,f,i):t(s,f.end,d,null,f,i);if(s.schema.compat)$f.flowIndentCheck(n.indent,u,i);l=m.range[2],a.items.push(m)}return a.range=[n.offset,l,c??l],a}Df.resolveBlockSeq=Bf});var Se=g(function(Kf){function Ff(e,t,s,n){let i="";if(e){let r=!1,o="";for(let a of e){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{if(s&&!r)n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=l.substring(1)||" ";if(!i)i=d;else i+=o+d;o="";break}case"newline":if(i)o+=l;r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:i,offset:t}}Kf.resolveEnd=Ff});var Fi=g(function(Qf){var Uf=O(),Yf=X(),Di=Z(),Vf=ee(),Jf=Se(),Ri=je(),Hf=Lt(),Gf=Ts(),Is="Block collections are not allowed within flow collections",Ps=(e)=>e&&(e.type==="block-map"||e.type==="block-seq");function Wf({composeNode:e,composeEmptyNode:t},s,n,i,r){let o=n.start.source==="{",a=o?"flow map":"flow sequence",c=new(r?.nodeClass??(o?Di.YAMLMap:Vf.YAMLSeq))(s.schema);c.flow=!0;let d=s.atRoot;if(d)s.atRoot=!1;if(s.atKey)s.atKey=!1;let u=n.offset+n.start.source.length;for(let p=0;p<n.items.length;++p){let w=n.items[p],{start:S,key:v,sep:N,value:k}=w,A=Ri.resolveProps(S,{flow:a,indicator:"explicit-key-ind",next:v??N?.[0],offset:u,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!N&&!k){if(p===0&&A.comma)i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(p<n.items.length-1)i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`);if(A.comment)if(c.comment)c.comment+=`
|
|
67
|
+
`+A.comment;else c.comment=A.comment;u=A.end;continue}if(!o&&s.options.strict&&Hf.containsNewline(v))i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0){if(A.comma)i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`)}else{if(!A.comma)i(A.start,"MISSING_CHAR",`Missing , between ${a} items`);if(A.comment){let q="";e:for(let b of S)switch(b.type){case"comma":case"space":break;case"comment":q=b.source.substring(1);break e;default:break e}if(q){let b=c.items[c.items.length-1];if(Uf.isPair(b))b=b.value??b.key;if(b.comment)b.comment+=`
|
|
68
|
+
`+q;else b.comment=q;A.comment=A.comment.substring(q.length+1)}}}if(!o&&!N&&!A.found){let q=k?e(s,k,A,i):t(s,A.end,N,null,A,i);if(c.items.push(q),u=q.range[2],Ps(k))i(q.range,"BLOCK_IN_FLOW",Is)}else{s.atKey=!0;let q=A.end,b=v?e(s,v,A,i):t(s,q,S,null,A,i);if(Ps(v))i(b.range,"BLOCK_IN_FLOW",Is);s.atKey=!1;let C=Ri.resolveProps(N??[],{flow:a,indicator:"map-value-ind",next:k,offset:b.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(C.found){if(!o&&!A.found&&s.options.strict){if(N)for(let L of N){if(L===C.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(A.start<C.found.offset-1024)i(C.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(k)if("source"in k&&k.source?.[0]===":")i(k,"MISSING_CHAR",`Missing space after : in ${a}`);else i(C.start,"MISSING_CHAR",`Missing , or : between ${a} items`);let J=k?e(s,k,C,i):C.found?t(s,C.end,N,null,C,i):null;if(J){if(Ps(k))i(J.range,"BLOCK_IN_FLOW",Is)}else if(C.comment)if(b.comment)b.comment+=`
|
|
69
|
+
`+C.comment;else b.comment=C.comment;let ue=new Yf.Pair(b,J);if(s.options.keepSourceTokens)ue.srcToken=w;if(o){let L=c;if(Gf.mapIncludes(s,L.items,b))i(q,"DUPLICATE_KEY","Map keys must be unique");L.items.push(ue)}else{let L=new Di.YAMLMap(s.schema);L.flow=!0,L.items.push(ue);let en=(J??b).range;L.range=[b.range[0],en[1],en[2]],c.items.push(L)}u=J?J.range[2]:C.end}}let f=o?"}":"]",[m,...y]=n.end,h=u;if(m?.source===f)h=m.offset+m.source.length;else{let p=a[0].toUpperCase()+a.substring(1),w=d?`${p} must end with a ${f}`:`${p} in block collection must be sufficiently indented and end with a ${f}`;if(i(u,d?"MISSING_CHAR":"BAD_INDENT",w),m&&m.source.length!==1)y.unshift(m)}if(y.length>0){let p=Jf.resolveEnd(y,h,s.options.strict,i);if(p.comment)if(c.comment)c.comment+=`
|
|
70
|
+
`+p.comment;else c.comment=p.comment;c.range=[n.offset,h,p.offset]}else c.range=[n.offset,h,h];return c}Qf.resolveFlowCollection=Wf});var Ki=g(function(oh){var zf=O(),Zf=E(),eh=Z(),th=ee(),sh=$i(),nh=Bi(),ih=Fi();function _s(e,t,s,n,i,r){let o=s.type==="block-map"?sh.resolveBlockMap(e,t,s,n,r):s.type==="block-seq"?nh.resolveBlockSeq(e,t,s,n,r):ih.resolveFlowCollection(e,t,s,n,r),a=o.constructor;if(i==="!"||i===a.tagName)return o.tag=a.tagName,o;if(i)o.tag=i;return o}function rh(e,t,s,n,i){let r=n.tag,o=!r?null:t.directives.tagName(r.source,(f)=>i(r,"TAG_RESOLVE_FAILED",f));if(s.type==="block-seq"){let{anchor:f,newlineAfterProp:m}=n,y=f&&r?f.offset>r.offset?f:r:f??r;if(y&&(!m||m.offset<y.offset))i(y,"MISSING_CHAR","Missing newline after block sequence props")}let a=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===eh.YAMLMap.tagName&&a==="map"||o===th.YAMLSeq.tagName&&a==="seq")return _s(e,t,s,i,o);let l=t.schema.tags.find((f)=>f.tag===o&&f.collection===a);if(!l){let f=t.schema.knownTags[o];if(f?.collection===a)t.schema.tags.push(Object.assign({},f,{default:!1})),l=f;else{if(f)i(r,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0);else i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0);return _s(e,t,s,i,o)}}let c=_s(e,t,s,i,o,l),d=l.resolve?.(c,(f)=>i(r,"TAG_RESOLVE_FAILED",f),t.options)??c,u=zf.isNode(d)?d:new Zf.Scalar(d);if(u.range=c.range,u.tag=o,l?.format)u.format=l.format;return u}oh.composeCollection=rh});var xs=g(function(fh){var Ms=E();function lh(e,t,s){let n=t.offset,i=ch(t,e.options.strict,s);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=i.mode===">"?Ms.Scalar.BLOCK_FOLDED:Ms.Scalar.BLOCK_LITERAL,o=t.source?uh(t.source):[],a=o.length;for(let h=o.length-1;h>=0;--h){let p=o[h][1];if(p===""||p==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&o.length>0?`
|
|
71
|
+
`.repeat(Math.max(1,o.length-1)):"",p=n+i.length;if(t.source)p+=t.source.length;return{value:h,type:r,comment:i.comment,range:[n,p,p]}}let l=t.indent+i.indent,c=t.offset+i.length,d=0;for(let h=0;h<a;++h){let[p,w]=o[h];if(w===""||w==="\r"){if(i.indent===0&&p.length>l)l=p.length}else{if(p.length<l)s(c+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(i.indent===0)l=p.length;if(d=h,l===0&&!e.atRoot)s(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=p.length+w.length+1}for(let h=o.length-1;h>=a;--h)if(o[h][0].length>l)a=h+1;let u="",f="",m=!1;for(let h=0;h<d;++h)u+=o[h][0].slice(l)+`
|
|
72
|
+
`;for(let h=d;h<a;++h){let[p,w]=o[h];c+=p.length+w.length+1;let S=w[w.length-1]==="\r";if(S)w=w.slice(0,-1);if(w&&p.length<l){let N=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;s(c-w.length-(S?2:1),"BAD_INDENT",N),p=""}if(r===Ms.Scalar.BLOCK_LITERAL)u+=f+p.slice(l)+w,f=`
|
|
73
|
+
`;else if(p.length>l||w[0]==="\t"){if(f===" ")f=`
|
|
74
|
+
`;else if(!m&&f===`
|
|
75
|
+
`)f=`
|
|
76
76
|
|
|
77
|
-
`;
|
|
78
|
-
`,
|
|
79
|
-
`)
|
|
80
|
-
`;else
|
|
81
|
-
`;else
|
|
82
|
-
`+
|
|
83
|
-
`)
|
|
84
|
-
`;break;default:
|
|
85
|
-
`}let
|
|
86
|
-
`,"sy"),
|
|
87
|
-
`,"sy")}catch{
|
|
88
|
-
`)
|
|
89
|
-
`;else
|
|
90
|
-
`)continue;if(
|
|
91
|
-
`){let{fold:
|
|
92
|
-
`){
|
|
93
|
-
`){
|
|
94
|
-
`&&!(
|
|
95
|
-
`))
|
|
96
|
-
`||
|
|
97
|
-
`)break;if(
|
|
98
|
-
`)
|
|
99
|
-
|
|
100
|
-
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
77
|
+
`;u+=f+p.slice(l)+w,f=`
|
|
78
|
+
`,m=!0}else if(w==="")if(f===`
|
|
79
|
+
`)u+=`
|
|
80
|
+
`;else f=`
|
|
81
|
+
`;else u+=f+w,f=" ",m=!1}switch(i.chomp){case"-":break;case"+":for(let h=a;h<o.length;++h)u+=`
|
|
82
|
+
`+o[h][0].slice(l);if(u[u.length-1]!==`
|
|
83
|
+
`)u+=`
|
|
84
|
+
`;break;default:u+=`
|
|
85
|
+
`}let y=n+i.length+t.source.length;return{value:u,type:r,comment:i.comment,range:[n,y,y]}}function ch({offset:e,props:t},s,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],r=i[0],o=0,a="",l=-1;for(let f=1;f<i.length;++f){let m=i[f];if(!a&&(m==="-"||m==="+"))a=m;else{let y=Number(m);if(!o&&y)o=y;else if(l===-1)l=e+f}}if(l!==-1)n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,d="",u=i.length;for(let f=1;f<t.length;++f){let m=t[f];switch(m.type){case"space":c=!0;case"newline":u+=m.source.length;break;case"comment":if(s&&!c)n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");u+=m.source.length,d=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let y=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",y);let h=m.source;if(h&&typeof h==="string")u+=h.length}}}return{mode:r,indent:o,chomp:a,comment:d,length:u}}function uh(e){let t=e.split(/\n( *)/),s=t[0],n=s.match(/^( *)/),r=[n?.[1]?[n[1],s.slice(n[1].length)]:["",s]];for(let o=1;o<t.length;o+=2)r.push([t[o],t[o+1]]);return r}fh.resolveBlockScalar=lh});var Bs=g(function(vh){var $s=E(),dh=Se();function ph(e,t,s){let{offset:n,type:i,source:r,end:o}=e,a,l,c=(f,m,y)=>s(n+f,m,y);switch(i){case"scalar":a=$s.Scalar.PLAIN,l=mh(r,c);break;case"single-quoted-scalar":a=$s.Scalar.QUOTE_SINGLE,l=gh(r,c);break;case"double-quoted-scalar":a=$s.Scalar.QUOTE_DOUBLE,l=yh(r,c);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}let d=n+r.length,u=dh.resolveEnd(o,d,t,s);return{value:l,type:a,comment:u.comment,range:[n,d,u.offset]}}function mh(e,t){let s="";switch(e[0]){case"\t":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${e[0]}`;break}case"@":case"`":{s=`reserved character ${e[0]}`;break}}if(s)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`);return ji(e)}function gh(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return ji(e.slice(1,-1)).replace(/''/g,"'")}function ji(e){let t,s;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
86
|
+
`,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
87
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=t.exec(e);if(!n)return e;let i=n[1],r=" ",o=t.lastIndex;s.lastIndex=o;while(n=s.exec(e)){if(n[1]==="")if(r===`
|
|
88
|
+
`)i+=r;else r=`
|
|
89
|
+
`;else i+=r+n[1],r=" ";o=s.lastIndex}let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(e),i+r+(n?.[1]??"")}function yh(e,t){let s="";for(let n=1;n<e.length-1;++n){let i=e[n];if(i==="\r"&&e[n+1]===`
|
|
90
|
+
`)continue;if(i===`
|
|
91
|
+
`){let{fold:r,offset:o}=bh(e,n);s+=r,n=o}else if(i==="\\"){let r=e[++n],o=wh[r];if(o)s+=o;else if(r===`
|
|
92
|
+
`){r=e[n+1];while(r===" "||r==="\t")r=e[++n+1]}else if(r==="\r"&&e[n+1]===`
|
|
93
|
+
`){r=e[++n+1];while(r===" "||r==="\t")r=e[++n+1]}else if(r==="x"||r==="u"||r==="U"){let a=r==="x"?2:r==="u"?4:8;s+=Sh(e,n+1,a,t),n+=a}else{let a=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),s+=a}}else if(i===" "||i==="\t"){let r=n,o=e[n+1];while(o===" "||o==="\t")o=e[++n+1];if(o!==`
|
|
94
|
+
`&&!(o==="\r"&&e[n+2]===`
|
|
95
|
+
`))s+=n>r?e.slice(r,n+1):i}else s+=i}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return s}function bh(e,t){let s="",n=e[t+1];while(n===" "||n==="\t"||n===`
|
|
96
|
+
`||n==="\r"){if(n==="\r"&&e[t+2]!==`
|
|
97
|
+
`)break;if(n===`
|
|
98
|
+
`)s+=`
|
|
99
|
+
`;t+=1,n=e[t+1]}if(!s)s=" ";return{fold:s,offset:t}}var wh={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
100
|
+
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Sh(e,t,s,n){let i=e.substr(t,s),o=i.length===s&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=e.substr(t-2,s+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}vh.resolveFlowScalar=ph});var Yi=g(function(Ch){var le=O(),Ui=E(),kh=xs(),Ah=Bs();function Oh(e,t,s,n){let{value:i,type:r,comment:o,range:a}=t.type==="block-scalar"?kh.resolveBlockScalar(e,t,n):Ah.resolveFlowScalar(t,e.options.strict,n),l=s?e.directives.tagName(s.source,(u)=>n(s,"TAG_RESOLVE_FAILED",u)):null,c;if(e.options.stringKeys&&e.atKey)c=e.schema[le.SCALAR];else if(l)c=qh(e.schema,i,l,s,n);else if(t.type==="scalar")c=Eh(e,i,t,n);else c=e.schema[le.SCALAR];let d;try{let u=c.resolve(i,(f)=>n(s??t,"TAG_RESOLVE_FAILED",f),e.options);d=le.isScalar(u)?u:new Ui.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);n(s??t,"TAG_RESOLVE_FAILED",f),d=new Ui.Scalar(i)}if(d.range=a,d.source=i,r)d.type=r;if(l)d.tag=l;if(c.format)d.format=c.format;if(o)d.comment=o;return d}function qh(e,t,s,n,i){if(s==="!")return e[le.SCALAR];let r=[];for(let a of e.tags)if(!a.collection&&a.tag===s)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(t))return a;let o=e.knownTags[s];if(o&&!o.collection)return e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o;return i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[le.SCALAR]}function Eh({atKey:e,directives:t,schema:s},n,i,r){let o=s.tags.find((a)=>(a.default===!0||e&&a.default==="key")&&a.test?.test(n))||s[le.SCALAR];if(s.compat){let a=s.compat.find((l)=>l.default&&l.test?.test(n))??s[le.SCALAR];if(o.tag!==a.tag){let l=t.tagString(o.tag),c=t.tagString(a.tag),d=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",d,!0)}}return o}Ch.composeScalar=Oh});var Vi=g(function(Ih){function Th(e,t,s){if(t){s??(s=t.length);for(let n=s-1;n>=0;--n){let i=t[n];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}i=t[++n];while(i?.type==="space")e+=i.source.length,i=t[++n];break}}return e}Ih.emptyScalarPosition=Th});var Gi=g(function(Fh){var _h=qe(),Mh=O(),xh=Ki(),Ji=Yi(),$h=Se(),Bh=Vi(),Dh={composeNode:Hi,composeEmptyNode:Ds};function Hi(e,t,s,n){let i=e.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=s,c,d=!0;switch(t.type){case"alias":if(c=Rh(e,t,n),a||l)n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(c=Ji.composeScalar(e,t,l,n),a)c.anchor=a.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(c=xh.composeCollection(Dh,e,t,s,n),a)c.anchor=a.source.substring(1)}catch(u){let f=u instanceof Error?u.message:String(u);n(t,"RESOURCE_EXHAUSTION",f)}break;default:{let u=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",u),d=!1}}if(c??(c=Ds(e,t.offset,void 0,null,s,n)),a&&c.anchor==="")n(a,"BAD_ALIAS","Anchor cannot be an empty string");if(i&&e.options.stringKeys&&(!Mh.isScalar(c)||typeof c.value!=="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str"))n(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(r)c.spaceBefore=!0;if(o)if(t.type==="scalar"&&t.source==="")c.comment=o;else c.commentBefore=o;if(e.options.keepSourceTokens&&d)c.srcToken=t;return c}function Ds(e,t,s,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let d={type:"scalar",offset:Bh.emptyScalarPosition(t,s,n),indent:-1,source:""},u=Ji.composeScalar(e,d,a,c);if(o){if(u.anchor=o.source.substring(1),u.anchor==="")c(o,"BAD_ALIAS","Anchor cannot be an empty string")}if(i)u.spaceBefore=!0;if(r)u.comment=r,u.range[2]=l;return u}function Rh({options:e},{offset:t,source:s,end:n},i){let r=new _h.Alias(s.substring(1));if(r.source==="")i(t,"BAD_ALIAS","Alias cannot be an empty string");if(r.source.endsWith(":"))i(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=t+s.length,a=$h.resolveEnd(n,o,e.strict,i);if(r.range=[t,o,a.offset],a.comment)r.comment=a.comment;return r}Fh.composeEmptyNode=Ds;Fh.composeNode=Hi});var Qi=g(function(Hh){var Uh=Fe(),Wi=Gi(),Yh=Se(),Vh=je();function Jh(e,t,{offset:s,start:n,value:i,end:r},o){let a=Object.assign({_directives:t},e),l=new Uh.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=Vh.resolveProps(n,{indicator:"doc-start",next:i??r?.[0],offset:s,onError:o,parentIndent:0,startOnNewline:!0});if(d.found){if(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline)o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}l.contents=i?Wi.composeNode(c,i,d,o):Wi.composeEmptyNode(c,d.end,n,null,d,o);let u=l.contents.range[2],f=Yh.resolveEnd(r,u,!1,o);if(f.comment)l.comment=f.comment;return l.range=[s,u,f.offset],l}Hh.composeDoc=Jh});var Rs=g(function(ed){var Wh=He("process"),Qh=Ut(),Xh=Fe(),Ue=Ke(),Xi=O(),zh=Qi(),Zh=Se();function Ye(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:s}=e;return[t,t+(typeof s==="string"?s.length:1)]}function zi(e){let t="",s=!1,n=!1;for(let i=0;i<e.length;++i){let r=e[i];switch(r[0]){case"#":t+=(t===""?"":n?`
|
|
101
101
|
|
|
102
102
|
`:`
|
|
103
|
-
`)+(
|
|
104
|
-
${
|
|
105
|
-
${
|
|
106
|
-
${
|
|
107
|
-
${
|
|
108
|
-
`}];switch(
|
|
109
|
-
`),
|
|
110
|
-
`,
|
|
111
|
-
`});return{type:"block-scalar",offset:
|
|
112
|
-
`),
|
|
113
|
-
`;if(
|
|
114
|
-
`});for(let
|
|
115
|
-
`};delete
|
|
103
|
+
`)+(r.substring(1)||" "),s=!0,n=!1;break;case"%":if(e[i+1]?.[0]!=="#")i+=1;s=!1;break;default:if(!s)n=!0;s=!1}}return{comment:t,afterEmptyLine:n}}class Zi{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,n,i)=>{let r=Ye(t);if(i)this.warnings.push(new Ue.YAMLWarning(r,s,n));else this.errors.push(new Ue.YAMLParseError(r,s,n))},this.directives=new Qh.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:s,afterEmptyLine:n}=zi(this.prelude);if(s){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
104
|
+
${s}`:s;else if(n||e.directives.docStart||!i)e.commentBefore=s;else if(Xi.isCollection(i)&&!i.flow&&i.items.length>0){let r=i.items[0];if(Xi.isPair(r))r=r.key;let o=r.commentBefore;r.commentBefore=o?`${s}
|
|
105
|
+
${o}`:s}else{let r=i.commentBefore;i.commentBefore=r?`${s}
|
|
106
|
+
${r}`:s}}if(t){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:zi(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(let n of e)yield*this.next(n);yield*this.end(t,s)}*next(e){if(Wh.env.LOG_STREAM)console.dir(e,{depth:null});switch(e.type){case"directive":this.directives.add(e.source,(t,s,n)=>{let i=Ye(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",s,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=zh.composeDoc(this.options,this.directives,e,this.onError);if(this.atDirectives&&!t.directives.docStart)this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(t,!1),this.doc)yield this.doc;this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new Ue.YAMLParseError(Ye(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(s);else this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){this.errors.push(new Ue.YAMLParseError(Ye(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=Zh.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
|
|
107
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Ue.YAMLParseError(Ye(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let s=Object.assign({_directives:this.directives},this.options),n=new Xh.Document(void 0,s);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");n.range=[0,t,t],this.decorate(n,!1),yield n}}}ed.Composer=Zi});var sr=g(function(cd){var sd=xs(),nd=Bs(),id=Ke(),er=Te();function rd(e,t=!0,s){if(e){let n=(i,r,o)=>{let a=typeof i==="number"?i:Array.isArray(i)?i[0]:i.offset;if(s)s(a,r,o);else throw new id.YAMLParseError([a,a+1],r,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return nd.resolveFlowScalar(e,t,n);case"block-scalar":return sd.resolveBlockScalar({options:{strict:t}},e,n)}}return null}function od(e,t){let{implicitKey:s=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=t,a=er.stringifyString({type:o,value:e},{implicitKey:s,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
108
|
+
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
109
|
+
`),d=a.substring(0,c),u=a.substring(c+1)+`
|
|
110
|
+
`,f=[{type:"block-scalar-header",offset:r,indent:n,source:d}];if(!tr(f,l))f.push({type:"newline",offset:-1,indent:n,source:`
|
|
111
|
+
`});return{type:"block-scalar",offset:r,indent:n,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:l};default:return{type:"scalar",offset:r,indent:n,source:a,end:l}}}function ad(e,t,s={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=s,a="indent"in e?e.indent:null;if(n&&typeof a==="number")a+=2;if(!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=e.props[0];if(c.type!=="block-scalar-header")throw Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=er.stringifyString({type:o,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":ld(e,l);break;case'"':Fs(e,l,"double-quoted-scalar");break;case"'":Fs(e,l,"single-quoted-scalar");break;default:Fs(e,l,"scalar")}}function ld(e,t){let s=t.indexOf(`
|
|
112
|
+
`),n=t.substring(0,s),i=t.substring(s+1)+`
|
|
113
|
+
`;if(e.type==="block-scalar"){let r=e.props[0];if(r.type!=="block-scalar-header")throw Error("Invalid block scalar header");r.source=n,e.source=i}else{let{offset:r}=e,o="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];if(!tr(a,"end"in e?e.end:void 0))a.push({type:"newline",offset:-1,indent:o,source:`
|
|
114
|
+
`});for(let l of Object.keys(e))if(l!=="type"&&l!=="offset")delete e[l];Object.assign(e,{type:"block-scalar",indent:o,props:a,source:i})}}function tr(e,t){if(t)for(let s of t)switch(s.type){case"space":case"comment":e.push(s);break;case"newline":return e.push(s),!0}return!1}function Fs(e,t,s){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=s,e.source=t;break;case"block-scalar":{let n=e.props.slice(1),i=t.length;if(e.props[0].type==="block-scalar-header")i-=e.props[0].source.length;for(let r of n)r.offset+=i;delete e.props,Object.assign(e,{type:s,source:t,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
115
|
+
`};delete e.items,Object.assign(e,{type:s,source:t,end:[i]});break}default:{let n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter((r)=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(e))if(r!=="type"&&r!=="offset")delete e[r];Object.assign(e,{type:s,indent:n,source:t,end:i})}}}cd.createScalarToken=od;cd.resolveAsScalar=rd;cd.setScalarValue=ad});var nr=g(function(pd){var dd=(e)=>("type"in e)?It(e):Tt(e);function It(e){switch(e.type){case"block-scalar":{let t="";for(let s of e.props)t+=It(s);return t+e.source}case"block-map":case"block-seq":{let t="";for(let s of e.items)t+=Tt(s);return t}case"flow-collection":{let t=e.start.source;for(let s of e.items)t+=Tt(s);for(let s of e.end)t+=s.source;return t}case"document":{let t=Tt(e);if(e.end)for(let s of e.end)t+=s.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let s of e.end)t+=s.source;return t}}}function Tt({start:e,key:t,sep:s,value:n}){let i="";for(let r of e)i+=r.source;if(t)i+=It(t);if(s)for(let r of s)i+=r.source;if(n)i+=It(n);return i}pd.stringify=dd});var or=g(function(yd){var Ks=Symbol("break visit"),gd=Symbol("skip children"),ir=Symbol("remove item");function ce(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};rr(Object.freeze([]),e,t)}ce.BREAK=Ks;ce.SKIP=gd;ce.REMOVE=ir;ce.itemAtPath=(e,t)=>{let s=e;for(let[n,i]of t){let r=s?.[n];if(r&&"items"in r)s=r.items[i];else return}return s};ce.parentCollection=(e,t)=>{let s=ce.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=s?.[n];if(i&&"items"in i)return i;throw Error("Parent collection not found")};function rr(e,t,s){let n=s(t,e);if(typeof n==="symbol")return n;for(let i of["key","value"]){let r=t[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=rr(Object.freeze(e.concat([[i,o]])),r.items[o],s);if(typeof a==="number")o=a-1;else if(a===Ks)return Ks;else if(a===ir)r.items.splice(o,1),o-=1}if(typeof n==="function"&&i==="key")n=n(t,e)}}return typeof n==="function"?n(t,e):n}yd.visit=ce});var Pt=g(function(Od){var js=sr(),wd=nr(),Sd=or(),Us="\uFEFF",Ys="\x02",Vs="\x18",Js="\x1F",vd=(e)=>!!e&&("items"in e),Nd=(e)=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function kd(e){switch(e){case Us:return"<BOM>";case Ys:return"<DOC>";case Vs:return"<FLOW_END>";case Js:return"<SCALAR>";default:return JSON.stringify(e)}}function Ad(e){switch(e){case Us:return"byte-order-mark";case Ys:return"doc-mode";case Vs:return"flow-error-end";case Js:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
116
116
|
`:case`\r
|
|
117
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(
|
|
118
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
119
|
-
\r `),
|
|
120
|
-
`)return!0;if(
|
|
121
|
-
`;return!1}charAt(
|
|
122
|
-
`||!
|
|
123
|
-
`||
|
|
124
|
-
`,this.pos),this.lineEndPos=
|
|
125
|
-
`,this.pos);if(
|
|
126
|
-
`,
|
|
127
|
-
`:
|
|
128
|
-
`)break}default:break
|
|
129
|
-
`,
|
|
130
|
-
`)
|
|
131
|
-
`&&
|
|
132
|
-
`)
|
|
133
|
-
`,
|
|
134
|
-
`){let
|
|
135
|
-
`)return yield*this.pushCount(1);else if(
|
|
136
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces(
|
|
137
|
-
`)+1;while(
|
|
138
|
-
|
|
139
|
-
`)+1;while(
|
|
140
|
-
|
|
117
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Od.createScalarToken=js.createScalarToken;Od.resolveAsScalar=js.resolveAsScalar;Od.setScalarValue=js.setScalarValue;Od.stringify=wd.stringify;Od.visit=Sd.visit;Od.BOM=Us;Od.DOCUMENT=Ys;Od.FLOW_END=Vs;Od.SCALAR=Js;Od.isCollection=vd;Od.isScalar=Nd;Od.prettyToken=kd;Od.tokenType=Ad});var Gs=g(function(Kd){var Ve=Pt();function R(e){switch(e){case void 0:case" ":case`
|
|
118
|
+
`:case"\r":case"\t":return!0;default:return!1}}var ar=new Set("0123456789ABCDEFabcdef"),Rd=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),_t=new Set(",[]{}"),Fd=new Set(` ,[]{}
|
|
119
|
+
\r `),Hs=(e)=>!e||Fd.has(e);class lr{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let s=this.next??"stream";while(s&&(t||this.hasChars(1)))s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t===`
|
|
120
|
+
`)return!0;if(t==="\r")return this.buffer[e+1]===`
|
|
121
|
+
`;return!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;while(t===" ")t=this.buffer[++s+e];if(t==="\r"){let n=this.buffer[s+e+1];if(n===`
|
|
122
|
+
`||!n&&!this.atEnd)return e+s+1}return t===`
|
|
123
|
+
`||s>=this.indentNext||!t&&!this.atEnd?e+s:-1}if(t==="-"||t==="."){let s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&R(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;if(typeof e!=="number"||e!==-1&&e<this.pos)e=this.buffer.indexOf(`
|
|
124
|
+
`,this.pos),this.lineEndPos=e;if(e===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[e-1]==="\r")e-=1;return this.buffer.substring(this.pos,e)}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Ve.BOM)yield*this.pushCount(1),e=e.substring(1);if(e[0]==="%"){let t=e.length,s=e.indexOf("#");while(s!==-1){let i=e[s-1];if(i===" "||i==="\t"){t=s-1;break}else s=e.indexOf("#",s+1)}while(!0){let i=e[t-1];if(i===" "||i==="\t")t-=1;else break}let n=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Ve.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&R(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!R(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&R(t)){let s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Hs),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,s=-1;do{if(e=yield*this.pushNewline(),e>0)t=yield*this.pushSpaces(!1),this.indentValue=s=t;else t=0;t+=yield*this.pushSpaces(!0)}while(e+t>0);let n=this.getLine();if(n===null)return this.setNext("flow");if(s!==-1&&s<this.indentNext&&n[0]!=="#"||s===0&&(n.startsWith("---")||n.startsWith("..."))&&R(n[3])){if(!(s===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield Ve.FLOW_END,yield*this.parseLineStart()}let i=0;while(n[i]===",")i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),n[i]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Hs),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let r=this.charAt(1);if(this.flowKey||R(r)||r===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")while(t!==-1&&this.buffer[t+1]==="'")t=this.buffer.indexOf("'",t+2);else while(t!==-1){let i=0;while(this.buffer[t-1-i]==="\\")i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}let s=this.buffer.substring(0,t),n=s.indexOf(`
|
|
125
|
+
`,this.pos);if(n!==-1){while(n!==-1){let i=this.continueScalar(n+1);if(i===-1)break;n=s.indexOf(`
|
|
126
|
+
`,i)}if(n!==-1)t=n-(s[n-1]==="\r"?2:1)}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;while(!0){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil((t)=>R(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,s;e:for(let i=this.pos;s=this.buffer[i];++i)switch(s){case" ":t+=1;break;case`
|
|
127
|
+
`:e=i,t=0;break;case"\r":{let r=this.buffer[i+1];if(!r&&!this.atEnd)return this.setNext("block-scalar");if(r===`
|
|
128
|
+
`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=t;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
129
|
+
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;s=this.buffer[n];while(s===" ")s=this.buffer[++n];if(s==="\t"){while(s==="\t"||s===" "||s==="\r"||s===`
|
|
130
|
+
`)s=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let i=e-1,r=this.buffer[i];if(r==="\r")r=this.buffer[--i];let o=i;while(r===" ")r=this.buffer[--i];if(r===`
|
|
131
|
+
`&&i>=this.pos&&i+1+t>o)e=i;else break}while(!0);return yield Ve.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,s=this.pos-1,n;while(n=this.buffer[++s])if(n===":"){let i=this.buffer[s+1];if(R(i)||e&&_t.has(i))break;t=s}else if(R(n)){let i=this.buffer[s+1];if(n==="\r")if(i===`
|
|
132
|
+
`)s+=1,n=`
|
|
133
|
+
`,i=this.buffer[s+1];else t=s;if(i==="#"||e&&_t.has(i))break;if(n===`
|
|
134
|
+
`){let r=this.continueScalar(s+1);if(r===-1)break;s=Math.max(s,r-2)}}else{if(e&&_t.has(n))break;t=s}if(!n&&!this.atEnd)return this.setNext("plain-scalar");return yield Ve.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc"}*pushCount(e){if(e>0)return yield this.buffer.substr(this.pos,e),this.pos+=e,e;return 0}*pushToIndex(e,t){let s=this.buffer.slice(this.pos,e);if(s)return yield s,this.pos+=s.length,s.length;else if(t)yield"";return 0}*pushIndicators(){let e=0;e:while(!0){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Hs),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,s=this.charAt(1);if(R(s)||t&&_t.has(s)){if(!t)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];while(!R(t)&&t!==">")t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];while(t)if(Rd.has(t))t=this.buffer[++e];else if(t==="%"&&ar.has(this.buffer[e+1])&&ar.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];if(e===`
|
|
135
|
+
`)return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)===`
|
|
136
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s==="\t");let n=t-this.pos;if(n>0)yield this.buffer.substr(this.pos,n),this.pos=t;return n}*pushUntil(e){let t=this.pos,s=this.buffer[t];while(!e(s))s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}Kd.Lexer=lr});var Ws=g(function(Ud){class cr{constructor(){this.lineStarts=[],this.addNewLine=(e)=>this.lineStarts.push(e),this.linePos=(e)=>{let t=0,s=this.lineStarts.length;while(t<s){let i=t+s>>1;if(this.lineStarts[i]<e)t=i+1;else s=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}Ud.LineCounter=cr});var Qs=g(function(Hd){var Vd=He("process"),ur=Pt(),Jd=Gs();function te(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function fr(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function dr(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Mt(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function ve(e){if(e.length===0)return[];let t=e.length;e:while(--t>=0)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}while(e[++t]?.type==="space");return e.splice(t,e.length)}function xt(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let s=0;s<t.length;++s)e.push(t[s])}function hr(e){if(e.start.type==="flow-seq-start"){for(let t of e.items)if(t.sep&&!t.value&&!te(t.start,"explicit-key-ind")&&!te(t.sep,"map-value-ind")){if(t.key)t.value=t.key;if(delete t.key,dr(t.value))if(t.value.end)xt(t.value.end,t.sep);else t.value.end=t.sep;else xt(t.start,t.sep);delete t.sep}}}class pr{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Jd.Lexer,this.onNewLine=e}*parse(e,t=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let s of this.lexer.lex(e,t))yield*this.next(s);if(!t)yield*this.end()}*next(e){if(this.source=e,Vd.env.LOG_TOKENS)console.log("|",ur.prettyToken(e));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=ur.tokenType(e);if(!t){let s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}else if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+e.length);break;case"space":if(this.atNewLine&&e[0]===" ")this.indent+=e.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=e.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.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 e=this.peek(1);if(this.type==="doc-end"&&e?.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(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let s=this.peek(1);if(t.type==="block-scalar")t.indent="indent"in s?s.indent:0;else if(t.type==="flow-collection"&&s.type==="document")t.indent=0;if(t.type==="flow-collection")hr(t);switch(s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{let n=s.items[s.items.length-1];if(n.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=s.items[s.items.length-1];if(n.value)s.items.push({start:[],value:t});else n.value=t;break}case"flow-collection":{let n=s.items[s.items.length-1];if(!n||n.value)s.items.push({start:[],key:t,sep:[]});else if(n.sep)n.value=t;else Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let n=t.items[t.items.length-1];if(n&&!n.sep&&!n.value&&n.start.length>0&&fr(n.start)===-1&&(t.indent===0||n.start.every((i)=>i.type!=="comment"||i.indent<t.indent))){if(s.type==="document")s.end=n.start;else s.items.push({start:n.start});t.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 e={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")e.start.push(this.sourceToken);this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{if(fr(e.start)!==-1)yield*this.pop(),yield*this.step();else e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);if(t)this.stack.push(t);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=Mt(this.peek(2)),s=ve(t),n;if(e.end)n=e.end,n.push(this.sourceToken),delete e.end;else n=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
137
|
+
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
138
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let s="end"in t.value?t.value.end:void 0;if((Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment")s?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){xt(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,n=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(n&&t.sep&&!t.value){let r=[];for(let o=0;o<t.sep.length;++o){let a=t.sep[o];switch(a.type){case"newline":r.push(o);break;case"space":break;case"comment":if(a.indent>e.indent)r.length=0;break;default:r.length=0}}if(r.length>=2)i=t.sep.splice(r[1])}switch(this.type){case"anchor":case"tag":if(n||t.value)i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0;else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"explicit-key-ind":if(!t.sep&&!t.explicitKey)t.start.push(this.sourceToken),t.explicitKey=!0;else if(n||t.value)i.push(this.sourceToken),e.items.push({start:i,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(t.explicitKey)if(!t.sep)if(te(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let r=ve(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(te(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(dr(t.key)&&!te(t.sep,"newline")){let r=ve(t.start),{key:o,sep:a}=t;a.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:o,sep:a}]})}else if(i.length>0)t.sep=t.sep.concat(i,this.sourceToken);else t.sep.push(this.sourceToken);else if(!t.sep)Object.assign(t,{key:null,sep:[this.sourceToken]});else if(t.value||n)e.items.push({start:i,key:null,sep:[this.sourceToken]});else if(te(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else t.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);if(n||t.value)e.items.push({start:i,key:r,sep:[]}),this.onKeyLine=!0;else if(t.sep)this.stack.push(r);else Object.assign(t,{key:r,sep:[]}),this.onKeyLine=!0;return}default:{let r=this.startBlockValue(e);if(r){if(r.type==="block-seq"){if(!t.explicitKey&&t.sep&&!te(t.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(s)e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let s="end"in t.value?t.value.end:void 0;if((Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment")s?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){xt(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;if(t.value||te(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){let s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!t||t.sep)e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return;case"map-value-ind":if(!t||t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!t||t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:n,sep:[]});else if(t.sep)this.stack.push(n);else Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);if(s)this.stack.push(s);else yield*this.pop(),yield*this.step()}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let n=Mt(s),i=ve(n);hr(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
139
|
+
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
140
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){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 t=Mt(e),s=ve(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Mt(e),s=ve(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((s)=>s.type==="newline"||s.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){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(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}Hd.Parser=pr});var wr=g(function(sp){var mr=Rs(),Wd=Fe(),Je=Ke(),Qd=Wt(),Xd=O(),zd=Ws(),gr=Qs();function yr(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new zd.LineCounter||null,prettyErrors:t}}function Zd(e,t={}){let{lineCounter:s,prettyErrors:n}=yr(t),i=new gr.Parser(s?.addNewLine),r=new mr.Composer(t),o=Array.from(r.compose(i.parse(e)));if(n&&s)for(let a of o)a.errors.forEach(Je.prettifyError(e,s)),a.warnings.forEach(Je.prettifyError(e,s));if(o.length>0)return o;return Object.assign([],{empty:!0},r.streamInfo())}function br(e,t={}){let{lineCounter:s,prettyErrors:n}=yr(t),i=new gr.Parser(s?.addNewLine),r=new mr.Composer(t),o=null;for(let a of r.compose(i.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Je.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(n&&s)o.errors.forEach(Je.prettifyError(e,s)),o.warnings.forEach(Je.prettifyError(e,s));return o}function ep(e,t,s){let n=void 0;if(typeof t==="function")n=t;else if(s===void 0&&t&&typeof t==="object")s=t;let i=br(e,s);if(!i)return null;if(i.warnings.forEach((r)=>Qd.warn(i.options.logLevel,r)),i.errors.length>0)if(i.options.logLevel!=="silent")throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:n},s))}function tp(e,t,s){let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(s===void 0&&t)s=t;if(typeof s==="string")s=s.length;if(typeof s==="number"){let i=Math.round(s);s=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=s??t??{};if(!i)return}if(Xd.isDocument(e)&&!n)return e.toString(s);return new Wd.Document(e,n,s).toString(s)}sp.parse=ep;sp.parseAllDocuments=Zd;sp.parseDocument=br;sp.stringify=tp});var vr=g(function(wp){var ap=Rs(),lp=Fe(),cp=ks(),Xs=Ke(),up=qe(),se=O(),fp=X(),hp=E(),dp=Z(),pp=ee(),mp=Pt(),gp=Gs(),yp=Ws(),bp=Qs(),$t=wr(),Sr=Ae();wp.Composer=ap.Composer;wp.Document=lp.Document;wp.Schema=cp.Schema;wp.YAMLError=Xs.YAMLError;wp.YAMLParseError=Xs.YAMLParseError;wp.YAMLWarning=Xs.YAMLWarning;wp.Alias=up.Alias;wp.isAlias=se.isAlias;wp.isCollection=se.isCollection;wp.isDocument=se.isDocument;wp.isMap=se.isMap;wp.isNode=se.isNode;wp.isPair=se.isPair;wp.isScalar=se.isScalar;wp.isSeq=se.isSeq;wp.Pair=fp.Pair;wp.Scalar=hp.Scalar;wp.YAMLMap=dp.YAMLMap;wp.YAMLSeq=pp.YAMLSeq;wp.CST=mp;wp.Lexer=gp.Lexer;wp.LineCounter=yp.LineCounter;wp.Parser=bp.Parser;wp.parse=$t.parse;wp.parseAllDocuments=$t.parseAllDocuments;wp.parseDocument=$t.parseDocument;wp.stringify=$t.stringify;wp.visit=Sr.visit;wp.visitAsync=Sr.visitAsync});import Zs from"path";import K from"path";var Ne={},ke=Bt(),{isBunRuntime:x,isCloudflareRuntime:nn,isNodeRuntime:Tr,hasFileSystemAccess:B,console:Ir}=ke,rn=Ne;Dt();function F(e,t){let s=typeof process<"u"?process.env:void 0,n=s?s[e]:void 0,i=x?Bun?.env?.[e]:void 0,r=rn[e],o=typeof r==="string"?r:void 0,a=nn?o??n??i:n??i??o;return a===void 0||a===""?t:a}function tm(e,t){if(typeof process<"u")process.env[e]=t;rn[e]=t}function sm(e){globalThis.__hapiRuntimeOverride="cloudflare",on(),Object.assign(Ne,e)}function nm(){delete globalThis.__hapiRuntimeOverride,on()}async function im(e){if(!x)throw Error(`File system access not available in this runtime: ${e}`);return await Bun.file(e).text()}async function rm(e){if(!x)throw Error(`File system access not available in this runtime: ${e}`);return await Bun.file(e).json()}async function om(e){return x?await Bun.file(e).exists():!1}function am(e){if(!x)throw Error(`File system access not available in this runtime: ${e}`);return Bun.file(e)}function on(){let e=Bt();ln(e),Dt()}function lm(){if(B)return;if(an()!==void 0)return;let e=Bt();ln(e),Dt()}function Bt(){let e=an(),t=Pr(e),s=t?!1:_r(e),n=Mr(e,s);return{isBunRuntime:t,isCloudflareRuntime:s,isNodeRuntime:n,hasFileSystemAccess:!s&&(t||n),console:xr()}}function Pr(e){if(e==="bun")return!0;if(e==="cloudflare"||e==="node")return!1;return typeof Bun<"u"}function _r(e){if(e==="cloudflare")return!0;if(e==="bun"||e==="node")return!1;let t=typeof globalThis<"u"?globalThis:void 0,s=t?.navigator?.userAgent??"",n=typeof s==="string"&&s.includes("Cloudflare-Workers"),i=typeof t?.__ENVIRONMENT__==="string"&&t.__ENVIRONMENT__.toLowerCase()==="workerd",r=typeof t?.caches?.default<"u";return n||i||r}function Mr(e,t){if(e==="node")return!0;if(e==="bun"||e==="cloudflare")return!1;if(t)return!1;let s=typeof process<"u"?process.versions?.node:void 0;return typeof s==="string"&&s.length>0}function an(){return typeof globalThis<"u"?globalThis.__hapiRuntimeOverride:void 0}function xr(){let e=()=>{},t=typeof console<"u"?console:void 0;if(!t)return{log:e,info:e,warn:e,error:e,debug:e};let s=(i,r)=>typeof i==="function"?i.bind(t):r,n=s(t.log,e);return{log:n,info:s(t.info,n),warn:s(t.warn,n),error:s(t.error,n),debug:s(t.debug,n)}}function ln(e){x=e.isBunRuntime,nn=e.isCloudflareRuntime,Tr=e.isNodeRuntime,B=e.hasFileSystemAccess,Ir=e.console}function Dt(){let e=$r();for(let t of Object.keys(Ne))delete Ne[t];Object.assign(Ne,e)}function $r(){if(x)return{...typeof Bun<"u"?Bun.env:{},...typeof process<"u"?process.env:{}};return(typeof process<"u"?process:void 0)?.env??{}}var H=B?cn():un(),{home:Br,specs:Dr,config:Rr,src:Fr,logs:Kr,certs:jr,plugins:Ur}=H;function hm(){return{...H}}function Ft(){return B?cn():un()}function cn(){let e=F("HAPI_HOME"),t=e&&e.trim().length>0?Vr(e):Yr();return fn(t)}function un(){return fn("/hapi")}function fn(e){return{home:e,specs:K.join(e,"specs"),config:K.join(e,"config"),src:K.join(e,"src"),logs:K.join(e,"logs"),certs:K.join(e,"certs"),plugins:K.join(e,"plugins")}}function Yr(){return K.join(Rt(),".hapi")}function Vr(e){let t=e.trim(),s=t==="~"?Rt():t.replace(/^~(?=[\\/])/,Rt());return K.resolve(s)}function Rt(){let e=x?globalThis.Bun?.env??{}:{},t=e.HOME??e.USERPROFILE??F("HOME")??F("USERPROFILE")??Jr(F("HOMEDRIVE"),F("HOMEPATH"));return t?K.resolve(t):K.resolve(".")}function Jr(e,t){if(!e||!t)return;return`${e}${t}`}async function Hr(e){if(!B)return;try{let t=await import("fs/promises");await t.mkdir(e,{recursive:!0})}catch{}}async function dm(){if(!B)return;await Promise.all([Br,Dr,Rr,Fr,Kr,jr,Ur].map(Hr))}var Wp=["config","hapi.config"],Qp=[".json",".yaml",".yml"],Nr={},P=null;async function $g(e={}){if(P&&!e.force)return P;if(!B)return P=Nr.global??{},zs(P),P;let t=await zp(Ft().config);if(!t)return P={},zs(P),P;return P=await Xp(t)??{},zs(P),P}async function Bg(e){if(P={...e},!B){Nr.global=P;return}let t=await import("fs/promises"),s=Ft().config;await t.mkdir(s,{recursive:!0});let n=Zs.join(s,"config.json");await t.writeFile(n,JSON.stringify(e,null,2),"utf8")}async function Xp(e){if(!B)return null;let t=Zs.extname(e).toLowerCase();try{let s=await Zp(e);if(!s)return null;if(t===".json")return JSON.parse(s);if(t===".yaml"||t===".yml"){let n=await Promise.resolve().then(() => Lr(vr(),1));return n.parse(s)}return s}catch{return null}}async function zp(e){let t=await import("fs/promises");for(let s of Wp)for(let n of Qp){let i=Zs.join(e,`${s}${n}`);try{return await t.access(i),i}catch{}}return null}async function Zp(e){if(x&&typeof globalThis.Bun<"u")try{return await globalThis.Bun.file(e).text()}catch{return null}try{let t=await import("fs/promises");return await t.readFile(e,"utf8")}catch{return null}}function zs(e){let t=F("HAPI_INFRA_PROVIDER");if(t)e.infraProvider=t;let s=F("HAPI_ANALYTICS_OPTOUT");if(s==="true"||s==="1")e.analyticsOptout=!0;let n=F("HAPI_PLUGINS");if(n)e.plugins=n.split(",").map((i)=>i.trim()).filter(Boolean)}function Dg(){P=null}export{Dg as clearConfigCache,$g as loadGlobalConfig,Xp as readConfigFile,Bg as saveGlobalConfig};
|