@hallohuman/hightea 0.1.31 → 0.1.33
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/dist/bin.js +26 -20
- package/dist/chunk-3emak1d3.js +2 -0
- package/dist/chunk-3w7svm2r.js +2 -0
- package/dist/chunk-4gpw7vjp.js +139 -0
- package/dist/{chunk-5s85pw9m.js → chunk-88mhcx5q.js} +1 -1
- package/dist/chunk-9fxpgay8.js +9 -0
- package/dist/chunk-a1vwy98c.js +1 -0
- package/dist/chunk-axj8ef03.js +1 -0
- package/dist/chunk-dw3tmpqv.js +1 -0
- package/dist/chunk-e9s05rg6.js +4 -0
- package/dist/chunk-evg5apz3.js +2 -0
- package/dist/chunk-jaf9mk6s.js +2 -0
- package/dist/{chunk-r9yjtfhp.js → chunk-kjkww5cr.js} +4 -4
- package/dist/chunk-kq5y08g7.js +5 -0
- package/dist/chunk-ntj1fcak.js +1 -0
- package/dist/chunk-p1142ccr.js +1 -0
- package/dist/chunk-q669464j.js +13 -0
- package/dist/chunk-tay0pyz4.js +58 -0
- package/dist/chunk-vzkbknwq.js +5 -0
- package/dist/chunk-ym5anbc7.js +5 -0
- package/dist/plugin/plugin.json +4 -1
- package/dist/plugin/plugin.mjs +36 -36
- package/package.json +1 -1
- package/dist/chunk-19pwmgzg.js +0 -5
- package/dist/chunk-5zb06f9b.js +0 -2
- package/dist/chunk-69dva4cx.js +0 -58
- package/dist/chunk-8rbp82rh.js +0 -139
- package/dist/chunk-8x5daqht.js +0 -1
- package/dist/chunk-9pv1nvfv.js +0 -5
- package/dist/chunk-db8mr7mp.js +0 -1
- package/dist/chunk-dkzzzkex.js +0 -13
- package/dist/chunk-f04t1q6v.js +0 -2
- package/dist/chunk-gcqhggbh.js +0 -1
- package/dist/chunk-jdzvh3gk.js +0 -1
- package/dist/chunk-p616vcdm.js +0 -4
- package/dist/chunk-xj3c5jgm.js +0 -5
- package/dist/chunk-xy8j3npr.js +0 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import{c}from"./chunk-jaf9mk6s.js";import"./chunk-kjkww5cr.js";import{t,e}from"./chunk-vzkbknwq.js";import{y,k,b,T}from"./chunk-evg5apz3.js";import{createRequire as ur}from"node:module";var v=(s,n)=>()=>(n||s((n={exports:{}}).exports,n),n.exports);var We=ur(import.meta.url);var I=v(function(wr){var Mt=Symbol.for("yaml.alias"),Qs=Symbol.for("yaml.document"),Qe=Symbol.for("yaml.map"),Hs=Symbol.for("yaml.pair"),xt=Symbol.for("yaml.scalar"),He=Symbol.for("yaml.seq"),V=Symbol.for("yaml.node.type"),hr=(s)=>!!s&&typeof s==="object"&&s[V]===Mt,dr=(s)=>!!s&&typeof s==="object"&&s[V]===Qs,pr=(s)=>!!s&&typeof s==="object"&&s[V]===Qe,mr=(s)=>!!s&&typeof s==="object"&&s[V]===Hs,Gs=(s)=>!!s&&typeof s==="object"&&s[V]===xt,yr=(s)=>!!s&&typeof s==="object"&&s[V]===He;function Xs(s){if(s&&typeof s==="object")switch(s[V]){case Qe:case He:return!0}return!1}function gr(s){if(s&&typeof s==="object")switch(s[V]){case Mt:case Qe:case xt:case He:return!0}return!1}var br=(s)=>(Gs(s)||Xs(s))&&!!s.anchor;wr.ALIAS=Mt;wr.DOC=Qs;wr.MAP=Qe;wr.NODE_TYPE=V;wr.PAIR=Hs;wr.SCALAR=xt;wr.SEQ=He;wr.hasAnchor=br;wr.isAlias=hr;wr.isCollection=Xs;wr.isDocument=dr;wr.isMap=pr;wr.isNode=gr;wr.isPair=mr;wr.isScalar=Gs;wr.isSeq=yr});var Ne=v(function(xr){var B=I(),j=Symbol("break visit"),zs=Symbol("skip children"),Y=Symbol("remove node");function Ge(s,n){let i=Zs(n);if(B.isDocument(s)){if(he(null,s.contents,i,Object.freeze([s]))===Y)s.contents=null}else he(null,s,i,Object.freeze([]))}Ge.BREAK=j;Ge.SKIP=zs;Ge.REMOVE=Y;function he(s,n,i,r){let o=en(s,n,i,r);if(B.isNode(o)||B.isPair(o))return tn(s,r,o),he(s,o,i,r);if(typeof o!=="symbol"){if(B.isCollection(n)){r=Object.freeze(r.concat(n));for(let a=0;a<n.items.length;++a){let l=he(a,n.items[a],i,r);if(typeof l==="number")a=l-1;else if(l===j)return j;else if(l===Y)n.items.splice(a,1),a-=1}}else if(B.isPair(n)){r=Object.freeze(r.concat(n));let a=he("key",n.key,i,r);if(a===j)return j;else if(a===Y)n.key=null;let l=he("value",n.value,i,r);if(l===j)return j;else if(l===Y)n.value=null}}return o}async function Xe(s,n){let i=Zs(n);if(B.isDocument(s)){if(await de(null,s.contents,i,Object.freeze([s]))===Y)s.contents=null}else await de(null,s,i,Object.freeze([]))}Xe.BREAK=j;Xe.SKIP=zs;Xe.REMOVE=Y;async function de(s,n,i,r){let o=await en(s,n,i,r);if(B.isNode(o)||B.isPair(o))return tn(s,r,o),de(s,o,i,r);if(typeof o!=="symbol"){if(B.isCollection(n)){r=Object.freeze(r.concat(n));for(let a=0;a<n.items.length;++a){let l=await de(a,n.items[a],i,r);if(typeof l==="number")a=l-1;else if(l===j)return j;else if(l===Y)n.items.splice(a,1),a-=1}}else if(B.isPair(n)){r=Object.freeze(r.concat(n));let a=await de("key",n.key,i,r);if(a===j)return j;else if(a===Y)n.key=null;let l=await de("value",n.value,i,r);if(l===j)return j;else if(l===Y)n.value=null}}return o}function Zs(s){if(typeof s==="object"&&(s.Collection||s.Node||s.Value))return Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s);return s}function en(s,n,i,r){if(typeof i==="function")return i(s,n,r);if(B.isMap(n))return i.Map?.(s,n,r);if(B.isSeq(n))return i.Seq?.(s,n,r);if(B.isPair(n))return i.Pair?.(s,n,r);if(B.isScalar(n))return i.Scalar?.(s,n,r);if(B.isAlias(n))return i.Alias?.(s,n,r);return}function tn(s,n,i){let r=n[n.length-1];if(B.isCollection(r))r.items[s]=i;else if(B.isPair(r))if(s==="key")r.key=i;else r.value=i;else if(B.isDocument(r))r.contents=i;else{let o=B.isAlias(r)?"alias":"scalar";throw Error(`Cannot replace node with ${o} parent`)}}xr.visit=Ge;xr.visitAsync=Xe});var Dt=v(function(Fr){var sn=I(),jr=Ne(),Kr={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Rr=(s)=>s.replace(/[!,[\]{}]/g,(n)=>Kr[n]);class K{constructor(s,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},K.defaultYaml,s),this.tags=Object.assign({},K.defaultTags,n)}clone(){let s=new K(this.yaml,this.tags);return s.docStart=this.docStart,s}atDocument(){let s=new K(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:K.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},K.defaultTags);break}return s}add(s,n){if(this.atNextDocument)this.yaml={explicit:K.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},K.defaultTags),this.atNextDocument=!1;let i=s.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2){if(n(0,"%TAG directive should contain exactly two parts"),i.length<2)return!1}let[o,a]=i;return this.tags[o]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;else{let a=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,a),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(s,n){if(s==="!")return"!";if(s[0]!=="!")return n(`Not a valid tag: ${s}`),null;if(s[1]==="<"){let a=s.slice(2,-1);if(a==="!"||a==="!!")return n(`Verbatim tags aren't resolved, so ${s} is invalid.`),null;if(s[s.length-1]!==">")n("Verbatim tags must end with a >");return a}let[,i,r]=s.match(/^(.*!)([^!]*)$/s);if(!r)n(`The ${s} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(r)}catch(a){return n(String(a)),null}if(i==="!")return s;return n(`Could not resolve tag: ${s}`),null}tagString(s){for(let[n,i]of Object.entries(this.tags))if(s.startsWith(i))return n+Rr(s.substring(i.length));return s[0]==="!"?s:`!<${s}>`}toString(s){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(s&&i.length>0&&sn.isNode(s.contents)){let o={};jr.visit(s.contents,(a,l)=>{if(sn.isNode(l)&&l.tag)o[l.tag]=!0}),r=Object.keys(o)}else r=[];for(let[o,a]of i){if(o==="!!"&&a==="tag:yaml.org,2002:")continue;if(!s||r.some((l)=>l.startsWith(a)))n.push(`%TAG ${o} ${a}`)}return n.join(`
|
|
2
|
+
`)}}K.defaultYaml={explicit:!1,version:"1.2"};K.defaultTags={"!!":"tag:yaml.org,2002:"};Fr.Directives=K});var ze=v(function(Wr){var nn=I(),Yr=Ne();function Jr(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw Error(i)}return!0}function rn(s){let n=new Set;return Yr.visit(s,{Value(i,r){if(r.anchor)n.add(r.anchor)}}),n}function on(s,n){for(let i=1;;++i){let r=`${s}${i}`;if(!n.has(r))return r}}function Vr(s,n){let i=[],r=new Map,o=null;return{onAnchor:(a)=>{i.push(a),o??(o=rn(s));let l=on(n,o);return o.add(l),l},setAnchors:()=>{for(let a of i){let l=r.get(a);if(typeof l==="object"&&l.anchor&&(nn.isScalar(l.node)||nn.isCollection(l.node)))l.node.anchor=l.anchor;else{let f=Error("Failed to resolve repeated object (this should not happen)");throw f.source=a,f}}},sourceObjects:r}}Wr.anchorIsValid=Jr;Wr.anchorNames=rn;Wr.createNodeAnchors=Vr;Wr.findNewAnchor=on});var Bt=v(function(zr){function Ae(s,n,i,r){if(r&&typeof r==="object")if(Array.isArray(r))for(let o=0,a=r.length;o<a;++o){let l=r[o],f=Ae(s,r,String(o),l);if(f===void 0)delete r[o];else if(f!==l)r[o]=f}else if(r instanceof Map)for(let o of Array.from(r.keys())){let a=r.get(o),l=Ae(s,r,o,a);if(l===void 0)r.delete(o);else if(l!==a)r.set(o,l)}else if(r instanceof Set)for(let o of Array.from(r)){let a=Ae(s,r,o,o);if(a===void 0)r.delete(o);else if(a!==o)r.delete(o),r.add(a)}else for(let[o,a]of Object.entries(r)){let l=Ae(s,r,o,a);if(l===void 0)delete r[o];else if(l!==a)r[o]=l}return s.call(n,i,r)}zr.applyReviver=Ae});var H=v(function(to){var eo=I();function an(s,n,i){if(Array.isArray(s))return s.map((r,o)=>an(r,String(o),i));if(s&&typeof s.toJSON==="function"){if(!i||!eo.hasAnchor(s))return s.toJSON(n,i);let r={aliasCount:0,count:1,res:void 0};i.anchors.set(s,r),i.onCreate=(a)=>{r.res=a,delete i.onCreate};let o=s.toJSON(n,i);if(i.onCreate)i.onCreate(o);return o}if(typeof s==="bigint"&&!i?.keep)return Number(s);return s}to.toJS=an});var Ze=v(function(ro){var no=Bt(),ln=I(),io=H();class cn{constructor(s){Object.defineProperty(this,ln.NODE_TYPE,{value:s})}clone(){let s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)s.range=this.range.slice();return s}toJS(s,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){if(!ln.isDocument(s))throw TypeError("A document argument is required");let a={anchors:new Map,doc:s,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i==="number"?i:100},l=io.toJS(this,"",a);if(typeof r==="function")for(let{count:f,res:u}of a.anchors.values())r(u,f);return typeof o==="function"?no.applyReviver(o,{"":l},"",l):l}}ro.NodeBase=cn});var Oe=v(function(uo){var ao=ze(),lo=Ne(),pe=I(),co=Ze(),fo=H();class fn extends co.NodeBase{constructor(s){super(pe.ALIAS);this.source=s,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(s,n){let i;if(n?.aliasResolveCache)i=n.aliasResolveCache;else if(i=[],lo.visit(s,{Node:(o,a)=>{if(pe.isAlias(a)||pe.hasAnchor(a))i.push(a)}}),n)n.aliasResolveCache=i;let r=void 0;for(let o of i){if(o===this)break;if(o.anchor===this.source)r=o}return r}toJSON(s,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:o}=n,a=this.resolve(r,n);if(!a){let f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(f)}let l=i.get(a);if(!l)fo.toJS(a,null,n),l=i.get(a);if(!l||l.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(o>=0){if(l.count+=1,l.aliasCount===0)l.aliasCount=et(r,a,i);if(l.count*l.aliasCount>o)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return l.res}toString(s,n,i){let r=`*${this.source}`;if(s){if(ao.anchorIsValid(this.source),s.options.verifyAliasOrder&&!s.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(o)}if(s.implicitKey)return`${r} `}return r}}function et(s,n,i){if(pe.isAlias(n)){let r=n.resolve(s),o=i&&r&&i.get(r);return o?o.count*o.aliasCount:0}else if(pe.isCollection(n)){let r=0;for(let o of n.items){let a=et(s,o,i);if(a>r)r=a}return r}else if(pe.isPair(n)){let r=et(s,n.key,i),o=et(s,n.value,i);return Math.max(r,o)}return 1}uo.Alias=fn});var M=v(function(bo){var po=I(),mo=Ze(),yo=H(),go=(s)=>!s||typeof s!=="function"&&typeof s!=="object";class ie extends mo.NodeBase{constructor(s){super(po.SCALAR);this.value=s}toJSON(s,n){return n?.keep?this.value:yo.toJS(this.value,s,n)}toString(){return String(this.value)}}ie.BLOCK_FOLDED="BLOCK_FOLDED";ie.BLOCK_LITERAL="BLOCK_LITERAL";ie.PLAIN="PLAIN";ie.QUOTE_DOUBLE="QUOTE_DOUBLE";ie.QUOTE_SINGLE="QUOTE_SINGLE";bo.Scalar=ie;bo.isScalarValue=go});var qe=v(function(Oo){var vo=Oe(),re=I(),un=M(),ko="tag:yaml.org,2002:";function No(s,n,i){if(n){let r=i.filter((a)=>a.tag===n),o=r.find((a)=>!a.format)??r[0];if(!o)throw Error(`Tag ${n} not found`);return o}return i.find((r)=>r.identify?.(s)&&!r.format)}function Ao(s,n,i){if(re.isDocument(s))s=s.contents;if(re.isNode(s))return s;if(re.isPair(s)){let d=i.schema[re.MAP].createNode?.(i.schema,null,i);return d.items.push(s),d}if(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)s=s.valueOf();let{aliasDuplicateObjects:r,onAnchor:o,onTagObj:a,schema:l,sourceObjects:f}=i,u=void 0;if(r&&s&&typeof s==="object")if(u=f.get(s),u)return u.anchor??(u.anchor=o(s)),new vo.Alias(u.anchor);else u={anchor:null,node:null},f.set(s,u);if(n?.startsWith("!!"))n=ko+n.slice(2);let h=No(s,n,l.tags);if(!h){if(s&&typeof s.toJSON==="function")s=s.toJSON();if(!s||typeof s!=="object"){let d=new un.Scalar(s);if(u)u.node=d;return d}h=s instanceof Map?l[re.MAP]:(Symbol.iterator in Object(s))?l[re.SEQ]:l[re.MAP]}if(a)a(h),delete i.onTagObj;let g=h?.createNode?h.createNode(i.schema,s,i):typeof h?.nodeClass?.from==="function"?h.nodeClass.from(i.schema,s,i):new un.Scalar(s);if(n)g.tag=n;else if(!h.default)g.tag=h.tag;if(u)u.node=g;return g}Oo.createNode=Ao});var tt=v(function(To){var Eo=qe(),J=I(),Lo=Ze();function jt(s,n,i){let r=i;for(let o=n.length-1;o>=0;--o){let a=n[o];if(typeof a==="number"&&Number.isInteger(a)&&a>=0){let l=[];l[a]=r,r=l}else r=new Map([[a,r]])}return Eo.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var hn=(s)=>s==null||typeof s==="object"&&!!s[Symbol.iterator]().next().done;class dn extends Lo.NodeBase{constructor(s,n){super(s);Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(s){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(s)n.schema=s;if(n.items=n.items.map((i)=>J.isNode(i)||J.isPair(i)?i.clone(s):i),this.range)n.range=this.range.slice();return n}addIn(s,n){if(hn(s))this.add(n);else{let[i,...r]=s,o=this.get(i,!0);if(J.isCollection(o))o.addIn(r,n);else if(o===void 0&&this.schema)this.set(i,jt(this.schema,r,n));else throw Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(s){let[n,...i]=s;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(J.isCollection(r))return r.deleteIn(i);else throw Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(s,n){let[i,...r]=s,o=this.get(i,!0);if(r.length===0)return!n&&J.isScalar(o)?o.value:o;else return J.isCollection(o)?o.getIn(r,n):void 0}hasAllNullValues(s){return this.items.every((n)=>{if(!J.isPair(n))return!1;let i=n.value;return i==null||s&&J.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(s){let[n,...i]=s;if(i.length===0)return this.has(n);let r=this.get(n,!0);return J.isCollection(r)?r.hasIn(i):!1}setIn(s,n){let[i,...r]=s;if(r.length===0)this.set(i,n);else{let o=this.get(i,!0);if(J.isCollection(o))o.setIn(r,n);else if(o===void 0&&this.schema)this.set(i,jt(this.schema,r,n));else throw Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}To.Collection=dn;To.collectionFromPath=jt;To.isEmptyPath=hn});var Ee=v(function(Mo){var Po=(s)=>s.replace(/^(?!$)(?: $)?/gm,"#");function Kt(s,n){if(/^\n+$/.test(s))return s.substring(1);return n?s.replace(/^(?! *$)/gm,n):s}var $o=(s,n,i)=>s.endsWith(`
|
|
3
|
+
`)?Kt(i,n):i.includes(`
|
|
4
|
+
`)?`
|
|
5
|
+
`+Kt(i,n):(s.endsWith(" ")?"":" ")+i;Mo.indentComment=Kt;Mo.lineComment=$o;Mo.stringifyComment=Po});var mn=v(function(Ko){function jo(s,n,i="flow",{indentAtStart:r,lineWidth:o=80,minContentWidth:a=20,onFold:l,onOverflow:f}={}){if(!o||o<0)return s;if(o<a)a=0;let u=Math.max(1+a,1+o-n.length);if(s.length<=u)return s;let h=[],g={},d=o-n.length;if(typeof r==="number")if(r>o-Math.max(2,a))h.push(0);else d=o-r;let p=void 0,S=void 0,N=!1,m=-1,w=-1,O=-1;if(i==="block"){if(m=pn(s,m,n.length),m!==-1)d=m+u}for(let E;E=s[m+=1];){if(i==="quoted"&&E==="\\"){switch(w=m,s[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}O=m}if(E===`
|
|
6
|
+
`){if(i==="block")m=pn(s,m,n.length);d=m+n.length+u,p=void 0}else{if(E===" "&&S&&S!==" "&&S!==`
|
|
7
|
+
`&&S!=="\t"){let L=s[m+1];if(L&&L!==" "&&L!==`
|
|
8
|
+
`&&L!=="\t")p=m}if(m>=d)if(p)h.push(p),d=p+u,p=void 0;else if(i==="quoted"){while(S===" "||S==="\t")S=E,E=s[m+=1],N=!0;let L=m>O+1?m-2:w-1;if(g[L])return s;h.push(L),g[L]=!0,d=L+u,p=void 0}else N=!0}S=E}if(N&&f)f();if(h.length===0)return s;if(l)l();let q=s.slice(0,h[0]);for(let E=0;E<h.length;++E){let L=h[E],C=h[E+1]||s.length;if(L===0)q=`
|
|
9
|
+
${n}${s.slice(0,C)}`;else{if(i==="quoted"&&g[L])q+=`${s[L]}\\`;q+=`
|
|
10
|
+
${n}${s.slice(L+1,C)}`}}return q}function pn(s,n,i){let r=n,o=n+1,a=s[o];while(a===" "||a==="\t")if(n<o+i)a=s[++n];else{do a=s[++n];while(a&&a!==`
|
|
11
|
+
`);r=n,o=n+1,a=s[o]}return r}Ko.FOLD_BLOCK="block";Ko.FOLD_FLOW="flow";Ko.FOLD_QUOTED="quoted";Ko.foldFlowLines=jo});var Te=v(function(Qo){var F=M(),G=mn(),nt=(s,n)=>({indentAtStart:n?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),it=(s)=>/^(%|---|\.\.\.)/m.test(s);function Jo(s,n,i){if(!n||n<0)return!1;let r=n-i,o=s.length;if(o<=r)return!1;for(let a=0,l=0;a<o;++a)if(s[a]===`
|
|
12
|
+
`){if(a-l>r)return!0;if(l=a+1,o-l<=r)return!1}return!0}function Le(s,n){let i=JSON.stringify(s);if(n.options.doubleQuotedAsJSON)return i;let{implicitKey:r}=n,o=n.options.doubleQuotedMinMultiLineLength,a=n.indent||(it(s)?" ":""),l="",f=0;for(let u=0,h=i[u];h;h=i[++u]){if(h===" "&&i[u+1]==="\\"&&i[u+2]==="n")l+=i.slice(f,u)+"\\ ",u+=1,f=u,h="\\";if(h==="\\")switch(i[u+1]){case"u":{l+=i.slice(f,u);let g=i.substr(u+2,4);switch(g){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:if(g.substr(0,2)==="00")l+="\\x"+g.substr(2);else l+=i.substr(u,6)}u+=5,f=u+1}break;case"n":if(r||i[u+2]==='"'||i.length<o)u+=1;else{l+=i.slice(f,u)+`
|
|
13
|
+
|
|
14
|
+
`;while(i[u+2]==="\\"&&i[u+3]==="n"&&i[u+4]!=='"')l+=`
|
|
15
|
+
`,u+=2;if(l+=a,i[u+2]===" ")l+="\\";u+=1,f=u+1}break;default:u+=1}}return l=f?l+i.slice(f):i,r?l:G.foldFlowLines(l,a,G.FOLD_QUOTED,nt(n,!1))}function Rt(s,n){if(n.options.singleQuote===!1||n.implicitKey&&s.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test(s))return Le(s,n);let i=n.indent||(it(s)?" ":""),r="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
|
+
${i}`)+"'";return n.implicitKey?r:G.foldFlowLines(r,i,G.FOLD_FLOW,nt(n,!1))}function me(s,n){let{singleQuote:i}=n.options,r;if(i===!1)r=Le;else{let o=s.includes('"'),a=s.includes("'");if(o&&!a)r=Rt;else if(a&&!o)r=Le;else r=i?Rt:Le}return r(s,n)}var Ft;try{Ft=new RegExp(`(^|(?<!
|
|
18
|
+
))
|
|
19
|
+
+(?!
|
|
20
|
+
|$)`,"g")}catch{Ft=/\n+(?!\n|$)/g}function st({comment:s,type:n,value:i},r,o,a){let{blockQuote:l,commentString:f,lineWidth:u}=r.options;if(!l||/\n[\t ]+$/.test(i))return me(i,r);let h=r.indent||(r.forceBlockIndent||it(i)?" ":""),g=l==="literal"?!0:l==="folded"||n===F.Scalar.BLOCK_FOLDED?!1:n===F.Scalar.BLOCK_LITERAL?!0:!Jo(i,u,h.length);if(!i)return g?`|
|
|
21
|
+
`:`>
|
|
22
|
+
`;let d,p;for(p=i.length;p>0;--p){let C=i[p-1];if(C!==`
|
|
23
|
+
`&&C!=="\t"&&C!==" ")break}let S=i.substring(p),N=S.indexOf(`
|
|
24
|
+
`);if(N===-1)d="-";else if(i===S||N!==S.length-1){if(d="+",a)a()}else d="";if(S){if(i=i.slice(0,-S.length),S[S.length-1]===`
|
|
25
|
+
`)S=S.slice(0,-1);S=S.replace(Ft,`$&${h}`)}let m=!1,w,O=-1;for(w=0;w<i.length;++w){let C=i[w];if(C===" ")m=!0;else if(C===`
|
|
26
|
+
`)O=w;else break}let q=i.substring(0,O<w?O+1:w);if(q)i=i.substring(q.length),q=q.replace(/\n+/g,`$&${h}`);let L=(m?h?"2":"1":"")+d;if(s){if(L+=" "+f(s.replace(/ ?[\r\n]+/g," ")),o)o()}if(!g){let C=i.replace(/\n+/g,`
|
|
27
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`),_=!1,P=nt(r,!0);if(l!=="folded"&&n!==F.Scalar.BLOCK_FOLDED)P.onOverflow=()=>{_=!0};let A=G.foldFlowLines(`${q}${C}${S}`,h,G.FOLD_BLOCK,P);if(!_)return`>${L}
|
|
28
|
+
${h}${A}`}return i=i.replace(/\n+/g,`$&${h}`),`|${L}
|
|
29
|
+
${h}${q}${i}${S}`}function Vo(s,n,i,r){let{type:o,value:a}=s,{actualString:l,implicitKey:f,indent:u,indentStep:h,inFlow:g}=n;if(f&&a.includes(`
|
|
30
|
+
`)||g&&/[[\]{},]/.test(a))return me(a,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return f||g||!a.includes(`
|
|
31
|
+
`)?me(a,n):st(s,n,i,r);if(!f&&!g&&o!==F.Scalar.PLAIN&&a.includes(`
|
|
32
|
+
`))return st(s,n,i,r);if(it(a)){if(u==="")return n.forceBlockIndent=!0,st(s,n,i,r);else if(f&&u===h)return me(a,n)}let d=a.replace(/\n+/g,`$&
|
|
33
|
+
${u}`);if(l){let p=(m)=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(d),{compat:S,tags:N}=n.doc.schema;if(N.some(p)||S?.some(p))return me(a,n)}return f?d:G.foldFlowLines(d,u,G.FOLD_FLOW,nt(n,!1))}function Wo(s,n,i,r){let{implicitKey:o,inFlow:a}=n,l=typeof s.value==="string"?s:Object.assign({},s,{value:String(s.value)}),{type:f}=s;if(f!==F.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value))f=F.Scalar.QUOTE_DOUBLE}let u=(g)=>{switch(g){case F.Scalar.BLOCK_FOLDED:case F.Scalar.BLOCK_LITERAL:return o||a?me(l.value,n):st(l,n,i,r);case F.Scalar.QUOTE_DOUBLE:return Le(l.value,n);case F.Scalar.QUOTE_SINGLE:return Rt(l.value,n);case F.Scalar.PLAIN:return Vo(l,n,i,r);default:return null}},h=u(f);if(h===null){let{defaultKeyType:g,defaultStringType:d}=n.options,p=o&&g||d;if(h=u(p),h===null)throw Error(`Unsupported default string type ${p}`)}return h}Qo.stringifyString=Wo});var Ce=v(function(na){var Go=ze(),X=I(),Xo=Ee(),zo=Te();function Zo(s,n){let i=Object.assign({blockQuote:!0,commentString:Xo.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,trueStr:"true",verifyAliasOrder:!0},s.schema.toStringOptions,n),r;switch(i.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:s,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent==="number"?" ".repeat(i.indent):" ",inFlow:r,options:i}}function ea(s,n){if(n.tag){let o=s.filter((a)=>a.tag===n.tag);if(o.length>0)return o.find((a)=>a.format===n.format)??o[0]}let i=void 0,r;if(X.isScalar(n)){r=n.value;let o=s.filter((a)=>a.identify?.(r));if(o.length>1){let a=o.filter((l)=>l.test);if(a.length>0)o=a}i=o.find((a)=>a.format===n.format)??o.find((a)=>!a.format)}else r=n,i=s.find((o)=>o.nodeClass&&r instanceof o.nodeClass);if(!i){let o=r?.constructor?.name??(r===null?"null":typeof r);throw Error(`Tag not resolved for ${o} value`)}return i}function ta(s,n,{anchors:i,doc:r}){if(!r.directives)return"";let o=[],a=(X.isScalar(s)||X.isCollection(s))&&s.anchor;if(a&&Go.anchorIsValid(a))i.add(a),o.push(`&${a}`);let l=s.tag??(n.default?null:n.tag);if(l)o.push(r.directives.tagString(l));return o.join(" ")}function sa(s,n,i,r){if(X.isPair(s))return s.toString(n,i,r);if(X.isAlias(s)){if(n.doc.directives)return s.toString(n);if(n.resolvedAliases?.has(s))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(n.resolvedAliases)n.resolvedAliases.add(s);else n.resolvedAliases=new Set([s]);s=s.resolve(n.doc)}}let o=void 0,a=X.isNode(s)?s:n.doc.createNode(s,{onTagObj:(u)=>o=u});o??(o=ea(n.doc.schema.tags,a));let l=ta(a,o,n);if(l.length>0)n.indentAtStart=(n.indentAtStart??0)+l.length+1;let f=typeof o.stringify==="function"?o.stringify(a,n,i,r):X.isScalar(a)?zo.stringifyString(a,n,i,r):a.toString(n,i,r);if(!l)return f;return X.isScalar(a)||f[0]==="{"||f[0]==="["?`${l} ${f}`:`${l}
|
|
34
|
+
${n.indent}${f}`}na.createStringifyContext=Zo;na.stringify=sa});var bn=v(function(aa){var W=I(),yn=M(),gn=Ce(),_e=Ee();function oa({key:s,value:n},i,r,o){let{allNullValues:a,doc:l,indent:f,indentStep:u,options:{commentString:h,indentSeq:g,simpleKeys:d}}=i,p=W.isNode(s)&&s.comment||null;if(d){if(p)throw Error("With simple keys, key nodes cannot have comments");if(W.isCollection(s)||!W.isNode(s)&&typeof s==="object")throw Error("With simple keys, collection cannot be used as a key value")}let S=!d&&(!s||p&&n==null&&!i.inFlow||W.isCollection(s)||(W.isScalar(s)?s.type===yn.Scalar.BLOCK_FOLDED||s.type===yn.Scalar.BLOCK_LITERAL:typeof s==="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!S&&(d||!a),indent:f+u});let N=!1,m=!1,w=gn.stringify(s,i,()=>N=!0,()=>m=!0);if(!S&&!i.inFlow&&w.length>1024){if(d)throw Error("With simple keys, single line scalar must not span more than 1024 characters");S=!0}if(i.inFlow){if(a||n==null){if(N&&r)r();return w===""?"?":S?`? ${w}`:w}}else if(a&&!d||n==null&&S){if(w=`? ${w}`,p&&!N)w+=_e.lineComment(w,i.indent,h(p));else if(m&&o)o();return w}if(N)p=null;if(S){if(p)w+=_e.lineComment(w,i.indent,h(p));w=`? ${w}
|
|
35
|
+
${f}:`}else if(w=`${w}:`,p)w+=_e.lineComment(w,i.indent,h(p));let O,q,E;if(W.isNode(n))O=!!n.spaceBefore,q=n.commentBefore,E=n.comment;else if(O=!1,q=null,E=null,n&&typeof n==="object")n=l.createNode(n);if(i.implicitKey=!1,!S&&!p&&W.isScalar(n))i.indentAtStart=w.length+1;if(m=!1,!g&&u.length>=2&&!i.inFlow&&!S&&W.isSeq(n)&&!n.flow&&!n.tag&&!n.anchor)i.indent=i.indent.substring(2);let L=!1,C=gn.stringify(n,i,()=>L=!0,()=>m=!0),_=" ";if(p||O||q){if(_=O?`
|
|
36
|
+
`:"",q){let P=h(q);_+=`
|
|
37
|
+
${_e.indentComment(P,i.indent)}`}if(C===""&&!i.inFlow){if(_===`
|
|
38
|
+
`)_=`
|
|
39
|
+
|
|
40
|
+
`}else _+=`
|
|
41
|
+
${i.indent}`}else if(!S&&W.isCollection(n)){let P=C[0],A=C.indexOf(`
|
|
42
|
+
`),x=A!==-1,Q=i.inFlow??n.flow??n.items.length===0;if(x||!Q){let ue=!1;if(x&&(P==="&"||P==="!")){let D=C.indexOf(" ");if(P==="&"&&D!==-1&&D<A&&C[D+1]==="!")D=C.indexOf(" ",D+1);if(D===-1||A<D)ue=!0}if(!ue)_=`
|
|
43
|
+
${i.indent}`}}else if(C===""||C[0]===`
|
|
44
|
+
`)_="";if(w+=_+C,i.inFlow){if(L&&r)r()}else if(E&&!L)w+=_e.lineComment(w,i.indent,h(E));else if(m&&o)o();return w}aa.stringifyPair=oa});var Ut=v(function(ua){var wn=We("process");function ca(s,...n){if(s==="debug")console.log(...n)}function fa(s,n){if(s==="debug"||s==="warn")if(typeof wn.emitWarning==="function")wn.emitWarning(n);else console.warn(n)}ua.debug=ca;ua.warn=fa});var at=v(function(ma){var Ie=I(),Sn=M(),rt="<<",ot={identify:(s)=>s===rt||typeof s==="symbol"&&s.description===rt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Sn.Scalar(Symbol(rt)),{addToJSMap:vn}),stringify:()=>rt},pa=(s,n)=>(ot.identify(n)||Ie.isScalar(n)&&(!n.type||n.type===Sn.Scalar.PLAIN)&&ot.identify(n.value))&&s?.doc.schema.tags.some((i)=>i.tag===ot.tag&&i.default);function vn(s,n,i){if(i=s&&Ie.isAlias(i)?i.resolve(s.doc):i,Ie.isSeq(i))for(let r of i.items)Yt(s,n,r);else if(Array.isArray(i))for(let r of i)Yt(s,n,r);else Yt(s,n,i)}function Yt(s,n,i){let r=s&&Ie.isAlias(i)?i.resolve(s.doc):i;if(!Ie.isMap(r))throw Error("Merge sources must be maps or map aliases");let o=r.toJSON(null,s,Map);for(let[a,l]of o)if(n instanceof Map){if(!n.has(a))n.set(a,l)}else if(n instanceof Set)n.add(a);else if(!Object.prototype.hasOwnProperty.call(n,a))Object.defineProperty(n,a,{value:l,writable:!0,enumerable:!0,configurable:!0});return n}ma.addMergeToJSMap=vn;ma.isMergeKey=pa;ma.merge=ot});var Vt=v(function(Na){var wa=Ut(),kn=at(),Sa=Ce(),Nn=I(),Jt=H();function va(s,n,{key:i,value:r}){if(Nn.isNode(i)&&i.addToJSMap)i.addToJSMap(s,n,r);else if(kn.isMergeKey(s,i))kn.addMergeToJSMap(s,n,r);else{let o=Jt.toJS(i,"",s);if(n instanceof Map)n.set(o,Jt.toJS(r,o,s));else if(n instanceof Set)n.add(o);else{let a=ka(i,o,s),l=Jt.toJS(r,a,s);if(a in n)Object.defineProperty(n,a,{value:l,writable:!0,enumerable:!0,configurable:!0});else n[a]=l}}return n}function ka(s,n,i){if(n===null)return"";if(typeof n!=="object")return String(n);if(Nn.isNode(s)&&i?.doc){let r=Sa.createStringifyContext(i.doc,{});r.anchors=new Set;for(let a of i.anchors.keys())r.anchors.add(a.anchor);r.inFlow=!0,r.inStringifyKey=!0;let o=s.toString(r);if(!i.mapKeyWarned){let a=JSON.stringify(o);if(a.length>40)a=a.substring(0,36)+'..."';wa.warn(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return o}return JSON.stringify(n)}Na.addPairToJSMap=va});var z=v(function(La){var An=qe(),Oa=bn(),qa=Vt(),lt=I();function Ea(s,n,i){let r=An.createNode(s,void 0,i),o=An.createNode(n,void 0,i);return new ct(r,o)}class ct{constructor(s,n=null){Object.defineProperty(this,lt.NODE_TYPE,{value:lt.PAIR}),this.key=s,this.value=n}clone(s){let{key:n,value:i}=this;if(lt.isNode(n))n=n.clone(s);if(lt.isNode(i))i=i.clone(s);return new ct(n,i)}toJSON(s,n){let i=n?.mapAsMap?new Map:{};return qa.addPairToJSMap(n,i,this)}toString(s,n,i){return s?.doc?Oa.stringifyPair(this,s,n,i):JSON.stringify(this)}}La.Pair=ct;La.createPair=Ea});var Wt=v(function($a){var oe=I(),On=Ce(),ft=Ee();function _a(s,n,i){return(n.inFlow??s.flow?Pa:Ia)(s,n,i)}function Ia({comment:s,items:n},i,{blockItemPrefix:r,flowChars:o,itemIndent:a,onChompKeep:l,onComment:f}){let{indent:u,options:{commentString:h}}=i,g=Object.assign({},i,{indent:a,type:null}),d=!1,p=[];for(let N=0;N<n.length;++N){let m=n[N],w=null;if(oe.isNode(m)){if(!d&&m.spaceBefore)p.push("");if(ut(i,p,m.commentBefore,d),m.comment)w=m.comment}else if(oe.isPair(m)){let q=oe.isNode(m.key)?m.key:null;if(q){if(!d&&q.spaceBefore)p.push("");ut(i,p,q.commentBefore,d)}}d=!1;let O=On.stringify(m,g,()=>w=null,()=>d=!0);if(w)O+=ft.lineComment(O,a,h(w));if(d&&w)d=!1;p.push(r+O)}let S;if(p.length===0)S=o.start+o.end;else{S=p[0];for(let N=1;N<p.length;++N){let m=p[N];S+=m?`
|
|
45
|
+
${u}${m}`:`
|
|
46
|
+
`}}if(s){if(S+=`
|
|
47
|
+
`+ft.indentComment(h(s),u),f)f()}else if(d&&l)l();return S}function Pa({items:s},n,{flowChars:i,itemIndent:r}){let{indent:o,indentStep:a,flowCollectionPadding:l,options:{commentString:f}}=n;r+=a;let u=Object.assign({},n,{indent:r,inFlow:!0,type:null}),h=!1,g=0,d=[];for(let N=0;N<s.length;++N){let m=s[N],w=null;if(oe.isNode(m)){if(m.spaceBefore)d.push("");if(ut(n,d,m.commentBefore,!1),m.comment)w=m.comment}else if(oe.isPair(m)){let q=oe.isNode(m.key)?m.key:null;if(q){if(q.spaceBefore)d.push("");if(ut(n,d,q.commentBefore,!1),q.comment)h=!0}let E=oe.isNode(m.value)?m.value:null;if(E){if(E.comment)w=E.comment;if(E.commentBefore)h=!0}else if(m.value==null&&q?.comment)w=q.comment}if(w)h=!0;let O=On.stringify(m,u,()=>w=null);if(N<s.length-1)O+=",";if(w)O+=ft.lineComment(O,r,f(w));if(!h&&(d.length>g||O.includes(`
|
|
48
|
+
`)))h=!0;d.push(O),g=d.length}let{start:p,end:S}=i;if(d.length===0)return p+S;else{if(!h){let N=d.reduce((m,w)=>m+w.length+2,2);h=n.options.lineWidth>0&&N>n.options.lineWidth}if(h){let N=p;for(let m of d)N+=m?`
|
|
49
|
+
${a}${o}${m}`:`
|
|
50
|
+
`;return`${N}
|
|
51
|
+
${o}${S}`}else return`${p}${l}${d.join(" ")}${l}${S}`}}function ut({indent:s,options:{commentString:n}},i,r,o){if(r&&o)r=r.replace(/^\n+/,"");if(r){let a=ft.indentComment(n(r),s);i.push(a.trimStart())}}$a.stringifyCollection=_a});var ee=v(function(Ka){var xa=Wt(),Da=Vt(),Ba=tt(),Z=I(),ht=z(),ja=M();function Pe(s,n){let i=Z.isScalar(n)?n.value:n;for(let r of s)if(Z.isPair(r)){if(r.key===n||r.key===i)return r;if(Z.isScalar(r.key)&&r.key.value===i)return r}return}class qn extends Ba.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(s){super(Z.MAP,s);this.items=[]}static from(s,n,i){let{keepUndefined:r,replacer:o}=i,a=new this(s),l=(f,u)=>{if(typeof o==="function")u=o.call(n,f,u);else if(Array.isArray(o)&&!o.includes(f))return;if(u!==void 0||r)a.items.push(ht.createPair(f,u,i))};if(n instanceof Map)for(let[f,u]of n)l(f,u);else if(n&&typeof n==="object")for(let f of Object.keys(n))l(f,n[f]);if(typeof s.sortMapEntries==="function")a.items.sort(s.sortMapEntries);return a}add(s,n){let i;if(Z.isPair(s))i=s;else if(!s||typeof s!=="object"||!("key"in s))i=new ht.Pair(s,s?.value);else i=new ht.Pair(s.key,s.value);let r=Pe(this.items,i.key),o=this.schema?.sortMapEntries;if(r){if(!n)throw Error(`Key ${i.key} already set`);if(Z.isScalar(r.value)&&ja.isScalarValue(i.value))r.value.value=i.value;else r.value=i.value}else if(o){let a=this.items.findIndex((l)=>o(i,l)<0);if(a===-1)this.items.push(i);else this.items.splice(a,0,i)}else this.items.push(i)}delete(s){let n=Pe(this.items,s);if(!n)return!1;return this.items.splice(this.items.indexOf(n),1).length>0}get(s,n){let r=Pe(this.items,s)?.value;return(!n&&Z.isScalar(r)?r.value:r)??void 0}has(s){return!!Pe(this.items,s)}set(s,n){this.add(new ht.Pair(s,n),!0)}toJSON(s,n,i){let r=i?new i:n?.mapAsMap?new Map:{};if(n?.onCreate)n.onCreate(r);for(let o of this.items)Da.addPairToJSMap(n,r,o);return r}toString(s,n,i){if(!s)return JSON.stringify(this);for(let r of this.items)if(!Z.isPair(r))throw Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);if(!s.allNullValues&&this.hasAllNullValues(!1))s=Object.assign({},s,{allNullValues:!0});return xa.stringifyCollection(this,s,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:s.indent||"",onChompKeep:i,onComment:n})}}Ka.YAMLMap=qn;Ka.findPair=Pe});var ye=v(function(Ja){var Ua=I(),En=ee(),Ya={collection:"map",default:!0,nodeClass:En.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,n){if(!Ua.isMap(s))n("Expected a mapping for this tag");return s},createNode:(s,n,i)=>En.YAMLMap.from(s,n,i)};Ja.map=Ya});var te=v(function(za){var Wa=qe(),Qa=Wt(),Ha=tt(),pt=I(),Ga=M(),Xa=H();class Ln extends Ha.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(s){super(pt.SEQ,s);this.items=[]}add(s){this.items.push(s)}delete(s){let n=dt(s);if(typeof n!=="number")return!1;return this.items.splice(n,1).length>0}get(s,n){let i=dt(s);if(typeof i!=="number")return;let r=this.items[i];return!n&&pt.isScalar(r)?r.value:r}has(s){let n=dt(s);return typeof n==="number"&&n<this.items.length}set(s,n){let i=dt(s);if(typeof i!=="number")throw Error(`Expected a valid index, not ${s}.`);let r=this.items[i];if(pt.isScalar(r)&&Ga.isScalarValue(n))r.value=n;else this.items[i]=n}toJSON(s,n){let i=[];if(n?.onCreate)n.onCreate(i);let r=0;for(let o of this.items)i.push(Xa.toJS(o,String(r++),n));return i}toString(s,n,i){if(!s)return JSON.stringify(this);return Qa.stringifyCollection(this,s,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(s.indent||"")+" ",onChompKeep:i,onComment:n})}static from(s,n,i){let{replacer:r}=i,o=new this(s);if(n&&Symbol.iterator in Object(n)){let a=0;for(let l of n){if(typeof r==="function"){let f=n instanceof Set?l:String(a++);l=r.call(n,f,l)}o.items.push(Wa.createNode(l,void 0,i))}}return o}}function dt(s){let n=pt.isScalar(s)?s.value:s;if(n&&typeof n==="string")n=Number(n);return typeof n==="number"&&Number.isInteger(n)&&n>=0?n:null}za.YAMLSeq=Ln});var ge=v(function(sl){var el=I(),Tn=te(),tl={collection:"seq",default:!0,nodeClass:Tn.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,n){if(!el.isSeq(s))n("Expected a sequence for this tag");return s},createNode:(s,n,i)=>Tn.YAMLSeq.from(s,n,i)};sl.seq=tl});var $e=v(function(ol){var il=Te(),rl={identify:(s)=>typeof s==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(s)=>s,stringify(s,n,i,r){return n=Object.assign({actualString:!0},n),il.stringifyString(s,n,i,r)}};ol.string=rl});var mt=v(function(ll){var Cn=M(),_n={identify:(s)=>s==null,createNode:()=>new Cn.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Cn.Scalar(null),stringify:({source:s},n)=>typeof s==="string"&&_n.test.test(s)?s:n.options.nullStr};ll.nullTag=_n});var Qt=v(function(ul){var fl=M(),In={identify:(s)=>typeof s==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(s)=>new fl.Scalar(s[0]==="t"||s[0]==="T"),stringify({source:s,value:n},i){if(s&&In.test.test(s)){let r=s[0]==="t"||s[0]==="T";if(n===r)return s}return n?i.options.trueStr:i.options.falseStr}};ul.boolTag=In});var be=v(function(pl){function dl({format:s,minFractionDigits:n,tag:i,value:r}){if(typeof r==="bigint")return String(r);let o=typeof r==="number"?r:Number(r);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let a=JSON.stringify(r);if(!s&&n&&(!i||i==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let l=a.indexOf(".");if(l<0)l=a.length,a+=".";let f=n-(a.length-l-1);while(f-- >0)a+="0"}return a}pl.stringifyNumber=dl});var Gt=v(function(Sl){var yl=M(),Ht=be(),gl={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(s)=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ht.stringifyNumber},bl={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(s)=>parseFloat(s),stringify(s){let n=Number(s.value);return isFinite(n)?n.toExponential():Ht.stringifyNumber(s)}},wl={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){let n=new yl.Scalar(parseFloat(s)),i=s.indexOf(".");if(i!==-1&&s[s.length-1]==="0")n.minFractionDigits=s.length-i-1;return n},stringify:Ht.stringifyNumber};Sl.float=wl;Sl.floatExp=bl;Sl.floatNaN=gl});var zt=v(function(El){var Pn=be(),yt=(s)=>typeof s==="bigint"||Number.isInteger(s),Xt=(s,n,i,{intAsBigInt:r})=>r?BigInt(s):parseInt(s.substring(n),i);function $n(s,n,i){let{value:r}=s;if(yt(r)&&r>=0)return i+r.toString(n);return Pn.stringifyNumber(s)}var Al={identify:(s)=>yt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,n,i)=>Xt(s,2,8,i),stringify:(s)=>$n(s,8,"0o")},Ol={identify:yt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,n,i)=>Xt(s,0,10,i),stringify:Pn.stringifyNumber},ql={identify:(s)=>yt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,n,i)=>Xt(s,2,16,i),stringify:(s)=>$n(s,16,"0x")};El.int=Ol;El.intHex=ql;El.intOct=Al});var Mn=v(function(Dl){var _l=ye(),Il=mt(),Pl=ge(),$l=$e(),Ml=Qt(),Zt=Gt(),es=zt(),xl=[_l.map,Pl.seq,$l.string,Il.nullTag,Ml.boolTag,es.intOct,es.int,es.intHex,Zt.floatNaN,Zt.floatExp,Zt.float];Dl.schema=xl});var Dn=v(function(Jl){var jl=M(),Kl=ye(),Rl=ge();function xn(s){return typeof s==="bigint"||Number.isInteger(s)}var gt=({value:s})=>JSON.stringify(s),Fl=[{identify:(s)=>typeof s==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(s)=>s,stringify:gt},{identify:(s)=>s==null,createNode:()=>new jl.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:gt},{identify:(s)=>typeof s==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(s)=>s==="true",stringify:gt},{identify:xn,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,n,{intAsBigInt:i})=>i?BigInt(s):parseInt(s,10),stringify:({value:s})=>xn(s)?s.toString():JSON.stringify(s)},{identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(s)=>parseFloat(s),stringify:gt}],Ul={default:!0,tag:"",test:/^/,resolve(s,n){return n(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},Yl=[Kl.map,Rl.seq].concat(Fl,Ul);Jl.schema=Yl});var ss=v(function(Hl){var Me=We("buffer"),ts=M(),Wl=Te(),Ql={identify:(s)=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,n){if(typeof Me.Buffer==="function")return Me.Buffer.from(s,"base64");else if(typeof atob==="function"){let i=atob(s.replace(/[\n\r]/g,"")),r=new Uint8Array(i.length);for(let o=0;o<i.length;++o)r[o]=i.charCodeAt(o);return r}else return n("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:n,value:i},r,o,a){if(!i)return"";let l=i,f;if(typeof Me.Buffer==="function")f=l instanceof Me.Buffer?l.toString("base64"):Me.Buffer.from(l.buffer).toString("base64");else if(typeof btoa==="function"){let u="";for(let h=0;h<l.length;++h)u+=String.fromCharCode(l[h]);f=btoa(u)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(n??(n=ts.Scalar.BLOCK_LITERAL),n!==ts.Scalar.QUOTE_DOUBLE){let u=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),h=Math.ceil(f.length/u),g=Array(h);for(let d=0,p=0;d<h;++d,p+=u)g[d]=f.substr(p,u);f=g.join(n===ts.Scalar.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return Wl.stringifyString({comment:s,type:n,value:f},r,o,a)}};Hl.binary=Ql});var wt=v(function(ec){var bt=I(),ns=z(),Xl=M(),zl=te();function Bn(s,n){if(bt.isSeq(s))for(let i=0;i<s.items.length;++i){let r=s.items[i];if(bt.isPair(r))continue;else if(bt.isMap(r)){if(r.items.length>1)n("Each pair must have its own sequence indicator");let o=r.items[0]||new ns.Pair(new Xl.Scalar(null));if(r.commentBefore)o.key.commentBefore=o.key.commentBefore?`${r.commentBefore}
|
|
53
|
+
${o.key.commentBefore}`:r.commentBefore;if(r.comment){let a=o.value??o.key;a.comment=a.comment?`${r.comment}
|
|
54
|
+
${a.comment}`:r.comment}r=o}s.items[i]=bt.isPair(r)?r:new ns.Pair(r)}else n("Expected a sequence for this tag");return s}function jn(s,n,i){let{replacer:r}=i,o=new zl.YAMLSeq(s);o.tag="tag:yaml.org,2002:pairs";let a=0;if(n&&Symbol.iterator in Object(n))for(let l of n){if(typeof r==="function")l=r.call(n,String(a++),l);let f,u;if(Array.isArray(l))if(l.length===2)f=l[0],u=l[1];else throw TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){let h=Object.keys(l);if(h.length===1)f=h[0],u=l[f];else throw TypeError(`Expected tuple with one key, not ${h.length} keys`)}else f=l;o.items.push(ns.createPair(f,u,i))}return o}var Zl={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Bn,createNode:jn};ec.createPairs=jn;ec.pairs=Zl;ec.resolvePairs=Bn});var rs=v(function(oc){var Kn=I(),is=H(),xe=ee(),ic=te(),Rn=wt();class ae extends ic.YAMLSeq{constructor(){super();this.add=xe.YAMLMap.prototype.add.bind(this),this.delete=xe.YAMLMap.prototype.delete.bind(this),this.get=xe.YAMLMap.prototype.get.bind(this),this.has=xe.YAMLMap.prototype.has.bind(this),this.set=xe.YAMLMap.prototype.set.bind(this),this.tag=ae.tag}toJSON(s,n){if(!n)return super.toJSON(s);let i=new Map;if(n?.onCreate)n.onCreate(i);for(let r of this.items){let o,a;if(Kn.isPair(r))o=is.toJS(r.key,"",n),a=is.toJS(r.value,o,n);else o=is.toJS(r,"",n);if(i.has(o))throw Error("Ordered maps must not include duplicate keys");i.set(o,a)}return i}static from(s,n,i){let r=Rn.createPairs(s,n,i),o=new this;return o.items=r.items,o}}ae.tag="tag:yaml.org,2002:omap";var rc={collection:"seq",identify:(s)=>s instanceof Map,nodeClass:ae,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,n){let i=Rn.resolvePairs(s,n),r=[];for(let{key:o}of i.items)if(Kn.isScalar(o))if(r.includes(o.value))n(`Ordered maps must not include duplicate keys: ${o.value}`);else r.push(o.value);return Object.assign(new ae,i)},createNode:(s,n,i)=>ae.from(s,n,i)};oc.YAMLOMap=ae;oc.omap=rc});var Vn=v(function(cc){var Fn=M();function Un({value:s,source:n},i){if(n&&(s?Yn:Jn).test.test(n))return n;return s?i.options.trueStr:i.options.falseStr}var Yn={identify:(s)=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Fn.Scalar(!0),stringify:Un},Jn={identify:(s)=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Fn.Scalar(!1),stringify:Un};cc.falseTag=Jn;cc.trueTag=Yn});var Wn=v(function(yc){var hc=M(),os=be(),dc={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(s)=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:os.stringifyNumber},pc={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(s)=>parseFloat(s.replace(/_/g,"")),stringify(s){let n=Number(s.value);return isFinite(n)?n.toExponential():os.stringifyNumber(s)}},mc={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let n=new hc.Scalar(parseFloat(s.replace(/_/g,""))),i=s.indexOf(".");if(i!==-1){let r=s.substring(i+1).replace(/_/g,"");if(r[r.length-1]==="0")n.minFractionDigits=r.length}return n},stringify:os.stringifyNumber};yc.float=mc;yc.floatExp=pc;yc.floatNaN=dc});var Hn=v(function(Ac){var Qn=be(),De=(s)=>typeof s==="bigint"||Number.isInteger(s);function St(s,n,i,{intAsBigInt:r}){let o=s[0];if(o==="-"||o==="+")n+=1;if(s=s.substring(n).replace(/_/g,""),r){switch(i){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let l=BigInt(s);return o==="-"?BigInt(-1)*l:l}let a=parseInt(s,i);return o==="-"?-1*a:a}function as(s,n,i){let{value:r}=s;if(De(r)){let o=r.toString(n);return r<0?"-"+i+o.substr(1):i+o}return Qn.stringifyNumber(s)}var Sc={identify:De,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,n,i)=>St(s,2,2,i),stringify:(s)=>as(s,2,"0b")},vc={identify:De,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,n,i)=>St(s,1,8,i),stringify:(s)=>as(s,8,"0")},kc={identify:De,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,n,i)=>St(s,0,10,i),stringify:Qn.stringifyNumber},Nc={identify:De,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,n,i)=>St(s,2,16,i),stringify:(s)=>as(s,16,"0x")};Ac.int=kc;Ac.intBin=Sc;Ac.intHex=Nc;Ac.intOct=vc});var ls=v(function(Cc){var Nt=I(),vt=z(),kt=ee();class le extends kt.YAMLMap{constructor(s){super(s);this.tag=le.tag}add(s){let n;if(Nt.isPair(s))n=s;else if(s&&typeof s==="object"&&"key"in s&&"value"in s&&s.value===null)n=new vt.Pair(s.key,null);else n=new vt.Pair(s,null);if(!kt.findPair(this.items,n.key))this.items.push(n)}get(s,n){let i=kt.findPair(this.items,s);return!n&&Nt.isPair(i)?Nt.isScalar(i.key)?i.key.value:i.key:i}set(s,n){if(typeof n!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=kt.findPair(this.items,s);if(i&&!n)this.items.splice(this.items.indexOf(i),1);else if(!i&&n)this.items.push(new vt.Pair(s))}toJSON(s,n){return super.toJSON(s,n,Set)}toString(s,n,i){if(!s)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},s,{allNullValues:!0}),n,i);else throw Error("Set items must all have null values")}static from(s,n,i){let{replacer:r}=i,o=new this(s);if(n&&Symbol.iterator in Object(n))for(let a of n){if(typeof r==="function")a=r.call(n,a,a);o.items.push(vt.createPair(a,null,i))}return o}}le.tag="tag:yaml.org,2002:set";var Tc={collection:"map",identify:(s)=>s instanceof Set,nodeClass:le,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,n,i)=>le.from(s,n,i),resolve(s,n){if(Nt.isMap(s))if(s.hasAllNullValues(!0))return Object.assign(new le,s);else n("Set items must all have null values");else n("Expected a mapping for this tag");return s}};Cc.YAMLSet=le;Cc.set=Tc});var fs=v(function(xc){var Pc=be();function cs(s,n){let i=s[0],r=i==="-"||i==="+"?s.substring(1):s,o=(l)=>n?BigInt(l):Number(l),a=r.replace(/_/g,"").split(":").reduce((l,f)=>l*o(60)+o(f),o(0));return i==="-"?o(-1)*a:a}function Gn(s){let{value:n}=s,i=(l)=>l;if(typeof n==="bigint")i=(l)=>BigInt(l);else if(isNaN(n)||!isFinite(n))return Pc.stringifyNumber(s);let r="";if(n<0)r="-",n*=i(-1);let o=i(60),a=[n%o];if(n<60)a.unshift(0);else if(n=(n-a[0])/o,a.unshift(n%o),n>=60)n=(n-a[0])/o,a.unshift(n);return r+a.map((l)=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var $c={identify:(s)=>typeof s==="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,n,{intAsBigInt:i})=>cs(s,i),stringify:Gn},Mc={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(s)=>cs(s,!1),stringify:Gn},Xn={identify:(s)=>s 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(s){let n=s.match(Xn.test);if(!n)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,i,r,o,a,l,f]=n.map(Number),u=n[7]?Number((n[7]+"00").substr(1,3)):0,h=Date.UTC(i,r-1,o,a||0,l||0,f||0,u),g=n[8];if(g&&g!=="Z"){let d=cs(g,!1);if(Math.abs(d)<30)d*=60;h-=60000*d}return new Date(h)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};xc.floatTime=Mc;xc.intTime=$c;xc.timestamp=Xn});var Zn=v(function(Gc){var Kc=ye(),Rc=mt(),Fc=ge(),Uc=$e(),Yc=ss(),zn=Vn(),us=Wn(),At=Hn(),Jc=at(),Vc=rs(),Wc=wt(),Qc=ls(),hs=fs(),Hc=[Kc.map,Fc.seq,Uc.string,Rc.nullTag,zn.trueTag,zn.falseTag,At.intBin,At.intOct,At.int,At.intHex,us.floatNaN,us.floatExp,us.float,Yc.binary,Jc.merge,Vc.omap,Wc.pairs,Qc.set,hs.intTime,hs.floatTime,hs.timestamp];Gc.schema=Hc});var ci=v(function(of){var ni=ye(),zc=mt(),ii=ge(),Zc=$e(),ef=Qt(),ds=Gt(),ps=zt(),tf=Mn(),sf=Dn(),ri=ss(),Be=at(),oi=rs(),ai=wt(),ei=Zn(),li=ls(),Ot=fs(),ti=new Map([["core",tf.schema],["failsafe",[ni.map,ii.seq,Zc.string]],["json",sf.schema],["yaml11",ei.schema],["yaml-1.1",ei.schema]]),si={binary:ri.binary,bool:ef.boolTag,float:ds.float,floatExp:ds.floatExp,floatNaN:ds.floatNaN,floatTime:Ot.floatTime,int:ps.int,intHex:ps.intHex,intOct:ps.intOct,intTime:Ot.intTime,map:ni.map,merge:Be.merge,null:zc.nullTag,omap:oi.omap,pairs:ai.pairs,seq:ii.seq,set:li.set,timestamp:Ot.timestamp},nf={"tag:yaml.org,2002:binary":ri.binary,"tag:yaml.org,2002:merge":Be.merge,"tag:yaml.org,2002:omap":oi.omap,"tag:yaml.org,2002:pairs":ai.pairs,"tag:yaml.org,2002:set":li.set,"tag:yaml.org,2002:timestamp":Ot.timestamp};function rf(s,n,i){let r=ti.get(n);if(r&&!s)return i&&!r.includes(Be.merge)?r.concat(Be.merge):r.slice();let o=r;if(!o)if(Array.isArray(s))o=[];else{let a=Array.from(ti.keys()).filter((l)=>l!=="yaml11").map((l)=>JSON.stringify(l)).join(", ");throw Error(`Unknown schema "${n}"; use one of ${a} or define customTags array`)}if(Array.isArray(s))for(let a of s)o=o.concat(a);else if(typeof s==="function")o=s(o.slice());if(i)o=o.concat(Be.merge);return o.reduce((a,l)=>{let f=typeof l==="string"?si[l]:l;if(!f){let u=JSON.stringify(l),h=Object.keys(si).map((g)=>JSON.stringify(g)).join(", ");throw Error(`Unknown custom tag ${u}; use one of ${h}`)}if(!a.includes(f))a.push(f);return a},[])}of.coreKnownTags=nf;of.getTags=rf});var gs=v(function(df){var ms=I(),cf=ye(),ff=ge(),uf=$e(),qt=ci(),hf=(s,n)=>s.key<n.key?-1:s.key>n.key?1:0;class ys{constructor({compat:s,customTags:n,merge:i,resolveKnownTags:r,schema:o,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(s)?qt.getTags(s,"compat"):s?qt.getTags(null,s):null,this.name=typeof o==="string"&&o||"core",this.knownTags=r?qt.coreKnownTags:{},this.tags=qt.getTags(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,ms.MAP,{value:cf.map}),Object.defineProperty(this,ms.SCALAR,{value:uf.string}),Object.defineProperty(this,ms.SEQ,{value:ff.seq}),this.sortMapEntries=typeof a==="function"?a:a===!0?hf:null}clone(){let s=Object.create(ys.prototype,Object.getOwnPropertyDescriptors(this));return s.tags=this.tags.slice(),s}}df.Schema=ys});var fi=v(function(gf){var mf=I(),bs=Ce(),je=Ee();function yf(s,n){let i=[],r=n.directives===!0;if(n.directives!==!1&&s.directives){let u=s.directives.toString(s);if(u)i.push(u),r=!0;else if(s.directives.docStart)r=!0}if(r)i.push("---");let o=bs.createStringifyContext(s,n),{commentString:a}=o.options;if(s.commentBefore){if(i.length!==1)i.unshift("");let u=a(s.commentBefore);i.unshift(je.indentComment(u,""))}let l=!1,f=null;if(s.contents){if(mf.isNode(s.contents)){if(s.contents.spaceBefore&&r)i.push("");if(s.contents.commentBefore){let g=a(s.contents.commentBefore);i.push(je.indentComment(g,""))}o.forceBlockIndent=!!s.comment,f=s.contents.comment}let u=f?void 0:()=>l=!0,h=bs.stringify(s.contents,o,()=>f=null,u);if(f)h+=je.lineComment(h,"",a(f));if((h[0]==="|"||h[0]===">")&&i[i.length-1]==="---")i[i.length-1]=`--- ${h}`;else i.push(h)}else i.push(bs.stringify(s.contents,o));if(s.directives?.docEnd)if(s.comment){let u=a(s.comment);if(u.includes(`
|
|
55
|
+
`))i.push("..."),i.push(je.indentComment(u,""));else i.push(`... ${u}`)}else i.push("...");else{let u=s.comment;if(u&&l)u=u.replace(/^\n+/,"");if(u){if((!l||f)&&i[i.length-1]!=="")i.push("");i.push(je.indentComment(a(u),""))}}return i.join(`
|
|
56
|
+
`)+`
|
|
57
|
+
`}gf.stringifyDocument=yf});var Ke=v(function(qf){var wf=Oe(),we=tt(),R=I(),Sf=z(),vf=H(),kf=gs(),Nf=fi(),ws=ze(),Af=Bt(),Of=qe(),Ss=Dt();class vs{constructor(s,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,R.NODE_TYPE,{value:R.DOC});let r=null;if(typeof n==="function"||Array.isArray(n))r=n;else if(i===void 0&&n)i=n,n=void 0;let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=o;let{version:a}=o;if(i?._directives){if(this.directives=i._directives.atDocument(),this.directives.yaml.explicit)a=this.directives.yaml.version}else this.directives=new Ss.Directives({version:a});this.setSchema(a,i),this.contents=s===void 0?null:this.createNode(s,r,i)}clone(){let s=Object.create(vs.prototype,{[R.NODE_TYPE]:{value:R.DOC}});if(s.commentBefore=this.commentBefore,s.comment=this.comment,s.errors=this.errors.slice(),s.warnings=this.warnings.slice(),s.options=Object.assign({},this.options),this.directives)s.directives=this.directives.clone();if(s.schema=this.schema.clone(),s.contents=R.isNode(this.contents)?this.contents.clone(s.schema):this.contents,this.range)s.range=this.range.slice();return s}add(s){if(Se(this.contents))this.contents.add(s)}addIn(s,n){if(Se(this.contents))this.contents.addIn(s,n)}createAlias(s,n){if(!s.anchor){let i=ws.anchorNames(this);s.anchor=!n||i.has(n)?ws.findNewAnchor(n||"a",i):n}return new wf.Alias(s.anchor)}createNode(s,n,i){let r=void 0;if(typeof n==="function")s=n.call({"":s},"",s),r=n;else if(Array.isArray(n)){let m=(O)=>typeof O==="number"||O instanceof String||O instanceof Number,w=n.filter(m).map(String);if(w.length>0)n=n.concat(w);r=n}else if(i===void 0&&n)i=n,n=void 0;let{aliasDuplicateObjects:o,anchorPrefix:a,flow:l,keepUndefined:f,onTagObj:u,tag:h}=i??{},{onAnchor:g,setAnchors:d,sourceObjects:p}=ws.createNodeAnchors(this,a||"a"),S={aliasDuplicateObjects:o??!0,keepUndefined:f??!1,onAnchor:g,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:p},N=Of.createNode(s,h,S);if(l&&R.isCollection(N))N.flow=!0;return d(),N}createPair(s,n,i={}){let r=this.createNode(s,null,i),o=this.createNode(n,null,i);return new Sf.Pair(r,o)}delete(s){return Se(this.contents)?this.contents.delete(s):!1}deleteIn(s){if(we.isEmptyPath(s)){if(this.contents==null)return!1;return this.contents=null,!0}return Se(this.contents)?this.contents.deleteIn(s):!1}get(s,n){return R.isCollection(this.contents)?this.contents.get(s,n):void 0}getIn(s,n){if(we.isEmptyPath(s))return!n&&R.isScalar(this.contents)?this.contents.value:this.contents;return R.isCollection(this.contents)?this.contents.getIn(s,n):void 0}has(s){return R.isCollection(this.contents)?this.contents.has(s):!1}hasIn(s){if(we.isEmptyPath(s))return this.contents!==void 0;return R.isCollection(this.contents)?this.contents.hasIn(s):!1}set(s,n){if(this.contents==null)this.contents=we.collectionFromPath(this.schema,[s],n);else if(Se(this.contents))this.contents.set(s,n)}setIn(s,n){if(we.isEmptyPath(s))this.contents=n;else if(this.contents==null)this.contents=we.collectionFromPath(this.schema,Array.from(s),n);else if(Se(this.contents))this.contents.setIn(s,n)}setSchema(s,n={}){if(typeof s==="number")s=String(s);let i;switch(s){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new Ss.Directives({version:"1.1"});i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=s;else this.directives=new Ss.Directives({version:s});i={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;i=null;break;default:{let r=JSON.stringify(s);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new kf.Schema(Object.assign(i,n));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:s,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:o,reviver:a}={}){let l={anchors:new Map,doc:this,keep:!s,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r==="number"?r:100},f=vf.toJS(this.contents,n??"",l);if(typeof o==="function")for(let{count:u,res:h}of l.anchors.values())o(h,u);return typeof a==="function"?Af.applyReviver(a,{"":f},"",f):f}toJSON(s,n){return this.toJS({json:!0,jsonArg:s,mapAsMap:!1,onAnchor:n})}toString(s={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in s&&(!Number.isInteger(s.indent)||Number(s.indent)<=0)){let n=JSON.stringify(s.indent);throw Error(`"indent" option must be a positive integer, not ${n}`)}return Nf.stringifyDocument(this,s)}}function Se(s){if(R.isCollection(s))return!0;throw Error("Expected a YAML collection as document contents")}qf.Document=vs});var Re=v(function(Tf){class Et extends Error{constructor(s,n,i,r){super();this.name=s,this.code=i,this.message=r,this.pos=n}}class ui extends Et{constructor(s,n,i){super("YAMLParseError",s,n,i)}}class hi extends Et{constructor(s,n,i){super("YAMLWarning",s,n,i)}}var Lf=(s,n)=>(i)=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map((f)=>n.linePos(f));let{line:r,col:o}=i.linePos[0];i.message+=` at line ${r}, column ${o}`;let a=o-1,l=s.substring(n.lineStarts[r-1],n.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&l.length>80){let f=Math.min(a-39,l.length-79);l="…"+l.substring(f),a-=f-1}if(l.length>80)l=l.substring(0,79)+"…";if(r>1&&/^ *$/.test(l.substring(0,a))){let f=s.substring(n.lineStarts[r-2],n.lineStarts[r-1]);if(f.length>80)f=f.substring(0,79)+`…
|
|
58
|
+
`;l=f+l}if(/[^ ]/.test(l)){let f=1,u=i.linePos[1];if(u&&u.line===r&&u.col>o)f=Math.max(1,Math.min(u.col-o,80-a));let h=" ".repeat(a)+"^".repeat(f);i.message+=`:
|
|
59
|
+
|
|
60
|
+
${l}
|
|
61
|
+
${h}
|
|
62
|
+
`}};Tf.YAMLError=Et;Tf.YAMLParseError=ui;Tf.YAMLWarning=hi;Tf.prettifyError=Lf});var Fe=v(function(Mf){function $f(s,{flow:n,indicator:i,next:r,offset:o,onError:a,parentIndent:l,startOnNewline:f}){let u=!1,h=f,g=f,d="",p="",S=!1,N=!1,m=null,w=null,O=null,q=null,E=null,L=null,C=null;for(let A of s){if(N){if(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma")a(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");N=!1}if(m){if(h&&A.type!=="comment"&&A.type!=="newline")a(m,"TAB_AS_INDENT","Tabs are not allowed as indentation");m=null}switch(A.type){case"space":if(!n&&(i!=="doc-start"||r?.type!=="flow-collection")&&A.source.includes("\t"))m=A;g=!0;break;case"comment":{if(!g)a(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let x=A.source.substring(1)||" ";if(!d)d=x;else d+=p+x;p="",h=!1;break}case"newline":if(h){if(d)d+=A.source;else if(!L||i!=="seq-item-ind")u=!0}else p+=A.source;if(h=!0,S=!0,w||O)q=A;g=!0;break;case"anchor":if(w)a(A,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(A.source.endsWith(":"))a(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);w=A,C??(C=A.offset),h=!1,g=!1,N=!0;break;case"tag":{if(O)a(A,"MULTIPLE_TAGS","A node can have at most one tag");O=A,C??(C=A.offset),h=!1,g=!1,N=!0;break}case i:if(w||O)a(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`);if(L)a(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${n??"collection"}`);L=A,h=i==="seq-item-ind"||i==="explicit-key-ind",g=!1;break;case"comma":if(n){if(E)a(A,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`);E=A,h=!1,g=!1;break}default:a(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),h=!1,g=!1}}let _=s[s.length-1],P=_?_.offset+_.source.length:o;if(N&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!==""))a(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(m&&(h&&m.indent<=l||r?.type==="block-map"||r?.type==="block-seq"))a(m,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:E,found:L,spaceBefore:u,comment:d,hasNewline:S,anchor:w,tag:O,newlineAfterProp:q,end:P,start:C??P}}Mf.resolveProps=$f});var Lt=v(function(Df){function ks(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
|
|
63
|
+
`))return!0;if(s.end){for(let n of s.end)if(n.type==="newline")return!0}return!1;case"flow-collection":for(let n of s.items){for(let i of n.start)if(i.type==="newline")return!0;if(n.sep){for(let i of n.sep)if(i.type==="newline")return!0}if(ks(n.key)||ks(n.value))return!0}return!1;default:return!0}}Df.containsNewline=ks});var Ns=v(function(Rf){var jf=Lt();function Kf(s,n,i){if(n?.type==="flow-collection"){let r=n.end[0];if(r.indent===s&&(r.source==="]"||r.source==="}")&&jf.containsNewline(n))i(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Rf.flowIndentCheck=Kf});var As=v(function(Yf){var di=I();function Uf(s,n,i){let{uniqueKeys:r}=s.options;if(r===!1)return!1;let o=typeof r==="function"?r:(a,l)=>a===l||di.isScalar(a)&&di.isScalar(l)&&a.value===l.value;return n.some((a)=>o(a.key,i))}Yf.mapIncludes=Uf});var bi=v(function(Gf){var pi=z(),Vf=ee(),mi=Fe(),Wf=Lt(),yi=Ns(),Qf=As(),gi="All mapping items must start at the same column";function Hf({composeNode:s,composeEmptyNode:n},i,r,o,a){let f=new(a?.nodeClass??Vf.YAMLMap)(i.schema);if(i.atRoot)i.atRoot=!1;let u=r.offset,h=null;for(let g of r.items){let{start:d,key:p,sep:S,value:N}=g,m=mi.resolveProps(d,{indicator:"explicit-key-ind",next:p??S?.[0],offset:u,onError:o,parentIndent:r.indent,startOnNewline:!0}),w=!m.found;if(w){if(p){if(p.type==="block-seq")o(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in p&&p.indent!==r.indent)o(u,"BAD_INDENT",gi)}if(!m.anchor&&!m.tag&&!S){if(h=m.end,m.comment)if(f.comment)f.comment+=`
|
|
64
|
+
`+m.comment;else f.comment=m.comment;continue}if(m.newlineAfterProp||Wf.containsNewline(p))o(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(m.found?.indent!==r.indent)o(u,"BAD_INDENT",gi);i.atKey=!0;let O=m.end,q=p?s(i,p,m,o):n(i,O,d,null,m,o);if(i.schema.compat)yi.flowIndentCheck(r.indent,p,o);if(i.atKey=!1,Qf.mapIncludes(i,f.items,q))o(O,"DUPLICATE_KEY","Map keys must be unique");let E=mi.resolveProps(S??[],{indicator:"map-value-ind",next:N,offset:q.range[2],onError:o,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(u=E.end,E.found){if(w){if(N?.type==="block-map"&&!E.hasNewline)o(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(i.options.strict&&m.start<E.found.offset-1024)o(q.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let L=N?s(i,N,E,o):n(i,u,S,null,E,o);if(i.schema.compat)yi.flowIndentCheck(r.indent,N,o);u=L.range[2];let C=new pi.Pair(q,L);if(i.options.keepSourceTokens)C.srcToken=g;f.items.push(C)}else{if(w)o(q.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(E.comment)if(q.comment)q.comment+=`
|
|
65
|
+
`+E.comment;else q.comment=E.comment;let L=new pi.Pair(q);if(i.options.keepSourceTokens)L.srcToken=g;f.items.push(L)}}if(h&&h<u)o(h,"IMPOSSIBLE","Map comment with trailing content");return f.range=[r.offset,u,h??u],f}Gf.resolveBlockMap=Hf});var wi=v(function(su){var zf=te(),Zf=Fe(),eu=Ns();function tu({composeNode:s,composeEmptyNode:n},i,r,o,a){let f=new(a?.nodeClass??zf.YAMLSeq)(i.schema);if(i.atRoot)i.atRoot=!1;if(i.atKey)i.atKey=!1;let u=r.offset,h=null;for(let{start:g,value:d}of r.items){let p=Zf.resolveProps(g,{indicator:"seq-item-ind",next:d,offset:u,onError:o,parentIndent:r.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)if(d&&d.type==="block-seq")o(p.end,"BAD_INDENT","All sequence items must start at the same column");else o(u,"MISSING_CHAR","Sequence item without - indicator");else{if(h=p.end,p.comment)f.comment=p.comment;continue}let S=d?s(i,d,p,o):n(i,p.end,g,null,p,o);if(i.schema.compat)eu.flowIndentCheck(r.indent,d,o);u=S.range[2],f.items.push(S)}return f.range=[r.offset,u,h??u],f}su.resolveBlockSeq=tu});var ve=v(function(ru){function iu(s,n,i,r){let o="";if(s){let a=!1,l="";for(let f of s){let{source:u,type:h}=f;switch(h){case"space":a=!0;break;case"comment":{if(i&&!a)r(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let g=u.substring(1)||" ";if(!o)o=g;else o+=l+g;l="";break}case"newline":if(o)l+=u;a=!0;break;default:r(f,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}n+=u.length}}return{comment:o,offset:n}}ru.resolveEnd=iu});var ki=v(function(pu){var au=I(),lu=z(),Si=ee(),cu=te(),fu=ve(),vi=Fe(),uu=Lt(),hu=As(),Os="Block collections are not allowed within flow collections",qs=(s)=>s&&(s.type==="block-map"||s.type==="block-seq");function du({composeNode:s,composeEmptyNode:n},i,r,o,a){let l=r.start.source==="{",f=l?"flow map":"flow sequence",h=new(a?.nodeClass??(l?Si.YAMLMap:cu.YAMLSeq))(i.schema);h.flow=!0;let g=i.atRoot;if(g)i.atRoot=!1;if(i.atKey)i.atKey=!1;let d=r.offset+r.start.source.length;for(let w=0;w<r.items.length;++w){let O=r.items[w],{start:q,key:E,sep:L,value:C}=O,_=vi.resolveProps(q,{flow:f,indicator:"explicit-key-ind",next:E??L?.[0],offset:d,onError:o,parentIndent:r.indent,startOnNewline:!1});if(!_.found){if(!_.anchor&&!_.tag&&!L&&!C){if(w===0&&_.comma)o(_.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(w<r.items.length-1)o(_.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`);if(_.comment)if(h.comment)h.comment+=`
|
|
66
|
+
`+_.comment;else h.comment=_.comment;d=_.end;continue}if(!l&&i.options.strict&&uu.containsNewline(E))o(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(w===0){if(_.comma)o(_.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`)}else{if(!_.comma)o(_.start,"MISSING_CHAR",`Missing , between ${f} items`);if(_.comment){let P="";e:for(let A of q)switch(A.type){case"comma":case"space":break;case"comment":P=A.source.substring(1);break e;default:break e}if(P){let A=h.items[h.items.length-1];if(au.isPair(A))A=A.value??A.key;if(A.comment)A.comment+=`
|
|
67
|
+
`+P;else A.comment=P;_.comment=_.comment.substring(P.length+1)}}}if(!l&&!L&&!_.found){let P=C?s(i,C,_,o):n(i,_.end,L,null,_,o);if(h.items.push(P),d=P.range[2],qs(C))o(P.range,"BLOCK_IN_FLOW",Os)}else{i.atKey=!0;let P=_.end,A=E?s(i,E,_,o):n(i,P,q,null,_,o);if(qs(E))o(A.range,"BLOCK_IN_FLOW",Os);i.atKey=!1;let x=vi.resolveProps(L??[],{flow:f,indicator:"map-value-ind",next:C,offset:A.range[2],onError:o,parentIndent:r.indent,startOnNewline:!1});if(x.found){if(!l&&!_.found&&i.options.strict){if(L)for(let D of L){if(D===x.found)break;if(D.type==="newline"){o(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(_.start<x.found.offset-1024)o(x.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(C)if("source"in C&&C.source&&C.source[0]===":")o(C,"MISSING_CHAR",`Missing space after : in ${f}`);else o(x.start,"MISSING_CHAR",`Missing , or : between ${f} items`);let Q=C?s(i,C,x,o):x.found?n(i,x.end,L,null,x,o):null;if(Q){if(qs(C))o(Q.range,"BLOCK_IN_FLOW",Os)}else if(x.comment)if(A.comment)A.comment+=`
|
|
68
|
+
`+x.comment;else A.comment=x.comment;let ue=new lu.Pair(A,Q);if(i.options.keepSourceTokens)ue.srcToken=O;if(l){let D=h;if(hu.mapIncludes(i,D.items,A))o(P,"DUPLICATE_KEY","Map keys must be unique");D.items.push(ue)}else{let D=new Si.YAMLMap(i.schema);D.flow=!0,D.items.push(ue);let Ws=(Q??A).range;D.range=[A.range[0],Ws[1],Ws[2]],h.items.push(D)}d=Q?Q.range[2]:x.end}}let p=l?"}":"]",[S,...N]=r.end,m=d;if(S&&S.source===p)m=S.offset+S.source.length;else{let w=f[0].toUpperCase()+f.substring(1),O=g?`${w} must end with a ${p}`:`${w} in block collection must be sufficiently indented and end with a ${p}`;if(o(d,g?"MISSING_CHAR":"BAD_INDENT",O),S&&S.source.length!==1)N.unshift(S)}if(N.length>0){let w=fu.resolveEnd(N,m,i.options.strict,o);if(w.comment)if(h.comment)h.comment+=`
|
|
69
|
+
`+w.comment;else h.comment=w.comment;h.range=[r.offset,m,w.offset]}else h.range=[r.offset,m,m];return h}pu.resolveFlowCollection=du});var Ni=v(function(Au){var yu=I(),gu=M(),bu=ee(),wu=te(),Su=bi(),vu=wi(),ku=ki();function Es(s,n,i,r,o,a){let l=i.type==="block-map"?Su.resolveBlockMap(s,n,i,r,a):i.type==="block-seq"?vu.resolveBlockSeq(s,n,i,r,a):ku.resolveFlowCollection(s,n,i,r,a),f=l.constructor;if(o==="!"||o===f.tagName)return l.tag=f.tagName,l;if(o)l.tag=o;return l}function Nu(s,n,i,r,o){let a=r.tag,l=!a?null:n.directives.tagName(a.source,(p)=>o(a,"TAG_RESOLVE_FAILED",p));if(i.type==="block-seq"){let{anchor:p,newlineAfterProp:S}=r,N=p&&a?p.offset>a.offset?p:a:p??a;if(N&&(!S||S.offset<N.offset))o(N,"MISSING_CHAR","Missing newline after block sequence props")}let f=i.type==="block-map"?"map":i.type==="block-seq"?"seq":i.start.source==="{"?"map":"seq";if(!a||!l||l==="!"||l===bu.YAMLMap.tagName&&f==="map"||l===wu.YAMLSeq.tagName&&f==="seq")return Es(s,n,i,o,l);let u=n.schema.tags.find((p)=>p.tag===l&&p.collection===f);if(!u){let p=n.schema.knownTags[l];if(p&&p.collection===f)n.schema.tags.push(Object.assign({},p,{default:!1})),u=p;else{if(p)o(a,"BAD_COLLECTION_TYPE",`${p.tag} used for ${f} collection, but expects ${p.collection??"scalar"}`,!0);else o(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0);return Es(s,n,i,o,l)}}let h=Es(s,n,i,o,l,u),g=u.resolve?.(h,(p)=>o(a,"TAG_RESOLVE_FAILED",p),n.options)??h,d=yu.isNode(g)?g:new gu.Scalar(g);if(d.range=h.range,d.tag=l,u?.format)d.format=u.format;return d}Au.composeCollection=Nu});var Ts=v(function(Tu){var Ls=M();function qu(s,n,i){let r=n.offset,o=Eu(n,s.options.strict,i);if(!o)return{value:"",type:null,comment:"",range:[r,r,r]};let a=o.mode===">"?Ls.Scalar.BLOCK_FOLDED:Ls.Scalar.BLOCK_LITERAL,l=n.source?Lu(n.source):[],f=l.length;for(let m=l.length-1;m>=0;--m){let w=l[m][1];if(w===""||w==="\r")f=m;else break}if(f===0){let m=o.chomp==="+"&&l.length>0?`
|
|
70
|
+
`.repeat(Math.max(1,l.length-1)):"",w=r+o.length;if(n.source)w+=n.source.length;return{value:m,type:a,comment:o.comment,range:[r,w,w]}}let u=n.indent+o.indent,h=n.offset+o.length,g=0;for(let m=0;m<f;++m){let[w,O]=l[m];if(O===""||O==="\r"){if(o.indent===0&&w.length>u)u=w.length}else{if(w.length<u)i(h+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(o.indent===0)u=w.length;if(g=m,u===0&&!s.atRoot)i(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=w.length+O.length+1}for(let m=l.length-1;m>=f;--m)if(l[m][0].length>u)f=m+1;let d="",p="",S=!1;for(let m=0;m<g;++m)d+=l[m][0].slice(u)+`
|
|
71
|
+
`;for(let m=g;m<f;++m){let[w,O]=l[m];h+=w.length+O.length+1;let q=O[O.length-1]==="\r";if(q)O=O.slice(0,-1);if(O&&w.length<u){let L=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;i(h-O.length-(q?2:1),"BAD_INDENT",L),w=""}if(a===Ls.Scalar.BLOCK_LITERAL)d+=p+w.slice(u)+O,p=`
|
|
72
|
+
`;else if(w.length>u||O[0]==="\t"){if(p===" ")p=`
|
|
73
|
+
`;else if(!S&&p===`
|
|
74
|
+
`)p=`
|
|
75
|
+
|
|
76
|
+
`;d+=p+w.slice(u)+O,p=`
|
|
77
|
+
`,S=!0}else if(O==="")if(p===`
|
|
78
|
+
`)d+=`
|
|
79
|
+
`;else p=`
|
|
80
|
+
`;else d+=p+O,p=" ",S=!1}switch(o.chomp){case"-":break;case"+":for(let m=f;m<l.length;++m)d+=`
|
|
81
|
+
`+l[m][0].slice(u);if(d[d.length-1]!==`
|
|
82
|
+
`)d+=`
|
|
83
|
+
`;break;default:d+=`
|
|
84
|
+
`}let N=r+o.length+n.source.length;return{value:d,type:a,comment:o.comment,range:[r,N,N]}}function Eu({offset:s,props:n},i,r){if(n[0].type!=="block-scalar-header")return r(n[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:o}=n[0],a=o[0],l=0,f="",u=-1;for(let p=1;p<o.length;++p){let S=o[p];if(!f&&(S==="-"||S==="+"))f=S;else{let N=Number(S);if(!l&&N)l=N;else if(u===-1)u=s+p}}if(u!==-1)r(u,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let h=!1,g="",d=o.length;for(let p=1;p<n.length;++p){let S=n[p];switch(S.type){case"space":h=!0;case"newline":d+=S.source.length;break;case"comment":if(i&&!h)r(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");d+=S.source.length,g=S.source.substring(1);break;case"error":r(S,"UNEXPECTED_TOKEN",S.message),d+=S.source.length;break;default:{let N=`Unexpected token in block scalar header: ${S.type}`;r(S,"UNEXPECTED_TOKEN",N);let m=S.source;if(m&&typeof m==="string")d+=m.length}}}return{mode:a,indent:l,chomp:f,comment:g,length:d}}function Lu(s){let n=s.split(/\n( *)/),i=n[0],r=i.match(/^( *)/),a=[r?.[1]?[r[1],i.slice(r[1].length)]:["",i]];for(let l=1;l<n.length;l+=2)a.push([n[l],n[l+1]]);return a}Tu.resolveBlockScalar=qu});var _s=v(function(ju){var Cs=M(),_u=ve();function Iu(s,n,i){let{offset:r,type:o,source:a,end:l}=s,f,u,h=(p,S,N)=>i(r+p,S,N);switch(o){case"scalar":f=Cs.Scalar.PLAIN,u=Pu(a,h);break;case"single-quoted-scalar":f=Cs.Scalar.QUOTE_SINGLE,u=$u(a,h);break;case"double-quoted-scalar":f=Cs.Scalar.QUOTE_DOUBLE,u=Mu(a,h);break;default:return i(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[r,r+a.length,r+a.length]}}let g=r+a.length,d=_u.resolveEnd(l,g,n,i);return{value:u,type:f,comment:d.comment,range:[r,g,d.offset]}}function Pu(s,n){let i="";switch(s[0]){case"\t":i="a tab character";break;case",":i="flow indicator character ,";break;case"%":i="directive indicator character %";break;case"|":case">":{i=`block scalar indicator ${s[0]}`;break}case"@":case"`":{i=`reserved character ${s[0]}`;break}}if(i)n(0,"BAD_SCALAR_START",`Plain value cannot start with ${i}`);return Ai(s)}function $u(s,n){if(s[s.length-1]!=="'"||s.length===1)n(s.length,"MISSING_CHAR","Missing closing 'quote");return Ai(s.slice(1,-1)).replace(/''/g,"'")}function Ai(s){let n,i;try{n=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
85
|
+
`,"sy"),i=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
86
|
+
`,"sy")}catch{n=/(.*?)[ \t]*\r?\n/sy,i=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=n.exec(s);if(!r)return s;let o=r[1],a=" ",l=n.lastIndex;i.lastIndex=l;while(r=i.exec(s)){if(r[1]==="")if(a===`
|
|
87
|
+
`)o+=a;else a=`
|
|
88
|
+
`;else o+=a+r[1],a=" ";l=i.lastIndex}let f=/[ \t]*(.*)/sy;return f.lastIndex=l,r=f.exec(s),o+a+(r?.[1]??"")}function Mu(s,n){let i="";for(let r=1;r<s.length-1;++r){let o=s[r];if(o==="\r"&&s[r+1]===`
|
|
89
|
+
`)continue;if(o===`
|
|
90
|
+
`){let{fold:a,offset:l}=xu(s,r);i+=a,r=l}else if(o==="\\"){let a=s[++r],l=Du[a];if(l)i+=l;else if(a===`
|
|
91
|
+
`){a=s[r+1];while(a===" "||a==="\t")a=s[++r+1]}else if(a==="\r"&&s[r+1]===`
|
|
92
|
+
`){a=s[++r+1];while(a===" "||a==="\t")a=s[++r+1]}else if(a==="x"||a==="u"||a==="U"){let f={x:2,u:4,U:8}[a];i+=Bu(s,r+1,f,n),r+=f}else{let f=s.substr(r-1,2);n(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),i+=f}}else if(o===" "||o==="\t"){let a=r,l=s[r+1];while(l===" "||l==="\t")l=s[++r+1];if(l!==`
|
|
93
|
+
`&&!(l==="\r"&&s[r+2]===`
|
|
94
|
+
`))i+=r>a?s.slice(a,r+1):o}else i+=o}if(s[s.length-1]!=='"'||s.length===1)n(s.length,"MISSING_CHAR",'Missing closing "quote');return i}function xu(s,n){let i="",r=s[n+1];while(r===" "||r==="\t"||r===`
|
|
95
|
+
`||r==="\r"){if(r==="\r"&&s[n+2]!==`
|
|
96
|
+
`)break;if(r===`
|
|
97
|
+
`)i+=`
|
|
98
|
+
`;n+=1,r=s[n+1]}if(!i)i=" ";return{fold:i,offset:n}}var Du={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Bu(s,n,i,r){let o=s.substr(n,i),l=o.length===i&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;if(isNaN(l)){let f=s.substr(n-2,i+2);return r(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),f}return String.fromCodePoint(l)}ju.resolveFlowScalar=Iu});var qi=v(function(Vu){var ce=I(),Oi=M(),Ru=Ts(),Fu=_s();function Uu(s,n,i,r){let{value:o,type:a,comment:l,range:f}=n.type==="block-scalar"?Ru.resolveBlockScalar(s,n,r):Fu.resolveFlowScalar(n,s.options.strict,r),u=i?s.directives.tagName(i.source,(d)=>r(i,"TAG_RESOLVE_FAILED",d)):null,h;if(s.options.stringKeys&&s.atKey)h=s.schema[ce.SCALAR];else if(u)h=Yu(s.schema,o,u,i,r);else if(n.type==="scalar")h=Ju(s,o,n,r);else h=s.schema[ce.SCALAR];let g;try{let d=h.resolve(o,(p)=>r(i??n,"TAG_RESOLVE_FAILED",p),s.options);g=ce.isScalar(d)?d:new Oi.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);r(i??n,"TAG_RESOLVE_FAILED",p),g=new Oi.Scalar(o)}if(g.range=f,g.source=o,a)g.type=a;if(u)g.tag=u;if(h.format)g.format=h.format;if(l)g.comment=l;return g}function Yu(s,n,i,r,o){if(i==="!")return s[ce.SCALAR];let a=[];for(let f of s.tags)if(!f.collection&&f.tag===i)if(f.default&&f.test)a.push(f);else return f;for(let f of a)if(f.test?.test(n))return f;let l=s.knownTags[i];if(l&&!l.collection)return s.tags.push(Object.assign({},l,{default:!1,test:void 0})),l;return o(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,i!=="tag:yaml.org,2002:str"),s[ce.SCALAR]}function Ju({atKey:s,directives:n,schema:i},r,o,a){let l=i.tags.find((f)=>(f.default===!0||s&&f.default==="key")&&f.test?.test(r))||i[ce.SCALAR];if(i.compat){let f=i.compat.find((u)=>u.default&&u.test?.test(r))??i[ce.SCALAR];if(l.tag!==f.tag){let u=n.tagString(l.tag),h=n.tagString(f.tag),g=`Value may be parsed as either ${u} or ${h}`;a(o,"TAG_RESOLVE_FAILED",g,!0)}}return l}Vu.composeScalar=Uu});var Ei=v(function(Hu){function Qu(s,n,i){if(n){i??(i=n.length);for(let r=i-1;r>=0;--r){let o=n[r];switch(o.type){case"space":case"comment":case"newline":s-=o.source.length;continue}o=n[++r];while(o?.type==="space")s+=o.source.length,o=n[++r];break}}return s}Hu.emptyScalarPosition=Qu});var Ci=v(function(ih){var Xu=Oe(),zu=I(),Zu=Ni(),Li=qi(),eh=ve(),th=Ei(),sh={composeNode:Ti,composeEmptyNode:Is};function Ti(s,n,i,r){let o=s.atKey,{spaceBefore:a,comment:l,anchor:f,tag:u}=i,h,g=!0;switch(n.type){case"alias":if(h=nh(s,n,r),f||u)r(n,"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(h=Li.composeScalar(s,n,u,r),f)h.anchor=f.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(h=Zu.composeCollection(sh,s,n,i,r),f)h.anchor=f.source.substring(1);break;default:{let d=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;r(n,"UNEXPECTED_TOKEN",d),h=Is(s,n.offset,void 0,null,i,r),g=!1}}if(f&&h.anchor==="")r(f,"BAD_ALIAS","Anchor cannot be an empty string");if(o&&s.options.stringKeys&&(!zu.isScalar(h)||typeof h.value!=="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str"))r(u??n,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(a)h.spaceBefore=!0;if(l)if(n.type==="scalar"&&n.source==="")h.comment=l;else h.commentBefore=l;if(s.options.keepSourceTokens&&g)h.srcToken=n;return h}function Is(s,n,i,r,{spaceBefore:o,comment:a,anchor:l,tag:f,end:u},h){let g={type:"scalar",offset:th.emptyScalarPosition(n,i,r),indent:-1,source:""},d=Li.composeScalar(s,g,f,h);if(l){if(d.anchor=l.source.substring(1),d.anchor==="")h(l,"BAD_ALIAS","Anchor cannot be an empty string")}if(o)d.spaceBefore=!0;if(a)d.comment=a,d.range[2]=u;return d}function nh({options:s},{offset:n,source:i,end:r},o){let a=new Xu.Alias(i.substring(1));if(a.source==="")o(n,"BAD_ALIAS","Alias cannot be an empty string");if(a.source.endsWith(":"))o(n+i.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let l=n+i.length,f=eh.resolveEnd(r,l,s.strict,o);if(a.range=[n,l,f.offset],f.comment)a.comment=f.comment;return a}ih.composeEmptyNode=Is;ih.composeNode=Ti});var Ii=v(function(uh){var ah=Ke(),_i=Ci(),lh=ve(),ch=Fe();function fh(s,n,{offset:i,start:r,value:o,end:a},l){let f=Object.assign({_directives:n},s),u=new ah.Document(void 0,f),h={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},g=ch.resolveProps(r,{indicator:"doc-start",next:o??a?.[0],offset:i,onError:l,parentIndent:0,startOnNewline:!0});if(g.found){if(u.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!g.hasNewline)l(g.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}u.contents=o?_i.composeNode(h,o,g,l):_i.composeEmptyNode(h,g.end,r,null,g,l);let d=u.contents.range[2],p=lh.resolveEnd(a,d,!1,l);if(p.comment)u.comment=p.comment;return u.range=[i,d,p.offset],u}uh.composeDoc=fh});var Ps=v(function(bh){var dh=We("process"),ph=Dt(),mh=Ke(),Ue=Re(),Pi=I(),yh=Ii(),gh=ve();function Ye(s){if(typeof s==="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:n,source:i}=s;return[n,n+(typeof i==="string"?i.length:1)]}function $i(s){let n="",i=!1,r=!1;for(let o=0;o<s.length;++o){let a=s[o];switch(a[0]){case"#":n+=(n===""?"":r?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(a.substring(1)||" "),i=!0,r=!1;break;case"%":if(s[o+1]?.[0]!=="#")o+=1;i=!1;break;default:if(!i)r=!0;i=!1}}return{comment:n,afterEmptyLine:r}}class Mi{constructor(s={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,o)=>{let a=Ye(n);if(o)this.warnings.push(new Ue.YAMLWarning(a,i,r));else this.errors.push(new Ue.YAMLParseError(a,i,r))},this.directives=new ph.Directives({version:s.version||"1.2"}),this.options=s}decorate(s,n){let{comment:i,afterEmptyLine:r}=$i(this.prelude);if(i){let o=s.contents;if(n)s.comment=s.comment?`${s.comment}
|
|
103
|
+
${i}`:i;else if(r||s.directives.docStart||!o)s.commentBefore=i;else if(Pi.isCollection(o)&&!o.flow&&o.items.length>0){let a=o.items[0];if(Pi.isPair(a))a=a.key;let l=a.commentBefore;a.commentBefore=l?`${i}
|
|
104
|
+
${l}`:i}else{let a=o.commentBefore;o.commentBefore=a?`${i}
|
|
105
|
+
${a}`:i}}if(n)Array.prototype.push.apply(s.errors,this.errors),Array.prototype.push.apply(s.warnings,this.warnings);else s.errors=this.errors,s.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:$i(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(s,n=!1,i=-1){for(let r of s)yield*this.next(r);yield*this.end(n,i)}*next(s){if(dh.env.LOG_STREAM)console.dir(s,{depth:null});switch(s.type){case"directive":this.directives.add(s.source,(n,i,r)=>{let o=Ye(s);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",i,r)}),this.prelude.push(s.source),this.atDirectives=!0;break;case"document":{let n=yh.composeDoc(this.options,this.directives,s,this.onError);if(this.atDirectives&&!n.directives.docStart)this.onError(s,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(n,!1),this.doc)yield this.doc;this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(s.source);break;case"error":{let n=s.source?`${s.message}: ${JSON.stringify(s.source)}`:s.message,i=new Ue.YAMLParseError(Ye(s),"UNEXPECTED_TOKEN",n);if(this.atDirectives||!this.doc)this.errors.push(i);else this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){this.errors.push(new Ue.YAMLParseError(Ye(s),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let n=gh.resolveEnd(s.end,s.offset+s.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
|
|
106
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Ue.YAMLParseError(Ye(s),"UNEXPECTED_TOKEN",`Unsupported token ${s.type}`))}}*end(s=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(s){let i=Object.assign({_directives:this.directives},this.options),r=new mh.Document(void 0,i);if(this.atDirectives)this.onError(n,"MISSING_CHAR","Missing directives-end indicator line");r.range=[0,n,n],this.decorate(r,!1),yield r}}}bh.Composer=Mi});var Bi=v(function(Eh){var Sh=Ts(),vh=_s(),kh=Re(),xi=Te();function Nh(s,n=!0,i){if(s){let r=(o,a,l)=>{let f=typeof o==="number"?o:Array.isArray(o)?o[0]:o.offset;if(i)i(f,a,l);else throw new kh.YAMLParseError([f,f+1],a,l)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return vh.resolveFlowScalar(s,n,r);case"block-scalar":return Sh.resolveBlockScalar({options:{strict:n}},s,r)}}return null}function Ah(s,n){let{implicitKey:i=!1,indent:r,inFlow:o=!1,offset:a=-1,type:l="PLAIN"}=n,f=xi.stringifyString({type:l,value:s},{implicitKey:i,indent:r>0?" ".repeat(r):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),u=n.end??[{type:"newline",offset:-1,indent:r,source:`
|
|
107
|
+
`}];switch(f[0]){case"|":case">":{let h=f.indexOf(`
|
|
108
|
+
`),g=f.substring(0,h),d=f.substring(h+1)+`
|
|
109
|
+
`,p=[{type:"block-scalar-header",offset:a,indent:r,source:g}];if(!Di(p,u))p.push({type:"newline",offset:-1,indent:r,source:`
|
|
110
|
+
`});return{type:"block-scalar",offset:a,indent:r,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:a,indent:r,source:f,end:u};case"'":return{type:"single-quoted-scalar",offset:a,indent:r,source:f,end:u};default:return{type:"scalar",offset:a,indent:r,source:f,end:u}}}function Oh(s,n,i={}){let{afterKey:r=!1,implicitKey:o=!1,inFlow:a=!1,type:l}=i,f="indent"in s?s.indent:null;if(r&&typeof f==="number")f+=2;if(!l)switch(s.type){case"single-quoted-scalar":l="QUOTE_SINGLE";break;case"double-quoted-scalar":l="QUOTE_DOUBLE";break;case"block-scalar":{let h=s.props[0];if(h.type!=="block-scalar-header")throw Error("Invalid block scalar header");l=h.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:l="PLAIN"}let u=xi.stringifyString({type:l,value:n},{implicitKey:o||f===null,indent:f!==null&&f>0?" ".repeat(f):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(u[0]){case"|":case">":qh(s,u);break;case'"':$s(s,u,"double-quoted-scalar");break;case"'":$s(s,u,"single-quoted-scalar");break;default:$s(s,u,"scalar")}}function qh(s,n){let i=n.indexOf(`
|
|
111
|
+
`),r=n.substring(0,i),o=n.substring(i+1)+`
|
|
112
|
+
`;if(s.type==="block-scalar"){let a=s.props[0];if(a.type!=="block-scalar-header")throw Error("Invalid block scalar header");a.source=r,s.source=o}else{let{offset:a}=s,l="indent"in s?s.indent:-1,f=[{type:"block-scalar-header",offset:a,indent:l,source:r}];if(!Di(f,"end"in s?s.end:void 0))f.push({type:"newline",offset:-1,indent:l,source:`
|
|
113
|
+
`});for(let u of Object.keys(s))if(u!=="type"&&u!=="offset")delete s[u];Object.assign(s,{type:"block-scalar",indent:l,props:f,source:o})}}function Di(s,n){if(n)for(let i of n)switch(i.type){case"space":case"comment":s.push(i);break;case"newline":return s.push(i),!0}return!1}function $s(s,n,i){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=i,s.source=n;break;case"block-scalar":{let r=s.props.slice(1),o=n.length;if(s.props[0].type==="block-scalar-header")o-=s.props[0].source.length;for(let a of r)a.offset+=o;delete s.props,Object.assign(s,{type:i,source:n,end:r});break}case"block-map":case"block-seq":{let o={type:"newline",offset:s.offset+n.length,indent:s.indent,source:`
|
|
114
|
+
`};delete s.items,Object.assign(s,{type:i,source:n,end:[o]});break}default:{let r="indent"in s?s.indent:-1,o="end"in s&&Array.isArray(s.end)?s.end.filter((a)=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(let a of Object.keys(s))if(a!=="type"&&a!=="offset")delete s[a];Object.assign(s,{type:i,indent:r,source:n,end:o})}}}Eh.createScalarToken=Ah;Eh.resolveAsScalar=Nh;Eh.setScalarValue=Oh});var ji=v(function(Ih){var _h=(s)=>("type"in s)?Ct(s):Tt(s);function Ct(s){switch(s.type){case"block-scalar":{let n="";for(let i of s.props)n+=Ct(i);return n+s.source}case"block-map":case"block-seq":{let n="";for(let i of s.items)n+=Tt(i);return n}case"flow-collection":{let n=s.start.source;for(let i of s.items)n+=Tt(i);for(let i of s.end)n+=i.source;return n}case"document":{let n=Tt(s);if(s.end)for(let i of s.end)n+=i.source;return n}default:{let n=s.source;if("end"in s&&s.end)for(let i of s.end)n+=i.source;return n}}}function Tt({start:s,key:n,sep:i,value:r}){let o="";for(let a of s)o+=a.source;if(n)o+=Ct(n);if(i)for(let a of i)o+=a.source;if(r)o+=Ct(r);return o}Ih.stringify=_h});var Fi=v(function(Mh){var Ms=Symbol("break visit"),$h=Symbol("skip children"),Ki=Symbol("remove item");function fe(s,n){if("type"in s&&s.type==="document")s={start:s.start,value:s.value};Ri(Object.freeze([]),s,n)}fe.BREAK=Ms;fe.SKIP=$h;fe.REMOVE=Ki;fe.itemAtPath=(s,n)=>{let i=s;for(let[r,o]of n){let a=i?.[r];if(a&&"items"in a)i=a.items[o];else return}return i};fe.parentCollection=(s,n)=>{let i=fe.itemAtPath(s,n.slice(0,-1)),r=n[n.length-1][0],o=i?.[r];if(o&&"items"in o)return o;throw Error("Parent collection not found")};function Ri(s,n,i){let r=i(n,s);if(typeof r==="symbol")return r;for(let o of["key","value"]){let a=n[o];if(a&&"items"in a){for(let l=0;l<a.items.length;++l){let f=Ri(Object.freeze(s.concat([[o,l]])),a.items[l],i);if(typeof f==="number")l=f-1;else if(f===Ms)return Ms;else if(f===Ki)a.items.splice(l,1),l-=1}if(typeof r==="function"&&o==="key")r=r(n,s)}}return typeof r==="function"?r(n,s):r}Mh.visit=fe});var _t=v(function(Uh){var xs=Bi(),Dh=ji(),Bh=Fi(),Ds="\uFEFF",Bs="\x02",js="\x18",Ks="\x1F",jh=(s)=>!!s&&("items"in s),Kh=(s)=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function Rh(s){switch(s){case Ds:return"<BOM>";case Bs:return"<DOC>";case js:return"<FLOW_END>";case Ks:return"<SCALAR>";default:return JSON.stringify(s)}}function Fh(s){switch(s){case Ds:return"byte-order-mark";case Bs:return"doc-mode";case js:return"flow-error-end";case Ks:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
115
|
+
`:case`\r
|
|
116
|
+
`: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(s[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}Uh.createScalarToken=xs.createScalarToken;Uh.resolveAsScalar=xs.resolveAsScalar;Uh.setScalarValue=xs.setScalarValue;Uh.stringify=Dh.stringify;Uh.visit=Bh.visit;Uh.BOM=Ds;Uh.DOCUMENT=Bs;Uh.FLOW_END=js;Uh.SCALAR=Ks;Uh.isCollection=jh;Uh.isScalar=Kh;Uh.prettyToken=Rh;Uh.tokenType=Fh});var Fs=v(function(rd){var Je=_t();function U(s){switch(s){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case"\t":return!0;default:return!1}}var Ui=new Set("0123456789ABCDEFabcdef"),nd=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),It=new Set(",[]{}"),id=new Set(` ,[]{}
|
|
118
|
+
\r `),Rs=(s)=>!s||id.has(s);class Yi{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(s,n=!1){if(s){if(typeof s!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+s:s,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";while(i&&(n||this.hasChars(1)))i=yield*this.parseNext(i)}atLineEnd(){let s=this.pos,n=this.buffer[s];while(n===" "||n==="\t")n=this.buffer[++s];if(!n||n==="#"||n===`
|
|
119
|
+
`)return!0;if(n==="\r")return this.buffer[s+1]===`
|
|
120
|
+
`;return!1}charAt(s){return this.buffer[this.pos+s]}continueScalar(s){let n=this.buffer[s];if(this.indentNext>0){let i=0;while(n===" ")n=this.buffer[++i+s];if(n==="\r"){let r=this.buffer[i+s+1];if(r===`
|
|
121
|
+
`||!r&&!this.atEnd)return s+i+1}return n===`
|
|
122
|
+
`||i>=this.indentNext||!n&&!this.atEnd?s+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(s,3);if((i==="---"||i==="...")&&U(this.buffer[s+3]))return-1}return s}getLine(){let s=this.lineEndPos;if(typeof s!=="number"||s!==-1&&s<this.pos)s=this.buffer.indexOf(`
|
|
123
|
+
`,this.pos),this.lineEndPos=s;if(s===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[s-1]==="\r")s-=1;return this.buffer.substring(this.pos,s)}hasChars(s){return this.pos+s<=this.buffer.length}setNext(s){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=s,null}peek(s){return this.buffer.substr(this.pos,s)}*parseNext(s){switch(s){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 s=this.getLine();if(s===null)return this.setNext("stream");if(s[0]===Je.BOM)yield*this.pushCount(1),s=s.substring(1);if(s[0]==="%"){let n=s.length,i=s.indexOf("#");while(i!==-1){let o=s[i-1];if(o===" "||o==="\t"){n=i-1;break}else i=s.indexOf("#",i+1)}while(!0){let o=s[n-1];if(o===" "||o==="\t")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(s.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(s.length-n),yield*this.pushNewline(),"stream"}return yield Je.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let s=this.charAt(0);if(!s&&!this.atEnd)return this.setNext("line-start");if(s==="-"||s==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&U(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!U(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[s,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((s==="-"||s==="?"||s===":")&&U(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let s=this.getLine();if(s===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(s[n]){case"#":yield*this.pushCount(s.length-n);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(Rs),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(s.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let s,n,i=-1;do{if(s=yield*this.pushNewline(),s>0)n=yield*this.pushSpaces(!1),this.indentValue=i=n;else n=0;n+=yield*this.pushSpaces(!0)}while(s+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if(i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&U(r[3])){if(!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Je.FLOW_END,yield*this.parseLineStart()}let o=0;while(r[o]===",")o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),r[o]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-o),"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(Rs),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||U(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let s=this.charAt(0),n=this.buffer.indexOf(s,this.pos+1);if(s==="'")while(n!==-1&&this.buffer[n+1]==="'")n=this.buffer.indexOf("'",n+2);else while(n!==-1){let o=0;while(this.buffer[n-1-o]==="\\")o+=1;if(o%2===0)break;n=this.buffer.indexOf('"',n+1)}let i=this.buffer.substring(0,n),r=i.indexOf(`
|
|
124
|
+
`,this.pos);if(r!==-1){while(r!==-1){let o=this.continueScalar(r+1);if(o===-1)break;r=i.indexOf(`
|
|
125
|
+
`,o)}if(r!==-1)n=r-(i[r-1]==="\r"?2:1)}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let s=this.pos;while(!0){let n=this.buffer[++s];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil((n)=>U(n)||n==="#")}*parseBlockScalar(){let s=this.pos-1,n=0,i;e:for(let o=this.pos;i=this.buffer[o];++o)switch(i){case" ":n+=1;break;case`
|
|
126
|
+
`:s=o,n=0;break;case"\r":{let a=this.buffer[o+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
127
|
+
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=n;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(s+1);if(o===-1)break;s=this.buffer.indexOf(`
|
|
128
|
+
`,o)}while(s!==-1);if(s===-1){if(!this.atEnd)return this.setNext("block-scalar");s=this.buffer.length}}let r=s+1;i=this.buffer[r];while(i===" ")i=this.buffer[++r];if(i==="\t"){while(i==="\t"||i===" "||i==="\r"||i===`
|
|
129
|
+
`)i=this.buffer[++r];s=r-1}else if(!this.blockScalarKeep)do{let o=s-1,a=this.buffer[o];if(a==="\r")a=this.buffer[--o];let l=o;while(a===" ")a=this.buffer[--o];if(a===`
|
|
130
|
+
`&&o>=this.pos&&o+1+n>l)s=o;else break}while(!0);return yield Je.SCALAR,yield*this.pushToIndex(s+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let s=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;while(r=this.buffer[++i])if(r===":"){let o=this.buffer[i+1];if(U(o)||s&&It.has(o))break;n=i}else if(U(r)){let o=this.buffer[i+1];if(r==="\r")if(o===`
|
|
131
|
+
`)i+=1,r=`
|
|
132
|
+
`,o=this.buffer[i+1];else n=i;if(o==="#"||s&&It.has(o))break;if(r===`
|
|
133
|
+
`){let a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(s&&It.has(r))break;n=i}if(!r&&!this.atEnd)return this.setNext("plain-scalar");return yield Je.SCALAR,yield*this.pushToIndex(n+1,!0),s?"flow":"doc"}*pushCount(s){if(s>0)return yield this.buffer.substr(this.pos,s),this.pos+=s,s;return 0}*pushToIndex(s,n){let i=this.buffer.slice(this.pos,s);if(i)return yield i,this.pos+=i.length,i.length;else if(n)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Rs))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let s=this.flowLevel>0,n=this.charAt(1);if(U(n)||s&&It.has(n)){if(!s)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let s=this.pos+2,n=this.buffer[s];while(!U(n)&&n!==">")n=this.buffer[++s];return yield*this.pushToIndex(n===">"?s+1:s,!1)}else{let s=this.pos+1,n=this.buffer[s];while(n)if(nd.has(n))n=this.buffer[++s];else if(n==="%"&&Ui.has(this.buffer[s+1])&&Ui.has(this.buffer[s+2]))n=this.buffer[s+=3];else break;return yield*this.pushToIndex(s,!1)}}*pushNewline(){let s=this.buffer[this.pos];if(s===`
|
|
134
|
+
`)return yield*this.pushCount(1);else if(s==="\r"&&this.charAt(1)===`
|
|
135
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(s){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||s&&i==="\t");let r=n-this.pos;if(r>0)yield this.buffer.substr(this.pos,r),this.pos=n;return r}*pushUntil(s){let n=this.pos,i=this.buffer[n];while(!s(i))i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}rd.Lexer=Yi});var Us=v(function(ad){class Ji{constructor(){this.lineStarts=[],this.addNewLine=(s)=>this.lineStarts.push(s),this.linePos=(s)=>{let n=0,i=this.lineStarts.length;while(n<i){let o=n+i>>1;if(this.lineStarts[o]<s)n=o+1;else i=o}if(this.lineStarts[n]===s)return{line:n+1,col:1};if(n===0)return{line:0,col:s};let r=this.lineStarts[n-1];return{line:n,col:s-r+1}}}}ad.LineCounter=Ji});var Ys=v(function(ud){var cd=We("process"),Vi=_t(),fd=Fs();function se(s,n){for(let i=0;i<s.length;++i)if(s[i].type===n)return!0;return!1}function Wi(s){for(let n=0;n<s.length;++n)switch(s[n].type){case"space":case"comment":case"newline":break;default:return n}return-1}function Hi(s){switch(s?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Pt(s){switch(s.type){case"document":return s.start;case"block-map":{let n=s.items[s.items.length-1];return n.sep??n.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function ke(s){if(s.length===0)return[];let n=s.length;e:while(--n>=0)switch(s[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}while(s[++n]?.type==="space");return s.splice(n,s.length)}function Qi(s){if(s.start.type==="flow-seq-start"){for(let n of s.items)if(n.sep&&!n.value&&!se(n.start,"explicit-key-ind")&&!se(n.sep,"map-value-ind")){if(n.key)n.value=n.key;if(delete n.key,Hi(n.value))if(n.value.end)Array.prototype.push.apply(n.value.end,n.sep);else n.value.end=n.sep;else Array.prototype.push.apply(n.start,n.sep);delete n.sep}}}class Gi{constructor(s){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new fd.Lexer,this.onNewLine=s}*parse(s,n=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let i of this.lexer.lex(s,n))yield*this.next(i);if(!n)yield*this.end()}*next(s){if(this.source=s,cd.env.LOG_TOKENS)console.log("|",Vi.prettyToken(s));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=s.length;return}let n=Vi.tokenType(s);if(!n){let i=`Not a YAML token: ${s}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:s}),this.offset+=s.length}else if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+s.length);break;case"space":if(this.atNewLine&&s[0]===" ")this.indent+=s.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=s.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=s.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 s=this.peek(1);if(this.type==="doc-end"&&(!s||s.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(!s)return yield*this.stream();switch(s.type){case"document":return yield*this.document(s);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(s);case"block-scalar":return yield*this.blockScalar(s);case"block-map":return yield*this.blockMap(s);case"block-seq":return yield*this.blockSequence(s);case"flow-collection":return yield*this.flowCollection(s);case"doc-end":return yield*this.documentEnd(s)}yield*this.pop()}peek(s){return this.stack[this.stack.length-s]}*pop(s){let n=s??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);if(n.type==="block-scalar")n.indent="indent"in i?i.indent:0;else if(n.type==="flow-collection"&&i.type==="document")n.indent=0;if(n.type==="flow-collection")Qi(n);switch(i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];if(r.value)i.items.push({start:[],value:n});else r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];if(!r||r.value)i.items.push({start:[],key:n,sep:[]});else if(r.sep)r.value=n;else Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];if(r&&!r.sep&&!r.value&&r.start.length>0&&Wi(r.start)===-1&&(n.indent===0||r.start.every((o)=>o.type!=="comment"||o.indent<n.indent))){if(i.type==="document")i.end=r.start;else i.items.push({start:r.start});n.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 s={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")s.start.push(this.sourceToken);this.stack.push(s);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(s){if(s.value)return yield*this.lineEnd(s);switch(this.type){case"doc-start":{if(Wi(s.start)!==-1)yield*this.pop(),yield*this.step();else s.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":s.start.push(this.sourceToken);return}let n=this.startBlockValue(s);if(n)this.stack.push(n);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(s){if(this.type==="map-value-ind"){let n=Pt(this.peek(2)),i=ke(n),r;if(s.end)r=s.end,r.push(this.sourceToken),delete s.end;else r=[this.sourceToken];let o={type:"block-map",offset:s.offset,indent:s.indent,items:[{start:i,key:s,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(s)}*blockScalar(s){switch(this.type){case"space":case"comment":case"newline":s.props.push(this.sourceToken);return;case"scalar":if(s.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
136
|
+
`)+1;while(n!==0)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
137
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(s){let n=s.items[s.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;if((Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment")i?.push(this.sourceToken);else s.items.push({start:[this.sourceToken]})}else if(n.sep)n.sep.push(this.sourceToken);else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)s.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,s.indent)){let r=s.items[s.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,n.start),r.push(this.sourceToken),s.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=s.indent){let i=!this.onKeyLine&&this.indent===s.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(r&&n.sep&&!n.value){let a=[];for(let l=0;l<n.sep.length;++l){let f=n.sep[l];switch(f.type){case"newline":a.push(l);break;case"space":break;case"comment":if(f.indent>s.indent)a.length=0;break;default:a.length=0}}if(a.length>=2)o=n.sep.splice(a[1])}switch(this.type){case"anchor":case"tag":if(r||n.value)o.push(this.sourceToken),s.items.push({start:o}),this.onKeyLine=!0;else if(n.sep)n.sep.push(this.sourceToken);else n.start.push(this.sourceToken);return;case"explicit-key-ind":if(!n.sep&&!n.explicitKey)n.start.push(this.sourceToken),n.explicitKey=!0;else if(r||n.value)o.push(this.sourceToken),s.items.push({start:o,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(n.explicitKey)if(!n.sep)if(se(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let a=ke(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else if(n.value)s.items.push({start:[],key:null,sep:[this.sourceToken]});else if(se(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(Hi(n.key)&&!se(n.sep,"newline")){let a=ke(n.start),{key:l,sep:f}=n;f.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:f}]})}else if(o.length>0)n.sep=n.sep.concat(o,this.sourceToken);else n.sep.push(this.sourceToken);else if(!n.sep)Object.assign(n,{key:null,sep:[this.sourceToken]});else if(n.value||r)s.items.push({start:o,key:null,sep:[this.sourceToken]});else if(se(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else n.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);if(r||n.value)s.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0;else if(n.sep)this.stack.push(a);else Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0;return}default:{let a=this.startBlockValue(s);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!se(n.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(i)s.items.push({start:o});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(s){let n=s.items[s.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;if((Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment")i?.push(this.sourceToken);else s.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)s.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,s.indent)){let r=s.items[s.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,n.start),r.push(this.sourceToken),s.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=s.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==s.indent)break;if(n.value||se(n.start,"seq-item-ind"))s.items.push({start:[this.sourceToken]});else n.start.push(this.sourceToken);return}if(this.indent>s.indent){let i=this.startBlockValue(s);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(s){let n=s.items[s.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i&&i.type==="flow-collection")}else if(s.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!n||n.sep)s.items.push({start:[this.sourceToken]});else n.start.push(this.sourceToken);return;case"map-value-ind":if(!n||n.value)s.items.push({start:[],key:null,sep:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!n||n.value)s.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);if(!n||n.value)s.items.push({start:[],key:r,sep:[]});else if(n.sep)this.stack.push(r);else Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":s.end.push(this.sourceToken);return}let i=this.startBlockValue(s);if(i)this.stack.push(i);else yield*this.pop(),yield*this.step()}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===s.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=Pt(i),o=ke(r);Qi(s);let a=s.end.splice(1,s.end.length);a.push(this.sourceToken);let l={type:"block-map",offset:s.offset,indent:s.indent,items:[{start:o,key:s,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(s)}}flowScalar(s){if(this.onNewLine){let n=this.source.indexOf(`
|
|
138
|
+
`)+1;while(n!==0)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
139
|
+
`,n)+1}return{type:s,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(s){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 n=Pt(s),i=ke(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Pt(s),i=ke(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(s,n){if(this.type!=="comment")return!1;if(this.indent<=n)return!1;return s.every((i)=>i.type==="newline"||i.type==="space")}*documentEnd(s){if(this.type!=="doc-mode"){if(s.end)s.end.push(this.sourceToken);else s.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(s){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(s.end)s.end.push(this.sourceToken);else s.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}ud.Parser=Gi});var tr=v(function(Sd){var Xi=Ps(),dd=Ke(),Ve=Re(),pd=Ut(),md=I(),yd=Us(),zi=Ys();function Zi(s){let n=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||n&&new yd.LineCounter||null,prettyErrors:n}}function gd(s,n={}){let{lineCounter:i,prettyErrors:r}=Zi(n),o=new zi.Parser(i?.addNewLine),a=new Xi.Composer(n),l=Array.from(a.compose(o.parse(s)));if(r&&i)for(let f of l)f.errors.forEach(Ve.prettifyError(s,i)),f.warnings.forEach(Ve.prettifyError(s,i));if(l.length>0)return l;return Object.assign([],{empty:!0},a.streamInfo())}function er(s,n={}){let{lineCounter:i,prettyErrors:r}=Zi(n),o=new zi.Parser(i?.addNewLine),a=new Xi.Composer(n),l=null;for(let f of a.compose(o.parse(s),!0,s.length))if(!l)l=f;else if(l.options.logLevel!=="silent"){l.errors.push(new Ve.YAMLParseError(f.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(r&&i)l.errors.forEach(Ve.prettifyError(s,i)),l.warnings.forEach(Ve.prettifyError(s,i));return l}function bd(s,n,i){let r=void 0;if(typeof n==="function")r=n;else if(i===void 0&&n&&typeof n==="object")i=n;let o=er(s,i);if(!o)return null;if(o.warnings.forEach((a)=>pd.warn(o.options.logLevel,a)),o.errors.length>0)if(o.options.logLevel!=="silent")throw o.errors[0];else o.errors=[];return o.toJS(Object.assign({reviver:r},i))}function wd(s,n,i){let r=null;if(typeof n==="function"||Array.isArray(n))r=n;else if(i===void 0&&n)i=n;if(typeof i==="string")i=i.length;if(typeof i==="number"){let o=Math.round(i);i=o<1?void 0:o>8?{indent:8}:{indent:o}}if(s===void 0){let{keepUndefined:o}=i??n??{};if(!o)return}if(md.isDocument(s)&&!r)return s.toString(i);return new dd.Document(s,r,i).toString(i)}Sd.parse=bd;Sd.parseAllDocuments=gd;Sd.parseDocument=er;Sd.stringify=wd});import{execFileSync as yp}from"node:child_process";import{readFile as gp}from"node:fs/promises";import{basename as bp,dirname as wp,extname as cr,resolve as Sp}from"node:path";import{pathToFileURL as vp}from"node:url";var Od=Ps(),qd=Ke(),Ed=gs(),Js=Re(),Ld=Oe(),ne=I(),Td=z(),Cd=M(),_d=ee(),Id=te(),Vm=_t(),Pd=Fs(),$d=Us(),Md=Ys(),$t=tr(),sr=Ne();var xd=Od.Composer,Dd=qd.Document,Bd=Ed.Schema,{YAMLError:jd,YAMLParseError:Kd,YAMLWarning:Rd}=Js,Fd=Ld.Alias,{isAlias:Ud,isCollection:Yd,isDocument:Jd,isMap:Vd,isNode:Wd,isPair:Qd,isScalar:Hd,isSeq:Gd}=ne,Xd=Td.Pair,zd=Cd.Scalar,Zd=_d.YAMLMap,ep=Id.YAMLSeq;var tp=Pd.Lexer,sp=$d.LineCounter,np=Md.Parser,{parse:Vs,parseAllDocuments:ip,parseDocument:rp,stringify:op}=$t,{visit:ap,visitAsync:lp}=sr;var nr=["process_started","process_healthy","process_completed","process_completed_successfully","process_log_ready"],ir=["always","on_failure","exit_on_failure","no"],cp=(s)=>/^[A-Za-z0-9_@%+=:,./-]+$/u.test(s)?s:`'${s.replaceAll("'","'\\''")}'`,or=(s,n)=>{if(typeof n==="string"&&n.trim()!=="")return n;if(Array.isArray(n)&&n.length>0&&n.every((i)=>typeof i==="string"))return n.map(cp).join(" ");throw Error(`${s}: no command`)},fp=(s,n)=>{if(n===void 0)return;if(Array.isArray(n)){if(n.length===0)return;throw Error(`${s}: an environment list cannot say which values are secret references; use a map of name to {"$secret": "<name>"}`)}if(n===null||typeof n!=="object")throw Error(`${s}: environment must be a map`);let i={};for(let[r,o]of Object.entries(n)){let a=o!==null&&typeof o==="object"?o.$secret:void 0;if(typeof a!=="string"||a.length===0)throw Error(`${s}: env ${r} is a literal value; the neutral record carries only {"$secret": "<name>"}`);i[r]={$secret:a}}return i},up=(s)=>{let n=s.schedule??s,i=typeof n.cron==="string"?n.cron:void 0,r=typeof n.interval==="string"?n.interval:void 0,o=typeof s.timezone==="string"?s.timezone:void 0,a=typeof s.run_on_start==="boolean"?s.run_on_start:void 0;if(i===void 0&&r===void 0&&o===void 0&&a===void 0)return;return{...i!==void 0?{cron:i}:{},...r!==void 0?{interval:r}:{},...o!==void 0?{timezone:o}:{},...a!==void 0?{run_on_start:a}:{}}},hp=(s,n)=>{let i=n.restart??n.restart_policy;if(i===void 0)return;let r=i!==null&&typeof i==="object"?i:void 0,o=r===void 0?i:r.policy;if(typeof o!=="string"||!ir.includes(o))throw Error(`${s}: restart policy ${JSON.stringify(o)} is not one of ${ir.join(", ")}`);let a=r!==void 0&&typeof r.backoff_seconds==="number"?r.backoff_seconds:void 0,l=r!==void 0&&typeof r.max_restarts==="number"?r.max_restarts:void 0;return{policy:o,...a!==void 0?{backoff_seconds:a}:{},...l!==void 0?{max_restarts:l}:{}}},dp=(s,n)=>{let i=n.depends_on;if(i===void 0)return;let r=(o,a)=>{if(a===void 0)return{name:o,condition:"process_started"};if(typeof a!=="string"||!nr.includes(a))throw Error(`${s}: depends_on ${o} condition ${JSON.stringify(a)} is not one of ${nr.join(", ")}`);return{name:o,condition:a}};if(Array.isArray(i))return i.map((o)=>{if(typeof o!=="string")throw Error(`${s}: depends_on must name services`);return r(o,void 0)});if(i!==null&&typeof i==="object")return Object.entries(i).map(([o,a])=>{let l=a!==null&&typeof a==="object"?a.condition:void 0;return r(o,l)});throw Error(`${s}: depends_on must be a list or a map`)},pp=(s,n)=>{let i=n.readiness_probe??n.liveness_probe;if(i===void 0)return;if(i===null||typeof i!=="object")throw Error(`${s}: the health probe must be a map`);let r=i;if(r.exec?.command!==void 0)return{exec:or(`${s} health`,r.exec.command)};let o=r.http_get;if(o!==void 0&&typeof o.path==="string"&&typeof o.port==="number"){let a=typeof o.host==="string"?o.host:void 0,l=o.scheme==="https"||o.scheme==="http"?o.scheme:void 0;return{http:{port:o.port,...a!==void 0?{host:a}:{},path:o.path,...l!==void 0?{scheme:l}:{}}}}throw Error(`${s}: the health probe is neither exec.command nor http_get with path and port`)},ar=[{keys:["command"],to:["command"],read:(s,n)=>({command:or(s,n.command)})},{keys:["working_dir"],to:["cwd"],read:(s,n)=>typeof n.working_dir==="string"?{cwd:n.working_dir}:{}},{keys:["environment"],to:["env"],read:(s,n)=>{let i=fp(s,n.environment);return i===void 0?{}:{env:i}}},{keys:["schedule","cron","interval","timezone","run_on_start"],to:["schedule"],read:(s,n)=>{let i=up(n);return i===void 0?{}:{schedule:i}}},{keys:["restart","restart_policy"],to:["restart"],read:(s,n)=>{let i=hp(s,n);return i===void 0?{}:{restart:i}}},{keys:["depends_on"],to:["depends_on"],read:(s,n)=>{let i=dp(s,n);return i===void 0?{}:{depends_on:i}}},{keys:["readiness_probe","liveness_probe"],to:["health"],read:(s,n)=>{let i=pp(s,n);return i===void 0?{}:{health:i}}}],rr=new Set(ar.flatMap((s)=>s.keys));function mp(s,n){for(let i of Object.keys(n))if(!rr.has(i))throw Error(`${s}: ${i} is not a field this client carries, and the driver's record cannot hold it (carried: ${[...rr].join(", ")})`);return Object.assign({},...ar.map((i)=>i.read(s,n)))}function lr(s,n){let i;try{i=Vs(s.text)}catch(a){throw Error(`${s.path}: ${a.message}`)}if(i===null||typeof i!=="object")throw Error(`${s.path}: not a process-compose document`);let r=i.processes;if(r===void 0)throw Error(`${s.path}: no processes map; this is not a process-compose file`);if(r===null||typeof r!=="object")throw Error(`${s.path}: processes must be a map`);let o=[];for(let[a,l]of Object.entries(r)){if(l===null||typeof l!=="object")throw Error(`${a}: an entry must be a map`);let f=l;if(f.extends!==void 0)throw Error(`${a}: extends is not representable; the machine lists it read-only`);o.push({name:a,source:n,...mp(a,f)})}if(o.length===0)throw Error(`${s.path}: processes is empty; nothing to apply`);return o}var fr=new Set([".ts",".mts",".js",".mjs"]),kp=(s)=>s!==null&&typeof s==="object";async function Np(s,n){if(fr.has(cr(s))){let r=await import(vp(s).href);if(r.default===void 0)throw Error(`${s}: the program has no default export`);let o=typeof r.default==="function"?await r.default():r.default;if(!kp(o))throw Error(`${s}: the default export is not a plan object`);return o}let i=await gp(s,"utf8");return{services:lr({path:s,text:i},n)}}async function Ap(s){if(fr.has(cr(s)))return y("program",bp(s));let n;try{n=yp("git",["-C",wp(s),"rev-parse","--short=12","HEAD"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{n="no-commit"}return y("file",`${s}@${n}`)}function Op(s){if(s.origin.trim().length===0||s.workspace.trim().length===0)return;let n={origin:s.origin.trim(),workspace:s.workspace.trim(),sessionFile:s.sessionFile,json:s.json},i=t();return{async mintHostJoin(r){let o=await e(n,i,{method:"POST",path:"/join-links",body:{purpose:"host",agentMemberIds:[...r]},what:"mint a host join link",label:"HOST_JOIN"});if("error"in o)throw Error(o.error);let a=o.answer;if(typeof a.id!=="string"||typeof a.code!=="string"||typeof a.expiresAt!=="string")throw Error(`HOST_JOIN_ANSWER_INVALID: the workspace minted a link without id, code and expiresAt (${JSON.stringify(o.answer).slice(0,300)})`);return{id:a.id,code:a.code,url:typeof a.url==="string"?a.url:"",expiresAt:a.expiresAt}}}}var qp=(s,n,i)=>{if(s.json){console.log(JSON.stringify(n,null,2));return}console.log(`machine ${s.machine}; source ${i.kind}:${i.id}`);for(let a of T(n))console.log(a);let r=n.agents;if(n.create.length+n.change.length+n.remove.length+(r===void 0?0:r.create.length+r.change.length+r.remove.length)+(n.hosts?.pending.length??0)===0)console.log("nothing to do")};async function iy(s,n){let i;try{if(n.stop&&n.keep)throw Error("--stop and --keep answer the same question differently; pass one");let r=Sp(s),o=await Ap(r),a=await Np(r,o);if((a.services!==void 0||a.agents!==void 0)&&n.machine.length===0)throw Error("--machine <url> is required: the machine's ahpd WebSocket endpoint");if(n.machine.length>0)i=await c(n.machine,{token:n.token,clientId:"hightea-apply"});let f=i??{call:async()=>{throw Error("this plan names no services or agents, so no ahpd channel is read")}},u=n.stop?"stop":n.keep?"keep":void 0,h=Op(n),g=await k(a,f,{source:o,prune:n.prune,...u===void 0?{}:{removal:u},...h===void 0?{}:{hostJoin:h}});if(qp(n,g,o),!n.yes){if(!n.json)console.log("nothing sent; run again with --yes to apply");return 0}let d=await b(g,f,h);if(n.json)console.log(JSON.stringify(d,null,2));else{let p=d.written.length===0?"nothing":d.written.join(", "),S=d.removed.length===0?"nothing":d.removed.join(", "),N=d.kept.length===0?"":`; kept ${d.kept.join(", ")}`,m=d.hostLinks===void 0||d.hostLinks.length===0?"":`; minted ${d.hostLinks.length} host ${d.hostLinks.length===1?"link":"links"}`;if(console.log(`wrote ${p}; removed ${S}${N}${m}`),d.hostNote!==void 0)console.log(`note: ${d.hostNote}`);for(let w of d.hostLinks??[])console.log(`host ${w.name}: join with ${w.link.url||w.link.code} (single use; expires ${w.link.expiresAt})`)}return 0}catch(r){return console.error(r.message),1}finally{i?.close()}}export{iy as applyFile};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-kjkww5cr.js";import{t,e}from"./chunk-vzkbknwq.js";var u=`hightea source bind --origin https://your-deployment --workspace SLUG --source SOURCE --host HOST [--refresh 1h] [--session-file FILE] [--json]
|
|
2
2
|
hightea source bind-linear --origin https://your-deployment --workspace SLUG --team TEAM [--refresh 5m] [--session-file FILE] [--json]
|
|
3
3
|
hightea source teams --origin https://your-deployment --workspace SLUG [--session-file FILE] [--json]
|
|
4
4
|
hightea source unbind --origin https://your-deployment --workspace SLUG --source SOURCE [--session-file FILE] [--json]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import"./chunk-kjkww5cr.js";import{t,e}from"./chunk-vzkbknwq.js";var c={ADMIN_SEAT_REQUIRED:4},m=`hightea admin room create --origin https://your-deployment --workspace SLUG --slug ROOM --seat @chief [--title TITLE] [--session-file FILE] [--json]
|
|
2
|
+
hightea admin member remove --origin https://your-deployment --workspace SLUG MEMBER_ID --seat @chief [--session-file FILE] [--json]
|
|
3
|
+
hightea admin members --origin https://your-deployment --workspace SLUG [--session-file FILE] [--json]
|
|
4
|
+
hightea admin activity --origin https://your-deployment --workspace SLUG [--seat @chief] [--limit 100] [--session-file FILE] [--json]`;function d(){return t()}function f(r){if(r.seat===void 0||r.seat.trim().length===0)return{};let n=r.seat.trim();if(!/^@[A-Za-z0-9][A-Za-z0-9._/-]*$/u.test(n))return null;return{"x-hightea-seat":n}}async function u(r,n,i){if(r.workspace.trim().length===0)return{exit:1,error:`ADMIN_INPUT: --workspace is required.
|
|
5
|
+
${m}`};let o=f(r);if(o===null)return{exit:1,error:`ADMIN_INPUT: --seat names the acting seat as @name, e.g. @chief.
|
|
6
|
+
${m}`};return e(r,n,{...i,label:"ADMIN",headers:o,extraExits:c})}async function w(r,n=d()){let i=r.slug.trim();if(i.length===0)return n.err(`ADMIN_INPUT: --slug is required (lowercase letters, digits and single hyphens).
|
|
7
|
+
${m}`),1;let o=await u(r,n,{method:"POST",what:"room create",path:"/rooms",body:r.title===void 0?{slug:i}:{slug:i,title:r.title}});if("error"in o)return n.err(o.error),o.exit;if(r.json)return n.out(JSON.stringify(o.answer)),0;let s=o.answer.room??{};return n.out(`created room ${String(s.slug??i)} (${String(s.roomId??"no id")})`),n.out("Every active member is seated in an open room; no separate join step."),0}async function h(r,n=d()){let i=r.memberId.trim();if(i.length===0)return n.err(`ADMIN_INPUT: a member id is required (hightea admin members lists them).
|
|
8
|
+
${m}`),1;let o=await u(r,n,{method:"DELETE",what:"member remove",path:`/members/${encodeURIComponent(i)}`});if("error"in o)return n.err(o.error),o.exit;if(r.json)return n.out(JSON.stringify(o.answer)),0;let s=o.answer.member??{};return n.out(`removed ${String(s.kind??"member")} ${String(s.name??i)} (${String(s.id??i)}); its turns and join links are cancelled with it`),0}async function y(r,n=d()){let i=await u(r,n,{method:"GET",what:"members",path:"/members"});if("error"in i)return n.err(i.error),i.exit;if(r.json)return n.out(JSON.stringify(i.answer)),0;let o=Array.isArray(i.answer.members)?i.answer.members:[];for(let s of o)n.out(`${String(s.displayName??"(unnamed)")} — ${String(s.kind??"?")} ${String(s.role??"?")} (${String(s.id??"no id")})`);if(o.length===0)n.out("No active members. This workspace answered a member list with no rows.");return 0}async function p(r,n=d()){let i=r.limit===void 0?void 0:r.limit;if(i!==void 0&&(!Number.isSafeInteger(i)||i<1||i>1000))return n.err(`ADMIN_INPUT: --limit is a whole number from 1 to 1000.
|
|
9
|
+
${m}`),1;let o=await u(r,n,{method:"GET",what:"activity",path:i===void 0?"/audit":`/audit?limit=${i}`});if("error"in o)return n.err(o.error),o.exit;if(r.json)return n.out(JSON.stringify(o.answer)),0;let s=Array.isArray(o.answer.entries)?o.answer.entries:[];for(let a of s){let l=a.detail===null||a.detail===void 0?"":` — ${String(a.detail)}`;n.out(`${String(a.at??"?")} ${String(a.action??"?")} ${String(a.target??"?")}${l}`)}if(s.length===0)n.out("No audit rows. This workspace answered an activity read with no entries.");return 0}export{p as adminActivity,h as adminMemberRemove,y as adminMembers,w as adminRoomCreate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h}from"./chunk-3w7svm2r.js";import"./chunk-kq5y08g7.js";import"./chunk-tay0pyz4.js";export{h as hostTrust};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N,R,n,i,x,C}from"./chunk-kq5y08g7.js";import"./chunk-tay0pyz4.js";export{N as hostJoin,x as hostServicesGrants,R as hostStatus,C as hostUpdate,n as localHost,i as runningAhpds};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s,f,I,v,O}from"./chunk-kjkww5cr.js";export{I as authLogin,O as authLogout,v as authStatus,s as checkedOrigin,f as ensureCredential};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{c}from"./chunk-jaf9mk6s.js";import"./chunk-tay0pyz4.js";import{i}from"./chunk-kq5y08g7.js";import{S,E}from"./chunk-evg5apz3.js";import{readFile as D}from"node:fs/promises";import{join as O}from"node:path";var h=`hightea deploy <service> --pin <sha> [--host <id>] [--json]
|
|
2
|
+
hightea deploy status <service> [--host <id>] [--json]`,P=/^[0-9a-fA-F]{40}$/u,y=()=>({out:(e)=>console.log(e),err:(e)=>console.error(e)}),_=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),u=(e)=>e.hostIds.length>0?`${e.hostIds.join(",")} (pid ${String(e.pid)})`:`pid ${String(e.pid)}`;async function N(e,n){if(e.port!==void 0)return e.port;try{let s=JSON.parse(await n(e.config));if(_(s)&&typeof s.port==="number"&&Number.isInteger(s.port))return s.port}catch{return}return}async function R(e,n){let s=e.connectionTokenFile??O(e.configDir,"connection.token");try{return(await n(s)).trim()||void 0}catch{return}}async function f(e,n={}){let s=n.readFile??((t)=>D(t,"utf8")),a;try{a=await(n.runningAhpds??i)()}catch(t){return{error:`DEPLOY_NO_AHPD: the process table could not be read: ${t.message}`}}let d=e?.trim(),r;if(d!==void 0&&d!==""){let t=a.filter((p)=>p.hostIds.includes(d));if(t.length===0)return{error:`DEPLOY_NO_AHPD: no running ahpd on this machine serves host ${d} (running: ${a.map(u).join("; ")||"none"})`};if(t.length>1)return{error:`DEPLOY_NO_AHPD: ${String(t.length)} running ahpds serve host ${d} (${t.map(u).join("; ")}); the process table cannot tell them apart`};r=t[0]}else{if(a.length===0)return{error:"DEPLOY_NO_AHPD: no running ahpd on this machine; start one with `hightea host join` first"};if(a.length>1)return{error:`DEPLOY_NO_AHPD: this machine runs ${String(a.length)} ahpds (${a.map(u).join("; ")}); name one with --host <id>`};r=a[0]}if(r===void 0)return{error:"DEPLOY_NO_AHPD: no running ahpd on this machine"};let l=await N(r,s);if(l===void 0)return{error:`DEPLOY_NO_AHPD: ${r.config} names no port and its command line has no --port; cannot reach this ahpd`};let o=await R(r,s);return{url:`ws://${r.host??"127.0.0.1"}:${String(l)}`,...o===void 0?{}:{token:o},label:r.hostIds[0]??`pid ${String(r.pid)}`}}async function g(e,n){try{return await(n.connect??c)(e.url,{token:e.token,clientId:"hightea-deploy"})}catch(s){return{error:`DEPLOY_NO_AHPD: ${e.url} did not answer: ${s.message}`}}}var I=(e,n)=>{if(e==="RUNNING")return`DEPLOY_RUNNING: ${n}`;if(e==="UNKNOWN_SERVICE")return`DEPLOY_UNKNOWN_SERVICE: ${n}`;return`DEPLOY_REFUSED ${e}: ${n}`},m=(e)=>/No channel at x-hh-deploys:\/\//u.test(e.message)?"DEPLOY_NO_DRIVER: this ahpd has no deploy driver loaded (x-hh-deploys://); its deploy plugin is not in its configuration":`DEPLOY_DRIVER_UNREADABLE: ${e.message}`;async function x(e,n=y(),s={}){let a=e.service.trim();if(a==="")return n.err(`DEPLOY_SERVICE_REQUIRED: name the service to deploy
|
|
3
|
+
${h}`),1;let d=e.pin.trim();if(!P.test(d))return n.err(`DEPLOY_PIN_NOT_SHA: --pin must be a full 40-character commit sha; '${d}' is not`),1;let r=await f(e.host,s);if("error"in r)return n.err(r.error),1;let l=await g(r,s);if("error"in l)return n.err(l.error),1;try{let o=await S(l,{service:a,version:d.toLowerCase()});if(!o.ok)return n.err(I(o.code,o.message)),1;if(e.json)n.out(JSON.stringify({machine:r.label,service:o.service,pin:o.sha,deployId:o.deployId,state:o.state}));else n.out(`started ${o.service} at ${o.sha}: deploy ${o.deployId} on ${r.label}`);return 0}catch(o){return n.err(m(o)),1}finally{l.close()}}var A=(e,n)=>({machine:n,service:e.service,state:e.state,pin:e.to??null,from:e.from??null,...e.step===void 0?{}:{step:e.step},...e.reason===void 0?{}:{reason:e.reason},...e.exit===void 0?{}:{exit:e.exit},deployId:e.deployId,...e.at===void 0?{}:{at:e.at}});async function j(e,n=y(),s={}){let a=e.service.trim();if(a==="")return n.err(`DEPLOY_SERVICE_REQUIRED: name the service to read
|
|
4
|
+
${h}`),1;let d=await f(e.host,s);if("error"in d)return n.err(d.error),1;let r=await g(d,s);if("error"in r)return n.err(r.error),1;try{let l=await E(r),o=l.runs.filter((p)=>p.service===a);if(o.length===0){let p=l.error===void 0?"":` (${l.error})`;return n.err(`DEPLOY_UNKNOWN_SERVICE: ${a} has no deploy on ${l.machine||d.label}${p}`),1}let t=A(o[0],l.machine||d.label);if(e.json)n.out(JSON.stringify(t));else n.out(`${t.state} ${t.service} pin ${t.pin??"?"} ${t.step===void 0?"":`${t.step} `}deploy ${t.deployId}${t.reason===void 0?"":` last error: ${t.reason}`}`);return 0}catch(l){return n.err(m(l)),1}finally{r.close()}}export{x as deployPlace,j as deployStatus};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var y=(e,t)=>({kind:e,id:t}),O=(e,t)=>e!==void 0&&t!==void 0&&e.kind===t.kind&&e.id===t.id,A=(e)=>`${e.kind}:${e.id}`;function r(e,t){if(e.kind==="agent")throw Error(`${t}: a person must grant this; agent ${e.id} cannot`)}var N="source",w="x-hh/source",J=["command","cwd","env","schedule","restart","depends_on","health"],C=(e)=>({command:e.command,cwd:e.cwd,env:e.env,schedule:e.schedule,restart:e.restart,depends_on:e.depends_on,health:e.health}),h=(e)=>{if(e===void 0)return"undefined";if(Array.isArray(e))return`[${e.map(h).join(",")}]`;if(e!==null&&typeof e==="object")return`{${Object.keys(e).sort().map((n)=>`${JSON.stringify(n)}:${h(e[n])}`).join(",")}}`;return JSON.stringify(e)},L=(e,t)=>{let n=C(e),o=C(t);return J.filter((i)=>h(n[i])!==h(o[i]))},R="x-hh-services://",v=(e,t,n)=>e.call("x-ahpd/invokeOperation",{channel:R,operationId:t,...n}),F=async(e)=>{let t=await e.call("subscribe",{channel:R});await e.call("unsubscribe",{channel:R});let n=t?.snapshot?.state;if(typeof n?.error==="string")throw Error(`the machine's services could not be read: ${n.error}`);if(n===void 0||!Array.isArray(n.rows))throw Error("the services channel answered no rows");let o=n.rows;return{services:o.flatMap((i)=>i.record===void 0?[]:[U(i.record,i.state)]),readOnly:o.flatMap((i)=>i.readOnly===void 0?[]:[{name:i.name,reason:i.readOnly}]),capabilities:n.capabilities,ifVersion:n.ifVersion,...typeof n.file==="string"?{file:n.file}:{}}},U=(e,t)=>{if(!p(t)||typeof t.status!=="string")return e;return{...e,state:{status:t.status,...typeof t.why==="string"?{why:t.why}:{}}}},H="x-hh-deploys://";async function S(e,t){if(typeof t?.service!=="string"||t.service.trim()==="")throw Error("deployService: service is a non-empty name");if(typeof t?.version!=="string"||t.version.trim()==="")throw Error("deployService: version is a branch, a tag or a commit sha");let n=await e.call("x-ahpd/invokeOperation",{channel:H,operationId:"deploy",target:{id:t.service},input:{service:t.service,version:t.version}});if(!p(n))throw Error(`the deploys channel answered no record: ${JSON.stringify(n)}`);if(n.ok===!0){let{service:a,sha:f,deployId:c}=n;if(typeof a!=="string"||typeof f!=="string"||typeof c!=="string"||n.state!=="started")throw Error(`the deploys channel answered a start without service, sha, deployId and state: ${JSON.stringify(n)}`);return{ok:!0,service:a,sha:f,deployId:c,state:"started"}}let{code:o,message:i}=n;if(n.ok===!1&&typeof o==="string"&&o!==""&&typeof i==="string")return{ok:!1,code:o,message:i};throw Error(`the deploys channel answered neither a start nor a named refusal: ${JSON.stringify(n)}`)}var W=(e)=>{if(!p(e))return;let{service:t,deployId:n,state:o}=e;if(typeof t!=="string"||typeof n!=="string"||typeof o!=="string")return;let{step:i,from:a,to:f,at:c,last:l}=e,s=p(l)&&typeof l.reason==="string"?l.reason:void 0,d=p(l)&&(l.exit===null||typeof l.exit==="number")?l.exit:void 0;return{service:t,deployId:n,state:o,...typeof i==="string"?{step:i}:{},...a===null||typeof a==="string"?{from:a}:{},...typeof f==="string"?{to:f}:{},...typeof c==="string"?{at:c}:{},...s===void 0?{}:{reason:s},...d===void 0?{}:{exit:d}}};async function E(e){let t=await e.call("subscribe",{channel:H});await e.call("unsubscribe",{channel:H});let n=t?.snapshot?.state;if(n===void 0)throw Error("the deploys channel answered no state");let o=Array.isArray(n.runs)?n.runs.flatMap((f)=>{let c=W(f);return c===void 0?[]:[c]}):[],i=typeof n.machine==="string"?n.machine:"",a=typeof n.error==="string"?n.error:void 0;return{machine:i,runs:o,...a===void 0?{}:{error:a}}}async function k(e,t,n){let o=Y(e);return{...(e.services===void 0?void 0:await G(e.services,t,n))??{create:[],change:[],unchanged:[],readOnly:[],remove:[],keep:[],unmanaged:[]},...e.agents===void 0?{}:{agents:await ee(e.agents,t,n)},...o.length===0?{}:{hosts:await q(o,n)}}}async function G(e,t,n){let o=await F(t),i=o.capabilities?.fields??[];if(!i.includes(N))throw Error(`this machine's services driver records no "${N}" (its fields are ${i.join(", ")}); it cannot say which client wrote an entry, so nothing is written`);let a=new Map(o.services.map((u)=>[u.name,u])),f=new Map(o.readOnly.map((u)=>[u.name,u.reason])),c=[],l=[],s=[],d=new Set;for(let u of e){d.add(u.name);let m=a.get(u.name);if(f.has(u.name))throw Error(`${u.name} is read-only on this machine: ${f.get(u.name)??""}`);if(m===void 0)c.push(u);else{let P=L(m,u);if(P.length===0)s.push(u.name);else l.push({name:u.name,before:m,after:u,changed:P})}}let g=n.prune===!0?o.services.filter((u)=>O(u.source,n.source)&&!d.has(u.name)):[];if(g.length>0&&n.removal===void 0){let u=g.map((m)=>`${m.name} (${m.state?.status??"state unknown"})`).join(", ");throw Error(`prune would remove ${u}: pass stop (stop each program, then remove the entry) or keep (leave it running here and clear its source)`)}let x=n.removal==="stop"?g:[],j=n.removal==="keep"?g:[],V=n.prune===!0?o.services.filter((u)=>!O(u.source,n.source)&&!d.has(u.name)):[];return{ifVersion:o.ifVersion,create:c,change:l,unchanged:s,readOnly:o.readOnly,remove:x,keep:j,unmanaged:V}}function Y(e){let t=e.hosts;if(t===void 0)return[];if(!Array.isArray(t))throw Error("the plan's hosts is not a list: a host entry is {name, agents}");let n=new Set;return t.map((o,i)=>{if(!p(o))throw Error(`host entry ${i+1} is not an object: a host entry is {name, agents}`);let a=o.name;if(typeof a!=="string"||a.trim().length===0)throw Error(`host entry ${i+1} names no machine: every host entry needs a non-empty "name"`);let f=Object.keys(o).filter((l)=>l!=="name"&&l!=="agents");if(f.length>0)throw Error(`host entry ${a}: unknown ${f.length===1?"field":"fields"} ${f.join(", ")} (a host entry is {name, agents})`);if(n.has(a))throw Error(`${a} is named twice in one plan`);n.add(a);let c=o.agents;if(c!==void 0&&(!Array.isArray(c)||!c.every((l)=>typeof l==="string"&&l.length>0&&l.length<=256)))throw Error(`host entry ${a}: agents must be a list of agent member ids`);return c===void 0?{name:a}:{name:a,agents:c}})}function K(e,t){let n=t.hostJoin;if(n!==void 0)return n;let o=e.map((i)=>`host:${i.name}`).join(", ");throw Error(`host entries need a workspace to mint their join links and this apply has none: ${o}. Nothing is sent and no host is created from a plan: run it with the workspace's origin and slug, signed in as a person, or take the hosts out of the plan.`)}async function q(e,t){r(t.source.kind==="agent"?{kind:"agent",id:t.source.id}:{kind:"person",id:t.source.id},"host-join"),K(e,t);let n=e.map((o)=>({name:o.name,agents:[...o.agents??[]]}));if(t.prune!==!0)return{pending:n};return{pending:n,pruneNote:"host links are not pruned; each unconsumed link expires on its own, and its expiry is printed when it is minted"}}var _="x-ahpd-agents://",z=["engine","owner","name","description","tags","model"],p=(e)=>e!==null&&typeof e==="object"&&!Array.isArray(e),B=(e,t)=>{let n=t[w];if(n===void 0)return;if(!p(n))throw Error(`${e}: config.${w} is not a source ({kind, id})`);let{kind:o,id:i}=n;if(o!=="file"&&o!=="program"&&o!=="agent"&&o!=="ci")throw Error(`${e}: config.${w}.kind is not one of file, program, agent, ci`);if(typeof i!=="string"||i==="")throw Error(`${e}: config.${w}.id is empty`);return{kind:o,id:i}},Q=(e)=>{if(!p(e))throw Error("the agents channel answered an entry that is not an object");let t=p(e.record)?e.record:e,n=e.id;if(typeof n!=="string"||n==="")throw Error("the agents channel answered a record that names no id");let o=typeof t.revision==="number"&&Number.isInteger(t.revision)&&t.revision>=0?t.revision:void 0,i=p(t.config)?t.config:{},a=B(n,i);return{id:n,...o===void 0?{}:{revision:o},record:t,...a===void 0?{}:{source:a}}};async function X(e){let t=await e.call("subscribe",{channel:_});await e.call("unsubscribe",{channel:_});let n=t?.snapshot?.state,o=p(n)?n.records:void 0;if(!Array.isArray(o))throw Error("the agents channel answered no records");return o.map(Q)}var I=(e)=>({engine:e.engine,owner:e.owner,name:e.name,...e.description===void 0?{}:{description:e.description},...e.tags===void 0?{}:{tags:e.tags},...e.model===void 0?{}:{model:e.model}}),M=(e)=>Object.fromEntries(Object.entries(e).filter(([t])=>t!==w)),Z=(e,t)=>{let n=I(t),o=z.filter((a)=>h(e.record[a])!==h(n[a])),i=p(e.record.config)?e.record.config:{};if(h(M(i))!==h(M(t.config??{})))o.push("config");return o};async function ee(e,t,n){let o=await X(t),i=new Map(o.map((d)=>[d.id,d])),a=[],f=[],c=[],l=new Set;for(let d of e){if(l.has(d.id))throw Error(`${d.id} is named twice in one plan`);l.add(d.id);let g=i.get(d.id);if(g===void 0)a.push(d);else{let x=Z(g,d);if(x.length===0)c.push(d.id);else if(g.revision===void 0)throw Error(`${d.id} has no revision on this machine; it cannot be edited from here`);else f.push({id:d.id,before:g,after:d,changed:x})}}let s=n.prune===!0?o.filter((d)=>O(d.source,n.source)&&!l.has(d.id)):[];for(let d of s)if(d.revision===void 0)throw Error(`${d.id} has no revision on this machine; it cannot be removed from here`);return{create:a,change:f,unchanged:c,remove:s}}async function b(e,t,n){let o=e.ifVersion??"",i=[],a=[];for(let s of e.hosts?.pending??[]){if(n===void 0)throw Error(`host ${s.name}: host links need a workspace to mint them and this apply has none; nothing was minted`);let d;try{d=await n.mintHostJoin(s.agents)}catch(g){throw Error(`host ${s.name} was not minted: ${g.message}`)}a.push({name:s.name,link:d})}for(let s of e.create)o=(await v(t,"put",{input:{service:s,ifVersion:"absent"}})).ifVersion??o,i.push(s.name);for(let s of e.change)o=(await v(t,"put",{input:{service:s.after,ifVersion:o}})).ifVersion??o,i.push(s.name);let f=[];for(let s of e.keep??[])o=(await v(t,"put",{input:{service:{name:s.name,source:null},ifVersion:o}})).ifVersion??o,f.push(s.name);let c=[];for(let s of e.remove??[]){if(s.state?.status.toLowerCase()==="running")await v(t,"stop",{target:{id:s.name},input:{}});o=(await v(t,"remove",{target:{id:s.name},input:{ifVersion:o}})).ifVersion??o,c.push(s.name)}if(e.agents!==void 0){for(let s of e.agents.create)await D(t,s,0),i.push(`agent:${s.id}`);for(let s of e.agents.change){if(s.before.revision===void 0)throw Error(`${s.id} has no revision on this machine; it cannot be edited from here`);await D(t,s.after,s.before.revision),i.push(`agent:${s.id}`)}for(let s of e.agents.remove){if(s.revision===void 0)throw Error(`${s.id} has no revision on this machine; it cannot be removed from here`);await ne(t,s.id,s.revision),c.push(`agent:${s.id}`)}}let l=e.hosts?.pruneNote===void 0?void 0:a.length===0?"host links are not pruned; this apply minted none, so nothing of its own is outstanding":`host links are not pruned; unconsumed ones expire at ${a.map((s)=>s.link.expiresAt).sort()[0]}`;return{preview:e,written:i,removed:c,kept:f,...e.hosts===void 0?{}:{hostLinks:a},...l===void 0?{}:{hostNote:l}}}var D=(e,t,n)=>e.call("x-ahpd/agents/put",{id:t.id,...I(t),config:{...t.config,[w]:t.source},ifRevision:n}),ne=(e,t,n)=>e.call("x-ahpd/agents/remove",{id:t,ifRevision:n});function T(e){let t=[];for(let n of e.create)t.push(`+ ${n.name}`);for(let n of e.change)t.push(`~ ${n.name} (${n.changed.join(", ")})`);for(let n of e.remove??[]){let o=n.state?.status.toLowerCase()==="running";t.push(`- ${n.name} (${o?"stop, then remove":"remove"}; source ${A(n.source)})`)}for(let n of e.keep??[])t.push(`= ${n.name} (kept: left running here, source cleared)`);for(let n of e.unmanaged??[]){let o=n.source===void 0?"no source":`source ${A(n.source)}`;t.push(`? ${n.name} (not managed by this apply: ${o})`)}for(let n of e.unchanged)t.push(`= ${n}`);for(let n of e.readOnly)t.push(`! ${n.name} read-only: ${n.reason}`);if(e.hosts!==void 0){for(let n of e.hosts.pending){let o=n.agents.length===0?"no agents":`agents ${n.agents.join(",")}`;t.push(`+ host:${n.name} (pending link: the machine must join; ${o})`)}if(e.hosts.pruneNote!==void 0)t.push(`note: ${e.hosts.pruneNote}`)}if(e.agents!==void 0){for(let n of e.agents.create)t.push(`+ agent:${n.id}`);for(let n of e.agents.change)t.push(`~ agent:${n.id} (${n.changed.join(", ")})`);for(let n of e.agents.remove)t.push(`- agent:${n.id} (source ${n.source===void 0?"unknown":A(n.source)})`);for(let n of e.agents.unchanged)t.push(`= agent:${n}`)}return t}
|
|
2
|
+
export{y,r,S,E,k,b,T};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import w from"ws";async function c(i,s){let u=s.token===void 0?i:`${i}${i.includes("?")?"&":"?"}tkn=${encodeURIComponent(s.token)}`,o=new w(u),d=new Map,t,f=0;o.on("message",(n)=>{let e=JSON.parse(String(n));if(e.id!==void 0&&e.method===void 0)d.get(e.id)?.(e)}),o.on("close",(n,e)=>{t=`${String(n)} ${e.toString()}`;for(let r of d.values())r({error:{code:0,message:`closed: ${t}`}})}),await new Promise((n,e)=>{o.once("open",()=>n()),o.once("error",(r)=>e(r))});let l=(n,e)=>new Promise((r,m)=>{if(t!==void 0)return m(Error(`the machine's connection closed: ${t}`));let g=++f;d.set(g,(a)=>{if(a.error!==void 0)m(Error(a.error.message));else r(a.result)}),o.send(JSON.stringify({jsonrpc:"2.0",id:g,method:n,params:e}))});return await l("initialize",{channel:"ahp-root://",protocolVersions:["1.1.0"],clientId:s.clientId}),{call:l,close:()=>o.close()}}
|
|
2
|
+
export{c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{chmod as j,mkdir as J,readFile as M,rename as V,rm as B,stat as G,writeFile as W}from"node:fs/promises";import{spawn as X}from"node:child_process";import{randomUUID as z}from"node:crypto";import{homedir as Z}from"node:os";import{join as
|
|
1
|
+
import{chmod as j,mkdir as J,readFile as M,rename as V,rm as B,stat as G,writeFile as W}from"node:fs/promises";import{spawn as X}from"node:child_process";import{randomUUID as z}from"node:crypto";import{homedir as Z}from"node:os";import{join as _}from"node:path";function U(r){return r.replace(/\brt_[A-Za-z0-9_-]+/g,"[redacted-refresh-token]").replace(/\bht_session=[^;\s]+/g,"ht_session=[redacted]").replace(/\b[A-Za-z0-9_-]{40,}\b/g,"[redacted-token]")}function C(){return{readFile:(r)=>M(r,"utf8"),stat:(r)=>G(r),writeFile:(r,e,n)=>W(r,e,n),mkdir:async(r,e)=>{await J(r,e)},chmod:(r,e)=>j(r,e),rename:(r,e)=>V(r,e),rm:(r,e)=>B(r,e),env:process.env,home:Z(),nowMs:()=>Date.now(),fetch:(r,e)=>globalThis.fetch(r,e),out:(r)=>{process.stdout.write(`${r}
|
|
2
2
|
`)},err:(r)=>{process.stderr.write(`${r}
|
|
3
|
-
`)},sleep:(r)=>new Promise((e)=>setTimeout(e,r)),openBrowser:async(r)=>{let e=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",n=process.platform==="win32"?["/c","start","",r]:[r];try{X(e,n,{stdio:"ignore",detached:!0}).unref()}catch{}}}}function s(r,e){let n;try{n=new URL(r)}catch{return{error:`${e}_ORIGIN_INVALID: --origin must be the https deployment origin, e.g. https://hightea.dev (got ${JSON.stringify(r)}).`}}let t=n.hostname==="localhost"||n.hostname==="127.0.0.1"||n.hostname==="[::1]"||n.hostname==="::1";if(n.protocol!=="https:"&&!(n.protocol==="http:"&&t)||n.pathname!=="/"||n.search!==""||n.hash!=="")return{error:`${e}_ORIGIN_INVALID: --origin must be the https deployment origin (http is allowed only on localhost), e.g. https://hightea.dev (got ${JSON.stringify(r)}).`};return{origin:n.origin}}function R(r){return r.env.XDG_CONFIG_HOME?.trim()||
|
|
4
|
-
`,{mode:384,flag:"wx"}),await n.chmod(t,384),await n.rename(t,r)}catch(o){try{await n.rm?.(t,{force:!0})}catch{}throw o}}async function Y(r,e){let n,t;try{n=await e.readFile(r),t=(await e.stat(r)).mode}catch(o){if(o.code==="ENOENT")return{error:"AUTH_NOT_SIGNED_IN"};return{error:`AUTH_CREDENTIALS_UNREADABLE: ${r} (${o.message})`}}if((t&63)!==0)return{error:`AUTH_CREDENTIALS_EXPOSED: ${r} is mode ${q(t)}; run chmod 600 ${r}.`};try{let o=JSON.parse(n);if(typeof o!=="object"||o===null||Array.isArray(o))throw SyntaxError("not an object");let i=o;if(i.version!==1||typeof i.origins!=="object"||i.origins===null||Array.isArray(i.origins))throw SyntaxError("not a version 1 credential file");return{file:i}}catch(o){return{error:`AUTH_CREDENTIALS_INVALID: ${r} (${o.message})`}}}function K(r){let e=r;return e!==null&&typeof e==="object"&&typeof e.sessionToken==="string"&&e.sessionToken.length>0&&typeof e.sessionExpiresAt==="string"&&Number.isFinite(Date.parse(e.sessionExpiresAt))&&(e.refreshToken===void 0||typeof e.refreshToken==="string")&&(e.account===void 0||typeof e.account==="object"&&e.account!==null)}async function
|
|
5
|
-
export{s,
|
|
3
|
+
`)},sleep:(r)=>new Promise((e)=>setTimeout(e,r)),openBrowser:async(r)=>{let e=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",n=process.platform==="win32"?["/c","start","",r]:[r];try{X(e,n,{stdio:"ignore",detached:!0}).unref()}catch{}}}}function s(r,e){let n;try{n=new URL(r)}catch{return{error:`${e}_ORIGIN_INVALID: --origin must be the https deployment origin, e.g. https://hightea.dev (got ${JSON.stringify(r)}).`}}let t=n.hostname==="localhost"||n.hostname==="127.0.0.1"||n.hostname==="[::1]"||n.hostname==="::1";if(n.protocol!=="https:"&&!(n.protocol==="http:"&&t)||n.pathname!=="/"||n.search!==""||n.hash!=="")return{error:`${e}_ORIGIN_INVALID: --origin must be the https deployment origin (http is allowed only on localhost), e.g. https://hightea.dev (got ${JSON.stringify(r)}).`};return{origin:n.origin}}function R(r){return r.env.XDG_CONFIG_HOME?.trim()||_(r.home,".config")}function y(r,e){return _(R(e),"hightea","credentials.json")}function l(r){return`run \`hightea auth login --origin ${r}\``}function q(r){return`0${(r&511).toString(8).padStart(3,"0")}`}async function D(r,e,n){let t=`${r}.${process.pid}.${z()}.tmp`;try{await n.writeFile(t,`${JSON.stringify(e,null,2)}
|
|
4
|
+
`,{mode:384,flag:"wx"}),await n.chmod(t,384),await n.rename(t,r)}catch(o){try{await n.rm?.(t,{force:!0})}catch{}throw o}}async function Y(r,e){let n,t;try{n=await e.readFile(r),t=(await e.stat(r)).mode}catch(o){if(o.code==="ENOENT")return{error:"AUTH_NOT_SIGNED_IN"};return{error:`AUTH_CREDENTIALS_UNREADABLE: ${r} (${o.message})`}}if((t&63)!==0)return{error:`AUTH_CREDENTIALS_EXPOSED: ${r} is mode ${q(t)}; run chmod 600 ${r}.`};try{let o=JSON.parse(n);if(typeof o!=="object"||o===null||Array.isArray(o))throw SyntaxError("not an object");let i=o;if(i.version!==1||typeof i.origins!=="object"||i.origins===null||Array.isArray(i.origins))throw SyntaxError("not a version 1 credential file");return{file:i}}catch(o){return{error:`AUTH_CREDENTIALS_INVALID: ${r} (${o.message})`}}}function K(r){let e=r;return e!==null&&typeof e==="object"&&typeof e.sessionToken==="string"&&e.sessionToken.length>0&&typeof e.sessionExpiresAt==="string"&&Number.isFinite(Date.parse(e.sessionExpiresAt))&&(e.refreshToken===void 0||typeof e.refreshToken==="string")&&(e.account===void 0||typeof e.account==="object"&&e.account!==null)}async function w(r,e){let n=y(r,e),t=await Y(n,e);if("error"in t){if(t.error==="AUTH_NOT_SIGNED_IN")return{error:`${t.error}: no sign-in for ${r}; ${l(r)}.`};if(t.error.startsWith("AUTH_CREDENTIALS_INVALID"))return{error:`${t.error}; ${l(r)}.`};return{error:t.error}}let o=t.file.origins[r];if(!K(o))return{error:`AUTH_NOT_SIGNED_IN: no sign-in for ${r}; ${l(r)}.`};return{credential:o}}async function b(r,e,n){if(n.writeFile===void 0||n.mkdir===void 0||n.chmod===void 0||n.rename===void 0)return{error:"AUTH_FILESYSTEM_UNAVAILABLE: this command had no filesystem to store the credential."};let t=y(r,n),o=_(R(n),"hightea"),i={};try{let a=JSON.parse(await n.readFile(t));if(typeof a.origins==="object"&&a.origins!==null&&!Array.isArray(a.origins))i=a.origins}catch{}try{await n.mkdir(o,{recursive:!0,mode:448});let a={version:1,origins:{...i,[r]:e}};return await D(t,a,n),{ok:!0}}catch(a){return{error:`AUTH_CREDENTIALS_UNWRITABLE: ${t} (${a.message})`}}}async function Q(r,e){if(e.writeFile===void 0||e.chmod===void 0||e.rename===void 0||e.rm===void 0)return{error:"AUTH_FILESYSTEM_UNAVAILABLE: this command had no filesystem to forget the credential."};let n=y(r,e),t;try{t=JSON.parse(await e.readFile(n))}catch(i){if(i.code==="ENOENT")return{ok:!0};return{error:`AUTH_CREDENTIALS_INVALID: ${n} (${i.message}).`}}let o={...t.origins};delete o[r];try{if(Object.keys(o).length===0)await e.rm(n,{force:!0});else await D(n,{version:1,origins:o},e);return{ok:!0}}catch(i){return{error:`AUTH_CREDENTIALS_UNWRITABLE: ${n} (${i.message})`}}}async function k(r,e,n,t){let o;try{o=await r.fetch(e,{method:"POST",headers:{origin:n,"content-type":"application/json",accept:"application/json","cache-control":"no-store"},body:JSON.stringify(t)})}catch(d){return{error:`AUTH_UNREACHABLE: ${e} did not answer: ${d.message}`}}let i=await o.text(),a={};if(i.length>0)try{let d=JSON.parse(i);if(typeof d!=="object"||d===null||Array.isArray(d))throw SyntaxError("not an object");a=d}catch{return{error:`AUTH_ANSWER_INVALID: ${e} answered HTTP ${o.status} with non-JSON: ${U(i.slice(0,200))}`}}return{status:o.status,answer:a}}function N(r){let e=r.error;return{code:typeof e?.code==="string"?e.code:"HTTP_ERROR",message:U(typeof e?.message==="string"?e.message:"the deployment refused the request")}}function L(r){let{sessionToken:e,sessionExpiresAt:n,refreshToken:t,account:o}=r;if(typeof e!=="string"||e.length===0||typeof n!=="string"||!Number.isFinite(Date.parse(n))||typeof t!=="string"||t.length===0)return null;return{sessionToken:e,sessionExpiresAt:n,refreshToken:t,...o===void 0?{}:{account:o}}}async function H(r,e,n,t=!1){if(e.refreshToken===void 0||e.refreshToken.length===0)return{error:`AUTH_SESSION_EXPIRED: no refresh token for ${r}; ${l(r)}.`};let o=await k(n,`${r}/auth/cli/refresh`,r,{refreshToken:e.refreshToken,sessionToken:e.sessionToken});if("error"in o)return{error:o.error};if(o.status!==200){let d=N(o.answer);if(!t&&(o.status===401||d.code==="REFRESH_INVALID")){let c=await w(r,n);if("credential"in c&&c.credential.refreshToken!==e.refreshToken){if(Date.parse(c.credential.sessionExpiresAt)-(n.nowMs?.()??Date.now())>60000)return c;return await H(r,c.credential,n,!0)}}return{error:`AUTH_${d.code}: ${d.message} ${l(r)}`}}let i=L(o.answer);if(i===null)return{error:"AUTH_ANSWER_INVALID: the refresh answer lacked a session or refresh token."};let a=await b(r,{...i,...e.account===void 0?{}:{account:e.account}},n);if("error"in a)return a;return{credential:i}}async function f(r,e){let n=await w(r,e);if("error"in n)return n;if(Date.parse(n.credential.sessionExpiresAt)-(e.nowMs?.()??Date.now())>60000)return n;return await H(r,n.credential,e)}async function I(r,e=C()){let n=s(r.origin,"AUTH");if("error"in n)return e.err(n.error),1;let t=n.origin,o=await k(e,`${t}/auth/cli/device`,t,{});if("error"in o)return e.err(o.error),1;if(o.status!==200){let u=N(o.answer);return e.err(`AUTH_${u.code}: ${u.message}`),1}let i=o.answer.deviceCode,a=o.answer.userCode,d=o.answer.verificationUri,c=o.answer.verificationUriComplete,h=o.answer.expiresIn,A=o.answer.interval;if(typeof i!=="string"||typeof a!=="string"||typeof d!=="string"||typeof c!=="string"||typeof h!=="number"||typeof A!=="number")return e.err("AUTH_ANSWER_INVALID: the device authorization answer was malformed."),1;let T=r.json?e.err:e.out;if(T(`To sign in to ${t}, open ${d}`),T(`and confirm the code ${a}.`),r.noBrowser!==!0)T(`Opening ${c}`),await e.openBrowser(c);let x=A*1000,P=(e.nowMs?.()??Date.now())+h*1000,F=Math.max(1,Math.ceil(h/A)+1);for(let u=0;u<F;u+=1){if((e.nowMs?.()??Date.now())>=P)break;await e.sleep(x);let g=await k(e,`${t}/auth/cli/token`,t,{deviceCode:i});if("error"in g)return e.err(g.error),1;if(g.status===200){let m=L(g.answer);if(m===null)return e.err("AUTH_ANSWER_INVALID: the sign-in answer lacked a session or refresh token."),1;let S=await b(t,m,e);if("error"in S)return e.err(S.error),1;if(r.json)return e.out(JSON.stringify({origin:t,sessionExpiresAt:m.sessionExpiresAt,account:m.account??null})),0;let E=m.account?.email;return e.out(`Signed in to ${t}${typeof E==="string"&&E.length>0?` as ${E}`:""}.`),e.out(`Credential stored at ${y(t,e)} (mode 0600).`),0}let p=N(g.answer);if(p.code==="AUTHORIZATION_PENDING")continue;if(p.code==="SLOW_DOWN"){x+=5000;continue}return e.err(`AUTH_${p.code}: ${p.message}`),1}return e.err(`AUTH_EXPIRED_TOKEN: the sign-in code expired; ${l(t)}.`),1}async function v(r,e=C()){let n=s(r.origin,"AUTH");if("error"in n)return e.err(n.error),1;let t=await w(n.origin,e);if("error"in t)return e.err(t.error),1;let o=t.credential,i=Date.parse(o.sessionExpiresAt)<=(e.nowMs?.()??Date.now()),a=o.account;if(r.json)return e.out(JSON.stringify({origin:n.origin,account:a??null,sessionExpiresAt:o.sessionExpiresAt,expired:i})),0;let d=a?.email;return e.out(`Signed in to ${n.origin}${typeof d==="string"&&d.length>0?` as ${d}`:""}.`),e.out(`Session ${i?"expired":"expires"} ${o.sessionExpiresAt}${i?`; ${l(n.origin)}.`:"."}`),0}async function O(r,e=C()){let n=s(r.origin,"AUTH");if("error"in n)return e.err(n.error),1;let t=n.origin,o=await w(t,e);if("error"in o){if(o.error.startsWith("AUTH_NOT_SIGNED_IN"))return e.out(`Not signed in to ${t}; nothing to do.`),0;return e.err(o.error),1}let i=!0;try{let d=await e.fetch(`${t}/auth/logout`,{method:"POST",headers:{origin:t,cookie:`ht_session=${o.credential.sessionToken}`,accept:"application/json","cache-control":"no-store"}});i=d.ok||d.status===302}catch{i=!1}if(!i)return e.err(`AUTH_LOGOUT_FAILED: ${t} could not be told to revoke the session; the local credential was kept. Try again.`),1;let a=await Q(t,e);if("error"in a)return e.err(a.error),1;if(r.json)e.out(JSON.stringify({origin:t,signedOut:!0,revoked:i}));else e.out(`Signed out of ${t}.`);return 0}
|
|
5
|
+
export{s,f,I,v,O};
|