typebulb 0.23.3 → 0.23.4
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/agents/claude/client.js +1 -1
- package/dist/agents/pi/matchu-patchu.ts +1 -1
- package/dist/index.js +177 -177
- package/dist/servers.js +74 -74
- package/package.json +1 -1
package/dist/servers.js
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
import { createRequire as __cr } from 'module'; const require = __cr(import.meta.url);
|
|
2
|
-
var
|
|
3
|
-
`)}};
|
|
4
|
-
`)?
|
|
2
|
+
var ba=Object.create;var or=Object.defineProperty;var Sa=Object.getOwnPropertyDescriptor;var wa=Object.getOwnPropertyNames;var va=Object.getPrototypeOf,Aa=Object.prototype.hasOwnProperty;var at=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var g=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var ka=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of wa(e))!Aa.call(s,r)&&r!==t&&or(s,r,{get:()=>e[r],enumerable:!(n=Sa(e,r))||n.enumerable});return s};var Na=(s,e,t)=>(t=s!=null?ba(va(s)):{},ka(e||!s||!s.__esModule?or(t,"default",{value:s,enumerable:!0}):t,s));var O=g(q=>{"use strict";var ws=Symbol.for("yaml.alias"),Sr=Symbol.for("yaml.document"),ct=Symbol.for("yaml.map"),wr=Symbol.for("yaml.pair"),vs=Symbol.for("yaml.scalar"),ut=Symbol.for("yaml.seq"),K=Symbol.for("yaml.node.type"),Qa=s=>!!s&&typeof s=="object"&&s[K]===ws,za=s=>!!s&&typeof s=="object"&&s[K]===Sr,Xa=s=>!!s&&typeof s=="object"&&s[K]===ct,Za=s=>!!s&&typeof s=="object"&&s[K]===wr,vr=s=>!!s&&typeof s=="object"&&s[K]===vs,el=s=>!!s&&typeof s=="object"&&s[K]===ut;function Ar(s){if(s&&typeof s=="object")switch(s[K]){case ct:case ut:return!0}return!1}function tl(s){if(s&&typeof s=="object")switch(s[K]){case ws:case ct:case vs:case ut:return!0}return!1}var sl=s=>(vr(s)||Ar(s))&&!!s.anchor;q.ALIAS=ws;q.DOC=Sr;q.MAP=ct;q.NODE_TYPE=K;q.PAIR=wr;q.SCALAR=vs;q.SEQ=ut;q.hasAnchor=sl;q.isAlias=Qa;q.isCollection=Ar;q.isDocument=za;q.isMap=Xa;q.isNode=tl;q.isPair=Za;q.isScalar=vr;q.isSeq=el});var Te=g(As=>{"use strict";var I=O(),M=Symbol("break visit"),kr=Symbol("skip children"),F=Symbol("remove node");function ft(s,e){let t=Nr(e);I.isDocument(s)?me(null,s.contents,t,Object.freeze([s]))===F&&(s.contents=null):me(null,s,t,Object.freeze([]))}ft.BREAK=M;ft.SKIP=kr;ft.REMOVE=F;function me(s,e,t,n){let r=Or(s,e,t,n);if(I.isNode(r)||I.isPair(r))return Er(s,n,r),me(s,r,t,n);if(typeof r!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){let o=me(i,e.items[i],t,n);if(typeof o=="number")i=o-1;else{if(o===M)return M;o===F&&(e.items.splice(i,1),i-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let i=me("key",e.key,t,n);if(i===M)return M;i===F&&(e.key=null);let o=me("value",e.value,t,n);if(o===M)return M;o===F&&(e.value=null)}}return r}async function dt(s,e){let t=Nr(e);I.isDocument(s)?await ge(null,s.contents,t,Object.freeze([s]))===F&&(s.contents=null):await ge(null,s,t,Object.freeze([]))}dt.BREAK=M;dt.SKIP=kr;dt.REMOVE=F;async function ge(s,e,t,n){let r=await Or(s,e,t,n);if(I.isNode(r)||I.isPair(r))return Er(s,n,r),ge(s,r,t,n);if(typeof r!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){let o=await ge(i,e.items[i],t,n);if(typeof o=="number")i=o-1;else{if(o===M)return M;o===F&&(e.items.splice(i,1),i-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let i=await ge("key",e.key,t,n);if(i===M)return M;i===F&&(e.key=null);let o=await ge("value",e.value,t,n);if(o===M)return M;o===F&&(e.value=null)}}return r}function Nr(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?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):s}function Or(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(I.isMap(e))return t.Map?.(s,e,n);if(I.isSeq(e))return t.Seq?.(s,e,n);if(I.isPair(e))return t.Pair?.(s,e,n);if(I.isScalar(e))return t.Scalar?.(s,e,n);if(I.isAlias(e))return t.Alias?.(s,e,n)}function Er(s,e,t){let n=e[e.length-1];if(I.isCollection(n))n.items[s]=t;else if(I.isPair(n))s==="key"?n.key=t:n.value=t;else if(I.isDocument(n))n.contents=t;else{let r=I.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}As.visit=ft;As.visitAsync=dt});var ks=g(Lr=>{"use strict";var Tr=O(),nl=Te(),rl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},il=s=>s.replace(/[!,[\]{}]/g,e=>rl[e]),Le=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[i,o]=n;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=n;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+il(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&Tr.isNode(e.contents)){let i={};nl.visit(e.contents,(o,a)=>{Tr.isNode(a)&&a.tag&&(i[a.tag]=!0)}),r=Object.keys(i)}else r=[];for(let[i,o]of n)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&t.push(`%TAG ${i} ${o}`);return t.join(`
|
|
3
|
+
`)}};Le.defaultYaml={explicit:!1,version:"1.2"};Le.defaultTags={"!!":"tag:yaml.org,2002:"};Lr.Directives=Le});var pt=g(Ce=>{"use strict";var Cr=O(),ol=Te();function al(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Pr(s){let e=new Set;return ol.visit(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Ir(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function ll(s,e){let t=[],n=new Map,r=null;return{onAnchor:i=>{t.push(i),r??(r=Pr(s));let o=Ir(e,r);return r.add(o),o},setAnchors:()=>{for(let i of t){let o=n.get(i);if(typeof o=="object"&&o.anchor&&(Cr.isScalar(o.node)||Cr.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:n}}Ce.anchorIsValid=al;Ce.anchorNames=Pr;Ce.createNodeAnchors=ll;Ce.findNewAnchor=Ir});var Ns=g(qr=>{"use strict";function Pe(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let r=0,i=n.length;r<i;++r){let o=n[r],a=Pe(s,n,String(r),o);a===void 0?delete n[r]:a!==o&&(n[r]=a)}else if(n instanceof Map)for(let r of Array.from(n.keys())){let i=n.get(r),o=Pe(s,n,r,i);o===void 0?n.delete(r):o!==i&&n.set(r,o)}else if(n instanceof Set)for(let r of Array.from(n)){let i=Pe(s,n,r,r);i===void 0?n.delete(r):i!==r&&(n.delete(r),n.add(i))}else for(let[r,i]of Object.entries(n)){let o=Pe(s,n,r,i);o===void 0?delete n[r]:o!==i&&(n[r]=o)}return s.call(e,t,n)}qr.applyReviver=Pe});var W=g(_r=>{"use strict";var cl=O();function Mr(s,e,t){if(Array.isArray(s))return s.map((n,r)=>Mr(n,String(r),t));if(s&&typeof s.toJSON=="function"){if(!t||!cl.hasAnchor(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=i=>{n.res=i,delete t.onCreate};let r=s.toJSON(e,t);return t.onCreate&&t.onCreate(r),r}return typeof s=="bigint"&&!t?.keep?Number(s):s}_r.toJS=Mr});var ht=g(Br=>{"use strict";var ul=Ns(),xr=O(),fl=W(),Os=class{constructor(e){Object.defineProperty(this,xr.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!xr.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=fl.toJS(this,"",o);if(typeof r=="function")for(let{count:l,res:c}of o.anchors.values())r(c,l);return typeof i=="function"?ul.applyReviver(i,{"":a},"",a):a}};Br.NodeBase=Os});var Ie=g(Rr=>{"use strict";var dl=pt(),pl=Te(),ye=O(),hl=ht(),ml=W(),Es=class extends hl.NodeBase{constructor(e){super(ye.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],pl.visit(e,{Node:(i,o)=>{(ye.isAlias(o)||ye.hasAnchor(o))&&n.push(o)}}),t&&(t.aliasResolveCache=n));let r;for(let i of n){if(i===this)break;i.anchor===this.source&&(r=i)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,o=this.resolve(r,t);if(!o){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=n.get(o);if(a||(ml.toJS(o,null,t),a=n.get(o)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=mt(r,o,n)),a.count*a.aliasCount>i)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(dl.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${r} `}return r}};function mt(s,e,t){if(ye.isAlias(e)){let n=e.resolve(s),r=t&&n&&t.get(n);return r?r.count*r.aliasCount:0}else if(ye.isCollection(e)){let n=0;for(let r of e.items){let i=mt(s,r,t);i>n&&(n=i)}return n}else if(ye.isPair(e)){let n=mt(s,e.key,t),r=mt(s,e.value,t);return Math.max(n,r)}return 1}Rr.Alias=Es});var L=g(Ts=>{"use strict";var gl=O(),yl=ht(),bl=W(),Sl=s=>!s||typeof s!="function"&&typeof s!="object",G=class extends yl.NodeBase{constructor(e){super(gl.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:bl.toJS(this.value,e,t)}toString(){return String(this.value)}};G.BLOCK_FOLDED="BLOCK_FOLDED";G.BLOCK_LITERAL="BLOCK_LITERAL";G.PLAIN="PLAIN";G.QUOTE_DOUBLE="QUOTE_DOUBLE";G.QUOTE_SINGLE="QUOTE_SINGLE";Ts.Scalar=G;Ts.isScalarValue=Sl});var qe=g(Dr=>{"use strict";var wl=Ie(),ne=O(),$r=L(),vl="tag:yaml.org,2002:";function Al(s,e,t){if(e){let n=t.filter(i=>i.tag===e),r=n.find(i=>!i.format)??n[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(n=>n.identify?.(s)&&!n.format)}function kl(s,e,t){if(ne.isDocument(s)&&(s=s.contents),ne.isNode(s))return s;if(ne.isPair(s)){let u=t.schema[ne.MAP].createNode?.(t.schema,null,t);return u.items.push(s),u}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:r,onTagObj:i,schema:o,sourceObjects:a}=t,l;if(n&&s&&typeof s=="object"){if(l=a.get(s),l)return l.anchor??(l.anchor=r(s)),new wl.Alias(l.anchor);l={anchor:null,node:null},a.set(s,l)}e?.startsWith("!!")&&(e=vl+e.slice(2));let c=Al(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let u=new $r.Scalar(s);return l&&(l.node=u),u}c=s instanceof Map?o[ne.MAP]:Symbol.iterator in Object(s)?o[ne.SEQ]:o[ne.MAP]}i&&(i(c),delete t.onTagObj);let p=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new $r.Scalar(s);return e?p.tag=e:c.default||(p.tag=c.tag),l&&(l.node=p),p}Dr.createNode=kl});var yt=g(gt=>{"use strict";var Nl=qe(),j=O(),Ol=ht();function Ls(s,e,t){let n=t;for(let r=e.length-1;r>=0;--r){let i=e[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=n,n=o}else n=new Map([[i,n]])}return Nl.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var Fr=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,Cs=class extends Ol.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>j.isNode(n)||j.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Fr(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(j.isCollection(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Ls(this.schema,r,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(j.isCollection(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&j.isScalar(i)?i.value:i:j.isCollection(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!j.isPair(t))return!1;let n=t.value;return n==null||e&&j.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return j.isCollection(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let i=this.get(n,!0);if(j.isCollection(i))i.setIn(r,t);else if(i===void 0&&this.schema)this.set(n,Ls(this.schema,r,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}};gt.Collection=Cs;gt.collectionFromPath=Ls;gt.isEmptyPath=Fr});var Me=g(bt=>{"use strict";var El=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function Ps(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var Tl=(s,e,t)=>s.endsWith(`
|
|
4
|
+
`)?Ps(t,e):t.includes(`
|
|
5
5
|
`)?`
|
|
6
|
-
`+
|
|
7
|
-
`)t===
|
|
6
|
+
`+Ps(t,e):(s.endsWith(" ")?"":" ")+t;bt.indentComment=Ps;bt.lineComment=Tl;bt.stringifyComment=El});var Kr=g(_e=>{"use strict";var Ll="flow",Is="block",St="quoted";function Cl(s,e,t="flow",{indentAtStart:n,lineWidth:r=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return s;r<i&&(i=0);let l=Math.max(1+i,1+r-e.length);if(s.length<=l)return s;let c=[],p={},u=r-e.length;typeof n=="number"&&(n>r-Math.max(2,i)?c.push(0):u=r-n);let f,m,y=!1,d=-1,h=-1,S=-1;t===Is&&(d=jr(s,d,e.length),d!==-1&&(u=d+l));for(let v;v=s[d+=1];){if(t===St&&v==="\\"){switch(h=d,s[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}S=d}if(v===`
|
|
7
|
+
`)t===Is&&(d=jr(s,d,e.length)),u=d+e.length+l,f=void 0;else{if(v===" "&&m&&m!==" "&&m!==`
|
|
8
8
|
`&&m!==" "){let A=s[d+1];A&&A!==" "&&A!==`
|
|
9
|
-
`&&A!==" "&&(f=d)}if(d>=u)if(f)c.push(f),u=f+l,f=void 0;else if(t===
|
|
10
|
-
${e}${s.slice(0,k)}`:(t===
|
|
11
|
-
${e}${s.slice(A+1,k)}`)}return w}function
|
|
12
|
-
`);n=e,r=e+1,i=s[r]}return n}
|
|
13
|
-
`){if(i-o>n)return!0;if(o=i+1,r-o<=n)return!1}return!0}function
|
|
9
|
+
`&&A!==" "&&(f=d)}if(d>=u)if(f)c.push(f),u=f+l,f=void 0;else if(t===St){for(;m===" "||m===" ";)m=v,v=s[d+=1],y=!0;let A=d>S+1?d-2:h-1;if(p[A])return s;c.push(A),p[A]=!0,u=A+l,f=void 0}else y=!0}m=v}if(y&&a&&a(),c.length===0)return s;o&&o();let w=s.slice(0,c[0]);for(let v=0;v<c.length;++v){let A=c[v],k=c[v+1]||s.length;A===0?w=`
|
|
10
|
+
${e}${s.slice(0,k)}`:(t===St&&p[A]&&(w+=`${s[A]}\\`),w+=`
|
|
11
|
+
${e}${s.slice(A+1,k)}`)}return w}function jr(s,e,t){let n=e,r=e+1,i=s[r];for(;i===" "||i===" ";)if(e<r+t)i=s[++e];else{do i=s[++e];while(i&&i!==`
|
|
12
|
+
`);n=e,r=e+1,i=s[r]}return n}_e.FOLD_BLOCK=Is;_e.FOLD_FLOW=Ll;_e.FOLD_QUOTED=St;_e.foldFlowLines=Cl});var Be=g(Ur=>{"use strict";var R=L(),H=Kr(),vt=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),At=s=>/^(%|---|\.\.\.)/m.test(s);function Pl(s,e,t){if(!e||e<0)return!1;let n=e-t,r=s.length;if(r<=n)return!1;for(let i=0,o=0;i<r;++i)if(s[i]===`
|
|
13
|
+
`){if(i-o>n)return!0;if(o=i+1,r-o<=n)return!1}return!0}function xe(s,e){let t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,r=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(At(s)?" ":""),o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);let p=t.substr(l+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||t[l+2]==='"'||t.length<r)l+=1;else{for(o+=t.slice(a,l)+`
|
|
14
14
|
|
|
15
15
|
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
|
|
16
|
-
`,l+=2;o+=i,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,n?o:H.foldFlowLines(o,i,H.FOLD_QUOTED,
|
|
17
|
-
`)||/[ \t]\n|\n[ \t]/.test(s))return
|
|
18
|
-
${t}`)+"'";return e.implicitKey?n:H.foldFlowLines(n,t,H.FOLD_FLOW,
|
|
16
|
+
`,l+=2;o+=i,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,n?o:H.foldFlowLines(o,i,H.FOLD_QUOTED,vt(e,!1))}function qs(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
|
|
17
|
+
`)||/[ \t]\n|\n[ \t]/.test(s))return xe(s,e);let t=e.indent||(At(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
+
${t}`)+"'";return e.implicitKey?n:H.foldFlowLines(n,t,H.FOLD_FLOW,vt(e,!1))}function be(s,e){let{singleQuote:t}=e.options,n;if(t===!1)n=xe;else{let r=s.includes('"'),i=s.includes("'");r&&!i?n=qs:i&&!r?n=xe:n=t?qs:xe}return n(s,e)}var Ms;try{Ms=new RegExp(`(^|(?<!
|
|
19
19
|
))
|
|
20
20
|
+(?!
|
|
21
|
-
|$)`,"g")}catch{
|
|
21
|
+
|$)`,"g")}catch{Ms=/\n+(?!\n|$)/g}function wt({comment:s,type:e,value:t},n,r,i){let{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(t))return be(t,n);let c=n.indent||(n.forceBlockIndent||At(t)?" ":""),p=o==="literal"?!0:o==="folded"||e===R.Scalar.BLOCK_FOLDED?!1:e===R.Scalar.BLOCK_LITERAL?!0:!Pl(t,l,c.length);if(!t)return p?`|
|
|
22
22
|
`:`>
|
|
23
23
|
`;let u,f;for(f=t.length;f>0;--f){let k=t[f-1];if(k!==`
|
|
24
24
|
`&&k!==" "&&k!==" ")break}let m=t.substring(f),y=m.indexOf(`
|
|
25
25
|
`);y===-1?u="-":t===m||y!==m.length-1?(u="+",i&&i()):u="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
|
|
26
|
-
`&&(m=m.slice(0,-1)),m=m.replace(
|
|
26
|
+
`&&(m=m.slice(0,-1)),m=m.replace(Ms,`$&${c}`));let d=!1,h,S=-1;for(h=0;h<t.length;++h){let k=t[h];if(k===" ")d=!0;else if(k===`
|
|
27
27
|
`)S=h;else break}let w=t.substring(0,S<h?S+1:h);w&&(t=t.substring(w.length),w=w.replace(/\n+/g,`$&${c}`));let A=(d?c?"2":"1":"")+u;if(s&&(A+=" "+a(s.replace(/ ?[\r\n]+/g," ")),r&&r()),!p){let k=t.replace(/\n+/g,`
|
|
28
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),N=!1,T=
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),N=!1,T=vt(n,!0);o!=="folded"&&e!==R.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{N=!0});let b=H.foldFlowLines(`${w}${k}${m}`,c,H.FOLD_BLOCK,T);if(!N)return`>${A}
|
|
29
29
|
${c}${b}`}return t=t.replace(/\n+/g,`$&${c}`),`|${A}
|
|
30
|
-
${c}${w}${t}${m}`}function
|
|
30
|
+
${c}${w}${t}${m}`}function Il(s,e,t,n){let{type:r,value:i}=s,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:p}=e;if(a&&i.includes(`
|
|
31
31
|
`)||p&&/[[\]{},]/.test(i))return be(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||p||!i.includes(`
|
|
32
|
-
`)?be(i,e):
|
|
33
|
-
`))return
|
|
34
|
-
${l}`);if(o){let f=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(u),{compat:m,tags:y}=e.doc.schema;if(y.some(f)||m?.some(f))return be(i,e)}return a?u:H.foldFlowLines(u,l,H.FOLD_FLOW,
|
|
35
|
-
${e.indent}${a}`:a}
|
|
36
|
-
${a}:`):(h=`${h}:`,f&&(h
|
|
32
|
+
`)?be(i,e):wt(s,e,t,n);if(!a&&!p&&r!==R.Scalar.PLAIN&&i.includes(`
|
|
33
|
+
`))return wt(s,e,t,n);if(At(i)){if(l==="")return e.forceBlockIndent=!0,wt(s,e,t,n);if(a&&l===c)return be(i,e)}let u=i.replace(/\n+/g,`$&
|
|
34
|
+
${l}`);if(o){let f=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(u),{compat:m,tags:y}=e.doc.schema;if(y.some(f)||m?.some(f))return be(i,e)}return a?u:H.foldFlowLines(u,l,H.FOLD_FLOW,vt(e,!1))}function ql(s,e,t,n){let{implicitKey:r,inFlow:i}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)}),{type:a}=s;a!==R.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=R.Scalar.QUOTE_DOUBLE);let l=p=>{switch(p){case R.Scalar.BLOCK_FOLDED:case R.Scalar.BLOCK_LITERAL:return r||i?be(o.value,e):wt(o,e,t,n);case R.Scalar.QUOTE_DOUBLE:return xe(o.value,e);case R.Scalar.QUOTE_SINGLE:return qs(o.value,e);case R.Scalar.PLAIN:return Il(o,e,t,n);default:return null}},c=l(a);if(c===null){let{defaultKeyType:p,defaultStringType:u}=e.options,f=r&&p||u;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}Ur.stringifyString=ql});var Re=g(_s=>{"use strict";var Ml=pt(),Q=O(),_l=Me(),xl=Be();function Bl(s,e){let t=Object.assign({blockQuote:!0,commentString:_l.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,e),n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function Rl(s,e){if(e.tag){let r=s.filter(i=>i.tag===e.tag);if(r.length>0)return r.find(i=>i.format===e.format)??r[0]}let t,n;if(Q.isScalar(e)){n=e.value;let r=s.filter(i=>i.identify?.(n));if(r.length>1){let i=r.filter(o=>o.test);i.length>0&&(r=i)}t=r.find(i=>i.format===e.format)??r.find(i=>!i.format)}else n=e,t=s.find(r=>r.nodeClass&&n instanceof r.nodeClass);if(!t){let r=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${r} value`)}return t}function $l(s,e,{anchors:t,doc:n}){if(!n.directives)return"";let r=[],i=(Q.isScalar(s)||Q.isCollection(s))&&s.anchor;i&&Ml.anchorIsValid(i)&&(t.add(i),r.push(`&${i}`));let o=s.tag??(e.default?null:e.tag);return o&&r.push(n.directives.tagString(o)),r.join(" ")}function Dl(s,e,t,n){if(Q.isPair(s))return s.toString(e,t,n);if(Q.isAlias(s)){if(e.doc.directives)return s.toString(e);if(e.resolvedAliases?.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let r,i=Q.isNode(s)?s:e.doc.createNode(s,{onTagObj:l=>r=l});r??(r=Rl(e.doc.schema.tags,i));let o=$l(i,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof r.stringify=="function"?r.stringify(i,e,t,n):Q.isScalar(i)?xl.stringifyString(i,e,t,n):i.toString(e,t,n);return o?Q.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
35
|
+
${e.indent}${a}`:a}_s.createStringifyContext=Bl;_s.stringify=Dl});var Wr=g(Vr=>{"use strict";var U=O(),Yr=L(),Jr=Re(),$e=Me();function Fl({key:s,value:e},t,n,r){let{allNullValues:i,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:p,simpleKeys:u}}=t,f=U.isNode(s)&&s.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(U.isCollection(s)||!U.isNode(s)&&typeof s=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let m=!u&&(!s||f&&e==null&&!t.inFlow||U.isCollection(s)||(U.isScalar(s)?s.type===Yr.Scalar.BLOCK_FOLDED||s.type===Yr.Scalar.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(u||!i),indent:a+l});let y=!1,d=!1,h=Jr.stringify(s,t,()=>y=!0,()=>d=!0);if(!m&&!t.inFlow&&h.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(i||e==null)return y&&n&&n(),h===""?"?":m?`? ${h}`:h}else if(i&&!u||e==null&&m)return h=`? ${h}`,f&&!y?h+=$e.lineComment(h,t.indent,c(f)):d&&r&&r(),h;y&&(f=null),m?(f&&(h+=$e.lineComment(h,t.indent,c(f))),h=`? ${h}
|
|
36
|
+
${a}:`):(h=`${h}:`,f&&(h+=$e.lineComment(h,t.indent,c(f))));let S,w,v;U.isNode(e)?(S=!!e.spaceBefore,w=e.commentBefore,v=e.comment):(S=!1,w=null,v=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!f&&U.isScalar(e)&&(t.indentAtStart=h.length+1),d=!1,!p&&l.length>=2&&!t.inFlow&&!m&&U.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let A=!1,k=Jr.stringify(e,t,()=>A=!0,()=>d=!0),N=" ";if(f||S||w){if(N=S?`
|
|
37
37
|
`:"",w){let T=c(w);N+=`
|
|
38
|
-
${
|
|
38
|
+
${$e.indentComment(T,t.indent)}`}k===""&&!t.inFlow?N===`
|
|
39
39
|
`&&v&&(N=`
|
|
40
40
|
|
|
41
41
|
`):N+=`
|
|
42
42
|
${t.indent}`}else if(!m&&U.isCollection(e)){let T=k[0],b=k.indexOf(`
|
|
43
43
|
`),C=b!==-1,J=t.inFlow??e.flow??e.items.length===0;if(C||!J){let ue=!1;if(C&&(T==="&"||T==="!")){let P=k.indexOf(" ");T==="&"&&P!==-1&&P<b&&k[P+1]==="!"&&(P=k.indexOf(" ",P+1)),(P===-1||b<P)&&(ue=!0)}ue||(N=`
|
|
44
44
|
${t.indent}`)}}else(k===""||k[0]===`
|
|
45
|
-
`)&&(N="");return h+=N+k,t.inFlow?A&&n&&n():v&&!A?h
|
|
45
|
+
`)&&(N="");return h+=N+k,t.inFlow?A&&n&&n():v&&!A?h+=$e.lineComment(h,t.indent,c(v)):d&&r&&r(),h}Vr.stringifyPair=Fl});var Bs=g(xs=>{"use strict";var Gr=at("process");function jl(s,...e){s==="debug"&&console.log(...e)}function Kl(s,e){(s==="debug"||s==="warn")&&(typeof Gr.emitWarning=="function"?Gr.emitWarning(e):console.warn(e))}xs.debug=jl;xs.warn=Kl});var Et=g(Ot=>{"use strict";var De=O(),Hr=L(),kt="<<",Nt={identify:s=>s===kt||typeof s=="symbol"&&s.description===kt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Hr.Scalar(Symbol(kt)),{addToJSMap:Qr}),stringify:()=>kt},Ul=(s,e)=>(Nt.identify(e)||De.isScalar(e)&&(!e.type||e.type===Hr.Scalar.PLAIN)&&Nt.identify(e.value))&&s?.doc.schema.tags.some(t=>t.tag===Nt.tag&&t.default);function Qr(s,e,t){if(t=s&&De.isAlias(t)?t.resolve(s.doc):t,De.isSeq(t))for(let n of t.items)Rs(s,e,n);else if(Array.isArray(t))for(let n of t)Rs(s,e,n);else Rs(s,e,t)}function Rs(s,e,t){let n=s&&De.isAlias(t)?t.resolve(s.doc):t;if(!De.isMap(n))throw new Error("Merge sources must be maps or map aliases");let r=n.toJSON(null,s,Map);for(let[i,o]of r)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}Ot.addMergeToJSMap=Qr;Ot.isMergeKey=Ul;Ot.merge=Nt});var Ds=g(Zr=>{"use strict";var Yl=Bs(),zr=Et(),Jl=Re(),Xr=O(),$s=W();function Vl(s,e,{key:t,value:n}){if(Xr.isNode(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(zr.isMergeKey(s,t))zr.addMergeToJSMap(s,e,n);else{let r=$s.toJS(t,"",s);if(e instanceof Map)e.set(r,$s.toJS(n,r,s));else if(e instanceof Set)e.add(r);else{let i=Wl(t,r,s),o=$s.toJS(n,i,s);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function Wl(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Xr.isNode(s)&&t?.doc){let n=Jl.createStringifyContext(t.doc,{});n.anchors=new Set;for(let i of t.anchors.keys())n.anchors.add(i.anchor);n.inFlow=!0,n.inStringifyKey=!0;let r=s.toString(n);if(!t.mapKeyWarned){let i=JSON.stringify(r);i.length>40&&(i=i.substring(0,36)+'..."'),Yl.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return r}return JSON.stringify(e)}Zr.addPairToJSMap=Vl});var z=g(Fs=>{"use strict";var ei=qe(),Gl=Wr(),Hl=Ds(),Tt=O();function Ql(s,e,t){let n=ei.createNode(s,void 0,t),r=ei.createNode(e,void 0,t);return new Lt(n,r)}var Lt=class s{constructor(e,t=null){Object.defineProperty(this,Tt.NODE_TYPE,{value:Tt.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return Tt.isNode(t)&&(t=t.clone(e)),Tt.isNode(n)&&(n=n.clone(e)),new s(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return Hl.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?Gl.stringifyPair(this,e,t,n):JSON.stringify(this)}};Fs.Pair=Lt;Fs.createPair=Ql});var js=g(si=>{"use strict";var re=O(),ti=Re(),Ct=Me();function zl(s,e,t){return(e.inFlow??s.flow?Zl:Xl)(s,e,t)}function Xl({comment:s,items:e},t,{blockItemPrefix:n,flowChars:r,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,p=Object.assign({},t,{indent:i,type:null}),u=!1,f=[];for(let y=0;y<e.length;++y){let d=e[y],h=null;if(re.isNode(d))!u&&d.spaceBefore&&f.push(""),Pt(t,f,d.commentBefore,u),d.comment&&(h=d.comment);else if(re.isPair(d)){let w=re.isNode(d.key)?d.key:null;w&&(!u&&w.spaceBefore&&f.push(""),Pt(t,f,w.commentBefore,u))}u=!1;let S=ti.stringify(d,p,()=>h=null,()=>u=!0);h&&(S+=Ct.lineComment(S,i,c(h))),u&&h&&(u=!1),f.push(n+S)}let m;if(f.length===0)m=r.start+r.end;else{m=f[0];for(let y=1;y<f.length;++y){let d=f[y];m+=d?`
|
|
46
46
|
${l}${d}`:`
|
|
47
47
|
`}}return s?(m+=`
|
|
48
|
-
`+
|
|
48
|
+
`+Ct.indentComment(c(s),l),a&&a()):u&&o&&o(),m}function Zl({items:s},e,{flowChars:t,itemIndent:n}){let{indent:r,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;n+=i;let l=Object.assign({},e,{indent:n,inFlow:!0,type:null}),c=!1,p=0,u=[];for(let y=0;y<s.length;++y){let d=s[y],h=null;if(re.isNode(d))d.spaceBefore&&u.push(""),Pt(e,u,d.commentBefore,!1),d.comment&&(h=d.comment);else if(re.isPair(d)){let w=re.isNode(d.key)?d.key:null;w&&(w.spaceBefore&&u.push(""),Pt(e,u,w.commentBefore,!1),w.comment&&(c=!0));let v=re.isNode(d.value)?d.value:null;v?(v.comment&&(h=v.comment),v.commentBefore&&(c=!0)):d.value==null&&w?.comment&&(h=w.comment)}h&&(c=!0);let S=ti.stringify(d,l,()=>h=null);y<s.length-1&&(S+=","),h&&(S+=Ct.lineComment(S,n,a(h))),!c&&(u.length>p||S.includes(`
|
|
49
49
|
`))&&(c=!0),u.push(S),p=u.length}let{start:f,end:m}=t;if(u.length===0)return f+m;if(!c){let y=u.reduce((d,h)=>d+h.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=f;for(let d of u)y+=d?`
|
|
50
50
|
${i}${r}${d}`:`
|
|
51
51
|
`;return`${y}
|
|
52
|
-
${r}${m}`}else return`${f}${o}${u.join(" ")}${o}${m}`}function
|
|
53
|
-
`:" ")}return
|
|
52
|
+
${r}${m}`}else return`${f}${o}${u.join(" ")}${o}${m}`}function Pt({indent:s,options:{commentString:e}},t,n,r){if(n&&r&&(n=n.replace(/^\n+/,"")),n){let i=Ct.indentComment(e(n),s);t.push(i.trimStart())}}si.stringifyCollection=zl});var Z=g(Us=>{"use strict";var ec=js(),tc=Ds(),sc=yt(),X=O(),It=z(),nc=L();function Fe(s,e){let t=X.isScalar(e)?e.value:e;for(let n of s)if(X.isPair(n)&&(n.key===e||n.key===t||X.isScalar(n.key)&&n.key.value===t))return n}var Ks=class extends sc.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(X.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,o=new this(e),a=(l,c)=>{if(typeof i=="function")c=i.call(t,l,c);else if(Array.isArray(i)&&!i.includes(l))return;(c!==void 0||r)&&o.items.push(It.createPair(l,c,n))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;X.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new It.Pair(e,e?.value):n=new It.Pair(e.key,e.value);let r=Fe(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${n.key} already set`);X.isScalar(r.value)&&nc.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let o=this.items.findIndex(a=>i(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=Fe(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let r=Fe(this.items,e)?.value;return(!t&&X.isScalar(r)?r.value:r)??void 0}has(e){return!!Fe(this.items,e)}set(e,t){this.add(new It.Pair(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let i of this.items)tc.addPairToJSMap(t,r,i);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let r of this.items)if(!X.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ec.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};Us.YAMLMap=Ks;Us.findPair=Fe});var Se=g(ri=>{"use strict";var rc=O(),ni=Z(),ic={collection:"map",default:!0,nodeClass:ni.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,e){return rc.isMap(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>ni.YAMLMap.from(s,e,t)};ri.map=ic});var ee=g(ii=>{"use strict";var oc=qe(),ac=js(),lc=yt(),Mt=O(),cc=L(),uc=W(),Ys=class extends lc.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Mt.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=qt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=qt(e);if(typeof n!="number")return;let r=this.items[n];return!t&&Mt.isScalar(r)?r.value:r}has(e){let t=qt(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=qt(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[n];Mt.isScalar(r)&&cc.isScalarValue(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let i of this.items)n.push(uc.toJS(i,String(r++),t));return n}toString(e,t,n){return e?ac.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof r=="function"){let l=t instanceof Set?a:String(o++);a=r.call(t,l,a)}i.items.push(oc.createNode(a,void 0,n))}}return i}};function qt(s){let e=Mt.isScalar(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}ii.YAMLSeq=Ys});var we=g(ai=>{"use strict";var fc=O(),oi=ee(),dc={collection:"seq",default:!0,nodeClass:oi.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,e){return fc.isSeq(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>oi.YAMLSeq.from(s,e,t)};ai.seq=dc});var je=g(li=>{"use strict";var pc=Be(),hc={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),pc.stringifyString(s,e,t,n)}};li.string=hc});var _t=g(fi=>{"use strict";var ci=L(),ui={identify:s=>s==null,createNode:()=>new ci.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ci.Scalar(null),stringify:({source:s},e)=>typeof s=="string"&&ui.test.test(s)?s:e.options.nullStr};fi.nullTag=ui});var Js=g(pi=>{"use strict";var mc=L(),di={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new mc.Scalar(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&di.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};pi.boolTag=di});var ve=g(hi=>{"use strict";function gc({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let r=typeof n=="number"?n:Number(n);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=Object.is(n,-0)?"-0":JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}hi.stringifyNumber=gc});var Ws=g(xt=>{"use strict";var yc=L(),Vs=ve(),bc={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:Vs.stringifyNumber},Sc={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 e=Number(s.value);return isFinite(e)?e.toExponential():Vs.stringifyNumber(s)}},wc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){let e=new yc.Scalar(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:Vs.stringifyNumber};xt.float=wc;xt.floatExp=Sc;xt.floatNaN=bc});var Hs=g(Rt=>{"use strict";var mi=ve(),Bt=s=>typeof s=="bigint"||Number.isInteger(s),Gs=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function gi(s,e,t){let{value:n}=s;return Bt(n)&&n>=0?t+n.toString(e):mi.stringifyNumber(s)}var vc={identify:s=>Bt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>Gs(s,2,8,t),stringify:s=>gi(s,8,"0o")},Ac={identify:Bt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>Gs(s,0,10,t),stringify:mi.stringifyNumber},kc={identify:s=>Bt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>Gs(s,2,16,t),stringify:s=>gi(s,16,"0x")};Rt.int=Ac;Rt.intHex=kc;Rt.intOct=vc});var bi=g(yi=>{"use strict";var Nc=Se(),Oc=_t(),Ec=we(),Tc=je(),Lc=Js(),Qs=Ws(),zs=Hs(),Cc=[Nc.map,Ec.seq,Tc.string,Oc.nullTag,Lc.boolTag,zs.intOct,zs.int,zs.intHex,Qs.floatNaN,Qs.floatExp,Qs.float];yi.schema=Cc});var vi=g(wi=>{"use strict";var Pc=L(),Ic=Se(),qc=we();function Si(s){return typeof s=="bigint"||Number.isInteger(s)}var $t=({value:s})=>JSON.stringify(s),Mc=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:$t},{identify:s=>s==null,createNode:()=>new Pc.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:$t},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:$t},{identify:Si,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>Si(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:$t}],_c={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},xc=[Ic.map,qc.seq].concat(Mc,_c);wi.schema=xc});var Zs=g(Ai=>{"use strict";var Ke=at("buffer"),Xs=L(),Bc=Be(),Rc={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof Ke.Buffer=="function")return Ke.Buffer.from(s,"base64");if(typeof atob=="function"){let t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,r,i){if(!t)return"";let o=t,a;if(typeof Ke.Buffer=="function")a=o instanceof Ke.Buffer?o.toString("base64"):Ke.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Xs.Scalar.BLOCK_LITERAL),e!==Xs.Scalar.QUOTE_DOUBLE){let l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),p=new Array(c);for(let u=0,f=0;u<c;++u,f+=l)p[u]=a.substr(f,l);a=p.join(e===Xs.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return Bc.stringifyString({comment:s,type:e,value:a},n,r,i)}};Ai.binary=Rc});var jt=g(Ft=>{"use strict";var Dt=O(),en=z(),$c=L(),Dc=ee();function ki(s,e){if(Dt.isSeq(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!Dt.isPair(n)){if(Dt.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let r=n.items[0]||new en.Pair(new $c.Scalar(null));if(n.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${n.commentBefore}
|
|
54
54
|
${r.key.commentBefore}`:n.commentBefore),n.comment){let i=r.value??r.key;i.comment=i.comment?`${n.comment}
|
|
55
|
-
${i.comment}`:n.comment}n=r}s.items[t]=$t.isPair(n)?n:new Zs.Pair(n)}}else e("Expected a sequence for this tag");return s}function ki(s,e,t){let{replacer:n}=t,r=new Rc.YAMLSeq(s);r.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(i++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;r.items.push(Zs.createPair(a,l,t))}return r}var $c={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ai,createNode:ki};Dt.createPairs=ki;Dt.pairs=$c;Dt.resolvePairs=Ai});var sn=g(tn=>{"use strict";var Ni=O(),en=W(),Ye=Z(),Dc=ee(),Oi=Ft(),ie=class s extends Dc.YAMLSeq{constructor(){super(),this.add=Ye.YAMLMap.prototype.add.bind(this),this.delete=Ye.YAMLMap.prototype.delete.bind(this),this.get=Ye.YAMLMap.prototype.get.bind(this),this.has=Ye.YAMLMap.prototype.has.bind(this),this.set=Ye.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let r of this.items){let i,o;if(Ni.isPair(r)?(i=en.toJS(r.key,"",t),o=en.toJS(r.value,i,t)):i=en.toJS(r,"",t),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,o)}return n}static from(e,t,n){let r=Oi.createPairs(e,t,n),i=new this;return i.items=r.items,i}};ie.tag="tag:yaml.org,2002:omap";var Fc={collection:"seq",identify:s=>s instanceof Map,nodeClass:ie,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=Oi.resolvePairs(s,e),n=[];for(let{key:r}of t.items)Ni.isScalar(r)&&(n.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):n.push(r.value));return Object.assign(new ie,t)},createNode:(s,e,t)=>ie.from(s,e,t)};tn.YAMLOMap=ie;tn.omap=Fc});var Pi=g(nn=>{"use strict";var Ei=L();function Ti({value:s,source:e},t){return e&&(s?Li:Ci).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var Li={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 Ei.Scalar(!0),stringify:Ti},Ci={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 Ei.Scalar(!1),stringify:Ti};nn.falseTag=Ci;nn.trueTag=Li});var Ii=g(jt=>{"use strict";var jc=L(),rn=ve(),Kc={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:rn.stringifyNumber},Uc={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 e=Number(s.value);return isFinite(e)?e.toExponential():rn.stringifyNumber(s)}},Yc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new jc.Scalar(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:rn.stringifyNumber};jt.float=Yc;jt.floatExp=Uc;jt.floatNaN=Kc});var Mi=g(Ve=>{"use strict";var qi=ve(),Je=s=>typeof s=="bigint"||Number.isInteger(s);function Kt(s,e,t,{intAsBigInt:n}){let r=s[0];if((r==="-"||r==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let o=BigInt(s);return r==="-"?BigInt(-1)*o:o}let i=parseInt(s,t);return r==="-"?-1*i:i}function on(s,e,t){let{value:n}=s;if(Je(n)){let r=n.toString(e);return n<0?"-"+t+r.substr(1):t+r}return qi.stringifyNumber(s)}var Jc={identify:Je,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Kt(s,2,2,t),stringify:s=>on(s,2,"0b")},Vc={identify:Je,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Kt(s,1,8,t),stringify:s=>on(s,8,"0")},Wc={identify:Je,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Kt(s,0,10,t),stringify:qi.stringifyNumber},Gc={identify:Je,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Kt(s,2,16,t),stringify:s=>on(s,16,"0x")};Ve.int=Wc;Ve.intBin=Jc;Ve.intHex=Gc;Ve.intOct=Vc});var ln=g(an=>{"use strict";var Jt=O(),Ut=z(),Yt=Z(),oe=class s extends Yt.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;Jt.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Ut.Pair(e.key,null):t=new Ut.Pair(e,null),Yt.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Yt.findPair(this.items,e);return!t&&Jt.isPair(n)?Jt.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Yt.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Ut.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof r=="function"&&(o=r.call(t,o,o)),i.items.push(Ut.createPair(o,null,n));return i}};oe.tag="tag:yaml.org,2002:set";var Hc={collection:"map",identify:s=>s instanceof Set,nodeClass:oe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>oe.from(s,e,t),resolve(s,e){if(Jt.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new oe,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};an.YAMLSet=oe;an.set=Hc});var un=g(Vt=>{"use strict";var Qc=ve();function cn(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,r=o=>e?BigInt(o):Number(o),i=n.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return t==="-"?r(-1)*i:i}function _i(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Qc.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let r=t(60),i=[e%r];return e<60?i.unshift(0):(e=(e-i[0])/r,i.unshift(e%r),e>=60&&(e=(e-i[0])/r,i.unshift(e))),n+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var zc={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,e,{intAsBigInt:t})=>cn(s,t),stringify:_i},Xc={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=>cn(s,!1),stringify:_i},xi={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 e=s.match(xi.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,r,i,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,r,i||0,o||0,a||0,l),p=e[8];if(p&&p!=="Z"){let u=cn(p,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Vt.floatTime=Xc;Vt.intTime=zc;Vt.timestamp=xi});var $i=g(Ri=>{"use strict";var Zc=Se(),eu=Mt(),tu=we(),su=Ke(),nu=Xs(),Bi=Pi(),fn=Ii(),Wt=Mi(),ru=Ot(),iu=sn(),ou=Ft(),au=ln(),dn=un(),lu=[Zc.map,tu.seq,su.string,eu.nullTag,Bi.trueTag,Bi.falseTag,Wt.intBin,Wt.intOct,Wt.int,Wt.intHex,fn.floatNaN,fn.floatExp,fn.float,nu.binary,ru.merge,iu.omap,ou.pairs,au.set,dn.intTime,dn.floatTime,dn.timestamp];Ri.schema=lu});var Gi=g(mn=>{"use strict";var Ki=Se(),cu=Mt(),Ui=we(),uu=Ke(),fu=Ys(),pn=Vs(),hn=Gs(),du=yi(),pu=wi(),Yi=Xs(),We=Ot(),Ji=sn(),Vi=Ft(),Di=$i(),Wi=ln(),Gt=un(),Fi=new Map([["core",du.schema],["failsafe",[Ki.map,Ui.seq,uu.string]],["json",pu.schema],["yaml11",Di.schema],["yaml-1.1",Di.schema]]),ji={binary:Yi.binary,bool:fu.boolTag,float:pn.float,floatExp:pn.floatExp,floatNaN:pn.floatNaN,floatTime:Gt.floatTime,int:hn.int,intHex:hn.intHex,intOct:hn.intOct,intTime:Gt.intTime,map:Ki.map,merge:We.merge,null:cu.nullTag,omap:Ji.omap,pairs:Vi.pairs,seq:Ui.seq,set:Wi.set,timestamp:Gt.timestamp},hu={"tag:yaml.org,2002:binary":Yi.binary,"tag:yaml.org,2002:merge":We.merge,"tag:yaml.org,2002:omap":Ji.omap,"tag:yaml.org,2002:pairs":Vi.pairs,"tag:yaml.org,2002:set":Wi.set,"tag:yaml.org,2002:timestamp":Gt.timestamp};function mu(s,e,t){let n=Fi.get(e);if(n&&!s)return t&&!n.includes(We.merge)?n.concat(We.merge):n.slice();let r=n;if(!r)if(Array.isArray(s))r=[];else{let i=Array.from(Fi.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(s))for(let i of s)r=r.concat(i);else typeof s=="function"&&(r=s(r.slice()));return t&&(r=r.concat(We.merge)),r.reduce((i,o)=>{let a=typeof o=="string"?ji[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(ji).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return i.includes(a)||i.push(a),i},[])}mn.coreKnownTags=hu;mn.getTags=mu});var bn=g(Hi=>{"use strict";var gn=O(),gu=Se(),yu=we(),bu=Ke(),Ht=Gi(),Su=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,yn=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Ht.getTags(e,"compat"):e?Ht.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?Ht.coreKnownTags:{},this.tags=Ht.getTags(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,gn.MAP,{value:gu.map}),Object.defineProperty(this,gn.SCALAR,{value:bu.string}),Object.defineProperty(this,gn.SEQ,{value:yu.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Su:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Hi.Schema=yn});var zi=g(Qi=>{"use strict";var wu=O(),Sn=$e(),Ge=_e();function vu(s,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let l=s.directives.toString(s);l?(t.push(l),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let r=Sn.createStringifyContext(s,e),{commentString:i}=r.options;if(s.commentBefore){t.length!==1&&t.unshift("");let l=i(s.commentBefore);t.unshift(Ge.indentComment(l,""))}let o=!1,a=null;if(s.contents){if(wu.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let p=i(s.contents.commentBefore);t.push(Ge.indentComment(p,""))}r.forceBlockIndent=!!s.comment,a=s.contents.comment}let l=a?void 0:()=>o=!0,c=Sn.stringify(s.contents,r,()=>a=null,l);a&&(c+=Ge.lineComment(c,"",i(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(Sn.stringify(s.contents,r));if(s.directives?.docEnd)if(s.comment){let l=i(s.comment);l.includes(`
|
|
56
|
-
`)?(t.push("..."),t.push(
|
|
55
|
+
${i.comment}`:n.comment}n=r}s.items[t]=Dt.isPair(n)?n:new en.Pair(n)}}else e("Expected a sequence for this tag");return s}function Ni(s,e,t){let{replacer:n}=t,r=new Dc.YAMLSeq(s);r.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(i++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;r.items.push(en.createPair(a,l,t))}return r}var Fc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ki,createNode:Ni};Ft.createPairs=Ni;Ft.pairs=Fc;Ft.resolvePairs=ki});var nn=g(sn=>{"use strict";var Oi=O(),tn=W(),Ue=Z(),jc=ee(),Ei=jt(),ie=class s extends jc.YAMLSeq{constructor(){super(),this.add=Ue.YAMLMap.prototype.add.bind(this),this.delete=Ue.YAMLMap.prototype.delete.bind(this),this.get=Ue.YAMLMap.prototype.get.bind(this),this.has=Ue.YAMLMap.prototype.has.bind(this),this.set=Ue.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let r of this.items){let i,o;if(Oi.isPair(r)?(i=tn.toJS(r.key,"",t),o=tn.toJS(r.value,i,t)):i=tn.toJS(r,"",t),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,o)}return n}static from(e,t,n){let r=Ei.createPairs(e,t,n),i=new this;return i.items=r.items,i}};ie.tag="tag:yaml.org,2002:omap";var Kc={collection:"seq",identify:s=>s instanceof Map,nodeClass:ie,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=Ei.resolvePairs(s,e),n=[];for(let{key:r}of t.items)Oi.isScalar(r)&&(n.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):n.push(r.value));return Object.assign(new ie,t)},createNode:(s,e,t)=>ie.from(s,e,t)};sn.YAMLOMap=ie;sn.omap=Kc});var Ii=g(rn=>{"use strict";var Ti=L();function Li({value:s,source:e},t){return e&&(s?Ci:Pi).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var Ci={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 Ti.Scalar(!0),stringify:Li},Pi={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 Ti.Scalar(!1),stringify:Li};rn.falseTag=Pi;rn.trueTag=Ci});var qi=g(Kt=>{"use strict";var Uc=L(),on=ve(),Yc={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:on.stringifyNumber},Jc={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 e=Number(s.value);return isFinite(e)?e.toExponential():on.stringifyNumber(s)}},Vc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new Uc.Scalar(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:on.stringifyNumber};Kt.float=Vc;Kt.floatExp=Jc;Kt.floatNaN=Yc});var _i=g(Je=>{"use strict";var Mi=ve(),Ye=s=>typeof s=="bigint"||Number.isInteger(s);function Ut(s,e,t,{intAsBigInt:n}){let r=s[0];if((r==="-"||r==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let o=BigInt(s);return r==="-"?BigInt(-1)*o:o}let i=parseInt(s,t);return r==="-"?-1*i:i}function an(s,e,t){let{value:n}=s;if(Ye(n)){let r=n.toString(e);return n<0?"-"+t+r.substr(1):t+r}return Mi.stringifyNumber(s)}var Wc={identify:Ye,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Ut(s,2,2,t),stringify:s=>an(s,2,"0b")},Gc={identify:Ye,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Ut(s,1,8,t),stringify:s=>an(s,8,"0")},Hc={identify:Ye,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Ut(s,0,10,t),stringify:Mi.stringifyNumber},Qc={identify:Ye,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Ut(s,2,16,t),stringify:s=>an(s,16,"0x")};Je.int=Hc;Je.intBin=Wc;Je.intHex=Qc;Je.intOct=Gc});var cn=g(ln=>{"use strict";var Vt=O(),Yt=z(),Jt=Z(),oe=class s extends Jt.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;Vt.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Yt.Pair(e.key,null):t=new Yt.Pair(e,null),Jt.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Jt.findPair(this.items,e);return!t&&Vt.isPair(n)?Vt.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Jt.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Yt.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof r=="function"&&(o=r.call(t,o,o)),i.items.push(Yt.createPair(o,null,n));return i}};oe.tag="tag:yaml.org,2002:set";var zc={collection:"map",identify:s=>s instanceof Set,nodeClass:oe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>oe.from(s,e,t),resolve(s,e){if(Vt.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new oe,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};ln.YAMLSet=oe;ln.set=zc});var fn=g(Wt=>{"use strict";var Xc=ve();function un(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,r=o=>e?BigInt(o):Number(o),i=n.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return t==="-"?r(-1)*i:i}function xi(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Xc.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let r=t(60),i=[e%r];return e<60?i.unshift(0):(e=(e-i[0])/r,i.unshift(e%r),e>=60&&(e=(e-i[0])/r,i.unshift(e))),n+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Zc={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,e,{intAsBigInt:t})=>un(s,t),stringify:xi},eu={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=>un(s,!1),stringify:xi},Bi={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 e=s.match(Bi.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,r,i,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,r,i||0,o||0,a||0,l),p=e[8];if(p&&p!=="Z"){let u=un(p,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Wt.floatTime=eu;Wt.intTime=Zc;Wt.timestamp=Bi});var Di=g($i=>{"use strict";var tu=Se(),su=_t(),nu=we(),ru=je(),iu=Zs(),Ri=Ii(),dn=qi(),Gt=_i(),ou=Et(),au=nn(),lu=jt(),cu=cn(),pn=fn(),uu=[tu.map,nu.seq,ru.string,su.nullTag,Ri.trueTag,Ri.falseTag,Gt.intBin,Gt.intOct,Gt.int,Gt.intHex,dn.floatNaN,dn.floatExp,dn.float,iu.binary,ou.merge,au.omap,lu.pairs,cu.set,pn.intTime,pn.floatTime,pn.timestamp];$i.schema=uu});var Hi=g(gn=>{"use strict";var Ui=Se(),fu=_t(),Yi=we(),du=je(),pu=Js(),hn=Ws(),mn=Hs(),hu=bi(),mu=vi(),Ji=Zs(),Ve=Et(),Vi=nn(),Wi=jt(),Fi=Di(),Gi=cn(),Ht=fn(),ji=new Map([["core",hu.schema],["failsafe",[Ui.map,Yi.seq,du.string]],["json",mu.schema],["yaml11",Fi.schema],["yaml-1.1",Fi.schema]]),Ki={binary:Ji.binary,bool:pu.boolTag,float:hn.float,floatExp:hn.floatExp,floatNaN:hn.floatNaN,floatTime:Ht.floatTime,int:mn.int,intHex:mn.intHex,intOct:mn.intOct,intTime:Ht.intTime,map:Ui.map,merge:Ve.merge,null:fu.nullTag,omap:Vi.omap,pairs:Wi.pairs,seq:Yi.seq,set:Gi.set,timestamp:Ht.timestamp},gu={"tag:yaml.org,2002:binary":Ji.binary,"tag:yaml.org,2002:merge":Ve.merge,"tag:yaml.org,2002:omap":Vi.omap,"tag:yaml.org,2002:pairs":Wi.pairs,"tag:yaml.org,2002:set":Gi.set,"tag:yaml.org,2002:timestamp":Ht.timestamp};function yu(s,e,t){let n=ji.get(e);if(n&&!s)return t&&!n.includes(Ve.merge)?n.concat(Ve.merge):n.slice();let r=n;if(!r)if(Array.isArray(s))r=[];else{let i=Array.from(ji.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(s))for(let i of s)r=r.concat(i);else typeof s=="function"&&(r=s(r.slice()));return t&&(r=r.concat(Ve.merge)),r.reduce((i,o)=>{let a=typeof o=="string"?Ki[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Ki).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return i.includes(a)||i.push(a),i},[])}gn.coreKnownTags=gu;gn.getTags=yu});var Sn=g(Qi=>{"use strict";var yn=O(),bu=Se(),Su=we(),wu=je(),Qt=Hi(),vu=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,bn=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Qt.getTags(e,"compat"):e?Qt.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?Qt.coreKnownTags:{},this.tags=Qt.getTags(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,yn.MAP,{value:bu.map}),Object.defineProperty(this,yn.SCALAR,{value:wu.string}),Object.defineProperty(this,yn.SEQ,{value:Su.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?vu:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Qi.Schema=bn});var Xi=g(zi=>{"use strict";var Au=O(),wn=Re(),We=Me();function ku(s,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let l=s.directives.toString(s);l?(t.push(l),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let r=wn.createStringifyContext(s,e),{commentString:i}=r.options;if(s.commentBefore){t.length!==1&&t.unshift("");let l=i(s.commentBefore);t.unshift(We.indentComment(l,""))}let o=!1,a=null;if(s.contents){if(Au.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let p=i(s.contents.commentBefore);t.push(We.indentComment(p,""))}r.forceBlockIndent=!!s.comment,a=s.contents.comment}let l=a?void 0:()=>o=!0,c=wn.stringify(s.contents,r,()=>a=null,l);a&&(c+=We.lineComment(c,"",i(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(wn.stringify(s.contents,r));if(s.directives?.docEnd)if(s.comment){let l=i(s.comment);l.includes(`
|
|
56
|
+
`)?(t.push("..."),t.push(We.indentComment(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=s.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(We.indentComment(i(l),"")))}return t.join(`
|
|
57
57
|
`)+`
|
|
58
|
-
`}
|
|
58
|
+
`}zi.stringifyDocument=ku});var Ge=g(Zi=>{"use strict";var Nu=Ie(),Ae=yt(),B=O(),Ou=z(),Eu=W(),Tu=Sn(),Lu=Xi(),vn=pt(),Cu=Ns(),Pu=qe(),An=ks(),kn=class s{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,B.NODE_TYPE,{value:B.DOC});let r=null;typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:o}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new An.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let e=Object.create(s.prototype,{[B.NODE_TYPE]:{value:B.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=B.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ke(this.contents)&&this.contents.add(e)}addIn(e,t){ke(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=vn.anchorNames(this);e.anchor=!t||n.has(t)?vn.findNewAnchor(t||"a",n):t}return new Nu.Alias(e.anchor)}createNode(e,t,n){let r;if(typeof t=="function")e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){let h=w=>typeof w=="number"||w instanceof String||w instanceof Number,S=t.filter(h).map(String);S.length>0&&(t=t.concat(S)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:p}=n??{},{onAnchor:u,setAnchors:f,sourceObjects:m}=vn.createNodeAnchors(this,o||"a"),y={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:m},d=Pu.createNode(e,p,y);return a&&B.isCollection(d)&&(d.flow=!0),f(),d}createPair(e,t,n={}){let r=this.createNode(e,null,n),i=this.createNode(t,null,n);return new Ou.Pair(r,i)}delete(e){return ke(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ae.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):ke(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return B.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ae.isEmptyPath(e)?!t&&B.isScalar(this.contents)?this.contents.value:this.contents:B.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return B.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ae.isEmptyPath(e)?this.contents!==void 0:B.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ae.collectionFromPath(this.schema,[e],t):ke(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ae.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Ae.collectionFromPath(this.schema,Array.from(e),t):ke(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new An.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new An.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Tu.Schema(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=Eu.toJS(this.contents,t??"",a);if(typeof i=="function")for(let{count:c,res:p}of a.anchors.values())i(p,c);return typeof o=="function"?Cu.applyReviver(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Lu.stringifyDocument(this,e)}};function ke(s){if(B.isCollection(s))return!0;throw new Error("Expected a YAML collection as document contents")}Zi.Document=kn});var ze=g(Qe=>{"use strict";var He=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Nn=class extends He{constructor(e,t,n){super("YAMLParseError",e,t,n)}},On=class extends He{constructor(e,t,n){super("YAMLWarning",e,t,n)}},Iu=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:n,col:r}=t.linePos[0];t.message+=` at line ${n}, column ${r}`;let i=r-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,i))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
59
59
|
`),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l?.line===n&&l.col>r&&(a=Math.max(1,Math.min(l.col-r,80-i)));let c=" ".repeat(i)+"^".repeat(a);t.message+=`:
|
|
60
60
|
|
|
61
61
|
${o}
|
|
62
62
|
${c}
|
|
63
|
-
`}};
|
|
64
|
-
`))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(
|
|
65
|
-
`+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||
|
|
66
|
-
`+v.comment:w.comment=v.comment);let A=new
|
|
67
|
-
`+N.comment:c.comment=N.comment),u=N.end;continue}!o&&t.options.strict&&
|
|
68
|
-
`+T:b.comment=T,N.comment=N.comment.substring(T.length+1)}}if(!o&&!A&&!N.found){let T=k?s(t,k,N,r):e(t,N.end,A,null,N,r);c.items.push(T),u=T.range[2],
|
|
69
|
-
`+C.comment:b.comment=C.comment);let ue=new
|
|
70
|
-
`+h.comment:c.comment=h.comment),c.range=[n.offset,d,h.offset]}else c.range=[n.offset,d,d];return c}
|
|
63
|
+
`}};Qe.YAMLError=He;Qe.YAMLParseError=Nn;Qe.YAMLWarning=On;Qe.prettifyError=Iu});var Xe=g(eo=>{"use strict";function qu(s,{flow:e,indicator:t,next:n,offset:r,onError:i,parentIndent:o,startOnNewline:a}){let l=!1,c=a,p=a,u="",f="",m=!1,y=!1,d=null,h=null,S=null,w=null,v=null,A=null,k=null;for(let b of s)switch(y&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&i(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),d&&(c&&b.type!=="comment"&&b.type!=="newline"&&i(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),b.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&b.source.includes(" ")&&(d=b),p=!0;break;case"comment":{p||i(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=b.source.substring(1)||" ";u?u+=f+C:u=C,f="",c=!1;break}case"newline":c?u?u+=b.source:(!A||t!=="seq-item-ind")&&(l=!0):f+=b.source,c=!0,m=!0,(h||S)&&(w=b),p=!0;break;case"anchor":h&&i(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&i(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=b,k??(k=b.offset),c=!1,p=!1,y=!0;break;case"tag":{S&&i(b,"MULTIPLE_TAGS","A node can have at most one tag"),S=b,k??(k=b.offset),c=!1,p=!1,y=!0;break}case t:(h||S)&&i(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),A&&i(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),A=b,c=t==="seq-item-ind"||t==="explicit-key-ind",p=!1;break;case"comma":if(e){v&&i(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=b,c=!1,p=!1;break}default:i(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),c=!1,p=!1}let N=s[s.length-1],T=N?N.offset+N.source.length:r;return y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&i(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(c&&d.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&i(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:A,spaceBefore:l,comment:u,hasNewline:m,anchor:h,tag:S,newlineAfterProp:w,end:T,start:k??T}}eo.resolveProps=qu});var zt=g(to=>{"use strict";function En(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
|
|
64
|
+
`))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(En(e.key)||En(e.value))return!0}return!1;default:return!0}}to.containsNewline=En});var Tn=g(so=>{"use strict";var Mu=zt();function _u(s,e,t){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Mu.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}so.flowIndentCheck=_u});var Ln=g(ro=>{"use strict";var no=O();function xu(s,e,t){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let r=typeof n=="function"?n:(i,o)=>i===o||no.isScalar(i)&&no.isScalar(o)&&i.value===o.value;return e.some(i=>r(i.key,t))}ro.mapIncludes=xu});var uo=g(co=>{"use strict";var io=z(),Bu=Z(),oo=Xe(),Ru=zt(),ao=Tn(),$u=Ln(),lo="All mapping items must start at the same column";function Du({composeNode:s,composeEmptyNode:e},t,n,r,i){let o=i?.nodeClass??Bu.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let p of n.items){let{start:u,key:f,sep:m,value:y}=p,d=oo.resolveProps(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:l,onError:r,parentIndent:n.indent,startOnNewline:!0}),h=!d.found;if(h){if(f&&(f.type==="block-seq"?r(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&r(l,"BAD_INDENT",lo)),!d.anchor&&!d.tag&&!m){c=d.end,d.comment&&(a.comment?a.comment+=`
|
|
65
|
+
`+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||Ru.containsNewline(f))&&r(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==n.indent&&r(l,"BAD_INDENT",lo);t.atKey=!0;let S=d.end,w=f?s(t,f,d,r):e(t,S,u,null,d,r);t.schema.compat&&ao.flowIndentCheck(n.indent,f,r),t.atKey=!1,$u.mapIncludes(t,a.items,w)&&r(S,"DUPLICATE_KEY","Map keys must be unique");let v=oo.resolveProps(m??[],{indicator:"map-value-ind",next:y,offset:w.range[2],onError:r,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=v.end,v.found){h&&(y?.type==="block-map"&&!v.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&d.start<v.found.offset-1024&&r(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let A=y?s(t,y,v,r):e(t,l,m,null,v,r);t.schema.compat&&ao.flowIndentCheck(n.indent,y,r),l=A.range[2];let k=new io.Pair(w,A);t.options.keepSourceTokens&&(k.srcToken=p),a.items.push(k)}else{h&&r(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(w.comment?w.comment+=`
|
|
66
|
+
`+v.comment:w.comment=v.comment);let A=new io.Pair(w);t.options.keepSourceTokens&&(A.srcToken=p),a.items.push(A)}}return c&&c<l&&r(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,l,c??l],a}co.resolveBlockMap=Du});var po=g(fo=>{"use strict";var Fu=ee(),ju=Xe(),Ku=Tn();function Uu({composeNode:s,composeEmptyNode:e},t,n,r,i){let o=i?.nodeClass??Fu.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=n.offset,c=null;for(let{start:p,value:u}of n.items){let f=ju.resolveProps(p,{indicator:"seq-item-ind",next:u,offset:l,onError:r,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?r(f.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{c=f.end,f.comment&&(a.comment=f.comment);continue}let m=u?s(t,u,f,r):e(t,f.end,p,null,f,r);t.schema.compat&&Ku.flowIndentCheck(n.indent,u,r),l=m.range[2],a.items.push(m)}return a.range=[n.offset,l,c??l],a}fo.resolveBlockSeq=Uu});var Ne=g(ho=>{"use strict";function Yu(s,e,t,n){let r="";if(s){let i=!1,o="";for(let a of s){let{source:l,type:c}=a;switch(c){case"space":i=!0;break;case"comment":{t&&!i&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=l.substring(1)||" ";r?r+=o+p:r=p,o="";break}case"newline":r&&(o+=l),i=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:r,offset:e}}ho.resolveEnd=Yu});var bo=g(yo=>{"use strict";var Ju=O(),Vu=z(),mo=Z(),Wu=ee(),Gu=Ne(),go=Xe(),Hu=zt(),Qu=Ln(),Cn="Block collections are not allowed within flow collections",Pn=s=>s&&(s.type==="block-map"||s.type==="block-seq");function zu({composeNode:s,composeEmptyNode:e},t,n,r,i){let o=n.start.source==="{",a=o?"flow map":"flow sequence",l=i?.nodeClass??(o?mo.YAMLMap:Wu.YAMLSeq),c=new l(t.schema);c.flow=!0;let p=t.atRoot;p&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=n.offset+n.start.source.length;for(let h=0;h<n.items.length;++h){let S=n.items[h],{start:w,key:v,sep:A,value:k}=S,N=go.resolveProps(w,{flow:a,indicator:"explicit-key-ind",next:v??A?.[0],offset:u,onError:r,parentIndent:n.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!A&&!k){h===0&&N.comma?r(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):h<n.items.length-1&&r(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),N.comment&&(c.comment?c.comment+=`
|
|
67
|
+
`+N.comment:c.comment=N.comment),u=N.end;continue}!o&&t.options.strict&&Hu.containsNewline(v)&&r(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0)N.comma&&r(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(N.comma||r(N.start,"MISSING_CHAR",`Missing , between ${a} items`),N.comment){let T="";e:for(let b of w)switch(b.type){case"comma":case"space":break;case"comment":T=b.source.substring(1);break e;default:break e}if(T){let b=c.items[c.items.length-1];Ju.isPair(b)&&(b=b.value??b.key),b.comment?b.comment+=`
|
|
68
|
+
`+T:b.comment=T,N.comment=N.comment.substring(T.length+1)}}if(!o&&!A&&!N.found){let T=k?s(t,k,N,r):e(t,N.end,A,null,N,r);c.items.push(T),u=T.range[2],Pn(k)&&r(T.range,"BLOCK_IN_FLOW",Cn)}else{t.atKey=!0;let T=N.end,b=v?s(t,v,N,r):e(t,T,w,null,N,r);Pn(v)&&r(b.range,"BLOCK_IN_FLOW",Cn),t.atKey=!1;let C=go.resolveProps(A??[],{flow:a,indicator:"map-value-ind",next:k,offset:b.range[2],onError:r,parentIndent:n.indent,startOnNewline:!1});if(C.found){if(!o&&!N.found&&t.options.strict){if(A)for(let P of A){if(P===C.found)break;if(P.type==="newline"){r(P,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}N.start<C.found.offset-1024&&r(C.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else k&&("source"in k&&k.source?.[0]===":"?r(k,"MISSING_CHAR",`Missing space after : in ${a}`):r(C.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let J=k?s(t,k,C,r):C.found?e(t,C.end,A,null,C,r):null;J?Pn(k)&&r(J.range,"BLOCK_IN_FLOW",Cn):C.comment&&(b.comment?b.comment+=`
|
|
69
|
+
`+C.comment:b.comment=C.comment);let ue=new Vu.Pair(b,J);if(t.options.keepSourceTokens&&(ue.srcToken=S),o){let P=c;Qu.mapIncludes(t,P.items,b)&&r(T,"DUPLICATE_KEY","Map keys must be unique"),P.items.push(ue)}else{let P=new mo.YAMLMap(t.schema);P.flow=!0,P.items.push(ue);let ir=(J??b).range;P.range=[b.range[0],ir[1],ir[2]],c.items.push(P)}u=J?J.range[2]:C.end}}let f=o?"}":"]",[m,...y]=n.end,d=u;if(m?.source===f)d=m.offset+m.source.length;else{let h=a[0].toUpperCase()+a.substring(1),S=p?`${h} must end with a ${f}`:`${h} in block collection must be sufficiently indented and end with a ${f}`;r(u,p?"MISSING_CHAR":"BAD_INDENT",S),m&&m.source.length!==1&&y.unshift(m)}if(y.length>0){let h=Gu.resolveEnd(y,d,t.options.strict,r);h.comment&&(c.comment?c.comment+=`
|
|
70
|
+
`+h.comment:c.comment=h.comment),c.range=[n.offset,d,h.offset]}else c.range=[n.offset,d,d];return c}yo.resolveFlowCollection=zu});var wo=g(So=>{"use strict";var Xu=O(),Zu=L(),ef=Z(),tf=ee(),sf=uo(),nf=po(),rf=bo();function In(s,e,t,n,r,i){let o=t.type==="block-map"?sf.resolveBlockMap(s,e,t,n,i):t.type==="block-seq"?nf.resolveBlockSeq(s,e,t,n,i):rf.resolveFlowCollection(s,e,t,n,i),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function of(s,e,t,n,r){let i=n.tag,o=i?e.directives.tagName(i.source,f=>r(i,"TAG_RESOLVE_FAILED",f)):null;if(t.type==="block-seq"){let{anchor:f,newlineAfterProp:m}=n,y=f&&i?f.offset>i.offset?f:i:f??i;y&&(!m||m.offset<y.offset)&&r(y,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===ef.YAMLMap.tagName&&a==="map"||o===tf.YAMLSeq.tagName&&a==="seq")return In(s,e,t,r,o);let l=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!l){let f=e.schema.knownTags[o];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),l=f;else return f?r(i,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),In(s,e,t,r,o)}let c=In(s,e,t,r,o,l),p=l.resolve?.(c,f=>r(i,"TAG_RESOLVE_FAILED",f),e.options)??c,u=Xu.isNode(p)?p:new Zu.Scalar(p);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}So.composeCollection=of});var Mn=g(vo=>{"use strict";var qn=L();function af(s,e,t){let n=e.offset,r=lf(e,s.options.strict,t);if(!r)return{value:"",type:null,comment:"",range:[n,n,n]};let i=r.mode===">"?qn.Scalar.BLOCK_FOLDED:qn.Scalar.BLOCK_LITERAL,o=e.source?cf(e.source):[],a=o.length;for(let d=o.length-1;d>=0;--d){let h=o[d][1];if(h===""||h==="\r")a=d;else break}if(a===0){let d=r.chomp==="+"&&o.length>0?`
|
|
71
71
|
`.repeat(Math.max(1,o.length-1)):"",h=n+r.length;return e.source&&(h+=e.source.length),{value:d,type:i,comment:r.comment,range:[n,h,h]}}let l=e.indent+r.indent,c=e.offset+r.length,p=0;for(let d=0;d<a;++d){let[h,S]=o[d];if(S===""||S==="\r")r.indent===0&&h.length>l&&(l=h.length);else{h.length<l&&t(c+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(l=h.length),p=d,l===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=h.length+S.length+1}for(let d=o.length-1;d>=a;--d)o[d][0].length>l&&(a=d+1);let u="",f="",m=!1;for(let d=0;d<p;++d)u+=o[d][0].slice(l)+`
|
|
72
|
-
`;for(let d=p;d<a;++d){let[h,S]=o[d];c+=h.length+S.length+1;let w=S[S.length-1]==="\r";if(w&&(S=S.slice(0,-1)),S&&h.length<l){let A=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;t(c-S.length-(w?2:1),"BAD_INDENT",A),h=""}i===
|
|
72
|
+
`;for(let d=p;d<a;++d){let[h,S]=o[d];c+=h.length+S.length+1;let w=S[S.length-1]==="\r";if(w&&(S=S.slice(0,-1)),S&&h.length<l){let A=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;t(c-S.length-(w?2:1),"BAD_INDENT",A),h=""}i===qn.Scalar.BLOCK_LITERAL?(u+=f+h.slice(l)+S,f=`
|
|
73
73
|
`):h.length>l||S[0]===" "?(f===" "?f=`
|
|
74
74
|
`:!m&&f===`
|
|
75
75
|
`&&(f=`
|
|
@@ -82,76 +82,76 @@ ${c}
|
|
|
82
82
|
`+o[d][0].slice(l);u[u.length-1]!==`
|
|
83
83
|
`&&(u+=`
|
|
84
84
|
`);break;default:u+=`
|
|
85
|
-
`}let y=n+r.length+e.source.length;return{value:u,type:i,comment:r.comment,range:[n,y,y]}}function
|
|
85
|
+
`}let y=n+r.length+e.source.length;return{value:u,type:i,comment:r.comment,range:[n,y,y]}}function lf({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],i=r[0],o=0,a="",l=-1;for(let f=1;f<r.length;++f){let m=r[f];if(!a&&(m==="-"||m==="+"))a=m;else{let y=Number(m);!o&&y?o=y:l===-1&&(l=s+f)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,p="",u=r.length;for(let f=1;f<e.length;++f){let m=e[f];switch(m.type){case"space":c=!0;case"newline":u+=m.source.length;break;case"comment":t&&!c&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=m.source.length,p=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let y=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",y);let d=m.source;d&&typeof d=="string"&&(u+=d.length)}}}return{mode:i,indent:o,chomp:a,comment:p,length:u}}function cf(s){let e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),i=[n?.[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}vo.resolveBlockScalar=af});var xn=g(ko=>{"use strict";var _n=L(),uf=Ne();function ff(s,e,t){let{offset:n,type:r,source:i,end:o}=s,a,l,c=(f,m,y)=>t(n+f,m,y);switch(r){case"scalar":a=_n.Scalar.PLAIN,l=df(i,c);break;case"single-quoted-scalar":a=_n.Scalar.QUOTE_SINGLE,l=pf(i,c);break;case"double-quoted-scalar":a=_n.Scalar.QUOTE_DOUBLE,l=hf(i,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[n,n+i.length,n+i.length]}}let p=n+i.length,u=uf.resolveEnd(o,p,e,t);return{value:l,type:a,comment:u.comment,range:[n,p,u.offset]}}function df(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),Ao(s)}function pf(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),Ao(s.slice(1,-1)).replace(/''/g,"'")}function Ao(s){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
86
86
|
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
87
87
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(s);if(!n)return s;let r=n[1],i=" ",o=e.lastIndex;for(t.lastIndex=o;n=t.exec(s);)n[1]===""?i===`
|
|
88
88
|
`?r+=i:i=`
|
|
89
|
-
`:(r+=i+n[1],i=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(s),r+i+(n?.[1]??"")}function
|
|
89
|
+
`:(r+=i+n[1],i=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(s),r+i+(n?.[1]??"")}function hf(s,e){let t="";for(let n=1;n<s.length-1;++n){let r=s[n];if(!(r==="\r"&&s[n+1]===`
|
|
90
90
|
`))if(r===`
|
|
91
|
-
`){let{fold:i,offset:o}=
|
|
91
|
+
`){let{fold:i,offset:o}=mf(s,n);t+=i,n=o}else if(r==="\\"){let i=s[++n],o=gf[i];if(o)t+=o;else if(i===`
|
|
92
92
|
`)for(i=s[n+1];i===" "||i===" ";)i=s[++n+1];else if(i==="\r"&&s[n+1]===`
|
|
93
|
-
`)for(i=s[++n+1];i===" "||i===" ";)i=s[++n+1];else if(i==="x"||i==="u"||i==="U"){let a={x:2,u:4,U:8}[i];t+=
|
|
93
|
+
`)for(i=s[++n+1];i===" "||i===" ";)i=s[++n+1];else if(i==="x"||i==="u"||i==="U"){let a={x:2,u:4,U:8}[i];t+=yf(s,n+1,a,e),n+=a}else{let a=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(r===" "||r===" "){let i=n,o=s[n+1];for(;o===" "||o===" ";)o=s[++n+1];o!==`
|
|
94
94
|
`&&!(o==="\r"&&s[n+2]===`
|
|
95
|
-
`)&&(t+=n>i?s.slice(i,n+1):r)}else t+=r}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function
|
|
95
|
+
`)&&(t+=n>i?s.slice(i,n+1):r)}else t+=r}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function mf(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
|
|
96
96
|
`||n==="\r")&&!(n==="\r"&&s[e+2]!==`
|
|
97
97
|
`);)n===`
|
|
98
98
|
`&&(t+=`
|
|
99
|
-
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var
|
|
100
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
99
|
+
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var gf={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
100
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function yf(s,e,t,n){let r=s.substr(e,t),o=r.length===t&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(o)){let a=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}ko.resolveFlowScalar=ff});var Eo=g(Oo=>{"use strict";var ae=O(),No=L(),bf=Mn(),Sf=xn();function wf(s,e,t,n){let{value:r,type:i,comment:o,range:a}=e.type==="block-scalar"?bf.resolveBlockScalar(s,e,n):Sf.resolveFlowScalar(e,s.options.strict,n),l=t?s.directives.tagName(t.source,u=>n(t,"TAG_RESOLVE_FAILED",u)):null,c;s.options.stringKeys&&s.atKey?c=s.schema[ae.SCALAR]:l?c=vf(s.schema,r,l,t,n):e.type==="scalar"?c=Af(s,r,e,n):c=s.schema[ae.SCALAR];let p;try{let u=c.resolve(r,f=>n(t??e,"TAG_RESOLVE_FAILED",f),s.options);p=ae.isScalar(u)?u:new No.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);n(t??e,"TAG_RESOLVE_FAILED",f),p=new No.Scalar(r)}return p.range=a,p.source=r,i&&(p.type=i),l&&(p.tag=l),c.format&&(p.format=c.format),o&&(p.comment=o),p}function vf(s,e,t,n,r){if(t==="!")return s[ae.SCALAR];let i=[];for(let a of s.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[ae.SCALAR])}function Af({atKey:s,directives:e,schema:t},n,r,i){let o=t.tags.find(a=>(a.default===!0||s&&a.default==="key")&&a.test?.test(n))||t[ae.SCALAR];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(n))??t[ae.SCALAR];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),p=`Value may be parsed as either ${l} or ${c}`;i(r,"TAG_RESOLVE_FAILED",p,!0)}}return o}Oo.composeScalar=wf});var Lo=g(To=>{"use strict";function kf(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let r=e[n];switch(r.type){case"space":case"comment":case"newline":s-=r.source.length;continue}for(r=e[++n];r?.type==="space";)s+=r.source.length,r=e[++n];break}}return s}To.emptyScalarPosition=kf});var Io=g(Rn=>{"use strict";var Nf=Ie(),Of=O(),Ef=wo(),Co=Eo(),Tf=Ne(),Lf=Lo(),Cf={composeNode:Po,composeEmptyNode:Bn};function Po(s,e,t,n){let r=s.atKey,{spaceBefore:i,comment:o,anchor:a,tag:l}=t,c,p=!0;switch(e.type){case"alias":c=Pf(s,e,n),(a||l)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Co.composeScalar(s,e,l,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=Ef.composeCollection(Cf,s,e,t,n),a&&(c.anchor=a.source.substring(1));break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",u),c=Bn(s,e.offset,void 0,null,t,n),p=!1}}return a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&s.options.stringKeys&&(!Of.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),s.options.keepSourceTokens&&p&&(c.srcToken=e),c}function Bn(s,e,t,n,{spaceBefore:r,comment:i,anchor:o,tag:a,end:l},c){let p={type:"scalar",offset:Lf.emptyScalarPosition(e,t,n),indent:-1,source:""},u=Co.composeScalar(s,p,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(u.spaceBefore=!0),i&&(u.comment=i,u.range[2]=l),u}function Pf({options:s},{offset:e,source:t,end:n},r){let i=new Nf.Alias(t.substring(1));i.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&r(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=Tf.resolveEnd(n,o,s.strict,r);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}Rn.composeEmptyNode=Bn;Rn.composeNode=Po});var _o=g(Mo=>{"use strict";var If=Ge(),qo=Io(),qf=Ne(),Mf=Xe();function _f(s,e,{offset:t,start:n,value:r,end:i},o){let a=Object.assign({_directives:e},s),l=new If.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},p=Mf.resolveProps(n,{indicator:"doc-start",next:r??i?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(l.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?qo.composeNode(c,r,p,o):qo.composeEmptyNode(c,p.end,n,null,p,o);let u=l.contents.range[2],f=qf.resolveEnd(i,u,!1,o);return f.comment&&(l.comment=f.comment),l.range=[t,u,f.offset],l}Mo.composeDoc=_f});var Dn=g(Ro=>{"use strict";var xf=at("process"),Bf=ks(),Rf=Ge(),Ze=ze(),xo=O(),$f=_o(),Df=Ne();function et(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function Bo(s){let e="",t=!1,n=!1;for(let r=0;r<s.length;++r){let i=s[r];switch(i[0]){case"#":e+=(e===""?"":n?`
|
|
101
101
|
|
|
102
102
|
`:`
|
|
103
|
-
`)+(i.substring(1)||" "),t=!0,n=!1;break;case"%":s[r+1]?.[0]!=="#"&&(r+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var
|
|
104
|
-
${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(
|
|
103
|
+
`)+(i.substring(1)||" "),t=!0,n=!1;break;case"%":s[r+1]?.[0]!=="#"&&(r+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var $n=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,r,i)=>{let o=et(t);i?this.warnings.push(new Ze.YAMLWarning(o,n,r)):this.errors.push(new Ze.YAMLParseError(o,n,r))},this.directives=new Bf.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=Bo(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
104
|
+
${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(xo.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];xo.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
|
|
105
105
|
${a}`:n}else{let o=i.commentBefore;i.commentBefore=o?`${n}
|
|
106
|
-
${o}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:
|
|
107
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
106
|
+
${o}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Bo(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let r of e)yield*this.next(r);yield*this.end(t,n)}*next(e){switch(xf.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,r)=>{let i=et(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=$f.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Ze.YAMLParseError(et(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Ze.YAMLParseError(et(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=Df.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
107
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Ze.YAMLParseError(et(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),r=new Rf.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}};Ro.Composer=$n});var Fo=g(Xt=>{"use strict";var Ff=Mn(),jf=xn(),Kf=ze(),$o=Be();function Uf(s,e=!0,t){if(s){let n=(r,i,o)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(t)t(a,i,o);else throw new Kf.YAMLParseError([a,a+1],i,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return jf.resolveFlowScalar(s,e,n);case"block-scalar":return Ff.resolveBlockScalar({options:{strict:e}},s,n)}}return null}function Yf(s,e){let{implicitKey:t=!1,indent:n,inFlow:r=!1,offset:i=-1,type:o="PLAIN"}=e,a=$o.stringifyString({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
108
108
|
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
109
109
|
`),p=a.substring(0,c),u=a.substring(c+1)+`
|
|
110
|
-
`,f=[{type:"block-scalar-header",offset:i,indent:n,source:p}];return
|
|
111
|
-
`}),{type:"block-scalar",offset:i,indent:n,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:i,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:i,indent:n,source:a,end:l};default:return{type:"scalar",offset:i,indent:n,source:a,end:l}}}function
|
|
110
|
+
`,f=[{type:"block-scalar-header",offset:i,indent:n,source:p}];return Do(f,l)||f.push({type:"newline",offset:-1,indent:n,source:`
|
|
111
|
+
`}),{type:"block-scalar",offset:i,indent:n,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:i,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:i,indent:n,source:a,end:l};default:return{type:"scalar",offset:i,indent:n,source:a,end:l}}}function Jf(s,e,t={}){let{afterKey:n=!1,implicitKey:r=!1,inFlow:i=!1,type:o}=t,a="indent"in s?s.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(s.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=s.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=$o.stringifyString({type:o,value:e},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Vf(s,l);break;case'"':Fn(s,l,"double-quoted-scalar");break;case"'":Fn(s,l,"single-quoted-scalar");break;default:Fn(s,l,"scalar")}}function Vf(s,e){let t=e.indexOf(`
|
|
112
112
|
`),n=e.substring(0,t),r=e.substring(t+1)+`
|
|
113
|
-
`;if(s.type==="block-scalar"){let i=s.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=n,s.source=r}else{let{offset:i}=s,o="indent"in s?s.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:n}]
|
|
114
|
-
`});for(let l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:o,props:a,source:r})}}function
|
|
115
|
-
`};delete s.items,Object.assign(s,{type:t,source:e,end:[r]});break}default:{let n="indent"in s?s.indent:-1,r="end"in s&&Array.isArray(s.end)?s.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(s))i!=="type"&&i!=="offset"&&delete s[i];Object.assign(s,{type:t,indent:n,source:e,end:r})}}}
|
|
113
|
+
`;if(s.type==="block-scalar"){let i=s.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=n,s.source=r}else{let{offset:i}=s,o="indent"in s?s.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:n}];Do(a,"end"in s?s.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
114
|
+
`});for(let l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:o,props:a,source:r})}}function Do(s,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":s.push(t);break;case"newline":return s.push(t),!0}return!1}function Fn(s,e,t){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=t,s.source=e;break;case"block-scalar":{let n=s.props.slice(1),r=e.length;s.props[0].type==="block-scalar-header"&&(r-=s.props[0].source.length);for(let i of n)i.offset+=r;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let r={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`
|
|
115
|
+
`};delete s.items,Object.assign(s,{type:t,source:e,end:[r]});break}default:{let n="indent"in s?s.indent:-1,r="end"in s&&Array.isArray(s.end)?s.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(s))i!=="type"&&i!=="offset"&&delete s[i];Object.assign(s,{type:t,indent:n,source:e,end:r})}}}Xt.createScalarToken=Yf;Xt.resolveAsScalar=Uf;Xt.setScalarValue=Jf});var Ko=g(jo=>{"use strict";var Wf=s=>"type"in s?es(s):Zt(s);function es(s){switch(s.type){case"block-scalar":{let e="";for(let t of s.props)e+=es(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(let t of s.items)e+=Zt(t);return e}case"flow-collection":{let e=s.start.source;for(let t of s.items)e+=Zt(t);for(let t of s.end)e+=t.source;return e}case"document":{let e=Zt(s);if(s.end)for(let t of s.end)e+=t.source;return e}default:{let e=s.source;if("end"in s&&s.end)for(let t of s.end)e+=t.source;return e}}}function Zt({start:s,key:e,sep:t,value:n}){let r="";for(let i of s)r+=i.source;if(e&&(r+=es(e)),t)for(let i of t)r+=i.source;return n&&(r+=es(n)),r}jo.stringify=Wf});var Vo=g(Jo=>{"use strict";var jn=Symbol("break visit"),Gf=Symbol("skip children"),Uo=Symbol("remove item");function le(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),Yo(Object.freeze([]),s,e)}le.BREAK=jn;le.SKIP=Gf;le.REMOVE=Uo;le.itemAtPath=(s,e)=>{let t=s;for(let[n,r]of e){let i=t?.[n];if(i&&"items"in i)t=i.items[r];else return}return t};le.parentCollection=(s,e)=>{let t=le.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],r=t?.[n];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function Yo(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(let r of["key","value"]){let i=e[r];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=Yo(Object.freeze(s.concat([[r,o]])),i.items[o],t);if(typeof a=="number")o=a-1;else{if(a===jn)return jn;a===Uo&&(i.items.splice(o,1),o-=1)}}typeof n=="function"&&r==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}Jo.visit=le});var ts=g(_=>{"use strict";var Kn=Fo(),Hf=Ko(),Qf=Vo(),Un="\uFEFF",Yn="",Jn="",Vn="",zf=s=>!!s&&"items"in s,Xf=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function Zf(s){switch(s){case Un:return"<BOM>";case Yn:return"<DOC>";case Jn:return"<FLOW_END>";case Vn:return"<SCALAR>";default:return JSON.stringify(s)}}function ed(s){switch(s){case Un:return"byte-order-mark";case Yn:return"doc-mode";case Jn:return"flow-error-end";case Vn:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
116
116
|
`:case`\r
|
|
117
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(s[0]){case" ":case" ":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}_.createScalarToken=
|
|
118
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
119
|
-
\r `),
|
|
117
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(s[0]){case" ":case" ":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}_.createScalarToken=Kn.createScalarToken;_.resolveAsScalar=Kn.resolveAsScalar;_.setScalarValue=Kn.setScalarValue;_.stringify=Hf.stringify;_.visit=Qf.visit;_.BOM=Un;_.DOCUMENT=Yn;_.FLOW_END=Jn;_.SCALAR=Vn;_.isCollection=zf;_.isScalar=Xf;_.prettyToken=Zf;_.tokenType=ed});var Hn=g(Go=>{"use strict";var tt=ts();function $(s){switch(s){case void 0:case" ":case`
|
|
118
|
+
`:case"\r":case" ":return!0;default:return!1}}var Wo=new Set("0123456789ABCDEFabcdef"),td=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ss=new Set(",[]{}"),sd=new Set(` ,[]{}
|
|
119
|
+
\r `),Wn=s=>!s||sd.has(s),Gn=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
120
120
|
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
121
121
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let r=this.buffer[n+e+1];if(r===`
|
|
122
122
|
`||!r&&!this.atEnd)return e+n+1}return t===`
|
|
123
123
|
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&$(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
124
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===
|
|
124
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===tt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){let i=e[n-1];if(i===" "||i===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let i=e[t-1];if(i===" "||i===" ")t-=1;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield tt.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&$(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!$(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&$(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Wn),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&r[0]!=="#"||n===0&&(r.startsWith("---")||r.startsWith("..."))&&$(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield tt.FLOW_END,yield*this.parseLineStart();let i=0;for(;r[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Wn),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||$(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let i=0;for(;this.buffer[t-1-i]==="\\";)i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
|
|
125
125
|
`,this.pos);if(r!==-1){for(;r!==-1;){let i=this.continueScalar(r+1);if(i===-1)break;r=n.indexOf(`
|
|
126
126
|
`,i)}r!==-1&&(t=r-(n[r-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>$(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let i=this.pos;n=this.buffer[i];++i)switch(n){case" ":t+=1;break;case`
|
|
127
127
|
`:e=i,t=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
128
128
|
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
129
129
|
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===" ";)n=this.buffer[++r];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
130
130
|
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);let a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
|
|
131
|
-
`&&i>=this.pos&&i+1+t>a)e=i;else break}while(!0);return yield
|
|
131
|
+
`&&i>=this.pos&&i+1+t>a)e=i;else break}while(!0);return yield tt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===":"){let i=this.buffer[n+1];if($(i)||e&&ss.has(i))break;t=n}else if($(r)){let i=this.buffer[n+1];if(r==="\r"&&(i===`
|
|
132
132
|
`?(n+=1,r=`
|
|
133
|
-
`,i=this.buffer[n+1]):t=n),i==="#"||e&&
|
|
134
|
-
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&
|
|
133
|
+
`,i=this.buffer[n+1]):t=n),i==="#"||e&&ss.has(i))break;if(r===`
|
|
134
|
+
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&ss.has(r))break;t=n}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield tt.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Wn))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if($(t)||e&&ss.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!$(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(td.has(t))t=this.buffer[++e];else if(t==="%"&&Wo.has(this.buffer[e+1])&&Wo.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
135
135
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
136
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};
|
|
136
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};Go.Lexer=Gn});var zn=g(Ho=>{"use strict";var Qn=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let i=t+n>>1;this.lineStarts[i]<e?t=i+1:n=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};Ho.LineCounter=Qn});var Zn=g(ea=>{"use strict";var nd=at("process"),Qo=ts(),rd=Hn();function te(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function zo(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Zo(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 ns(s){switch(s.type){case"document":return s.start;case"block-map":{let e=s.items[s.items.length-1];return e.sep??e.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function Oe(s){if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;s[++e]?.type==="space";);return s.splice(e,s.length)}function Xo(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!te(e.start,"explicit-key-ind")&&!te(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Zo(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var Xn=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new rd.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,nd.env.LOG_TOKENS&&console.log("|",Qo.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Qo.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Xo(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let r=n.items[n.items.length-1];if(r.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=n.items[n.items.length-1];r.value?n.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{let r=n.items[n.items.length-1];!r||r.value?n.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&zo(r.start)===-1&&(t.indent===0||r.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(n.type==="document"?n.end=r.start:n.items.push({start:r.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{zo(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=ns(this.peek(2)),n=Oe(t),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
137
137
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
138
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(r&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(te(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(
|
|
138
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(r&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(te(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Zo(t.key)&&!te(t.sep,"newline")){let o=Oe(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(te(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Oe(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):te(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!te(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||te(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let r=ns(n),i=Oe(r);Xo(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
139
139
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
140
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=
|
|
141
|
-
`),t=0;if(e[t]?.trim()!=="---")return null;t++;let n=[];for(;t<e.length&&e[t]?.trim()!=="---";)n.push(e[t]),t++;if(e[t]?.trim()!=="---")return null;t++;let r=
|
|
142
|
-
`)),a=t}else t++}return{frontmatter:r,files:i,warnings:o,bodyEndLine:a}}catch{return null}}function
|
|
140
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=ns(e),n=Oe(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=ns(e),n=Oe(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};ea.Parser=Xn});var ia=g(nt=>{"use strict";var ta=Dn(),id=Ge(),st=ze(),od=Bs(),ad=O(),ld=zn(),sa=Zn();function na(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new ld.LineCounter||null,prettyErrors:e}}function cd(s,e={}){let{lineCounter:t,prettyErrors:n}=na(e),r=new sa.Parser(t?.addNewLine),i=new ta.Composer(e),o=Array.from(i.compose(r.parse(s)));if(n&&t)for(let a of o)a.errors.forEach(st.prettifyError(s,t)),a.warnings.forEach(st.prettifyError(s,t));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function ra(s,e={}){let{lineCounter:t,prettyErrors:n}=na(e),r=new sa.Parser(t?.addNewLine),i=new ta.Composer(e),o=null;for(let a of i.compose(r.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new st.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(st.prettifyError(s,t)),o.warnings.forEach(st.prettifyError(s,t))),o}function ud(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let r=ra(s,t);if(!r)return null;if(r.warnings.forEach(i=>od.warn(r.options.logLevel,i)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:n},t))}function fd(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(s===void 0){let{keepUndefined:r}=t??e??{};if(!r)return}return ad.isDocument(s)&&!n?s.toString(t):new id.Document(s,n,t).toString(t)}nt.parse=ud;nt.parseAllDocuments=cd;nt.parseDocument=ra;nt.stringify=fd});var aa=g(E=>{"use strict";var dd=Dn(),pd=Ge(),hd=Sn(),er=ze(),md=Ie(),se=O(),gd=z(),yd=L(),bd=Z(),Sd=ee(),wd=ts(),vd=Hn(),Ad=zn(),kd=Zn(),rs=ia(),oa=Te();E.Composer=dd.Composer;E.Document=pd.Document;E.Schema=hd.Schema;E.YAMLError=er.YAMLError;E.YAMLParseError=er.YAMLParseError;E.YAMLWarning=er.YAMLWarning;E.Alias=md.Alias;E.isAlias=se.isAlias;E.isCollection=se.isCollection;E.isDocument=se.isDocument;E.isMap=se.isMap;E.isNode=se.isNode;E.isPair=se.isPair;E.isScalar=se.isScalar;E.isSeq=se.isSeq;E.Pair=gd.Pair;E.Scalar=yd.Scalar;E.YAMLMap=bd.YAMLMap;E.YAMLSeq=Sd.YAMLSeq;E.CST=wd;E.Lexer=vd.Lexer;E.LineCounter=Ad.LineCounter;E.Parser=kd.Parser;E.parse=rs.parse;E.parseAllDocuments=rs.parseAllDocuments;E.parseDocument=rs.parseDocument;E.stringify=rs.stringify;E.visit=oa.visit;E.visitAsync=oa.visitAsync});import{spawn as lr}from"child_process";import{readdir as La,readFile as Ca,writeFile as Ap,unlink as hs,mkdir as kp}from"fs/promises";import{mkdirSync as Op,writeFileSync as Ep,appendFileSync as Tp,readFileSync as Pa}from"fs";import*as x from"path";import{fileURLToPath as Ia}from"url";import{realpathSync as Oa}from"fs";import{join as ps,resolve as Ea}from"path";import{homedir as Ta}from"os";function lt(){let s=process.env.TYPEBULB_SERVERS_DIR;return s?ps(s,".."):ps(Ta(),".typebulb")}function fe(){return process.env.TYPEBULB_SERVERS_DIR||ps(lt(),"servers")}function V(s){let e=Ea(s),t=e;try{t=Oa.native(e)}catch{}return(process.platform==="win32"?t.toLowerCase():t).replace(/\\/g,"/")}function ar(s,e){let t=V(s),n=V(e);return t.startsWith(n.endsWith("/")?n:n+"/")?!t.includes("/node_modules/"):!1}function qa(s){return x.join(fe(),`${s}.json`)}function gs(s){return x.join(fe(),`${s}.log`)}function Ma(s){return x.join(fe(),`${s}.wait.json`)}function _a(s,e=0){try{let t=Pa(gs(s)),n=e>=0&&e<=t.length?e:0;return{text:t.subarray(n).toString("utf8"),offset:t.length}}catch{return{text:"",offset:0}}}function xa(s){try{return process.kill(s,0),!0}catch(e){return e.code==="EPERM"}}async function ms(s){await hs(qa(s)).catch(()=>{}),await hs(gs(s)).catch(()=>{}),await hs(Ma(s)).catch(()=>{})}async function ys(s){let e;try{e=await La(fe())}catch{return[]}let t=[];return await Promise.all(e.map(async r=>{if(!/^\d+\.json$/.test(r))return;let i=parseInt(r,10),o;try{o=JSON.parse(await Ca(x.join(fe(),r),"utf8"))}catch{await ms(i);return}o&&typeof o.pid=="number"&&xa(o.pid)?t.push(o):await ms(i)})),(s?t.filter(r=>r.agent==null&&ar(r.file,s)):t).sort((r,i)=>r.startedAt-i.startedAt)}async function cr(s){try{process.kill(s,"SIGTERM")}catch{}await ms(s)}function ur(s,e){let t=V(e);return s.filter(n=>n.agent==null&&n.pid!==process.pid&&V(n.file)===t)}async function Ba(s){let e=ur(await ys(),s);for(let t of e)await cr(t.pid);return e}var Ra=s=>new Promise(e=>setTimeout(e,s));function $a(s,e,t){(process.platform==="win32"?lr("cmd",["/c","start","","/b",s,...e],{cwd:t,stdio:"ignore",windowsHide:!0}):lr(s,e,{cwd:t,detached:!0,stdio:"ignore"})).unref()}function Da(){return x.join(x.dirname(Ia(import.meta.url)),"index.js")}function Fa(s,e={}){return{command:process.execPath,args:[Da(),...e.trust?["--trust"]:[],s,...e.open===!1?["--no-open"]:[]]}}async function ja(s,e,t,n){let r=await s();if(r)return r;$a(e.command,e.args,t);let i=Date.now()+2e4;for(;Date.now()<i;){await Ra(150);let o=await s();if(o)return o}throw new Error(`Launched ${n} but it did not register within 20s.`)}async function Ka(s,e={}){let t=e.cwd??process.cwd(),n=x.resolve(t,s);return await Ba(n),ja(async()=>ur(await ys(),n)[0],Fa(s,e),t,x.basename(s))}import{readdirSync as Td,readFileSync as Ld,statSync as Cd}from"fs";import{join as ca,basename as Pd}from"path";var de={code:{path:"code.tsx",language:"typescript"},css:{path:"styles.css",language:"css"},html:{path:"index.html",language:"html"},config:{path:"config.json",language:"json"},notes:{path:"notes.md",language:"markdown"},data:{path:"data.txt",language:"text"},infer:{path:"infer.md",language:"markdown"},insight:{path:"insight.json",language:"json"}},pe=["code","css","html","data","infer","insight","config","notes"];function fr(s){return pe.find(e=>de[e].path===s)}var dr="typebulb/v1";function pr(s){return!!s?.startsWith("typebulb")}function bs(s){return/[:\n"']/.test(s)||s.startsWith(" ")||s.endsWith(" ")?`"${s.replace(/"/g,'\\"')}"`:s}function Ss(s){return s.startsWith('"')&&s.endsWith('"')?s.slice(1,-1).replace(/\\"/g,'"'):s.startsWith("'")&&s.endsWith("'")?s.slice(1,-1):s}var hr=/^\*\*(.+)\*\*$/,mr=/^(`{3,})(\w*)\s*$/,Ua=new Set(pe.map(s=>de[s].path));function he(s){try{let e=s.split(`
|
|
141
|
+
`),t=0;if(e[t]?.trim()!=="---")return null;t++;let n=[];for(;t<e.length&&e[t]?.trim()!=="---";)n.push(e[t]),t++;if(e[t]?.trim()!=="---")return null;t++;let r=Va(n);if(!r)return null;let i=new Map,o=[],a=t;for(;t<e.length;){let c=e[t]?.trim()?.match(hr);if(c){let p=c[1].trim();for(t++;t<e.length&&e[t]?.trim()==="";)t++;let u=e[t]?.match(mr);if(!u){t++;continue}let f=u[1];t++;let m=[];for(;t<e.length&&!e[t]?.match(new RegExp(`^${f}\\s*$`));)m.push(e[t]),t++;let y=t<e.length;t++,o.push(...Ya(p,m,y)),i.set(p,m.join(`
|
|
142
|
+
`)),a=t}else t++}return{frontmatter:r,files:i,warnings:o,bodyEndLine:a}}catch{return null}}function Ya(s,e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r]?.trim().match(hr);i&&Ua.has(i[1].trim())&&Ja(e,r)&&n.push(i[1].trim())}return n.length?n.map(r=>`**${s}** block has an unterminated code fence \u2014 it swallowed the **${r}** block.`):t?[]:[`**${s}** block has an unterminated code fence (it runs to the end of the file).`]}function Ja(s,e){let t=e+1;for(;t<s.length&&s[t]?.trim()==="";)t++;return!!s[t]?.match(mr)}function Va(s){let e={};for(let t of s){let n=t.indexOf(":");if(n===-1)continue;let r=t.slice(0,n).trim(),i=t.slice(n+1).trim();switch(r){case"format":e.format=i;break;case"name":e.name=Ss(i);break}}return!pr(e.format)||!e.name?null:e}function gr(s){let e=Object.fromEntries(pe.map(t=>[t,s.files.get(de[t].path)||""]));return{name:s.frontmatter.name,...e}}function Wa(s){let e=s.match(/^`{3,}/gm),t=e?Math.max(...e.map(n=>n.length)):0;return"`".repeat(Math.max(3,t+1))}function yr(s){let e=pe.filter(t=>s[t]).map(t=>{let{path:n}=de[t],r=s[t],i=n.split(".").pop(),o=Wa(r);return`**${n}**
|
|
143
143
|
|
|
144
144
|
${o}${i}
|
|
145
145
|
${r}
|
|
146
|
-
${o}`});return["---",`format: ${
|
|
147
|
-
`)}var
|
|
148
|
-
`)).map(e=>e.root)}function
|
|
146
|
+
${o}`});return["---",`format: ${dr}`,`name: ${bs(s.name)}`,"---","",...e].join(`
|
|
147
|
+
`)}var Nd=Na(aa(),1);function is(s){return{...gr(s),server:s.files.get("server.ts")??""}}function la(s){return!!s.server&&!s.code}function os(s){let e=/^---[^\n]*\n([\s\S]*?)\n---/.exec(s),t=e?/^\s*name:\s*(.+?)\s*$/m.exec(e[1]):null;return t?t[1].replace(/^["']|["']$/g,""):void 0}function Od(s){return(os(s)??"bulb").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"bulb"}function Ed(s){return s.replace(/^---[^\n]*\r?\n[\s\S]*?\r?\n---[^\n]*\r?\n?/,"").replace(/^\r?\n+/,"")}function ua(s,e,t){if(e>8)return t;let n;try{n=Td(s,{withFileTypes:!0})}catch{return t}for(let r of n)if(r.isDirectory()){if(r.name.startsWith(".")||r.name==="node_modules")continue;ua(ca(s,r.name),e+1,t)}else r.isFile()&&r.name.endsWith(".bulb.md")&&t.push(ca(s,r.name));return t}function Id(s){return ua(s,0,[]).map(e=>{let t=0;try{t=Cd(e).mtimeMs}catch{}let n,r=!1;try{let i=Ld(e,"utf8");n=os(i.slice(0,1024));let o=he(i);r=!!o&&la(is(o))}catch{}return{path:e,name:n??Pd(e).replace(/\.bulb\.md$/,""),mtime:t,serverOnly:r}})}import{readFile as qd}from"fs/promises";function fa(s){if(s.server.trim())return"server-side code (server.ts)";let e=s.code;if(/\btb\s*\.\s*fs\b/.test(e)||e.includes("/__fs"))return"the filesystem";if(/\btb\s*\.\s*ai\b/.test(e)||e.includes("/__ai"))return"AI (your API keys)";if(/\btb\s*\.\s*server\s*\.\s*(?!log\b)\w/.test(e)||e.includes("/__api"))return"server-side code (server.ts)"}async function Md(s){try{let e=he(await qd(s,"utf-8"));return e?fa(is(e)):void 0}catch{return}}var _d=[/\bimport\s+(?:[^'";]*?from\s*)?['"]([^'"]+)['"]/g,/\bexport\s+[^'";]*?from\s*['"]([^'"]+)['"]/g];function xd(s){if(/^[./]/.test(s)||/^[a-z][a-z0-9+.-]*:/i.test(s))return null;let e=s.split("/");return s.startsWith("@")?e.slice(0,2).join("/"):e[0]}function Bd(s){let e=[],t=new Set;for(let n=0;n<s.length;n++)for(let r of _d)for(let i of s[n].matchAll(r)){let o=xd(i[1]);o&&!t.has(o)&&(t.add(o),e.push({root:o,lineIndex:n}))}return e}function da(s){return Bd(s.split(`
|
|
148
|
+
`)).map(e=>e.root)}function Rd(s){let e=he(s);if(!e)return s;let t=e.files.get("code.tsx");if(!t)return s;let n=da(t);if(!n.length)return s;let r=e.files.get("config.json"),i={};if(r)try{let c=JSON.parse(r);c&&typeof c=="object"&&(i=c)}catch{}let o=i.dependencies&&typeof i.dependencies=="object"?{...i.dependencies}:{},a=n.filter(c=>!(c in o));if(!a.length)return s;for(let c of a)o[c]="latest";i.dependencies=o;let l={name:e.frontmatter.name};for(let[c,p]of e.files){let u=fr(c);u&&(l[u]=p)}return l.config=JSON.stringify(i,null,2),yr(l)}import{spawn as pa}from"child_process";import{basename as $d}from"path";function Dd(){return process.env.TYPEBULB_EDITOR||"code"}var Fd=/^(code|code-insiders|codium|vscodium|cursor|windsurf)(\.cmd|\.exe)?$/i;function jd(s,e,t){return t==null?[e]:Fd.test($d(s))?["-g",`${e}:${t}`]:[`+${t}`,e]}function Kd(s,e){let t=Dd();return{command:t,args:jd(t,s,e)}}function Ud(s,e){let{command:t,args:n}=Kd(s,e),r=process.platform==="win32"?pa("cmd.exe",["/d","/s","/c",t,...n],{detached:!0,stdio:"ignore",windowsHide:!0}):pa(t,n,{detached:!0,stdio:"ignore"});r.on("error",i=>console.error("[typebulb] editor launch failed:",i?.message??i)),r.unref()}import{readFileSync as Yd,writeFileSync as Jd,mkdirSync as Vd}from"fs";import{join as Wd}from"path";function ha(){return Wd(lt(),"trust.json")}function tr(){try{let s=JSON.parse(Yd(ha(),"utf8"));return new Set(Array.isArray(s)?s:[])}catch{return new Set}}function Gd(s){Vd(lt(),{recursive:!0}),Jd(ha(),JSON.stringify([...s]))}function Hd(s){return tr().has(V(s))}function Qd(s,e){let t=tr(),n=V(s);(e?t.has(n):!t.has(n))||(e?t.add(n):t.delete(n),Gd(t))}function zd(){return[...tr()]}var sr={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY",gemini:"GOOGLE_API_KEY",openrouter:"OPENROUTER_API_KEY"};function nr(s){return(s.includes("://")?s:`http://${s}`).replace(/\/+$/,"")}var Xd="https://api.typebulb.com/api/models",Zd=1440*60*1e3,ep=5e3,tp=60*1e3,rt=null,as=null,it=null;function sp(){return it}async function np(){let[s,e]=await Promise.all([ip(),rp()]);return[...op(e),...s]}async function ma(){let s;try{s=await fetch(Xd,{signal:AbortSignal.timeout(ep)})}catch(e){return it=`catalog fetch failed: ${e?.message??e}`,null}if(!s.ok)return it=`catalog fetch failed: HTTP ${s.status}`,null;try{return await s.json()}catch(e){return it=`catalog returned an unreadable body: ${e?.message??e}`,null}}async function rp(){if(rt&&Date.now()-rt.fetchedAt<=Zd)return rt.models;let s=await ma()??await ma();return s?(rt={models:s,fetchedAt:Date.now()},it=null,s):rt?.models??[]}async function ip(){if(as&&Date.now()-as.fetchedAt<=tp)return as.models;let s=nr(process.env.OLLAMA_HOST??"http://localhost:11434"),e=[];try{let t=await fetch(new URL("/api/tags",s).toString());t.ok&&(e=((await t.json()).models??[]).map(r=>r.name).filter(r=>!!r).map(r=>({provider:"ollama",name:r,friendlyName:r,providerName:"Ollama"})))}catch{}return as={models:e,fetchedAt:Date.now()},e}function op(s){let e=new Set(Object.entries(sr).filter(([,t])=>!!process.env[t]).map(([t])=>t));return s.filter(t=>e.has(t.provider))}var Y=class extends Error{constructor(e,t="unknown",n=!1){super(e),this.code=t,this.retryable=n}},D=class{getPath(e,t){return this.path}parseError(e,t){return this.parseJsonError(e,t)}parseStreamChunk(e){return this.checkAndThrowError(e),this.parseProviderStreamChunk(e)}extractSystemMessages(e,t=`
|
|
149
149
|
|
|
150
|
-
`){let n=e.filter(r=>r.role==="system").map(r=>r.content);return{system:n.length?n.join(t):void 0,conversationMessages:e.filter(r=>r.role!=="system")}}parseJsonError(e,t){if(!e)return{message:`HTTP ${t}`};try{let n=JSON.parse(e);return n.error&&typeof n.error=="object"?{message:n.error.message||`HTTP ${t}`,type:n.error.type}:n.message?{message:n.message}:{message:e}}catch{return{message:e}}}checkAndThrowError(e){if(typeof e!="object"||e===null)return;let t=e;if(t.type==="error"&&"message"in t){let n=t.code||"unknown";throw new Y(t.message,n,!!t.retryable)}if(t.error)throw new Y(this.extractErrorMessage(t.error))}extractErrorMessage(e){if(typeof e=="string")try{let t=JSON.parse(e);return t.error?.message||t.message||e}catch{return e}return typeof e=="object"&&e!==null?e.message||JSON.stringify(e):`${this.providerName} returned an error`}};var
|
|
150
|
+
`){let n=e.filter(r=>r.role==="system").map(r=>r.content);return{system:n.length?n.join(t):void 0,conversationMessages:e.filter(r=>r.role!=="system")}}parseJsonError(e,t){if(!e)return{message:`HTTP ${t}`};try{let n=JSON.parse(e);return n.error&&typeof n.error=="object"?{message:n.error.message||`HTTP ${t}`,type:n.error.type}:n.message?{message:n.message}:{message:e}}catch{return{message:e}}}checkAndThrowError(e){if(typeof e!="object"||e===null)return;let t=e;if(t.type==="error"&&"message"in t){let n=t.code||"unknown";throw new Y(t.message,n,!!t.retryable)}if(t.error)throw new Y(this.extractErrorMessage(t.error))}extractErrorMessage(e){if(typeof e=="string")try{let t=JSON.parse(e);return t.error?.message||t.message||e}catch{return e}return typeof e=="object"&&e!==null?e.message||JSON.stringify(e):`${this.providerName} returned an error`}};var ls=class extends D{constructor(){super(...arguments),this.providerName="OpenAI",this.defaultBaseUrl="https://api.openai.com",this.path="/v1/responses",this.effortMap={0:"none",1:"low",2:"medium",3:"high"}}buildHeaders(e){return{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"}}buildPayload(e,t,n,r){let i=this.convertMessagesToInput(e),o={model:t,input:i,stream:r};if(n?.webSearch!==!1&&(o.tools=[{type:"web_search"}]),n?.effort!==void 0){let a=this.effortMap[n.effort];o.reasoning=a==="none"?{effort:a}:{effort:a,summary:"auto"}}return o}parseNonStreamingResponse(e){if(!this.isResponsesApiResponse(e))return{text:""};let t=e.output_text||"",n;if(e.output&&Array.isArray(e.output))for(let r of e.output)r.type==="reasoning"&&r.summary&&(n=r.summary.map(i=>i.text).join(`
|
|
151
151
|
`)),!t&&r.type==="message"&&r.content&&(t=r.content.filter(i=>i.type==="output_text").map(i=>i.text).join(""));return{text:t,reasoning:n}}parseProviderStreamChunk(e){if(!this.isResponsesApiEvent(e))return null;switch(e.type){case"response.failed":{let n=e.response?.error,r=n?.message||"Response failed",i=n?.code==="insufficient_quota"||n?.code==="rate_limit_exceeded";throw new Y(r,i?"rate_limit":"unknown",i)}case"response.output_text.delta":return{text:e.delta};case"response.reasoning_summary_text.delta":return{reasoning:e.delta};default:return null}}convertMessagesToInput(e){return e.map(t=>t.role==="system"?`System: ${t.content}`:t.role==="user"?`User: ${t.content}`:t.role==="assistant"?`Assistant: ${t.content}`:t.content).join(`
|
|
152
152
|
|
|
153
|
-
`)}isResponsesApiEvent(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"}isResponsesApiResponse(e){return typeof e=="object"&&e!==null&&e.object==="response"}};var
|
|
153
|
+
`)}isResponsesApiEvent(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"}isResponsesApiResponse(e){return typeof e=="object"&&e!==null&&e.object==="response"}};var Ee=class extends D{parseNonStreamingResponse(e){if(!this.hasChoices(e))return{text:""};let t=e,n=t.choices[0],r=n?.message,i=r?.content??n?.text??"",o=r?.reasoning??r?.reasoning_content??t.reasoning;return{text:i,reasoning:o}}parseProviderStreamChunk(e){if(!this.hasChoices(e))return null;let t=e.choices[0];if(!t)return null;let n=t.delta||t.message;if(!n)return null;let r=n.content||void 0,i=n.reasoning||n.reasoning_content||void 0;return!r&&!i?null:{text:r,reasoning:i}}hasChoices(e){return typeof e=="object"&&e!==null&&"choices"in e&&Array.isArray(e.choices)}};var cs=class extends Ee{constructor(){super(...arguments),this.providerName="OpenRouter",this.defaultBaseUrl="https://openrouter.ai",this.path="/api/v1/chat/completions",this.effortMap={0:"none",1:"low",2:"medium",3:"high"}}buildHeaders(e,t){let n={Authorization:`Bearer ${e}`,"x-api-key":e,"Content-Type":"application/json",Accept:"application/json","X-Title":"Typebulb"};return t&&(n["HTTP-Referer"]=t,n.Referer=t,n.Origin=t),n}buildPayload(e,t,n,r){let i={model:t,messages:e,stream:r};n?.webSearch===!0&&(i.plugins=[{id:"web"}]);let o=n?.effort;return o!==void 0&&(i.reasoning={effort:this.effortMap[o]}),i}};var us=class extends D{constructor(){super(...arguments),this.providerName="Anthropic",this.defaultBaseUrl="https://api.anthropic.com",this.path="/v1/messages"}buildHeaders(e){return{"x-api-key":e,"anthropic-version":"2023-06-01","Content-Type":"application/json",Accept:"application/json"}}buildPayload(e,t,n,r){let{system:i,conversationMessages:o}=this.extractSystemMessages(e),a={model:t,max_tokens:this.getMaxTokens(t),messages:this.withLastMessageCached(o),stream:r};n?.webSearch!==!1&&(a.tools=[{type:"web_search_20250305",name:"web_search"}]),i&&(a.system=[{type:"text",text:i,cache_control:{type:"ephemeral"}}]);let l=n?.effort;if(l!==void 0){if(this.isModernModel(t))if(l===0)a.output_config={effort:"low"};else{let c={1:"low",2:"medium",3:"high"};a.thinking={type:"adaptive",display:"summarized"},a.output_config={effort:c[l]}}else if(l!==0){let c={1:2048,2:4096,3:8192};a.thinking={type:"enabled",budget_tokens:c[l]}}}return a}parseNonStreamingResponse(e){if(!this.isAnthropicResponse(e))return{text:""};let t=e.content.filter(r=>r.type==="text").map(r=>r.text).join(""),n=e.content.filter(r=>r.type==="thinking").map(r=>r.thinking).join(`
|
|
154
154
|
|
|
155
|
-
`);return{text:t,reasoning:n||void 0}}parseProviderStreamChunk(e){return this.isAnthropicEvent(e)&&e.type==="content_block_delta"?e.delta.type==="text_delta"?{text:e.delta.text||""}:e.delta.type==="thinking_delta"?{reasoning:e.delta.thinking||""}:null:null}withLastMessageCached(e){let t=e.length-1;return e.map((n,r)=>r===t?{role:n.role,content:[{type:"text",text:n.content,cache_control:{type:"ephemeral"}}]}:n)}isAnthropicResponse(e){return typeof e=="object"&&e!==null&&e.type==="message"&&Array.isArray(e.content)}isAnthropicEvent(e){return typeof e=="object"&&e!==null&&"type"in e}isModernModel(e){let t=e.match(/^claude-[a-z]+-(\d+)(?:-(\d+))?/i);if(!t)return!1;let n=+t[1],r=t[2]?+t[2]:0;return n>4||n===4&&r>=6}getMaxTokens(e){return this.isModernModel(e)?64e3:32e3}};var
|
|
155
|
+
`);return{text:t,reasoning:n||void 0}}parseProviderStreamChunk(e){return this.isAnthropicEvent(e)&&e.type==="content_block_delta"?e.delta.type==="text_delta"?{text:e.delta.text||""}:e.delta.type==="thinking_delta"?{reasoning:e.delta.thinking||""}:null:null}withLastMessageCached(e){let t=e.length-1;return e.map((n,r)=>r===t?{role:n.role,content:[{type:"text",text:n.content,cache_control:{type:"ephemeral"}}]}:n)}isAnthropicResponse(e){return typeof e=="object"&&e!==null&&e.type==="message"&&Array.isArray(e.content)}isAnthropicEvent(e){return typeof e=="object"&&e!==null&&"type"in e}isModernModel(e){let t=e.match(/^claude-[a-z]+-(\d+)(?:-(\d+))?/i);if(!t)return!1;let n=+t[1],r=t[2]?+t[2]:0;return n>4||n===4&&r>=6}getMaxTokens(e){return this.isModernModel(e)?64e3:32e3}};var fs=class extends D{constructor(){super(...arguments),this.providerName="Gemini",this.defaultBaseUrl="https://generativelanguage.googleapis.com",this.path="/v1beta/models"}getPath(e,t){return`/v1beta/models/${e}:${t?"streamGenerateContent":"generateContent"}${t?"?alt=sse":""}`}buildHeaders(e){return{"Content-Type":"application/json","x-goog-api-key":e}}buildPayload(e,t,n,r){let{system:i,conversationMessages:o}=this.extractSystemMessages(e,`
|
|
156
156
|
`),l={contents:o.map(p=>({role:p.role==="assistant"?"model":"user",parts:[{text:p.content}]}))};n?.webSearch!==!1&&(l.tools=[{google_search:{}}]),i&&(l.systemInstruction={role:"system",parts:[{text:i}]});let c=n?.effort;if(c!==void 0){let u={0:0,1:1024,2:8192,3:-1}[c];l.generationConfig={thinkingConfig:u===0?{thinkingBudget:0}:{includeThoughts:!0,thinkingBudget:u}}}return l}parseError(e,t){if(!e)return{message:`HTTP ${t}`};try{let n=JSON.parse(e),r=Array.isArray(n)?n[0]?.error:n?.error;return r&&typeof r=="object"?{message:(r.message||`HTTP ${t}`).split(`
|
|
157
|
-
`)[0],type:r.status,code:r.code?.toString()}:n.message?{message:n.message}:{message:e}}catch{return{message:e}}}parseNonStreamingResponse(e){if(this.checkAndThrowError(e),this.checkGeminiError(e),!this.isGeminiResponse(e))return{text:"",status:"failed",error:"Invalid response format"};let t=this.extractParts(e).text||"",n=e.candidates?.[0]?.finishReason,r="complete";return n==="MAX_TOKENS"?r="interrupted":(n==="SAFETY"||n==="RECITATION")&&(r="failed"),{text:t,status:r}}parseProviderStreamChunk(e){if(this.checkGeminiError(e),!this.isGeminiResponse(e))return null;let t=this.extractParts(e);return t.text||t.reasoning?t:null}isGeminiResponse(e){return typeof e=="object"&&e!==null&&"candidates"in e&&Array.isArray(e.candidates)}extractParts(e){let t=e.candidates?.[0]?.content?.parts;if(!t)return{};let n="",r="";for(let i of t)i.text&&(i.thought?r+=i.text:n+=i.text);return{text:n||void 0,reasoning:r||void 0}}checkGeminiError(e){if(this.isGeminiResponse(e)&&e.promptFeedback?.blockReason){let t=e.promptFeedback.blockReason;throw new Y(`Prompt blocked: ${t}`)}}};var
|
|
157
|
+
`)[0],type:r.status,code:r.code?.toString()}:n.message?{message:n.message}:{message:e}}catch{return{message:e}}}parseNonStreamingResponse(e){if(this.checkAndThrowError(e),this.checkGeminiError(e),!this.isGeminiResponse(e))return{text:"",status:"failed",error:"Invalid response format"};let t=this.extractParts(e).text||"",n=e.candidates?.[0]?.finishReason,r="complete";return n==="MAX_TOKENS"?r="interrupted":(n==="SAFETY"||n==="RECITATION")&&(r="failed"),{text:t,status:r}}parseProviderStreamChunk(e){if(this.checkGeminiError(e),!this.isGeminiResponse(e))return null;let t=this.extractParts(e);return t.text||t.reasoning?t:null}isGeminiResponse(e){return typeof e=="object"&&e!==null&&"candidates"in e&&Array.isArray(e.candidates)}extractParts(e){let t=e.candidates?.[0]?.content?.parts;if(!t)return{};let n="",r="";for(let i of t)i.text&&(i.thought?r+=i.text:n+=i.text);return{text:n||void 0,reasoning:r||void 0}}checkGeminiError(e){if(this.isGeminiResponse(e)&&e.promptFeedback?.blockReason){let t=e.promptFeedback.blockReason;throw new Y(`Prompt blocked: ${t}`)}}};var ds=class extends Ee{constructor(){super(...arguments),this.providerName="Ollama",this.defaultBaseUrl="http://localhost:11434",this.path="/chat/completions"}buildHeaders(e){let t={"Content-Type":"application/json",Accept:"application/json"};return e&&(t.Authorization=`Bearer ${e}`),t}buildPayload(e,t,n,r){return{model:t,messages:e,stream:r}}};var ga=new ds,ap=new Map([["openai",new ls],["openrouter",new cs],["anthropic",new us],["gemini",new fs],["ollama",ga],["openai-compat",ga]]);function ot(s){let e=ap.get(s);if(!e)throw new Error(`Unsupported protocol: ${s}`);return e}function lp(s,e){return s.replace(/\/+$/,"")+(e.startsWith("/")?e:`/${e}`)}async function rr(s,e){let t=ot(s.protocol),n=t.getPath(s.model,e.stream),r=lp(s.baseUrl,n),i=t.buildHeaders(s.apiKey,e.origin),o=t.buildPayload(e.messages,s.model,{effort:e.effort,webSearch:e.webSearch},e.stream);return e.modifyPayload?.(o),fetch(r,{method:"POST",headers:i,body:JSON.stringify(o),signal:e.signal})}function cp(s,e){let t=s??process.env.TB_AI_PROVIDER,n=e??process.env.TB_AI_MODEL;if(!t)return"No provider specified. Set TB_AI_PROVIDER in your .env file or pass provider in the tb.ai() call.";if(!n)return"No model specified. Set TB_AI_MODEL in your .env file or pass model in the tb.ai() call.";let r;try{r=ot(t)}catch{return`Unknown provider '${t}'.`}if(t==="ollama")return{apiKey:"",baseUrl:`${nr(process.env.OLLAMA_HOST??r.defaultBaseUrl)}/v1`,protocol:t,model:n,isFreeModel:!1};if(t==="openai-compat"){let a=process.env.TB_AI_BASE_URL;return a?{apiKey:process.env.TB_AI_API_KEY??"",baseUrl:a,protocol:t,model:n,isFreeModel:!1}:"No base URL for openai-compat. Set TB_AI_BASE_URL (the OpenAI-style base ending in /v1, e.g. http://localhost:1234/v1) in your .env file."}let i=sr[t];if(!i)return`Unknown provider '${t}'.`;let o=process.env[i];return o?{apiKey:o,baseUrl:r.defaultBaseUrl,protocol:t,model:n,isFreeModel:!1}:`No API key for '${t}'. Set ${i} in your .env file.`}function up(s,e){let t=[...e.system?[{role:"system",content:e.system}]:[],...e.messages.map(r=>({role:r.role,content:r.content}))],n=e.effort;return rr(s,{messages:t,stream:!0,effort:n!=null&&n>=0&&n<=3?n:void 0,webSearch:e.webSearch??!0,signal:e.signal})}import{readFileSync as oy,existsSync as fp}from"fs";import*as ce from"path";import{fileURLToPath as dp}from"url";function ya(){let s=ce.dirname(dp(import.meta.url));for(;!fp(ce.join(s,"package.json"));){let e=ce.dirname(s);if(e===s)break;s=e}return s}function pp(){return ce.join(ya(),"README.md")}function hp(){return ce.join(ya(),"description.md")}export{os as bulbName,hp as bundledDescriptionPath,pp as bundledReadmePath,sp as catalogFetchError,Rd as ensureDeclaredDependencies,np as getFilteredModels,Hd as isBulbTrusted,Ka as launchBulbServer,Id as listBulbFiles,ys as listBulbServers,zd as listTrustedBulbs,Ud as openInEditor,Md as predictBulbTrust,_a as readServerLog,cp as resolveLocalProvider,up as sendTbAi,gs as serverLogPath,Qd as setBulbTrusted,Od as slugifyBulbName,cr as stopBulbServer,Ed as stripFrontmatter};
|