@uibot/cli 0.12.0 → 0.14.0
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/cli.js +113 -113
- package/dist/index.js +94 -94
- package/package.json +8 -8
package/dist/cli.js
CHANGED
|
@@ -1,142 +1,142 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// @bun
|
|
3
|
-
var Rd=Object.create;var{getPrototypeOf:kd,defineProperty:Ko,getOwnPropertyNames:xd}=Object;var Ho=Object.prototype.hasOwnProperty;function vd(e){return this[e]}var wd,Ed,Id=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?wd??=new WeakMap:Ed??=new WeakMap,o=i.get(e);if(o)return o}r=e!=null?Rd(kd(e)):{};let s=t||!e||!e.__esModule||!Ho.call(e,"default")?Ko(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of xd(e))if(!Ho.call(s,a))Ko(s,a,{get:vd.bind(e,a),enumerable:!0})}if(n)i.set(e,s);return s};var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var K=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var Wt=import.meta.require;var Ve=y(function(wA,bs){var Mp=Number.MAX_SAFE_INTEGER||9007199254740991,_p=["major","premajor","minor","preminor","patch","prepatch","prerelease"];bs.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Mp,RELEASE_TYPES:_p,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var pt=y(function(EA,Ss){var Fp=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Ss.exports=Fp});var Ke=y(function(ie,Cs){var{MAX_SAFE_COMPONENT_LENGTH:jn,MAX_SAFE_BUILD_LENGTH:qp,MAX_LENGTH:Bp}=Ve(),jp=pt();ie=Cs.exports={};var Up=ie.re=[],Vp=ie.safeRe=[],S=ie.src=[],Kp=ie.safeSrc=[],C=ie.t={},Hp=0,Un="[a-zA-Z0-9-]",Yp=[["\\s",1],["\\d",Bp],[Un,qp]],Gp=(e)=>{for(let[t,r]of Yp)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},E=(e,t,r)=>{let n=Gp(t),i=Hp++;jp(e,i,t),C[e]=i,S[i]=t,Kp[i]=n,Up[i]=new RegExp(t,r?"g":void 0),Vp[i]=new RegExp(n,r?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*");E("NUMERICIDENTIFIERLOOSE","\\d+");E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Un}*`);E("MAINVERSION",`(${S[C.NUMERICIDENTIFIER]})\\.(${S[C.NUMERICIDENTIFIER]})\\.(${S[C.NUMERICIDENTIFIER]})`);E("MAINVERSIONLOOSE",`(${S[C.NUMERICIDENTIFIERLOOSE]})\\.(${S[C.NUMERICIDENTIFIERLOOSE]})\\.(${S[C.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASEIDENTIFIER",`(?:${S[C.NONNUMERICIDENTIFIER]}|${S[C.NUMERICIDENTIFIER]})`);E("PRERELEASEIDENTIFIERLOOSE",`(?:${S[C.NONNUMERICIDENTIFIER]}|${S[C.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASE",`(?:-(${S[C.PRERELEASEIDENTIFIER]}(?:\\.${S[C.PRERELEASEIDENTIFIER]})*))`);E("PRERELEASELOOSE",`(?:-?(${S[C.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${S[C.PRERELEASEIDENTIFIERLOOSE]})*))`);E("BUILDIDENTIFIER",`${Un}+`);E("BUILD",`(?:\\+(${S[C.BUILDIDENTIFIER]}(?:\\.${S[C.BUILDIDENTIFIER]})*))`);E("FULLPLAIN",`v?${S[C.MAINVERSION]}${S[C.PRERELEASE]}?${S[C.BUILD]}?`);E("FULL",`^${S[C.FULLPLAIN]}$`);E("LOOSEPLAIN",`[v=\\s]*${S[C.MAINVERSIONLOOSE]}${S[C.PRERELEASELOOSE]}?${S[C.BUILD]}?`);E("LOOSE",`^${S[C.LOOSEPLAIN]}$`);E("GTLT","((?:<|>)?=?)");E("XRANGEIDENTIFIERLOOSE",`${S[C.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);E("XRANGEIDENTIFIER",`${S[C.NUMERICIDENTIFIER]}|x|X|\\*`);E("XRANGEPLAIN",`[v=\\s]*(${S[C.XRANGEIDENTIFIER]})(?:\\.(${S[C.XRANGEIDENTIFIER]})(?:\\.(${S[C.XRANGEIDENTIFIER]})(?:${S[C.PRERELEASE]})?${S[C.BUILD]}?)?)?`);E("XRANGEPLAINLOOSE",`[v=\\s]*(${S[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${S[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${S[C.XRANGEIDENTIFIERLOOSE]})(?:${S[C.PRERELEASELOOSE]})?${S[C.BUILD]}?)?)?`);E("XRANGE",`^${S[C.GTLT]}\\s*${S[C.XRANGEPLAIN]}$`);E("XRANGELOOSE",`^${S[C.GTLT]}\\s*${S[C.XRANGEPLAINLOOSE]}$`);E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${jn}})(?:\\.(\\d{1,${jn}}))?(?:\\.(\\d{1,${jn}}))?`);E("COERCE",`${S[C.COERCEPLAIN]}(?:$|[^\\d])`);E("COERCEFULL",S[C.COERCEPLAIN]+`(?:${S[C.PRERELEASE]})?(?:${S[C.BUILD]})?(?:$|[^\\d])`);E("COERCERTL",S[C.COERCE],!0);E("COERCERTLFULL",S[C.COERCEFULL],!0);E("LONETILDE","(?:~>?)");E("TILDETRIM",`(\\s*)${S[C.LONETILDE]}\\s+`,!0);ie.tildeTrimReplace="$1~";E("TILDE",`^${S[C.LONETILDE]}${S[C.XRANGEPLAIN]}$`);E("TILDELOOSE",`^${S[C.LONETILDE]}${S[C.XRANGEPLAINLOOSE]}$`);E("LONECARET","(?:\\^)");E("CARETTRIM",`(\\s*)${S[C.LONECARET]}\\s+`,!0);ie.caretTrimReplace="$1^";E("CARET",`^${S[C.LONECARET]}${S[C.XRANGEPLAIN]}$`);E("CARETLOOSE",`^${S[C.LONECARET]}${S[C.XRANGEPLAINLOOSE]}$`);E("COMPARATORLOOSE",`^${S[C.GTLT]}\\s*(${S[C.LOOSEPLAIN]})$|^$`);E("COMPARATOR",`^${S[C.GTLT]}\\s*(${S[C.FULLPLAIN]})$|^$`);E("COMPARATORTRIM",`(\\s*)${S[C.GTLT]}\\s*(${S[C.LOOSEPLAIN]}|${S[C.XRANGEPLAIN]})`,!0);ie.comparatorTrimReplace="$1$2$3";E("HYPHENRANGE",`^\\s*(${S[C.XRANGEPLAIN]})\\s+-\\s+(${S[C.XRANGEPLAIN]})\\s*$`);E("HYPHENRANGELOOSE",`^\\s*(${S[C.XRANGEPLAINLOOSE]})\\s+-\\s+(${S[C.XRANGEPLAINLOOSE]})\\s*$`);E("STAR","(<|>)?=?\\s*\\*");E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var rr=y(function(IA,Rs){var zp=Object.freeze({loose:!0}),Wp=Object.freeze({}),Jp=(e)=>{if(!e)return Wp;if(typeof e!=="object")return zp;return e};Rs.exports=Jp});var Vn=y(function(PA,vs){var ks=/^[0-9]+$/,xs=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=ks.test(e),n=ks.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Qp=(e,t)=>xs(t,e);vs.exports={compareIdentifiers:xs,rcompareIdentifiers:Qp}});var B=y(function(AA,Es){var nr=pt(),{MAX_LENGTH:ws,MAX_SAFE_INTEGER:ir}=Ve(),{safeRe:or,t:sr}=Ke(),Xp=rr(),{compareIdentifiers:Kn}=Vn(),Zp=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(Kn(e[n],r[n])!==0)return!1;return!0};class te{constructor(e,t){if(t=Xp(t),e instanceof te)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ws)throw TypeError(`version is longer than ${ws} characters`);nr("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?or[sr.LOOSE]:or[sr.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>ir||this.major<0)throw TypeError("Invalid major version");if(this.minor>ir||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>ir||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<ir)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(nr("SemVer.compare",this.version,this.options,e),!(e instanceof te)){if(typeof e==="string"&&e===this.version)return 0;e=new te(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof te))e=new te(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof te))e=new te(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(nr("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return Kn(r,n)}while(++t)}compareBuild(e){if(!(e instanceof te))e=new te(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(nr("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return Kn(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?or[sr.PRERELEASELOOSE]:or[sr.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(Zp(this.prerelease,t)){let o=this.prerelease[t.split(".").length];if(isNaN(o))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Es.exports=te});var me=y(function(DA,Ps){var Is=B(),ef=(e,t,r=!1)=>{if(e instanceof Is)return e;try{return new Is(e,t)}catch(n){if(!r)return null;throw n}};Ps.exports=ef});var Ds=y(function(OA,As){var tf=me(),rf=(e,t)=>{let r=tf(e,t);return r?r.version:null};As.exports=rf});var Ts=y(function(TA,Os){var nf=me(),of=(e,t)=>{let r=nf(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Os.exports=of});var $s=y(function(LA,Ns){var Ls=B(),sf=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new Ls(e instanceof Ls?e.version:e,r).inc(t,n,i).version}catch(o){return null}};Ns.exports=sf});var Fs=y(function(NA,_s){var Ms=me(),af=(e,t)=>{let r=Ms(e,null,!0),n=Ms(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let f=c?"pre":"";if(r.major!==n.major)return f+"major";if(r.minor!==n.minor)return f+"minor";if(r.patch!==n.patch)return f+"patch";return"prerelease"};_s.exports=af});var Bs=y(function($A,qs){var cf=B(),lf=(e,t)=>new cf(e,t).major;qs.exports=lf});var Us=y(function(MA,js){var uf=B(),df=(e,t)=>new uf(e,t).minor;js.exports=df});var Ks=y(function(_A,Vs){var pf=B(),ff=(e,t)=>new pf(e,t).patch;Vs.exports=ff});var Ys=y(function(FA,Hs){var gf=me(),mf=(e,t)=>{let r=gf(e,t);return r&&r.prerelease.length?r.prerelease:null};Hs.exports=mf});var z=y(function(qA,zs){var Gs=B(),hf=(e,t,r)=>new Gs(e,r).compare(new Gs(t,r));zs.exports=hf});var Js=y(function(BA,Ws){var yf=z(),bf=(e,t,r)=>yf(t,e,r);Ws.exports=bf});var Xs=y(function(jA,Qs){var Sf=z(),Cf=(e,t)=>Sf(e,t,!0);Qs.exports=Cf});var ar=y(function(UA,ea){var Zs=B(),Rf=(e,t,r)=>{let n=new Zs(e,r),i=new Zs(t,r);return n.compare(i)||n.compareBuild(i)};ea.exports=Rf});var ra=y(function(VA,ta){var kf=ar(),xf=(e,t)=>e.sort((r,n)=>kf(r,n,t));ta.exports=xf});var ia=y(function(KA,na){var vf=ar(),wf=(e,t)=>e.sort((r,n)=>vf(n,r,t));na.exports=wf});var ft=y(function(HA,oa){var Ef=z(),If=(e,t,r)=>Ef(e,t,r)>0;oa.exports=If});var cr=y(function(YA,sa){var Pf=z(),Af=(e,t,r)=>Pf(e,t,r)<0;sa.exports=Af});var Hn=y(function(GA,aa){var Df=z(),Of=(e,t,r)=>Df(e,t,r)===0;aa.exports=Of});var Yn=y(function(zA,ca){var Tf=z(),Lf=(e,t,r)=>Tf(e,t,r)!==0;ca.exports=Lf});var lr=y(function(WA,la){var Nf=z(),$f=(e,t,r)=>Nf(e,t,r)>=0;la.exports=$f});var ur=y(function(JA,ua){var Mf=z(),_f=(e,t,r)=>Mf(e,t,r)<=0;ua.exports=_f});var Gn=y(function(QA,da){var Ff=Hn(),qf=Yn(),Bf=ft(),jf=lr(),Uf=cr(),Vf=ur(),Kf=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return Ff(e,r,n);case"!=":return qf(e,r,n);case">":return Bf(e,r,n);case">=":return jf(e,r,n);case"<":return Uf(e,r,n);case"<=":return Vf(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};da.exports=Kf});var fa=y(function(XA,pa){var Hf=B(),Yf=me(),{safeRe:dr,t:pr}=Ke(),Gf=(e,t)=>{if(e instanceof Hf)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?dr[pr.COERCEFULL]:dr[pr.COERCE]);else{let c=t.includePrerelease?dr[pr.COERCERTLFULL]:dr[pr.COERCERTL],l;while((l=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||l.index+l[0].length!==r.index+r[0].length)r=l;c.lastIndex=l.index+l[1].length+l[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Yf(`${n}.${i}.${o}${s}${a}`,t)};pa.exports=Gf});var ma=y(function(ZA,ga){var zf=me(),Wf=Ve(),Jf=B(),Qf=(e,t,r)=>{if(!Wf.RELEASE_TYPES.includes(t))return null;let n=Xf(e,r);return n&&Zf(n,t)},Xf=(e,t)=>{let r=e instanceof Jf?e.version:e;return zf(r,t)},Zf=(e,t)=>{if(eg(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},eg=(e)=>e.startsWith("pre");ga.exports=Qf});var ba=y(function(e0,ya){class ha{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}ya.exports=ha});var W=y(function(t0,ka){var tg=/\s+/g;class gt{constructor(e,t){if(t=ng(t),e instanceof gt)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new gt(e.raw,t);if(e instanceof zn)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(tg," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!Ca(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&pg(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(dg,"");let r=((this.options.includePrerelease&&lg)|(this.options.loose&&ug))+":"+e,n=Sa.get(r);if(n)return n;let i=this.options.loose,o=i?U[j.HYPHENRANGELOOSE]:U[j.HYPHENRANGE];e=e.replace(o,xg(this.options.includePrerelease)),T("hyphen replace",e),e=e.replace(U[j.COMPARATORTRIM],sg),T("comparator trim",e),e=e.replace(U[j.TILDETRIM],ag),T("tilde trim",e),e=e.replace(U[j.CARETTRIM],cg),T("caret trim",e);let s=e.split(" ").map((f)=>fg(f,this.options)).join(" ").split(/\s+/).map((f)=>kg(f,this.options));if(i)s=s.filter((f)=>(T("loose invalid filter",f,this.options),!!f.match(U[j.COMPARATORLOOSE])));T("range list",s);let a=new Map,c=s.map((f)=>new zn(f,this.options));for(let f of c){if(Ca(f))return[f];a.set(f.value,f)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return Sa.set(r,l),l}intersects(e,t){if(!(e instanceof gt))throw TypeError("a Range is required");return this.set.some((r)=>Ra(r,t)&&e.set.some((n)=>Ra(n,t)&&r.every((i)=>n.every((o)=>i.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new ig(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(vg(this.set[t],e,this.options))return!0;return!1}}ka.exports=gt;var rg=ba(),Sa=new rg,ng=rr(),zn=mt(),T=pt(),ig=B(),{safeRe:U,src:og,t:j,comparatorTrimReplace:sg,tildeTrimReplace:ag,caretTrimReplace:cg}=Ke(),{FLAG_INCLUDE_PRERELEASE:lg,FLAG_LOOSE:ug}=Ve(),dg=new RegExp(og[j.BUILD],"g"),Ca=(e)=>e.value==="<0.0.0-0",pg=(e)=>e.value==="",Ra=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((o)=>i.intersects(o,t)),i=n.pop();return r},fg=(e,t)=>(e=e.replace(U[j.BUILD],""),T("comp",e,t),e=yg(e,t),T("caret",e),e=mg(e,t),T("tildes",e),e=Sg(e,t),T("xrange",e),e=Rg(e,t),T("stars",e),e),F=(e)=>!e||e.toLowerCase()==="x"||e==="*",gg=(e,t,r)=>F(e)&&!F(t)||F(t)&&r&&!F(r),mg=(e,t)=>e.trim().split(/\s+/).map((r)=>hg(r,t)).join(" "),hg=(e,t)=>{let r=t.loose?U[j.TILDELOOSE]:U[j.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{T("tilde",e,i,o,s,a,c);let l;if(F(o))l="";else if(F(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(F(a))l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else if(c)T("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;return T("tilde return",l),l})},yg=(e,t)=>e.trim().split(/\s+/).map((r)=>bg(r,t)).join(" "),bg=(e,t)=>{T("caret",e,t);let r=t.loose?U[j.CARETLOOSE]:U[j.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{T("caret",e,i,o,s,a,c);let l;if(F(o))l="";else if(F(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(F(a))if(o==="0")l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`;else if(c)if(T("replaceCaret pr",c),o==="0")if(s==="0")l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`;else if(T("no pr"),o==="0")if(s==="0")l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`;return T("caret return",l),l})},Sg=(e,t)=>(T("replaceXRanges",e,t),e.split(/\s+/).map((r)=>Cg(r,t)).join(" ")),Cg=(e,t)=>{e=e.trim();let r=t.loose?U[j.XRANGELOOSE]:U[j.XRANGE];return e.replace(r,(n,i,o,s,a,c)=>{if(T("xRange",e,n,i,o,s,a,c),gg(o,s,a))return e;let l=F(o),f=l||F(s),d=f||F(a),p=d;if(i==="="&&p)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&p){if(f)s=0;if(a=0,i===">")if(i=">=",f)o=+o+1,s=0,a=0;else s=+s+1,a=0;else if(i==="<=")if(i="<",f)o=+o+1;else s=+s+1;if(i==="<")c="-0";n=`${i+o}.${s}.${a}${c}`}else if(f)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(d)n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`;return T("xRange return",n),n})},Rg=(e,t)=>(T("replaceStars",e,t),e.trim().replace(U[j.STAR],"")),kg=(e,t)=>(T("replaceGTE0",e,t),e.trim().replace(U[t.includePrerelease?j.GTE0PRE:j.GTE0],"")),xg=(e)=>(t,r,n,i,o,s,a,c,l,f,d,p)=>{if(F(n))r="";else if(F(i))r=`>=${n}.0.0${e?"-0":""}`;else if(F(o))r=`>=${n}.${i}.0${e?"-0":""}`;else if(s)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(F(l))c="";else if(F(f))c=`<${+l+1}.0.0-0`;else if(F(d))c=`<${l}.${+f+1}.0-0`;else if(p)c=`<=${l}.${f}.${d}-${p}`;else if(e)c=`<${l}.${f}.${+d+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},vg=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(T(e[n].semver),e[n].semver===zn.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var mt=y(function(r0,Pa){var ht=Symbol("SemVer ANY");class fr{static get ANY(){return ht}constructor(e,t){if(t=xa(t),e instanceof fr)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),Jn("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===ht)this.value="";else this.value=this.operator+this.semver.version;Jn("comp",this)}parse(e){let t=this.options.loose?va[wa.COMPARATORLOOSE]:va[wa.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=ht;else this.semver=new Ea(r[2],this.options.loose)}toString(){return this.value}test(e){if(Jn("Comparator.test",e,this.options.loose),this.semver===ht||e===ht)return!0;if(typeof e==="string")try{e=new Ea(e,this.options)}catch(t){return!1}return Wn(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof fr))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Ia(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Ia(this.value,t).test(e.semver)}if(t=xa(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(Wn(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(Wn(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Pa.exports=fr;var xa=rr(),{safeRe:va,t:wa}=Ke(),Wn=Gn(),Jn=pt(),Ea=B(),Ia=W()});var yt=y(function(n0,Aa){var wg=W(),Eg=(e,t,r)=>{try{t=new wg(t,r)}catch(n){return!1}return t.test(e)};Aa.exports=Eg});var Oa=y(function(i0,Da){var Ig=W(),Pg=(e,t)=>new Ig(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));Da.exports=Pg});var La=y(function(o0,Ta){var Ag=B(),Dg=W(),Og=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Dg(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===-1)n=s,i=new Ag(n,r)}}),n};Ta.exports=Og});var $a=y(function(s0,Na){var Tg=B(),Lg=W(),Ng=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Lg(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===1)n=s,i=new Tg(n,r)}}),n};Na.exports=Ng});var Fa=y(function(a0,_a){var Qn=B(),$g=W(),Ma=ft(),Mg=(e,t)=>{e=new $g(e,t);let r=new Qn("0.0.0");if(e.test(r))return r;if(r=new Qn("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;if(i.forEach((s)=>{let a=new Qn(s.semver.version);switch(s.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!o||Ma(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||Ma(r,o)))r=o}if(r&&e.test(r))return r;return null};_a.exports=Mg});var Ba=y(function(c0,qa){var _g=W(),Fg=(e,t)=>{try{return new _g(e,t).range||"*"}catch(r){return null}};qa.exports=Fg});var gr=y(function(l0,Ka){var qg=B(),Va=mt(),{ANY:Bg}=Va,jg=W(),Ug=yt(),ja=ft(),Ua=cr(),Vg=ur(),Kg=lr(),Hg=(e,t,r,n)=>{e=new qg(e,n),t=new jg(t,n);let i,o,s,a,c;switch(r){case">":i=ja,o=Vg,s=Ua,a=">",c=">=";break;case"<":i=Ua,o=Kg,s=ja,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Ug(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let f=t.set[l],d=null,p=null;if(f.forEach((u)=>{if(u.semver===Bg)u=new Va(">=0.0.0");if(d=d||u,p=p||u,i(u.semver,d.semver,n))d=u;else if(s(u.semver,p.semver,n))p=u}),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&o(e,p.semver))return!1;else if(p.operator===c&&s(e,p.semver))return!1}return!0};Ka.exports=Hg});var Ya=y(function(u0,Ha){var Yg=gr(),Gg=(e,t,r)=>Yg(e,t,">",r);Ha.exports=Gg});var za=y(function(d0,Ga){var zg=gr(),Wg=(e,t,r)=>zg(e,t,"<",r);Ga.exports=Wg});var Qa=y(function(p0,Ja){var Wa=W(),Jg=(e,t,r)=>(e=new Wa(e,r),t=new Wa(t,r),e.intersects(t,r));Ja.exports=Jg});var Za=y(function(f0,Xa){var Qg=yt(),Xg=z();Xa.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((f,d)=>Xg(f,d,r));for(let f of s)if(Qg(f,t,r)){if(o=f,!i)i=f}else{if(o)n.push([i,o]);o=null,i=null}if(i)n.push([i,null]);let a=[];for(let[f,d]of n)if(f===d)a.push(f);else if(!d&&f===s[0])a.push("*");else if(!d)a.push(`>=${f}`);else if(f===s[0])a.push(`<=${d}`);else a.push(`${f} - ${d}`);let c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var oc=y(function(g0,ic){var ec=W(),ei=mt(),{ANY:Xn}=ei,Zn=yt(),ti=z(),Zg=(e,t,r={})=>{if(e===t)return!0;e=new ec(e,r),t=new ec(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=tm(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},em=[new ei(">=0.0.0-0")],tc=[new ei(">=0.0.0")],tm=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Xn)if(t.length===1&&t[0].semver===Xn)return!0;else if(r.includePrerelease)e=em;else e=tc;if(t.length===1&&t[0].semver===Xn)if(r.includePrerelease)return!0;else t=tc;let n=new Set,i,o;for(let u of e)if(u.operator===">"||u.operator===">=")i=rc(i,u,r);else if(u.operator==="<"||u.operator==="<=")o=nc(o,u,r);else n.add(u.semver);if(n.size>1)return null;let s;if(i&&o){if(s=ti(i.semver,o.semver,r),s>0)return null;else if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let u of n){if(i&&!Zn(u,String(i),r))return null;if(o&&!Zn(u,String(o),r))return null;for(let m of t)if(!Zn(u,String(m),r))return!1;return!0}let a,c,l,f,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0)d=!1;for(let u of t){if(f=f||u.operator===">"||u.operator===">=",l=l||u.operator==="<"||u.operator==="<=",i){if(p){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===p.major&&u.semver.minor===p.minor&&u.semver.patch===p.patch)p=!1}if(u.operator===">"||u.operator===">="){if(a=rc(i,u,r),a===u&&a!==i)return!1}else if(i.operator===">="&&!u.test(i.semver))return!1}if(o){if(d){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===d.major&&u.semver.minor===d.minor&&u.semver.patch===d.patch)d=!1}if(u.operator==="<"||u.operator==="<="){if(c=nc(o,u,r),c===u&&c!==o)return!1}else if(o.operator==="<="&&!u.test(o.semver))return!1}if(!u.operator&&(o||i)&&s!==0)return!1}if(i&&l&&!o&&s!==0)return!1;if(o&&f&&!i&&s!==0)return!1;if(p||d)return!1;return!0},rc=(e,t,r)=>{if(!e)return t;let n=ti(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},nc=(e,t,r)=>{if(!e)return t;let n=ti(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};ic.exports=Zg});var lc=y(function(m0,cc){var ri=Ke(),sc=Ve(),rm=B(),ac=Vn(),nm=me(),im=Ds(),om=Ts(),sm=$s(),am=Fs(),cm=Bs(),lm=Us(),um=Ks(),dm=Ys(),pm=z(),fm=Js(),gm=Xs(),mm=ar(),hm=ra(),ym=ia(),bm=ft(),Sm=cr(),Cm=Hn(),Rm=Yn(),km=lr(),xm=ur(),vm=Gn(),wm=fa(),Em=ma(),Im=mt(),Pm=W(),Am=yt(),Dm=Oa(),Om=La(),Tm=$a(),Lm=Fa(),Nm=Ba(),$m=gr(),Mm=Ya(),_m=za(),Fm=Qa(),qm=Za(),Bm=oc();cc.exports={parse:nm,valid:im,clean:om,inc:sm,diff:am,major:cm,minor:lm,patch:um,prerelease:dm,compare:pm,rcompare:fm,compareLoose:gm,compareBuild:mm,sort:hm,rsort:ym,gt:bm,lt:Sm,eq:Cm,neq:Rm,gte:km,lte:xm,cmp:vm,coerce:wm,truncate:Em,Comparator:Im,Range:Pm,satisfies:Am,toComparators:Dm,maxSatisfying:Om,minSatisfying:Tm,minVersion:Lm,validRange:Nm,outside:$m,gtr:Mm,ltr:_m,intersects:Fm,simplifyRange:qm,subset:Bm,SemVer:rm,re:ri.re,src:ri.src,tokens:ri.t,SEMVER_SPEC_VERSION:sc.SEMVER_SPEC_VERSION,RELEASE_TYPES:sc.RELEASE_TYPES,compareIdentifiers:ac.compareIdentifiers,rcompareIdentifiers:ac.rcompareIdentifiers}});var jm;var ni=K(()=>{jm=Id(lc(),1)});var A=y(function(Wm){var ii=Symbol.for("yaml.alias"),uc=Symbol.for("yaml.document"),mr=Symbol.for("yaml.map"),dc=Symbol.for("yaml.pair"),oi=Symbol.for("yaml.scalar"),hr=Symbol.for("yaml.seq"),pe=Symbol.for("yaml.node.type"),Um=(e)=>!!e&&typeof e==="object"&&e[pe]===ii,Vm=(e)=>!!e&&typeof e==="object"&&e[pe]===uc,Km=(e)=>!!e&&typeof e==="object"&&e[pe]===mr,Hm=(e)=>!!e&&typeof e==="object"&&e[pe]===dc,pc=(e)=>!!e&&typeof e==="object"&&e[pe]===oi,Ym=(e)=>!!e&&typeof e==="object"&&e[pe]===hr;function fc(e){if(e&&typeof e==="object")switch(e[pe]){case mr:case hr:return!0}return!1}function Gm(e){if(e&&typeof e==="object")switch(e[pe]){case ii:case mr:case oi:case hr:return!0}return!1}var zm=(e)=>(pc(e)||fc(e))&&!!e.anchor;Wm.ALIAS=ii;Wm.DOC=uc;Wm.MAP=mr;Wm.NODE_TYPE=pe;Wm.PAIR=dc;Wm.SCALAR=oi;Wm.SEQ=hr;Wm.hasAnchor=zm;Wm.isAlias=Um;Wm.isCollection=fc;Wm.isDocument=Vm;Wm.isMap=Km;Wm.isNode=Gm;Wm.isPair=Hm;Wm.isScalar=pc;Wm.isSeq=Ym});var bt=y(function(ph){var q=A(),V=Symbol("break visit"),gc=Symbol("skip children"),oe=Symbol("remove node");function yr(e,t){let r=mc(t);if(q.isDocument(e)){if(He(null,e.contents,r,Object.freeze([e]))===oe)e.contents=null}else He(null,e,r,Object.freeze([]))}yr.BREAK=V;yr.SKIP=gc;yr.REMOVE=oe;function He(e,t,r,n){let i=hc(e,t,r,n);if(q.isNode(i)||q.isPair(i))return yc(e,n,i),He(e,i,r,n);if(typeof i!=="symbol"){if(q.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let s=He(o,t.items[o],r,n);if(typeof s==="number")o=s-1;else if(s===V)return V;else if(s===oe)t.items.splice(o,1),o-=1}}else if(q.isPair(t)){n=Object.freeze(n.concat(t));let o=He("key",t.key,r,n);if(o===V)return V;else if(o===oe)t.key=null;let s=He("value",t.value,r,n);if(s===V)return V;else if(s===oe)t.value=null}}return i}async function br(e,t){let r=mc(t);if(q.isDocument(e)){if(await Ye(null,e.contents,r,Object.freeze([e]))===oe)e.contents=null}else await Ye(null,e,r,Object.freeze([]))}br.BREAK=V;br.SKIP=gc;br.REMOVE=oe;async function Ye(e,t,r,n){let i=await hc(e,t,r,n);if(q.isNode(i)||q.isPair(i))return yc(e,n,i),Ye(e,i,r,n);if(typeof i!=="symbol"){if(q.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let s=await Ye(o,t.items[o],r,n);if(typeof s==="number")o=s-1;else if(s===V)return V;else if(s===oe)t.items.splice(o,1),o-=1}}else if(q.isPair(t)){n=Object.freeze(n.concat(t));let o=await Ye("key",t.key,r,n);if(o===V)return V;else if(o===oe)t.key=null;let s=await Ye("value",t.value,r,n);if(s===V)return V;else if(s===oe)t.value=null}}return i}function mc(e){if(typeof e==="object"&&(e.Collection||e.Node||e.Value))return Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e);return e}function hc(e,t,r,n){if(typeof r==="function")return r(e,t,n);if(q.isMap(t))return r.Map?.(e,t,n);if(q.isSeq(t))return r.Seq?.(e,t,n);if(q.isPair(t))return r.Pair?.(e,t,n);if(q.isScalar(t))return r.Scalar?.(e,t,n);if(q.isAlias(t))return r.Alias?.(e,t,n);return}function yc(e,t,r){let n=t[t.length-1];if(q.isCollection(n))n.items[e]=r;else if(q.isPair(n))if(e==="key")n.key=r;else n.value=r;else if(q.isDocument(n))n.contents=r;else{let i=q.isAlias(n)?"alias":"scalar";throw Error(`Cannot replace node with ${i} parent`)}}ph.visit=yr;ph.visitAsync=br});var si=y(function(bh){var bc=A(),mh=bt(),hh={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},yh=(e)=>e.replace(/[!,[\]{}]/g,(t)=>hh[t]);class J{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},J.defaultYaml,e),this.tags=Object.assign({},J.defaultTags,t)}clone(){let e=new J(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new J(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:J.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},J.defaultTags);break}return e}add(e,t){if(this.atNextDocument)this.yaml={explicit:J.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},J.defaultTags),this.atNextDocument=!1;let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(r.length!==2){if(t(0,"%TAG directive should contain exactly two parts"),r.length<2)return!1}let[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;else{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);if(o==="!"||o==="!!")return t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null;if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return o}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);if(!n)t(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(n)}catch(o){return t(String(o)),null}if(r==="!")return e;return t(`Could not resolve tag: ${e}`),null}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+yh(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),n;if(e&&r.length>0&&bc.isNode(e.contents)){let i={};mh.visit(e.contents,(o,s)=>{if(bc.isNode(s)&&s.tag)i[s.tag]=!0}),n=Object.keys(i)}else n=[];for(let[i,o]of r){if(i==="!!"&&o==="tag:yaml.org,2002:")continue;if(!e||n.some((s)=>s.startsWith(o)))t.push(`%TAG ${i} ${o}`)}return t.join(`
|
|
4
|
-
`)}}J.defaultYaml={explicit:!1,version:"1.2"};J.defaultTags={"!!":"tag:yaml.org,2002:"};
|
|
5
|
-
`)?
|
|
3
|
+
var Pd=Object.create;var{getPrototypeOf:Ad,defineProperty:Wo,getOwnPropertyNames:Dd}=Object;var Jo=Object.prototype.hasOwnProperty;function Od(e){return this[e]}var Td,Ld,Nd=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?Td??=new WeakMap:Ld??=new WeakMap,o=i.get(e);if(o)return o}r=e!=null?Pd(Ad(e)):{};let s=t||!e||!e.__esModule||!Jo.call(e,"default")?Wo(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of Dd(e))if(!Jo.call(s,a))Wo(s,a,{get:Od.bind(e,a),enumerable:!0})}if(n)i.set(e,s);return s};var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var V=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var Xt=import.meta.require;var He=y(function(jA,xs){var Vp=Number.MAX_SAFE_INTEGER||9007199254740991,Kp=["major","premajor","minor","preminor","patch","prepatch","prerelease"];xs.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Vp,RELEASE_TYPES:Kp,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var mt=y(function(qA,ws){var Hp=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};ws.exports=Hp});var Ge=y(function(ie,vs){var{MAX_SAFE_COMPONENT_LENGTH:Hn,MAX_SAFE_BUILD_LENGTH:Gp,MAX_LENGTH:Yp}=He(),zp=mt();ie=vs.exports={};var Wp=ie.re=[],Jp=ie.safeRe=[],S=ie.src=[],Qp=ie.safeSrc=[],C=ie.t={},Xp=0,Gn="[a-zA-Z0-9-]",Zp=[["\\s",1],["\\d",Yp],[Gn,Gp]],ef=(e)=>{for(let[t,r]of Zp)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},E=(e,t,r)=>{let n=ef(t),i=Xp++;zp(e,i,t),C[e]=i,S[i]=t,Qp[i]=n,Wp[i]=new RegExp(t,r?"g":void 0),Jp[i]=new RegExp(n,r?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*");E("NUMERICIDENTIFIERLOOSE","\\d+");E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Gn}*`);E("MAINVERSION",`(${S[C.NUMERICIDENTIFIER]})\\.(${S[C.NUMERICIDENTIFIER]})\\.(${S[C.NUMERICIDENTIFIER]})`);E("MAINVERSIONLOOSE",`(${S[C.NUMERICIDENTIFIERLOOSE]})\\.(${S[C.NUMERICIDENTIFIERLOOSE]})\\.(${S[C.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASEIDENTIFIER",`(?:${S[C.NONNUMERICIDENTIFIER]}|${S[C.NUMERICIDENTIFIER]})`);E("PRERELEASEIDENTIFIERLOOSE",`(?:${S[C.NONNUMERICIDENTIFIER]}|${S[C.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASE",`(?:-(${S[C.PRERELEASEIDENTIFIER]}(?:\\.${S[C.PRERELEASEIDENTIFIER]})*))`);E("PRERELEASELOOSE",`(?:-?(${S[C.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${S[C.PRERELEASEIDENTIFIERLOOSE]})*))`);E("BUILDIDENTIFIER",`${Gn}+`);E("BUILD",`(?:\\+(${S[C.BUILDIDENTIFIER]}(?:\\.${S[C.BUILDIDENTIFIER]})*))`);E("FULLPLAIN",`v?${S[C.MAINVERSION]}${S[C.PRERELEASE]}?${S[C.BUILD]}?`);E("FULL",`^${S[C.FULLPLAIN]}$`);E("LOOSEPLAIN",`[v=\\s]*${S[C.MAINVERSIONLOOSE]}${S[C.PRERELEASELOOSE]}?${S[C.BUILD]}?`);E("LOOSE",`^${S[C.LOOSEPLAIN]}$`);E("GTLT","((?:<|>)?=?)");E("XRANGEIDENTIFIERLOOSE",`${S[C.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);E("XRANGEIDENTIFIER",`${S[C.NUMERICIDENTIFIER]}|x|X|\\*`);E("XRANGEPLAIN",`[v=\\s]*(${S[C.XRANGEIDENTIFIER]})(?:\\.(${S[C.XRANGEIDENTIFIER]})(?:\\.(${S[C.XRANGEIDENTIFIER]})(?:${S[C.PRERELEASE]})?${S[C.BUILD]}?)?)?`);E("XRANGEPLAINLOOSE",`[v=\\s]*(${S[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${S[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${S[C.XRANGEIDENTIFIERLOOSE]})(?:${S[C.PRERELEASELOOSE]})?${S[C.BUILD]}?)?)?`);E("XRANGE",`^${S[C.GTLT]}\\s*${S[C.XRANGEPLAIN]}$`);E("XRANGELOOSE",`^${S[C.GTLT]}\\s*${S[C.XRANGEPLAINLOOSE]}$`);E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Hn}})(?:\\.(\\d{1,${Hn}}))?(?:\\.(\\d{1,${Hn}}))?`);E("COERCE",`${S[C.COERCEPLAIN]}(?:$|[^\\d])`);E("COERCEFULL",S[C.COERCEPLAIN]+`(?:${S[C.PRERELEASE]})?(?:${S[C.BUILD]})?(?:$|[^\\d])`);E("COERCERTL",S[C.COERCE],!0);E("COERCERTLFULL",S[C.COERCEFULL],!0);E("LONETILDE","(?:~>?)");E("TILDETRIM",`(\\s*)${S[C.LONETILDE]}\\s+`,!0);ie.tildeTrimReplace="$1~";E("TILDE",`^${S[C.LONETILDE]}${S[C.XRANGEPLAIN]}$`);E("TILDELOOSE",`^${S[C.LONETILDE]}${S[C.XRANGEPLAINLOOSE]}$`);E("LONECARET","(?:\\^)");E("CARETTRIM",`(\\s*)${S[C.LONECARET]}\\s+`,!0);ie.caretTrimReplace="$1^";E("CARET",`^${S[C.LONECARET]}${S[C.XRANGEPLAIN]}$`);E("CARETLOOSE",`^${S[C.LONECARET]}${S[C.XRANGEPLAINLOOSE]}$`);E("COMPARATORLOOSE",`^${S[C.GTLT]}\\s*(${S[C.LOOSEPLAIN]})$|^$`);E("COMPARATOR",`^${S[C.GTLT]}\\s*(${S[C.FULLPLAIN]})$|^$`);E("COMPARATORTRIM",`(\\s*)${S[C.GTLT]}\\s*(${S[C.LOOSEPLAIN]}|${S[C.XRANGEPLAIN]})`,!0);ie.comparatorTrimReplace="$1$2$3";E("HYPHENRANGE",`^\\s*(${S[C.XRANGEPLAIN]})\\s+-\\s+(${S[C.XRANGEPLAIN]})\\s*$`);E("HYPHENRANGELOOSE",`^\\s*(${S[C.XRANGEPLAINLOOSE]})\\s+-\\s+(${S[C.XRANGEPLAINLOOSE]})\\s*$`);E("STAR","(<|>)?=?\\s*\\*");E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var or=y(function(BA,Es){var tf=Object.freeze({loose:!0}),rf=Object.freeze({}),nf=(e)=>{if(!e)return rf;if(typeof e!=="object")return tf;return e};Es.exports=nf});var Yn=y(function(UA,As){var Is=/^[0-9]+$/,Ps=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Is.test(e),n=Is.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},of=(e,t)=>Ps(t,e);As.exports={compareIdentifiers:Ps,rcompareIdentifiers:of}});var q=y(function(VA,Os){var sr=mt(),{MAX_LENGTH:Ds,MAX_SAFE_INTEGER:ar}=He(),{safeRe:cr,t:lr}=Ge(),sf=or(),{compareIdentifiers:zn}=Yn(),af=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(zn(e[n],r[n])!==0)return!1;return!0};class te{constructor(e,t){if(t=sf(t),e instanceof te)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Ds)throw TypeError(`version is longer than ${Ds} characters`);sr("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?cr[lr.LOOSE]:cr[lr.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>ar||this.major<0)throw TypeError("Invalid major version");if(this.minor>ar||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>ar||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<ar)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(sr("SemVer.compare",this.version,this.options,e),!(e instanceof te)){if(typeof e==="string"&&e===this.version)return 0;e=new te(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof te))e=new te(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof te))e=new te(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(sr("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return zn(r,n)}while(++t)}compareBuild(e){if(!(e instanceof te))e=new te(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(sr("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return zn(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?cr[lr.PRERELEASELOOSE]:cr[lr.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(af(this.prerelease,t)){let o=this.prerelease[t.split(".").length];if(isNaN(o))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Os.exports=te});var me=y(function(KA,Ls){var Ts=q(),cf=(e,t,r=!1)=>{if(e instanceof Ts)return e;try{return new Ts(e,t)}catch(n){if(!r)return null;throw n}};Ls.exports=cf});var $s=y(function(HA,Ns){var lf=me(),uf=(e,t)=>{let r=lf(e,t);return r?r.version:null};Ns.exports=uf});var _s=y(function(GA,Ms){var df=me(),pf=(e,t)=>{let r=df(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Ms.exports=pf});var qs=y(function(YA,js){var Fs=q(),ff=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new Fs(e instanceof Fs?e.version:e,r).inc(t,n,i).version}catch(o){return null}};js.exports=ff});var Vs=y(function(zA,Us){var Bs=me(),gf=(e,t)=>{let r=Bs(e,null,!0),n=Bs(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let p=c?"pre":"";if(r.major!==n.major)return p+"major";if(r.minor!==n.minor)return p+"minor";if(r.patch!==n.patch)return p+"patch";return"prerelease"};Us.exports=gf});var Hs=y(function(WA,Ks){var mf=q(),hf=(e,t)=>new mf(e,t).major;Ks.exports=hf});var Ys=y(function(JA,Gs){var yf=q(),bf=(e,t)=>new yf(e,t).minor;Gs.exports=bf});var Ws=y(function(QA,zs){var Sf=q(),Cf=(e,t)=>new Sf(e,t).patch;zs.exports=Cf});var Qs=y(function(XA,Js){var Rf=me(),kf=(e,t)=>{let r=Rf(e,t);return r&&r.prerelease.length?r.prerelease:null};Js.exports=kf});var z=y(function(ZA,Zs){var Xs=q(),xf=(e,t,r)=>new Xs(e,r).compare(new Xs(t,r));Zs.exports=xf});var ta=y(function(eD,ea){var wf=z(),vf=(e,t,r)=>wf(t,e,r);ea.exports=vf});var na=y(function(tD,ra){var Ef=z(),If=(e,t)=>Ef(e,t,!0);ra.exports=If});var ur=y(function(rD,oa){var ia=q(),Pf=(e,t,r)=>{let n=new ia(e,r),i=new ia(t,r);return n.compare(i)||n.compareBuild(i)};oa.exports=Pf});var aa=y(function(nD,sa){var Af=ur(),Df=(e,t)=>e.sort((r,n)=>Af(r,n,t));sa.exports=Df});var la=y(function(iD,ca){var Of=ur(),Tf=(e,t)=>e.sort((r,n)=>Of(n,r,t));ca.exports=Tf});var ht=y(function(oD,ua){var Lf=z(),Nf=(e,t,r)=>Lf(e,t,r)>0;ua.exports=Nf});var dr=y(function(sD,da){var $f=z(),Mf=(e,t,r)=>$f(e,t,r)<0;da.exports=Mf});var Wn=y(function(aD,pa){var _f=z(),Ff=(e,t,r)=>_f(e,t,r)===0;pa.exports=Ff});var Jn=y(function(cD,fa){var jf=z(),qf=(e,t,r)=>jf(e,t,r)!==0;fa.exports=qf});var pr=y(function(lD,ga){var Bf=z(),Uf=(e,t,r)=>Bf(e,t,r)>=0;ga.exports=Uf});var fr=y(function(uD,ma){var Vf=z(),Kf=(e,t,r)=>Vf(e,t,r)<=0;ma.exports=Kf});var Qn=y(function(dD,ha){var Hf=Wn(),Gf=Jn(),Yf=ht(),zf=pr(),Wf=dr(),Jf=fr(),Qf=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return Hf(e,r,n);case"!=":return Gf(e,r,n);case">":return Yf(e,r,n);case">=":return zf(e,r,n);case"<":return Wf(e,r,n);case"<=":return Jf(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};ha.exports=Qf});var ba=y(function(pD,ya){var Xf=q(),Zf=me(),{safeRe:gr,t:mr}=Ge(),eg=(e,t)=>{if(e instanceof Xf)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?gr[mr.COERCEFULL]:gr[mr.COERCE]);else{let c=t.includePrerelease?gr[mr.COERCERTLFULL]:gr[mr.COERCERTL],l;while((l=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||l.index+l[0].length!==r.index+r[0].length)r=l;c.lastIndex=l.index+l[1].length+l[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Zf(`${n}.${i}.${o}${s}${a}`,t)};ya.exports=eg});var Ca=y(function(fD,Sa){var tg=me(),rg=He(),ng=q(),ig=(e,t,r)=>{if(!rg.RELEASE_TYPES.includes(t))return null;let n=og(e,r);return n&&sg(n,t)},og=(e,t)=>{let r=e instanceof ng?e.version:e;return tg(r,t)},sg=(e,t)=>{if(ag(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},ag=(e)=>e.startsWith("pre");Sa.exports=ig});var xa=y(function(gD,ka){class Ra{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}ka.exports=Ra});var W=y(function(mD,Ia){var cg=/\s+/g;class yt{constructor(e,t){if(t=ug(t),e instanceof yt)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new yt(e.raw,t);if(e instanceof Xn)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(cg," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!va(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Sg(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(bg,"");let r=((this.options.includePrerelease&&hg)|(this.options.loose&&yg))+":"+e,n=wa.get(r);if(n)return n;let i=this.options.loose,o=i?U[B.HYPHENRANGELOOSE]:U[B.HYPHENRANGE];e=e.replace(o,Dg(this.options.includePrerelease)),T("hyphen replace",e),e=e.replace(U[B.COMPARATORTRIM],fg),T("comparator trim",e),e=e.replace(U[B.TILDETRIM],gg),T("tilde trim",e),e=e.replace(U[B.CARETTRIM],mg),T("caret trim",e);let s=e.split(" ").map((p)=>Cg(p,this.options)).join(" ").split(/\s+/).map((p)=>Ag(p,this.options));if(i)s=s.filter((p)=>(T("loose invalid filter",p,this.options),!!p.match(U[B.COMPARATORLOOSE])));T("range list",s);let a=new Map,c=s.map((p)=>new Xn(p,this.options));for(let p of c){if(va(p))return[p];a.set(p.value,p)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return wa.set(r,l),l}intersects(e,t){if(!(e instanceof yt))throw TypeError("a Range is required");return this.set.some((r)=>Ea(r,t)&&e.set.some((n)=>Ea(n,t)&&r.every((i)=>n.every((o)=>i.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new dg(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Og(this.set[t],e,this.options))return!0;return!1}}Ia.exports=yt;var lg=xa(),wa=new lg,ug=or(),Xn=bt(),T=mt(),dg=q(),{safeRe:U,src:pg,t:B,comparatorTrimReplace:fg,tildeTrimReplace:gg,caretTrimReplace:mg}=Ge(),{FLAG_INCLUDE_PRERELEASE:hg,FLAG_LOOSE:yg}=He(),bg=new RegExp(pg[B.BUILD],"g"),va=(e)=>e.value==="<0.0.0-0",Sg=(e)=>e.value==="",Ea=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((o)=>i.intersects(o,t)),i=n.pop();return r},Cg=(e,t)=>(e=e.replace(U[B.BUILD],""),T("comp",e,t),e=wg(e,t),T("caret",e),e=kg(e,t),T("tildes",e),e=Eg(e,t),T("xrange",e),e=Pg(e,t),T("stars",e),e),F=(e)=>!e||e.toLowerCase()==="x"||e==="*",Rg=(e,t,r)=>F(e)&&!F(t)||F(t)&&r&&!F(r),kg=(e,t)=>e.trim().split(/\s+/).map((r)=>xg(r,t)).join(" "),xg=(e,t)=>{let r=t.loose?U[B.TILDELOOSE]:U[B.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{T("tilde",e,i,o,s,a,c);let l;if(F(o))l="";else if(F(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(F(a))l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else if(c)T("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;return T("tilde return",l),l})},wg=(e,t)=>e.trim().split(/\s+/).map((r)=>vg(r,t)).join(" "),vg=(e,t)=>{T("caret",e,t);let r=t.loose?U[B.CARETLOOSE]:U[B.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{T("caret",e,i,o,s,a,c);let l;if(F(o))l="";else if(F(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(F(a))if(o==="0")l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`;else if(c)if(T("replaceCaret pr",c),o==="0")if(s==="0")l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`;else if(T("no pr"),o==="0")if(s==="0")l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`;return T("caret return",l),l})},Eg=(e,t)=>(T("replaceXRanges",e,t),e.split(/\s+/).map((r)=>Ig(r,t)).join(" ")),Ig=(e,t)=>{e=e.trim();let r=t.loose?U[B.XRANGELOOSE]:U[B.XRANGE];return e.replace(r,(n,i,o,s,a,c)=>{if(T("xRange",e,n,i,o,s,a,c),Rg(o,s,a))return e;let l=F(o),p=l||F(s),d=p||F(a),f=d;if(i==="="&&f)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&f){if(p)s=0;if(a=0,i===">")if(i=">=",p)o=+o+1,s=0,a=0;else s=+s+1,a=0;else if(i==="<=")if(i="<",p)o=+o+1;else s=+s+1;if(i==="<")c="-0";n=`${i+o}.${s}.${a}${c}`}else if(p)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(d)n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`;return T("xRange return",n),n})},Pg=(e,t)=>(T("replaceStars",e,t),e.trim().replace(U[B.STAR],"")),Ag=(e,t)=>(T("replaceGTE0",e,t),e.trim().replace(U[t.includePrerelease?B.GTE0PRE:B.GTE0],"")),Dg=(e)=>(t,r,n,i,o,s,a,c,l,p,d,f)=>{if(F(n))r="";else if(F(i))r=`>=${n}.0.0${e?"-0":""}`;else if(F(o))r=`>=${n}.${i}.0${e?"-0":""}`;else if(s)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(F(l))c="";else if(F(p))c=`<${+l+1}.0.0-0`;else if(F(d))c=`<${l}.${+p+1}.0-0`;else if(f)c=`<=${l}.${p}.${d}-${f}`;else if(e)c=`<${l}.${p}.${+d+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},Og=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(T(e[n].semver),e[n].semver===Xn.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var bt=y(function(hD,La){var St=Symbol("SemVer ANY");class hr{static get ANY(){return St}constructor(e,t){if(t=Pa(t),e instanceof hr)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),ei("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===St)this.value="";else this.value=this.operator+this.semver.version;ei("comp",this)}parse(e){let t=this.options.loose?Aa[Da.COMPARATORLOOSE]:Aa[Da.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=St;else this.semver=new Oa(r[2],this.options.loose)}toString(){return this.value}test(e){if(ei("Comparator.test",e,this.options.loose),this.semver===St||e===St)return!0;if(typeof e==="string")try{e=new Oa(e,this.options)}catch(t){return!1}return Zn(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof hr))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Ta(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Ta(this.value,t).test(e.semver)}if(t=Pa(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(Zn(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(Zn(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}La.exports=hr;var Pa=or(),{safeRe:Aa,t:Da}=Ge(),Zn=Qn(),ei=mt(),Oa=q(),Ta=W()});var Ct=y(function(yD,Na){var Tg=W(),Lg=(e,t,r)=>{try{t=new Tg(t,r)}catch(n){return!1}return t.test(e)};Na.exports=Lg});var Ma=y(function(bD,$a){var Ng=W(),$g=(e,t)=>new Ng(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));$a.exports=$g});var Fa=y(function(SD,_a){var Mg=q(),_g=W(),Fg=(e,t,r)=>{let n=null,i=null,o=null;try{o=new _g(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===-1)n=s,i=new Mg(n,r)}}),n};_a.exports=Fg});var qa=y(function(CD,ja){var jg=q(),qg=W(),Bg=(e,t,r)=>{let n=null,i=null,o=null;try{o=new qg(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===1)n=s,i=new jg(n,r)}}),n};ja.exports=Bg});var Va=y(function(RD,Ua){var ti=q(),Ug=W(),Ba=ht(),Vg=(e,t)=>{e=new Ug(e,t);let r=new ti("0.0.0");if(e.test(r))return r;if(r=new ti("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;if(i.forEach((s)=>{let a=new ti(s.semver.version);switch(s.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!o||Ba(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||Ba(r,o)))r=o}if(r&&e.test(r))return r;return null};Ua.exports=Vg});var Ha=y(function(kD,Ka){var Kg=W(),Hg=(e,t)=>{try{return new Kg(e,t).range||"*"}catch(r){return null}};Ka.exports=Hg});var yr=y(function(xD,Wa){var Gg=q(),za=bt(),{ANY:Yg}=za,zg=W(),Wg=Ct(),Ga=ht(),Ya=dr(),Jg=fr(),Qg=pr(),Xg=(e,t,r,n)=>{e=new Gg(e,n),t=new zg(t,n);let i,o,s,a,c;switch(r){case">":i=Ga,o=Jg,s=Ya,a=">",c=">=";break;case"<":i=Ya,o=Qg,s=Ga,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Wg(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let p=t.set[l],d=null,f=null;if(p.forEach((u)=>{if(u.semver===Yg)u=new za(">=0.0.0");if(d=d||u,f=f||u,i(u.semver,d.semver,n))d=u;else if(s(u.semver,f.semver,n))f=u}),d.operator===a||d.operator===c)return!1;if((!f.operator||f.operator===a)&&o(e,f.semver))return!1;else if(f.operator===c&&s(e,f.semver))return!1}return!0};Wa.exports=Xg});var Qa=y(function(wD,Ja){var Zg=yr(),em=(e,t,r)=>Zg(e,t,">",r);Ja.exports=em});var Za=y(function(vD,Xa){var tm=yr(),rm=(e,t,r)=>tm(e,t,"<",r);Xa.exports=rm});var rc=y(function(ED,tc){var ec=W(),nm=(e,t,r)=>(e=new ec(e,r),t=new ec(t,r),e.intersects(t,r));tc.exports=nm});var ic=y(function(ID,nc){var im=Ct(),om=z();nc.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((p,d)=>om(p,d,r));for(let p of s)if(im(p,t,r)){if(o=p,!i)i=p}else{if(o)n.push([i,o]);o=null,i=null}if(i)n.push([i,null]);let a=[];for(let[p,d]of n)if(p===d)a.push(p);else if(!d&&p===s[0])a.push("*");else if(!d)a.push(`>=${p}`);else if(p===s[0])a.push(`<=${d}`);else a.push(`${p} - ${d}`);let c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var uc=y(function(PD,lc){var oc=W(),ii=bt(),{ANY:ri}=ii,ni=Ct(),oi=z(),sm=(e,t,r={})=>{if(e===t)return!0;e=new oc(e,r),t=new oc(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=cm(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},am=[new ii(">=0.0.0-0")],sc=[new ii(">=0.0.0")],cm=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===ri)if(t.length===1&&t[0].semver===ri)return!0;else if(r.includePrerelease)e=am;else e=sc;if(t.length===1&&t[0].semver===ri)if(r.includePrerelease)return!0;else t=sc;let n=new Set,i,o;for(let u of e)if(u.operator===">"||u.operator===">=")i=ac(i,u,r);else if(u.operator==="<"||u.operator==="<=")o=cc(o,u,r);else n.add(u.semver);if(n.size>1)return null;let s;if(i&&o){if(s=oi(i.semver,o.semver,r),s>0)return null;else if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let u of n){if(i&&!ni(u,String(i),r))return null;if(o&&!ni(u,String(o),r))return null;for(let m of t)if(!ni(u,String(m),r))return!1;return!0}let a,c,l,p,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0)d=!1;for(let u of t){if(p=p||u.operator===">"||u.operator===">=",l=l||u.operator==="<"||u.operator==="<=",i){if(f){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===f.major&&u.semver.minor===f.minor&&u.semver.patch===f.patch)f=!1}if(u.operator===">"||u.operator===">="){if(a=ac(i,u,r),a===u&&a!==i)return!1}else if(i.operator===">="&&!u.test(i.semver))return!1}if(o){if(d){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===d.major&&u.semver.minor===d.minor&&u.semver.patch===d.patch)d=!1}if(u.operator==="<"||u.operator==="<="){if(c=cc(o,u,r),c===u&&c!==o)return!1}else if(o.operator==="<="&&!u.test(o.semver))return!1}if(!u.operator&&(o||i)&&s!==0)return!1}if(i&&l&&!o&&s!==0)return!1;if(o&&p&&!i&&s!==0)return!1;if(f||d)return!1;return!0},ac=(e,t,r)=>{if(!e)return t;let n=oi(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},cc=(e,t,r)=>{if(!e)return t;let n=oi(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};lc.exports=sm});var gc=y(function(AD,fc){var si=Ge(),dc=He(),lm=q(),pc=Yn(),um=me(),dm=$s(),pm=_s(),fm=qs(),gm=Vs(),mm=Hs(),hm=Ys(),ym=Ws(),bm=Qs(),Sm=z(),Cm=ta(),Rm=na(),km=ur(),xm=aa(),wm=la(),vm=ht(),Em=dr(),Im=Wn(),Pm=Jn(),Am=pr(),Dm=fr(),Om=Qn(),Tm=ba(),Lm=Ca(),Nm=bt(),$m=W(),Mm=Ct(),_m=Ma(),Fm=Fa(),jm=qa(),qm=Va(),Bm=Ha(),Um=yr(),Vm=Qa(),Km=Za(),Hm=rc(),Gm=ic(),Ym=uc();fc.exports={parse:um,valid:dm,clean:pm,inc:fm,diff:gm,major:mm,minor:hm,patch:ym,prerelease:bm,compare:Sm,rcompare:Cm,compareLoose:Rm,compareBuild:km,sort:xm,rsort:wm,gt:vm,lt:Em,eq:Im,neq:Pm,gte:Am,lte:Dm,cmp:Om,coerce:Tm,truncate:Lm,Comparator:Nm,Range:$m,satisfies:Mm,toComparators:_m,maxSatisfying:Fm,minSatisfying:jm,minVersion:qm,validRange:Bm,outside:Um,gtr:Vm,ltr:Km,intersects:Hm,simplifyRange:Gm,subset:Ym,SemVer:lm,re:si.re,src:si.src,tokens:si.t,SEMVER_SPEC_VERSION:dc.SEMVER_SPEC_VERSION,RELEASE_TYPES:dc.RELEASE_TYPES,compareIdentifiers:pc.compareIdentifiers,rcompareIdentifiers:pc.rcompareIdentifiers}});var zm;var ai=V(()=>{zm=Nd(gc(),1)});var A=y(function(rh){var ci=Symbol.for("yaml.alias"),mc=Symbol.for("yaml.document"),br=Symbol.for("yaml.map"),hc=Symbol.for("yaml.pair"),li=Symbol.for("yaml.scalar"),Sr=Symbol.for("yaml.seq"),pe=Symbol.for("yaml.node.type"),Wm=(e)=>!!e&&typeof e==="object"&&e[pe]===ci,Jm=(e)=>!!e&&typeof e==="object"&&e[pe]===mc,Qm=(e)=>!!e&&typeof e==="object"&&e[pe]===br,Xm=(e)=>!!e&&typeof e==="object"&&e[pe]===hc,yc=(e)=>!!e&&typeof e==="object"&&e[pe]===li,Zm=(e)=>!!e&&typeof e==="object"&&e[pe]===Sr;function bc(e){if(e&&typeof e==="object")switch(e[pe]){case br:case Sr:return!0}return!1}function eh(e){if(e&&typeof e==="object")switch(e[pe]){case ci:case br:case li:case Sr:return!0}return!1}var th=(e)=>(yc(e)||bc(e))&&!!e.anchor;rh.ALIAS=ci;rh.DOC=mc;rh.MAP=br;rh.NODE_TYPE=pe;rh.PAIR=hc;rh.SCALAR=li;rh.SEQ=Sr;rh.hasAnchor=th;rh.isAlias=Wm;rh.isCollection=bc;rh.isDocument=Jm;rh.isMap=Qm;rh.isNode=eh;rh.isPair=Xm;rh.isScalar=yc;rh.isSeq=Zm});var Rt=y(function(Sh){var j=A(),K=Symbol("break visit"),Sc=Symbol("skip children"),oe=Symbol("remove node");function Cr(e,t){let r=Cc(t);if(j.isDocument(e)){if(Ye(null,e.contents,r,Object.freeze([e]))===oe)e.contents=null}else Ye(null,e,r,Object.freeze([]))}Cr.BREAK=K;Cr.SKIP=Sc;Cr.REMOVE=oe;function Ye(e,t,r,n){let i=Rc(e,t,r,n);if(j.isNode(i)||j.isPair(i))return kc(e,n,i),Ye(e,i,r,n);if(typeof i!=="symbol"){if(j.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let s=Ye(o,t.items[o],r,n);if(typeof s==="number")o=s-1;else if(s===K)return K;else if(s===oe)t.items.splice(o,1),o-=1}}else if(j.isPair(t)){n=Object.freeze(n.concat(t));let o=Ye("key",t.key,r,n);if(o===K)return K;else if(o===oe)t.key=null;let s=Ye("value",t.value,r,n);if(s===K)return K;else if(s===oe)t.value=null}}return i}async function Rr(e,t){let r=Cc(t);if(j.isDocument(e)){if(await ze(null,e.contents,r,Object.freeze([e]))===oe)e.contents=null}else await ze(null,e,r,Object.freeze([]))}Rr.BREAK=K;Rr.SKIP=Sc;Rr.REMOVE=oe;async function ze(e,t,r,n){let i=await Rc(e,t,r,n);if(j.isNode(i)||j.isPair(i))return kc(e,n,i),ze(e,i,r,n);if(typeof i!=="symbol"){if(j.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let s=await ze(o,t.items[o],r,n);if(typeof s==="number")o=s-1;else if(s===K)return K;else if(s===oe)t.items.splice(o,1),o-=1}}else if(j.isPair(t)){n=Object.freeze(n.concat(t));let o=await ze("key",t.key,r,n);if(o===K)return K;else if(o===oe)t.key=null;let s=await ze("value",t.value,r,n);if(s===K)return K;else if(s===oe)t.value=null}}return i}function Cc(e){if(typeof e==="object"&&(e.Collection||e.Node||e.Value))return Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e);return e}function Rc(e,t,r,n){if(typeof r==="function")return r(e,t,n);if(j.isMap(t))return r.Map?.(e,t,n);if(j.isSeq(t))return r.Seq?.(e,t,n);if(j.isPair(t))return r.Pair?.(e,t,n);if(j.isScalar(t))return r.Scalar?.(e,t,n);if(j.isAlias(t))return r.Alias?.(e,t,n);return}function kc(e,t,r){let n=t[t.length-1];if(j.isCollection(n))n.items[e]=r;else if(j.isPair(n))if(e==="key")n.key=r;else n.value=r;else if(j.isDocument(n))n.contents=r;else{let i=j.isAlias(n)?"alias":"scalar";throw Error(`Cannot replace node with ${i} parent`)}}Sh.visit=Cr;Sh.visitAsync=Rr});var ui=y(function(vh){var xc=A(),kh=Rt(),xh={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},wh=(e)=>e.replace(/[!,[\]{}]/g,(t)=>xh[t]);class J{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},J.defaultYaml,e),this.tags=Object.assign({},J.defaultTags,t)}clone(){let e=new J(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new J(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:J.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},J.defaultTags);break}return e}add(e,t){if(this.atNextDocument)this.yaml={explicit:J.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},J.defaultTags),this.atNextDocument=!1;let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(r.length!==2){if(t(0,"%TAG directive should contain exactly two parts"),r.length<2)return!1}let[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;else{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);if(o==="!"||o==="!!")return t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null;if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return o}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);if(!n)t(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(n)}catch(o){return t(String(o)),null}if(r==="!")return e;return t(`Could not resolve tag: ${e}`),null}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+wh(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),n;if(e&&r.length>0&&xc.isNode(e.contents)){let i={};kh.visit(e.contents,(o,s)=>{if(xc.isNode(s)&&s.tag)i[s.tag]=!0}),n=Object.keys(i)}else n=[];for(let[i,o]of r){if(i==="!!"&&o==="tag:yaml.org,2002:")continue;if(!e||n.some((s)=>s.startsWith(o)))t.push(`%TAG ${i} ${o}`)}return t.join(`
|
|
4
|
+
`)}}J.defaultYaml={explicit:!1,version:"1.2"};J.defaultTags={"!!":"tag:yaml.org,2002:"};vh.Directives=J});var kr=y(function(Dh){var wc=A(),Ih=Rt();function Ph(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(r)}return!0}function vc(e){let t=new Set;return Ih.visit(e,{Value(r,n){if(n.anchor)t.add(n.anchor)}}),t}function Ec(e,t){for(let r=1;;++r){let n=`${e}${r}`;if(!t.has(n))return n}}function Ah(e,t){let r=[],n=new Map,i=null;return{onAnchor:(o)=>{r.push(o),i??(i=vc(e));let s=Ec(t,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s==="object"&&s.anchor&&(wc.isScalar(s.node)||wc.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}Dh.anchorIsValid=Ph;Dh.anchorNames=vc;Dh.createNodeAnchors=Ah;Dh.findNewAnchor=Ec});var di=y(function($h){function kt(e,t,r,n){if(n&&typeof n==="object")if(Array.isArray(n))for(let i=0,o=n.length;i<o;++i){let s=n[i],a=kt(e,n,String(i),s);if(a===void 0)delete n[i];else if(a!==s)n[i]=a}else if(n instanceof Map)for(let i of Array.from(n.keys())){let o=n.get(i),s=kt(e,n,i,o);if(s===void 0)n.delete(i);else if(s!==o)n.set(i,s)}else if(n instanceof Set)for(let i of Array.from(n)){let o=kt(e,n,i,i);if(o===void 0)n.delete(i);else if(o!==i)n.delete(i),n.add(o)}else for(let[i,o]of Object.entries(n)){let s=kt(e,n,i,o);if(s===void 0)delete n[i];else if(s!==o)n[i]=s}return e.call(t,r,n)}$h.applyReviver=kt});var he=y(function(Fh){var _h=A();function Ic(e,t,r){if(Array.isArray(e))return e.map((n,i)=>Ic(n,String(i),r));if(e&&typeof e.toJSON==="function"){if(!r||!_h.hasAnchor(e))return e.toJSON(t,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n),r.onCreate=(o)=>{n.res=o,delete r.onCreate};let i=e.toJSON(t,r);if(r.onCreate)r.onCreate(i);return i}if(typeof e==="bigint"&&!r?.keep)return Number(e);return e}Fh.toJS=Ic});var xr=y(function(Uh){var qh=di(),Pc=A(),Bh=he();class Ac{constructor(e){Object.defineProperty(this,Pc.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:n,reviver:i}={}){if(!Pc.isDocument(e))throw TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r==="number"?r:100},s=Bh.toJS(this,"",o);if(typeof n==="function")for(let{count:a,res:c}of o.anchors.values())n(c,a);return typeof i==="function"?qh.applyReviver(i,{"":s},"",s):s}}Uh.NodeBase=Ac});var xt=y(function(zh){var Kh=kr(),Hh=Rt(),We=A(),Gh=xr(),Yh=he();class Dc extends Gh.NodeBase{constructor(e){super(We.ALIAS);this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let r;if(t?.aliasResolveCache)r=t.aliasResolveCache;else if(r=[],Hh.visit(e,{Node:(i,o)=>{if(We.isAlias(o)||We.hasAnchor(o))r.push(o)}}),t)t.aliasResolveCache=r;let n=void 0;for(let i of r){if(i===this)break;if(i.anchor===this.source)n=i}if(n&&t){let{anchors:i,doc:o,maxAliasCount:s}=t,a=i.get(n);if(!a)Yh.toJS(n,null,t),a=i.get(n);if(a?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(s>=0){if(a.count+=1,a.aliasCount===0)a.aliasCount=wr(o,n,i);if(a.count*a.aliasCount>s)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}}return n}toJSON(e,t){if(!t)return{source:this.source};let r=this.resolve(t.doc,t);if(!r){let n=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(n)}return t.anchors.get(r).res}toString(e,t,r){let n=`*${this.source}`;if(e){if(Kh.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(i)}if(e.implicitKey)return`${n} `}return n}}function wr(e,t,r){if(We.isAlias(t)){let n=t.resolve(e),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(We.isCollection(t)){let n=0;for(let i of t.items){let o=wr(e,i,r);if(o>n)n=o}return n}else if(We.isPair(t)){let n=wr(e,t.key,r),i=wr(e,t.value,r);return Math.max(n,i)}return 1}zh.Alias=Dc});var L=y(function(ey){var Jh=A(),Qh=xr(),Xh=he(),Zh=(e)=>!e||typeof e!=="function"&&typeof e!=="object";class De extends Qh.NodeBase{constructor(e){super(Jh.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:Xh.toJS(this.value,e,t)}toString(){return String(this.value)}}De.BLOCK_FOLDED="BLOCK_FOLDED";De.BLOCK_LITERAL="BLOCK_LITERAL";De.PLAIN="PLAIN";De.QUOTE_DOUBLE="QUOTE_DOUBLE";De.QUOTE_SINGLE="QUOTE_SINGLE";ey.Scalar=De;ey.isScalarValue=Zh});var wt=y(function(ay){var ny=xt(),Oe=A(),Oc=L(),iy="tag:yaml.org,2002:";function oy(e,t,r){if(t){let n=r.filter((o)=>o.tag===t),i=n.find((o)=>!o.format)??n[0];if(!i)throw Error(`Tag ${t} not found`);return i}return r.find((n)=>n.identify?.(e)&&!n.format)}function sy(e,t,r){if(Oe.isDocument(e))e=e.contents;if(Oe.isNode(e))return e;if(Oe.isPair(e)){let d=r.schema[Oe.MAP].createNode?.(r.schema,null,r);return d.items.push(e),d}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)e=e.valueOf();let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c=void 0;if(n&&e&&typeof e==="object")if(c=a.get(e),c)return c.anchor??(c.anchor=i(e)),new ny.Alias(c.anchor);else c={anchor:null,node:null},a.set(e,c);if(t?.startsWith("!!"))t=iy+t.slice(2);let l=oy(e,t,s.tags);if(!l){if(e&&typeof e.toJSON==="function")e=e.toJSON();if(!e||typeof e!=="object"){let d=new Oc.Scalar(e);if(c)c.node=d;return d}l=e instanceof Map?s[Oe.MAP]:(Symbol.iterator in Object(e))?s[Oe.SEQ]:s[Oe.MAP]}if(o)o(l),delete r.onTagObj;let p=l?.createNode?l.createNode(r.schema,e,r):typeof l?.nodeClass?.from==="function"?l.nodeClass.from(r.schema,e,r):new Oc.Scalar(e);if(t)p.tag=t;else if(!l.default)p.tag=l.tag;if(c)c.node=p;return p}ay.createNode=sy});var vr=y(function(dy){var ly=wt(),se=A(),uy=xr();function pi(e,t,r){let n=r;for(let i=t.length-1;i>=0;--i){let o=t[i];if(typeof o==="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return ly.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var Tc=(e)=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class Lc extends uy.NodeBase{constructor(e,t){super(e);Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(e)t.schema=e;if(t.items=t.items.map((r)=>se.isNode(r)||se.isPair(r)?r.clone(e):r),this.range)t.range=this.range.slice();return t}addIn(e,t){if(Tc(e))this.add(t);else{let[r,...n]=e,i=this.get(r,!0);if(se.isCollection(i))i.addIn(n,t);else if(i===void 0&&this.schema)this.set(r,pi(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let n=this.get(t,!0);if(se.isCollection(n))return n.deleteIn(r);else throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...n]=e,i=this.get(r,!0);if(n.length===0)return!t&&se.isScalar(i)?i.value:i;else return se.isCollection(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every((t)=>{if(!se.isPair(t))return!1;let r=t.value;return r==null||e&&se.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let n=this.get(t,!0);return se.isCollection(n)?n.hasIn(r):!1}setIn(e,t){let[r,...n]=e;if(n.length===0)this.set(r,t);else{let i=this.get(r,!0);if(se.isCollection(i))i.setIn(n,t);else if(i===void 0&&this.schema)this.set(r,pi(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}}dy.Collection=Lc;dy.collectionFromPath=pi;dy.isEmptyPath=Tc});var vt=y(function(yy){var my=(e)=>e.replace(/^(?!$)(?: $)?/gm,"#");function fi(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}var hy=(e,t,r)=>e.endsWith(`
|
|
5
|
+
`)?fi(r,t):r.includes(`
|
|
6
6
|
`)?`
|
|
7
|
-
`+
|
|
8
|
-
`){if(r==="block")g=
|
|
9
|
-
`&&u!=="\t"){let
|
|
10
|
-
`&&
|
|
11
|
-
${t}${e.slice(0,
|
|
12
|
-
${t}${e.slice(
|
|
13
|
-
`);n=t,i=t+1,o=e[i]}return n}
|
|
14
|
-
`){if(o-s>n)return!0;if(s=o+1,i-s<=n)return!1}return!0}function
|
|
7
|
+
`+fi(r,t):(e.endsWith(" ")?"":" ")+r;yy.indentComment=fi;yy.lineComment=hy;yy.stringifyComment=my});var $c=y(function(ky){function Ry(e,t,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return e;if(i<o)o=0;let c=Math.max(1+o,1+i-t.length);if(e.length<=c)return e;let l=[],p={},d=i-t.length;if(typeof n==="number")if(n>i-Math.max(2,o))l.push(0);else d=i-n;let f=void 0,u=void 0,m=!1,g=-1,h=-1,b=-1;if(r==="block"){if(g=Nc(e,g,t.length),g!==-1)d=g+c}for(let x;x=e[g+=1];){if(r==="quoted"&&x==="\\"){switch(h=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}b=g}if(x===`
|
|
8
|
+
`){if(r==="block")g=Nc(e,g,t.length);d=g+t.length+c,f=void 0}else{if(x===" "&&u&&u!==" "&&u!==`
|
|
9
|
+
`&&u!=="\t"){let w=e[g+1];if(w&&w!==" "&&w!==`
|
|
10
|
+
`&&w!=="\t")f=g}if(g>=d)if(f)l.push(f),d=f+c,f=void 0;else if(r==="quoted"){while(u===" "||u==="\t")u=x,x=e[g+=1],m=!0;let w=g>b+1?g-2:h-1;if(p[w])return e;l.push(w),p[w]=!0,d=w+c,f=void 0}else m=!0}u=x}if(m&&a)a();if(l.length===0)return e;if(s)s();let R=e.slice(0,l[0]);for(let x=0;x<l.length;++x){let w=l[x],v=l[x+1]||e.length;if(w===0)R=`
|
|
11
|
+
${t}${e.slice(0,v)}`;else{if(r==="quoted"&&p[w])R+=`${e[w]}\\`;R+=`
|
|
12
|
+
${t}${e.slice(w+1,v)}`}}return R}function Nc(e,t,r){let n=t,i=t+1,o=e[i];while(o===" "||o==="\t")if(t<i+r)o=e[++t];else{do o=e[++t];while(o&&o!==`
|
|
13
|
+
`);n=t,i=t+1,o=e[i]}return n}ky.FOLD_BLOCK="block";ky.FOLD_FLOW="flow";ky.FOLD_QUOTED="quoted";ky.foldFlowLines=Ry});var It=y(function(Dy){var re=L(),ye=$c(),Ir=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Pr=(e)=>/^(%|---|\.\.\.)/m.test(e);function Iy(e,t,r){if(!t||t<0)return!1;let n=t-r,i=e.length;if(i<=n)return!1;for(let o=0,s=0;o<i;++o)if(e[o]===`
|
|
14
|
+
`){if(o-s>n)return!0;if(s=o+1,i-s<=n)return!1}return!0}function Et(e,t){let r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(Pr(e)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c]){if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n")s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\";if(l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let p=r.substr(c+2,4);switch(p){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:if(p.substr(0,2)==="00")s+="\\x"+p.substr(2);else s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length<i)c+=1;else{s+=r.slice(a,c)+`
|
|
15
15
|
|
|
16
16
|
`;while(r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"')s+=`
|
|
17
|
-
`,c+=2;if(s+=o,r[c+2]===" ")s+="\\";c+=1,a=c+1}break;default:c+=1}}return s=a?s+r.slice(a):r,n?s:ye.foldFlowLines(s,o,ye.FOLD_QUOTED,
|
|
18
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return
|
|
19
|
-
${r}`)+"'";return t.implicitKey?n:ye.foldFlowLines(n,r,ye.FOLD_FLOW,
|
|
17
|
+
`,c+=2;if(s+=o,r[c+2]===" ")s+="\\";c+=1,a=c+1}break;default:c+=1}}return s=a?s+r.slice(a):r,n?s:ye.foldFlowLines(s,o,ye.FOLD_QUOTED,Ir(t,!1))}function gi(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
18
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Et(e,t);let r=t.indent||(Pr(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
19
|
+
${r}`)+"'";return t.implicitKey?n:ye.foldFlowLines(n,r,ye.FOLD_FLOW,Ir(t,!1))}function Je(e,t){let{singleQuote:r}=t.options,n;if(r===!1)n=Et;else{let i=e.includes('"'),o=e.includes("'");if(i&&!o)n=gi;else if(o&&!i)n=Et;else n=r?gi:Et}return n(e,t)}var mi;try{mi=new RegExp(`(^|(?<!
|
|
20
20
|
))
|
|
21
21
|
+(?!
|
|
22
|
-
|$)`,"g")}catch{
|
|
22
|
+
|$)`,"g")}catch{mi=/\n+(?!\n|$)/g}function Er({comment:e,type:t,value:r},n,i,o){let{blockQuote:s,commentString:a,lineWidth:c}=n.options;if(!s||/\n[\t ]+$/.test(r))return Je(r,n);let l=n.indent||(n.forceBlockIndent||Pr(r)?" ":""),p=s==="literal"?!0:s==="folded"||t===re.Scalar.BLOCK_FOLDED?!1:t===re.Scalar.BLOCK_LITERAL?!0:!Iy(r,c,l.length);if(!r)return p?`|
|
|
23
23
|
`:`>
|
|
24
|
-
`;let d,
|
|
25
|
-
`&&
|
|
24
|
+
`;let d,f;for(f=r.length;f>0;--f){let v=r[f-1];if(v!==`
|
|
25
|
+
`&&v!=="\t"&&v!==" ")break}let u=r.substring(f),m=u.indexOf(`
|
|
26
26
|
`);if(m===-1)d="-";else if(r===u||m!==u.length-1){if(d="+",o)o()}else d="";if(u){if(r=r.slice(0,-u.length),u[u.length-1]===`
|
|
27
|
-
`)u=u.slice(0,-1);u=u.replace(
|
|
28
|
-
`)b=h;else break}let R=r.substring(0,b<h?b+1:h);if(R)r=r.substring(R.length),R=R.replace(/\n+/g,`$&${l}`);let
|
|
29
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),I=!1,O=
|
|
30
|
-
${l}${k}`}return r=r.replace(/\n+/g,`$&${l}`),`|${
|
|
31
|
-
${l}${R}${r}${u}`}function
|
|
32
|
-
`)||
|
|
33
|
-
`)?
|
|
34
|
-
`))return
|
|
35
|
-
${c}`);if(s){let
|
|
36
|
-
${t.indent}${a}`}
|
|
37
|
-
${a}:`}else if(h=`${h}:`,
|
|
27
|
+
`)u=u.slice(0,-1);u=u.replace(mi,`$&${l}`)}let g=!1,h,b=-1;for(h=0;h<r.length;++h){let v=r[h];if(v===" ")g=!0;else if(v===`
|
|
28
|
+
`)b=h;else break}let R=r.substring(0,b<h?b+1:h);if(R)r=r.substring(R.length),R=R.replace(/\n+/g,`$&${l}`);let w=(g?l?"2":"1":"")+d;if(e){if(w+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i)i()}if(!p){let v=r.replace(/\n+/g,`
|
|
29
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),I=!1,O=Ir(n,!0);if(s!=="folded"&&t!==re.Scalar.BLOCK_FOLDED)O.onOverflow=()=>{I=!0};let k=ye.foldFlowLines(`${R}${v}${u}`,l,ye.FOLD_BLOCK,O);if(!I)return`>${w}
|
|
30
|
+
${l}${k}`}return r=r.replace(/\n+/g,`$&${l}`),`|${w}
|
|
31
|
+
${l}${R}${r}${u}`}function Py(e,t,r,n){let{type:i,value:o}=e,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:p}=t;if(a&&o.includes(`
|
|
32
|
+
`)||p&&/[[\]{},]/.test(o))return Je(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||p||!o.includes(`
|
|
33
|
+
`)?Je(o,t):Er(e,t,r,n);if(!a&&!p&&i!==re.Scalar.PLAIN&&o.includes(`
|
|
34
|
+
`))return Er(e,t,r,n);if(Pr(o)){if(c==="")return t.forceBlockIndent=!0,Er(e,t,r,n);else if(a&&c===l)return Je(o,t)}let d=o.replace(/\n+/g,`$&
|
|
35
|
+
${c}`);if(s){let f=(g)=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(d),{compat:u,tags:m}=t.doc.schema;if(m.some(f)||u?.some(f))return Je(o,t)}return a?d:ye.foldFlowLines(d,c,ye.FOLD_FLOW,Ir(t,!1))}function Ay(e,t,r,n){let{implicitKey:i,inFlow:o}=t,s=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;if(a!==re.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value))a=re.Scalar.QUOTE_DOUBLE}let c=(p)=>{switch(p){case re.Scalar.BLOCK_FOLDED:case re.Scalar.BLOCK_LITERAL:return i||o?Je(s.value,t):Er(s,t,r,n);case re.Scalar.QUOTE_DOUBLE:return Et(s.value,t);case re.Scalar.QUOTE_SINGLE:return gi(s.value,t);case re.Scalar.PLAIN:return Py(s,t,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:p,defaultStringType:d}=t.options,f=i&&p||d;if(l=c(f),l===null)throw Error(`Unsupported default string type ${f}`)}return l}Dy.stringifyString=Ay});var Pt=y(function(jy){var Ty=kr(),be=A(),Ly=vt(),Ny=It();function $y(e,t){let r=Object.assign({blockQuote:!0,commentString:Ly.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent==="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function My(e,t){if(t.tag){let i=e.filter((o)=>o.tag===t.tag);if(i.length>0)return i.find((o)=>o.format===t.format)??i[0]}let r=void 0,n;if(be.isScalar(t)){n=t.value;let i=e.filter((o)=>o.identify?.(n));if(i.length>1){let o=i.filter((s)=>s.test);if(o.length>0)i=o}r=i.find((o)=>o.format===t.format)??i.find((o)=>!o.format)}else n=t,r=e.find((i)=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw Error(`Tag not resolved for ${i} value`)}return r}function _y(e,t,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(be.isScalar(e)||be.isCollection(e))&&e.anchor;if(o&&Ty.anchorIsValid(o))r.add(o),i.push(`&${o}`);let s=e.tag??(t.default?null:t.tag);if(s)i.push(n.directives.tagString(s));return i.join(" ")}function Fy(e,t,r,n){if(be.isPair(e))return e.toString(t,r,n);if(be.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(t.resolvedAliases)t.resolvedAliases.add(e);else t.resolvedAliases=new Set([e]);e=e.resolve(t.doc)}}let i=void 0,o=be.isNode(e)?e:t.doc.createNode(e,{onTagObj:(c)=>i=c});i??(i=My(t.doc.schema.tags,o));let s=_y(o,i,t);if(s.length>0)t.indentAtStart=(t.indentAtStart??0)+s.length+1;let a=typeof i.stringify==="function"?i.stringify(o,t,r,n):be.isScalar(o)?Ny.stringifyString(o,t,r,n):o.toString(t,r,n);if(!s)return a;return be.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
|
|
36
|
+
${t.indent}${a}`}jy.createStringifyContext=$y;jy.stringify=Fy});var Fc=y(function(Vy){var fe=A(),Mc=L(),_c=Pt(),At=vt();function Uy({key:e,value:t},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:p,simpleKeys:d}}=r,f=fe.isNode(e)&&e.comment||null;if(d){if(f)throw Error("With simple keys, key nodes cannot have comments");if(fe.isCollection(e)||!fe.isNode(e)&&typeof e==="object")throw Error("With simple keys, collection cannot be used as a key value")}let u=!d&&(!e||f&&t==null&&!r.inFlow||fe.isCollection(e)||(fe.isScalar(e)?e.type===Mc.Scalar.BLOCK_FOLDED||e.type===Mc.Scalar.BLOCK_LITERAL:typeof e==="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!u&&(d||!o),indent:a+c});let m=!1,g=!1,h=_c.stringify(e,r,()=>m=!0,()=>g=!0);if(!u&&!r.inFlow&&h.length>1024){if(d)throw Error("With simple keys, single line scalar must not span more than 1024 characters");u=!0}if(r.inFlow){if(o||t==null){if(m&&n)n();return h===""?"?":u?`? ${h}`:h}}else if(o&&!d||t==null&&u){if(h=`? ${h}`,f&&!m)h+=At.lineComment(h,r.indent,l(f));else if(g&&i)i();return h}if(m)f=null;if(u){if(f)h+=At.lineComment(h,r.indent,l(f));h=`? ${h}
|
|
37
|
+
${a}:`}else if(h=`${h}:`,f)h+=At.lineComment(h,r.indent,l(f));let b,R,x;if(fe.isNode(t))b=!!t.spaceBefore,R=t.commentBefore,x=t.comment;else if(b=!1,R=null,x=null,t&&typeof t==="object")t=s.createNode(t);if(r.implicitKey=!1,!u&&!f&&fe.isScalar(t))r.indentAtStart=h.length+1;if(g=!1,!p&&c.length>=2&&!r.inFlow&&!u&&fe.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor)r.indent=r.indent.substring(2);let w=!1,v=_c.stringify(t,r,()=>w=!0,()=>g=!0),I=" ";if(f||b||R){if(I=b?`
|
|
38
38
|
`:"",R){let O=l(R);I+=`
|
|
39
|
-
${
|
|
39
|
+
${At.indentComment(O,r.indent)}`}if(v===""&&!r.inFlow){if(I===`
|
|
40
40
|
`&&x)I=`
|
|
41
41
|
|
|
42
42
|
`}else I+=`
|
|
43
|
-
${r.indent}`}else if(!u&&fe.isCollection(t)){let O=
|
|
44
|
-
`),N=k!==-1,ge=r.inFlow??t.flow??t.items.length===0;if(N||!ge){let
|
|
45
|
-
${r.indent}`}}else if(
|
|
46
|
-
`)I="";if(h+=I+
|
|
43
|
+
${r.indent}`}else if(!u&&fe.isCollection(t)){let O=v[0],k=v.indexOf(`
|
|
44
|
+
`),N=k!==-1,ge=r.inFlow??t.flow??t.items.length===0;if(N||!ge){let Be=!1;if(N&&(O==="&"||O==="!")){let M=v.indexOf(" ");if(O==="&"&&M!==-1&&M<k&&v[M+1]==="!")M=v.indexOf(" ",M+1);if(M===-1||k<M)Be=!0}if(!Be)I=`
|
|
45
|
+
${r.indent}`}}else if(v===""||v[0]===`
|
|
46
|
+
`)I="";if(h+=I+v,r.inFlow){if(w&&n)n()}else if(x&&!w)h+=At.lineComment(h,r.indent,l(x));else if(g&&i)i();return h}Vy.stringifyPair=Uy});var hi=y(function(Yy){var jc=Xt("process");function Hy(e,...t){if(e==="debug")console.log(...t)}function Gy(e,t){if(e==="debug"||e==="warn")if(typeof jc.emitWarning==="function")jc.emitWarning(t);else console.warn(t)}Yy.debug=Hy;Yy.warn=Gy});var Tr=y(function(Qy){var Or=A(),qc=L(),Ar="<<",Dr={identify:(e)=>e===Ar||typeof e==="symbol"&&e.description===Ar,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new qc.Scalar(Symbol(Ar)),{addToJSMap:Bc}),stringify:()=>Ar},Jy=(e,t)=>(Dr.identify(t)||Or.isScalar(t)&&(!t.type||t.type===qc.Scalar.PLAIN)&&Dr.identify(t.value))&&e?.doc.schema.tags.some((r)=>r.tag===Dr.tag&&r.default);function Bc(e,t,r){let n=Uc(e,r);if(Or.isSeq(n))for(let i of n.items)yi(e,t,i);else if(Array.isArray(n))for(let i of n)yi(e,t,i);else yi(e,t,n)}function yi(e,t,r){let n=Uc(e,r);if(!Or.isMap(n))throw Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,e,Map);for(let[o,s]of i)if(t instanceof Map){if(!t.has(o))t.set(o,s)}else if(t instanceof Set)t.add(o);else if(!Object.prototype.hasOwnProperty.call(t,o))Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function Uc(e,t){return e&&Or.isAlias(t)?t.resolve(e.doc,e):t}Qy.addMergeToJSMap=Bc;Qy.isMergeKey=Jy;Qy.merge=Dr});var Si=y(function(ob){var tb=hi(),Vc=Tr(),rb=Pt(),Kc=A(),bi=he();function nb(e,t,{key:r,value:n}){if(Kc.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if(Vc.isMergeKey(e,r))Vc.addMergeToJSMap(e,t,n);else{let i=bi.toJS(r,"",e);if(t instanceof Map)t.set(i,bi.toJS(n,i,e));else if(t instanceof Set)t.add(i);else{let o=ib(r,i,e),s=bi.toJS(n,o,e);if(o in t)Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});else t[o]=s}}return t}function ib(e,t,r){if(t===null)return"";if(typeof t!=="object")return String(t);if(Kc.isNode(e)&&r?.doc){let n=rb.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);if(o.length>40)o=o.substring(0,36)+'..."';tb.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(t)}ob.addPairToJSMap=nb});var Se=y(function(ub){var Hc=wt(),ab=Fc(),cb=Si(),Lr=A();function lb(e,t,r){let n=Hc.createNode(e,void 0,r),i=Hc.createNode(t,void 0,r);return new Nr(n,i)}class Nr{constructor(e,t=null){Object.defineProperty(this,Lr.NODE_TYPE,{value:Lr.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;if(Lr.isNode(t))t=t.clone(e);if(Lr.isNode(r))r=r.clone(e);return new Nr(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return cb.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?ab.stringifyPair(this,e,t,r):JSON.stringify(this)}}ub.Pair=Nr;ub.createPair=lb});var Ci=y(function(hb){var Te=A(),Gc=Pt(),$r=vt();function fb(e,t,r){return(t.inFlow??e.flow?mb:gb)(e,t,r)}function gb({comment:e,items:t},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,p=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;m<t.length;++m){let g=t[m],h=null;if(Te.isNode(g)){if(!d&&g.spaceBefore)f.push("");if(Mr(r,f,g.commentBefore,d),g.comment)h=g.comment}else if(Te.isPair(g)){let R=Te.isNode(g.key)?g.key:null;if(R){if(!d&&R.spaceBefore)f.push("");Mr(r,f,R.commentBefore,d)}}d=!1;let b=Gc.stringify(g,p,()=>h=null,()=>d=!0);if(h)b+=$r.lineComment(b,o,l(h));if(d&&h)d=!1;f.push(n+b)}let u;if(f.length===0)u=i.start+i.end;else{u=f[0];for(let m=1;m<f.length;++m){let g=f[m];u+=g?`
|
|
47
47
|
${c}${g}`:`
|
|
48
48
|
`}}if(e){if(u+=`
|
|
49
|
-
|
|
50
|
-
`)),m<e.length-1)b+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)l||(l=d.reduce((R,x)=>R+x.length+2,2)+(b.length+2)>t.options.lineWidth);if(l)b+=","}if(h)b
|
|
49
|
+
`+$r.indentComment(l(e),c),a)a()}else if(d&&s)s();return u}function mb({items:e},t,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=t;n+=o;let c=Object.assign({},t,{indent:n,inFlow:!0,type:null}),l=!1,p=0,d=[];for(let m=0;m<e.length;++m){let g=e[m],h=null;if(Te.isNode(g)){if(g.spaceBefore)d.push("");if(Mr(t,d,g.commentBefore,!1),g.comment)h=g.comment}else if(Te.isPair(g)){let R=Te.isNode(g.key)?g.key:null;if(R){if(R.spaceBefore)d.push("");if(Mr(t,d,R.commentBefore,!1),R.comment)l=!0}let x=Te.isNode(g.value)?g.value:null;if(x){if(x.comment)h=x.comment;if(x.commentBefore)l=!0}else if(g.value==null&&R?.comment)h=R.comment}if(h)l=!0;let b=Gc.stringify(g,c,()=>h=null);if(l||(l=d.length>p||b.includes(`
|
|
50
|
+
`)),m<e.length-1)b+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)l||(l=d.reduce((R,x)=>R+x.length+2,2)+(b.length+2)>t.options.lineWidth);if(l)b+=","}if(h)b+=$r.lineComment(b,n,a(h));d.push(b),p=d.length}let{start:f,end:u}=r;if(d.length===0)return f+u;else{if(!l){let m=d.reduce((g,h)=>g+h.length+2,2);l=t.options.lineWidth>0&&m>t.options.lineWidth}if(l){let m=f;for(let g of d)m+=g?`
|
|
51
51
|
${o}${i}${g}`:`
|
|
52
52
|
`;return`${m}
|
|
53
|
-
${i}${u}`}else return`${
|
|
54
|
-
`:" ")}return
|
|
53
|
+
${i}${u}`}else return`${f}${s}${d.join(" ")}${s}${u}`}}function Mr({indent:e,options:{commentString:t}},r,n,i){if(n&&i)n=n.replace(/^\n+/,"");if(n){let o=$r.indentComment(t(n),e);r.push(o.trimStart())}}hb.stringifyCollection=fb});var Re=y(function(kb){var bb=Ci(),Sb=Si(),Cb=vr(),Ce=A(),_r=Se(),Rb=L();function Dt(e,t){let r=Ce.isScalar(t)?t.value:t;for(let n of e)if(Ce.isPair(n)){if(n.key===t||n.key===r)return n;if(Ce.isScalar(n.key)&&n.key.value===r)return n}return}class Yc extends Cb.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ce.MAP,e);this.items=[]}static from(e,t,r){let{keepUndefined:n,replacer:i}=r,o=new this(e),s=(a,c)=>{if(typeof i==="function")c=i.call(t,a,c);else if(Array.isArray(i)&&!i.includes(a))return;if(c!==void 0||n)o.items.push(_r.createPair(a,c,r))};if(t instanceof Map)for(let[a,c]of t)s(a,c);else if(t&&typeof t==="object")for(let a of Object.keys(t))s(a,t[a]);if(typeof e.sortMapEntries==="function")o.items.sort(e.sortMapEntries);return o}add(e,t){let r;if(Ce.isPair(e))r=e;else if(!e||typeof e!=="object"||!("key"in e))r=new _r.Pair(e,e?.value);else r=new _r.Pair(e.key,e.value);let n=Dt(this.items,r.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${r.key} already set`);if(Ce.isScalar(n.value)&&Rb.isScalarValue(r.value))n.value.value=r.value;else n.value=r.value}else if(i){let o=this.items.findIndex((s)=>i(r,s)<0);if(o===-1)this.items.push(r);else this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let t=Dt(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let n=Dt(this.items,e)?.value;return(!t&&Ce.isScalar(n)?n.value:n)??void 0}has(e){return!!Dt(this.items,e)}set(e,t){this.add(new _r.Pair(e,t),!0)}toJSON(e,t,r){let n=r?new r:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(n);for(let i of this.items)Sb.addPairToJSMap(t,n,i);return n}toString(e,t,r){if(!e)return JSON.stringify(this);for(let n of this.items)if(!Ce.isPair(n))throw Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);if(!e.allNullValues&&this.hasAllNullValues(!1))e=Object.assign({},e,{allNullValues:!0});return bb.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}kb.YAMLMap=Yc;kb.findPair=Dt});var Qe=y(function(Ib){var vb=A(),zc=Re(),Eb={collection:"map",default:!0,nodeClass:zc.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!vb.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,r)=>zc.YAMLMap.from(e,t,r)};Ib.map=Eb});var ke=y(function(Nb){var Ab=wt(),Db=Ci(),Ob=vr(),jr=A(),Tb=L(),Lb=he();class Wc extends Ob.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(jr.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){let t=Fr(e);if(typeof t!=="number")return!1;return this.items.splice(t,1).length>0}get(e,t){let r=Fr(e);if(typeof r!=="number")return;let n=this.items[r];return!t&&jr.isScalar(n)?n.value:n}has(e){let t=Fr(e);return typeof t==="number"&&t<this.items.length}set(e,t){let r=Fr(e);if(typeof r!=="number")throw Error(`Expected a valid index, not ${e}.`);let n=this.items[r];if(jr.isScalar(n)&&Tb.isScalarValue(t))n.value=t;else this.items[r]=t}toJSON(e,t){let r=[];if(t?.onCreate)t.onCreate(r);let n=0;for(let i of this.items)r.push(Lb.toJS(i,String(n++),t));return r}toString(e,t,r){if(!e)return JSON.stringify(this);return Db.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t})}static from(e,t,r){let{replacer:n}=r,i=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let s of t){if(typeof n==="function"){let a=t instanceof Set?s:String(o++);s=n.call(t,a,s)}i.items.push(Ab.createNode(s,void 0,r))}}return i}}function Fr(e){let t=jr.isScalar(e)?e.value:e;if(t&&typeof t==="string")t=Number(t);return typeof t==="number"&&Number.isInteger(t)&&t>=0?t:null}Nb.YAMLSeq=Wc});var Xe=y(function(Fb){var Mb=A(),Jc=ke(),_b={collection:"seq",default:!0,nodeClass:Jc.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!Mb.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,r)=>Jc.YAMLSeq.from(e,t,r)};Fb.seq=_b});var Ot=y(function(Ub){var qb=It(),Bb={identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify(e,t,r,n){return t=Object.assign({actualString:!0},t),qb.stringifyString(e,t,r,n)}};Ub.string=Bb});var qr=y(function(Kb){var Qc=L(),Xc={identify:(e)=>e==null,createNode:()=>new Qc.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Qc.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&Xc.test.test(e)?e:t.options.nullStr};Kb.nullTag=Xc});var Ri=y(function(Yb){var Gb=L(),Zc={identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(e)=>new Gb.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},r){if(e&&Zc.test.test(e)){let n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?r.options.trueStr:r.options.falseStr}};Yb.boolTag=Zc});var Ze=y(function(Jb){function Wb({format:e,minFractionDigits:t,tag:r,value:n}){if(typeof n==="bigint")return String(n);let i=typeof n==="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");if(s<0)s=o.length,o+=".";let a=t-(o.length-s-1);while(a-- >0)o+="0"}return o}Jb.stringifyNumber=Wb});var xi=y(function(rS){var Xb=L(),ki=Ze(),Zb={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ki.stringifyNumber},eS={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():ki.stringifyNumber(e)}},tS={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new Xb.Scalar(parseFloat(e)),r=e.indexOf(".");if(r!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-r-1;return t},stringify:ki.stringifyNumber};rS.float=tS;rS.floatExp=eS;rS.floatNaN=Zb});var vi=y(function(lS){var el=Ze(),Br=(e)=>typeof e==="bigint"||Number.isInteger(e),wi=(e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r);function tl(e,t,r){let{value:n}=e;if(Br(n)&&n>=0)return r+n.toString(t);return el.stringifyNumber(e)}var sS={identify:(e)=>Br(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>wi(e,2,8,r),stringify:(e)=>tl(e,8,"0o")},aS={identify:Br,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>wi(e,0,10,r),stringify:el.stringifyNumber},cS={identify:(e)=>Br(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>wi(e,2,16,r),stringify:(e)=>tl(e,16,"0x")};lS.int=aS;lS.intHex=cS;lS.intOct=sS});var rl=y(function(SS){var fS=Qe(),gS=qr(),mS=Xe(),hS=Ot(),yS=Ri(),Ei=xi(),Ii=vi(),bS=[fS.map,mS.seq,hS.string,gS.nullTag,yS.boolTag,Ii.intOct,Ii.int,Ii.intHex,Ei.floatNaN,Ei.floatExp,Ei.float];SS.schema=bS});var il=y(function(IS){var RS=L(),kS=Qe(),xS=Xe();function nl(e){return typeof e==="bigint"||Number.isInteger(e)}var Ur=({value:e})=>JSON.stringify(e),wS=[{identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify:Ur},{identify:(e)=>e==null,createNode:()=>new RS.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ur},{identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(e)=>e==="true",stringify:Ur},{identify:nl,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:r})=>r?BigInt(e):parseInt(e,10),stringify:({value:e})=>nl(e)?e.toString():JSON.stringify(e)},{identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(e)=>parseFloat(e),stringify:Ur}],vS={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},ES=[kS.map,xS.seq].concat(wS,vS);IS.schema=ES});var Ai=y(function(OS){var Tt=Xt("buffer"),Pi=L(),AS=It(),DS={identify:(e)=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof Tt.Buffer==="function")return Tt.Buffer.from(e,"base64");else if(typeof atob==="function"){let r=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:r},n,i,o){if(!r)return"";let s=r,a;if(typeof Tt.Buffer==="function")a=s instanceof Tt.Buffer?s.toString("base64"):Tt.Buffer.from(s.buffer).toString("base64");else if(typeof btoa==="function"){let c="";for(let l=0;l<s.length;++l)c+=String.fromCharCode(s[l]);a=btoa(c)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Pi.Scalar.BLOCK_LITERAL),t!==Pi.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),p=Array(l);for(let d=0,f=0;d<l;++d,f+=c)p[d]=a.substr(f,c);a=p.join(t===Pi.Scalar.BLOCK_LITERAL?`
|
|
54
|
+
`:" ")}return AS.stringifyString({comment:e,type:t,value:a},n,i,o)}};OS.binary=DS});var Kr=y(function(MS){var Vr=A(),Di=Se(),LS=L(),NS=ke();function ol(e,t){if(Vr.isSeq(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(Vr.isPair(n))continue;else if(Vr.isMap(n)){if(n.items.length>1)t("Each pair must have its own sequence indicator");let i=n.items[0]||new Di.Pair(new LS.Scalar(null));if(n.commentBefore)i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
55
55
|
${i.key.commentBefore}`:n.commentBefore;if(n.comment){let o=i.value??i.key;o.comment=o.comment?`${n.comment}
|
|
56
|
-
${o.comment}`:n.comment}n=i}e.items[r]=Br.isPair(n)?n:new Ei.Pair(n)}else t("Expected a sequence for this tag");return e}function tl(e,t,r){let{replacer:n}=r,i=new IS.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){if(typeof n==="function")s=n.call(t,String(o++),s);let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(Ei.createPair(a,c,r))}return i}var PS={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:el,createNode:tl};AS.createPairs=tl;AS.pairs=PS;AS.resolvePairs=el});var Pi=y(function($S){var rl=A(),Ii=he(),Dt=Re(),LS=ke(),nl=jr();class Te extends LS.YAMLSeq{constructor(){super();this.add=Dt.YAMLMap.prototype.add.bind(this),this.delete=Dt.YAMLMap.prototype.delete.bind(this),this.get=Dt.YAMLMap.prototype.get.bind(this),this.has=Dt.YAMLMap.prototype.has.bind(this),this.set=Dt.YAMLMap.prototype.set.bind(this),this.tag=Te.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;if(t?.onCreate)t.onCreate(r);for(let n of this.items){let i,o;if(rl.isPair(n))i=Ii.toJS(n.key,"",t),o=Ii.toJS(n.value,i,t);else i=Ii.toJS(n,"",t);if(r.has(i))throw Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,t,r){let n=nl.createPairs(e,t,r),i=new this;return i.items=n.items,i}}Te.tag="tag:yaml.org,2002:omap";var NS={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:Te,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=nl.resolvePairs(e,t),n=[];for(let{key:i}of r.items)if(rl.isScalar(i))if(n.includes(i.value))t(`Ordered maps must not include duplicate keys: ${i.value}`);else n.push(i.value);return Object.assign(new Te,r)},createNode:(e,t,r)=>Te.from(e,t,r)};$S.YAMLOMap=Te;$S.omap=NS});var cl=y(function(FS){var il=L();function ol({value:e,source:t},r){if(t&&(e?sl:al).test.test(t))return t;return e?r.options.trueStr:r.options.falseStr}var sl={identify:(e)=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new il.Scalar(!0),stringify:ol},al={identify:(e)=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new il.Scalar(!1),stringify:ol};FS.falseTag=al;FS.trueTag=sl});var ll=y(function(HS){var jS=L(),Ai=Qe(),US={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ai.stringifyNumber},VS={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Ai.stringifyNumber(e)}},KS={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new jS.Scalar(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(r!==-1){let n=e.substring(r+1).replace(/_/g,"");if(n[n.length-1]==="0")t.minFractionDigits=n.length}return t},stringify:Ai.stringifyNumber};HS.float=KS;HS.floatExp=VS;HS.floatNaN=US});var dl=y(function(ZS){var ul=Qe(),Ot=(e)=>typeof e==="bigint"||Number.isInteger(e);function Ur(e,t,r,{intAsBigInt:n}){let i=e[0];if(i==="-"||i==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return i==="-"?BigInt(-1)*s:s}let o=parseInt(e,r);return i==="-"?-1*o:o}function Di(e,t,r){let{value:n}=e;if(Ot(n)){let i=n.toString(t);return n<0?"-"+r+i.substr(1):r+i}return ul.stringifyNumber(e)}var WS={identify:Ot,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>Ur(e,2,2,r),stringify:(e)=>Di(e,2,"0b")},JS={identify:Ot,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>Ur(e,1,8,r),stringify:(e)=>Di(e,8,"0")},QS={identify:Ot,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>Ur(e,0,10,r),stringify:ul.stringifyNumber},XS={identify:Ot,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>Ur(e,2,16,r),stringify:(e)=>Di(e,16,"0x")};ZS.int=QS;ZS.intBin=WS;ZS.intHex=XS;ZS.intOct=JS});var Oi=y(function(oC){var Hr=A(),Vr=Se(),Kr=Re();class Le extends Kr.YAMLMap{constructor(e){super(e);this.tag=Le.tag}add(e){let t;if(Hr.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new Vr.Pair(e.key,null);else t=new Vr.Pair(e,null);if(!Kr.findPair(this.items,t.key))this.items.push(t)}get(e,t){let r=Kr.findPair(this.items,e);return!t&&Hr.isPair(r)?Hr.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=Kr.findPair(this.items,e);if(r&&!t)this.items.splice(this.items.indexOf(r),1);else if(!r&&t)this.items.push(new Vr.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);else throw Error("Set items must all have null values")}static from(e,t,r){let{replacer:n}=r,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t){if(typeof n==="function")o=n.call(t,o,o);i.items.push(Vr.createPair(o,null,r))}return i}}Le.tag="tag:yaml.org,2002:set";var iC={collection:"map",identify:(e)=>e instanceof Set,nodeClass:Le,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>Le.from(e,t,r),resolve(e,t){if(Hr.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new Le,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};oC.YAMLSet=Le;oC.set=iC});var Li=y(function(dC){var cC=Qe();function Ti(e,t){let r=e[0],n=r==="-"||r==="+"?e.substring(1):e,i=(s)=>t?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function pl(e){let{value:t}=e,r=(s)=>s;if(typeof t==="bigint")r=(s)=>BigInt(s);else if(isNaN(t)||!isFinite(t))return cC.stringifyNumber(e);let n="";if(t<0)n="-",t*=r(-1);let i=r(60),o=[t%i];if(t<60)o.unshift(0);else if(t=(t-o[0])/i,o.unshift(t%i),t>=60)t=(t-o[0])/i,o.unshift(t);return n+o.map((s)=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var lC={identify:(e)=>typeof e==="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>Ti(e,r),stringify:pl},uC={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(e)=>Ti(e,!1),stringify:pl},fl={identify:(e)=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(fl.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),f=t[8];if(f&&f!=="Z"){let d=Ti(f,!1);if(Math.abs(d)<30)d*=60;l-=60000*d}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};dC.floatTime=uC;dC.intTime=lC;dC.timestamp=fl});var ml=y(function(wC){var mC=We(),hC=_r(),yC=Je(),bC=Pt(),SC=wi(),gl=cl(),Ni=ll(),Yr=dl(),CC=Ar(),RC=Pi(),kC=jr(),xC=Oi(),$i=Li(),vC=[mC.map,yC.seq,bC.string,hC.nullTag,gl.trueTag,gl.falseTag,Yr.intBin,Yr.intOct,Yr.int,Yr.intHex,Ni.floatNaN,Ni.floatExp,Ni.float,SC.binary,CC.merge,RC.omap,kC.pairs,xC.set,$i.intTime,$i.floatTime,$i.timestamp];wC.schema=vC});var wl=y(function(NC){var Sl=We(),IC=_r(),Cl=Je(),PC=Pt(),AC=yi(),Mi=Si(),_i=Ri(),DC=Qc(),OC=Zc(),Rl=wi(),Tt=Ar(),kl=Pi(),xl=jr(),hl=ml(),vl=Oi(),Gr=Li(),yl=new Map([["core",DC.schema],["failsafe",[Sl.map,Cl.seq,PC.string]],["json",OC.schema],["yaml11",hl.schema],["yaml-1.1",hl.schema]]),bl={binary:Rl.binary,bool:AC.boolTag,float:Mi.float,floatExp:Mi.floatExp,floatNaN:Mi.floatNaN,floatTime:Gr.floatTime,int:_i.int,intHex:_i.intHex,intOct:_i.intOct,intTime:Gr.intTime,map:Sl.map,merge:Tt.merge,null:IC.nullTag,omap:kl.omap,pairs:xl.pairs,seq:Cl.seq,set:vl.set,timestamp:Gr.timestamp},TC={"tag:yaml.org,2002:binary":Rl.binary,"tag:yaml.org,2002:merge":Tt.merge,"tag:yaml.org,2002:omap":kl.omap,"tag:yaml.org,2002:pairs":xl.pairs,"tag:yaml.org,2002:set":vl.set,"tag:yaml.org,2002:timestamp":Gr.timestamp};function LC(e,t,r){let n=yl.get(t);if(n&&!e)return r&&!n.includes(Tt.merge)?n.concat(Tt.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let o=Array.from(yl.keys()).filter((s)=>s!=="yaml11").map((s)=>JSON.stringify(s)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)i=i.concat(o);else if(typeof e==="function")i=e(i.slice());if(r)i=i.concat(Tt.merge);return i.reduce((o,s)=>{let a=typeof s==="string"?bl[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(bl).map((f)=>JSON.stringify(f)).join(", ");throw Error(`Unknown custom tag ${c}; use one of ${l}`)}if(!o.includes(a))o.push(a);return o},[])}NC.coreKnownTags=TC;NC.getTags=LC});var Bi=y(function(jC){var Fi=A(),_C=We(),FC=Je(),qC=Pt(),zr=wl(),BC=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class qi{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:i,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?zr.getTags(e,"compat"):e?zr.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=n?zr.coreKnownTags:{},this.tags=zr.getTags(t,this.name,r),this.toStringOptions=s??null,Object.defineProperty(this,Fi.MAP,{value:_C.map}),Object.defineProperty(this,Fi.SCALAR,{value:qC.string}),Object.defineProperty(this,Fi.SEQ,{value:FC.seq}),this.sortMapEntries=typeof o==="function"?o:o===!0?BC:null}clone(){let e=Object.create(qi.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}jC.Schema=qi});var El=y(function(HC){var VC=A(),ji=wt(),Lt=kt();function KC(e,t){let r=[],n=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);if(c)r.push(c),n=!0;else if(e.directives.docStart)n=!0}if(n)r.push("---");let i=ji.createStringifyContext(e,t),{commentString:o}=i.options;if(e.commentBefore){if(r.length!==1)r.unshift("");let c=o(e.commentBefore);r.unshift(Lt.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(VC.isNode(e.contents)){if(e.contents.spaceBefore&&n)r.push("");if(e.contents.commentBefore){let f=o(e.contents.commentBefore);r.push(Lt.indentComment(f,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,l=ji.stringify(e.contents,i,()=>a=null,c);if(a)l+=Lt.lineComment(l,"",o(a));if((l[0]==="|"||l[0]===">")&&r[r.length-1]==="---")r[r.length-1]=`--- ${l}`;else r.push(l)}else r.push(ji.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=o(e.comment);if(c.includes(`
|
|
57
|
-
`))r.push("..."),r.push(
|
|
56
|
+
${o.comment}`:n.comment}n=i}e.items[r]=Vr.isPair(n)?n:new Di.Pair(n)}else t("Expected a sequence for this tag");return e}function sl(e,t,r){let{replacer:n}=r,i=new NS.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){if(typeof n==="function")s=n.call(t,String(o++),s);let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(Di.createPair(a,c,r))}return i}var $S={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ol,createNode:sl};MS.createPairs=sl;MS.pairs=$S;MS.resolvePairs=ol});var Ti=y(function(US){var al=A(),Oi=he(),Lt=Re(),qS=ke(),cl=Kr();class Le extends qS.YAMLSeq{constructor(){super();this.add=Lt.YAMLMap.prototype.add.bind(this),this.delete=Lt.YAMLMap.prototype.delete.bind(this),this.get=Lt.YAMLMap.prototype.get.bind(this),this.has=Lt.YAMLMap.prototype.has.bind(this),this.set=Lt.YAMLMap.prototype.set.bind(this),this.tag=Le.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;if(t?.onCreate)t.onCreate(r);for(let n of this.items){let i,o;if(al.isPair(n))i=Oi.toJS(n.key,"",t),o=Oi.toJS(n.value,i,t);else i=Oi.toJS(n,"",t);if(r.has(i))throw Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,t,r){let n=cl.createPairs(e,t,r),i=new this;return i.items=n.items,i}}Le.tag="tag:yaml.org,2002:omap";var BS={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:Le,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=cl.resolvePairs(e,t),n=[];for(let{key:i}of r.items)if(al.isScalar(i))if(n.includes(i.value))t(`Ordered maps must not include duplicate keys: ${i.value}`);else n.push(i.value);return Object.assign(new Le,r)},createNode:(e,t,r)=>Le.from(e,t,r)};US.YAMLOMap=Le;US.omap=BS});var fl=y(function(HS){var ll=L();function ul({value:e,source:t},r){if(t&&(e?dl:pl).test.test(t))return t;return e?r.options.trueStr:r.options.falseStr}var dl={identify:(e)=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ll.Scalar(!0),stringify:ul},pl={identify:(e)=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ll.Scalar(!1),stringify:ul};HS.falseTag=pl;HS.trueTag=dl});var gl=y(function(XS){var zS=L(),Li=Ze(),WS={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Li.stringifyNumber},JS={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Li.stringifyNumber(e)}},QS={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new zS.Scalar(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(r!==-1){let n=e.substring(r+1).replace(/_/g,"");if(n[n.length-1]==="0")t.minFractionDigits=n.length}return t},stringify:Li.stringifyNumber};XS.float=QS;XS.floatExp=JS;XS.floatNaN=WS});var hl=y(function(sC){var ml=Ze(),Nt=(e)=>typeof e==="bigint"||Number.isInteger(e);function Hr(e,t,r,{intAsBigInt:n}){let i=e[0];if(i==="-"||i==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return i==="-"?BigInt(-1)*s:s}let o=parseInt(e,r);return i==="-"?-1*o:o}function Ni(e,t,r){let{value:n}=e;if(Nt(n)){let i=n.toString(t);return n<0?"-"+r+i.substr(1):r+i}return ml.stringifyNumber(e)}var rC={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>Hr(e,2,2,r),stringify:(e)=>Ni(e,2,"0b")},nC={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>Hr(e,1,8,r),stringify:(e)=>Ni(e,8,"0")},iC={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>Hr(e,0,10,r),stringify:ml.stringifyNumber},oC={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>Hr(e,2,16,r),stringify:(e)=>Ni(e,16,"0x")};sC.int=iC;sC.intBin=rC;sC.intHex=oC;sC.intOct=nC});var $i=y(function(pC){var zr=A(),Gr=Se(),Yr=Re();class Ne extends Yr.YAMLMap{constructor(e){super(e);this.tag=Ne.tag}add(e){let t;if(zr.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new Gr.Pair(e.key,null);else t=new Gr.Pair(e,null);if(!Yr.findPair(this.items,t.key))this.items.push(t)}get(e,t){let r=Yr.findPair(this.items,e);return!t&&zr.isPair(r)?zr.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=Yr.findPair(this.items,e);if(r&&!t)this.items.splice(this.items.indexOf(r),1);else if(!r&&t)this.items.push(new Gr.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);else throw Error("Set items must all have null values")}static from(e,t,r){let{replacer:n}=r,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t){if(typeof n==="function")o=n.call(t,o,o);i.items.push(Gr.createPair(o,null,r))}return i}}Ne.tag="tag:yaml.org,2002:set";var dC={collection:"map",identify:(e)=>e instanceof Set,nodeClass:Ne,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>Ne.from(e,t,r),resolve(e,t){if(zr.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new Ne,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};pC.YAMLSet=Ne;pC.set=dC});var _i=y(function(bC){var mC=Ze();function Mi(e,t){let r=e[0],n=r==="-"||r==="+"?e.substring(1):e,i=(s)=>t?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function yl(e){let{value:t}=e,r=(s)=>s;if(typeof t==="bigint")r=(s)=>BigInt(s);else if(isNaN(t)||!isFinite(t))return mC.stringifyNumber(e);let n="";if(t<0)n="-",t*=r(-1);let i=r(60),o=[t%i];if(t<60)o.unshift(0);else if(t=(t-o[0])/i,o.unshift(t%i),t>=60)t=(t-o[0])/i,o.unshift(t);return n+o.map((s)=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var hC={identify:(e)=>typeof e==="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>Mi(e,r),stringify:yl},yC={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(e)=>Mi(e,!1),stringify:yl},bl={identify:(e)=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(bl.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),p=t[8];if(p&&p!=="Z"){let d=Mi(p,!1);if(Math.abs(d)<30)d*=60;l-=60000*d}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};bC.floatTime=yC;bC.intTime=hC;bC.timestamp=bl});var Cl=y(function(TC){var kC=Qe(),xC=qr(),wC=Xe(),vC=Ot(),EC=Ai(),Sl=fl(),Fi=gl(),Wr=hl(),IC=Tr(),PC=Ti(),AC=Kr(),DC=$i(),ji=_i(),OC=[kC.map,wC.seq,vC.string,xC.nullTag,Sl.trueTag,Sl.falseTag,Wr.intBin,Wr.intOct,Wr.int,Wr.intHex,Fi.floatNaN,Fi.floatExp,Fi.float,EC.binary,IC.merge,PC.omap,AC.pairs,DC.set,ji.intTime,ji.floatTime,ji.timestamp];TC.schema=OC});var Dl=y(function(BC){var wl=Qe(),NC=qr(),vl=Xe(),$C=Ot(),MC=Ri(),qi=xi(),Bi=vi(),_C=rl(),FC=il(),El=Ai(),$t=Tr(),Il=Ti(),Pl=Kr(),Rl=Cl(),Al=$i(),Jr=_i(),kl=new Map([["core",_C.schema],["failsafe",[wl.map,vl.seq,$C.string]],["json",FC.schema],["yaml11",Rl.schema],["yaml-1.1",Rl.schema]]),xl={binary:El.binary,bool:MC.boolTag,float:qi.float,floatExp:qi.floatExp,floatNaN:qi.floatNaN,floatTime:Jr.floatTime,int:Bi.int,intHex:Bi.intHex,intOct:Bi.intOct,intTime:Jr.intTime,map:wl.map,merge:$t.merge,null:NC.nullTag,omap:Il.omap,pairs:Pl.pairs,seq:vl.seq,set:Al.set,timestamp:Jr.timestamp},jC={"tag:yaml.org,2002:binary":El.binary,"tag:yaml.org,2002:merge":$t.merge,"tag:yaml.org,2002:omap":Il.omap,"tag:yaml.org,2002:pairs":Pl.pairs,"tag:yaml.org,2002:set":Al.set,"tag:yaml.org,2002:timestamp":Jr.timestamp};function qC(e,t,r){let n=kl.get(t);if(n&&!e)return r&&!n.includes($t.merge)?n.concat($t.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let o=Array.from(kl.keys()).filter((s)=>s!=="yaml11").map((s)=>JSON.stringify(s)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)i=i.concat(o);else if(typeof e==="function")i=e(i.slice());if(r)i=i.concat($t.merge);return i.reduce((o,s)=>{let a=typeof s==="string"?xl[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(xl).map((p)=>JSON.stringify(p)).join(", ");throw Error(`Unknown custom tag ${c}; use one of ${l}`)}if(!o.includes(a))o.push(a);return o},[])}BC.coreKnownTags=jC;BC.getTags=qC});var Ki=y(function(zC){var Ui=A(),KC=Qe(),HC=Xe(),GC=Ot(),Qr=Dl(),YC=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Vi{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:i,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?Qr.getTags(e,"compat"):e?Qr.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=n?Qr.coreKnownTags:{},this.tags=Qr.getTags(t,this.name,r),this.toStringOptions=s??null,Object.defineProperty(this,Ui.MAP,{value:KC.map}),Object.defineProperty(this,Ui.SCALAR,{value:GC.string}),Object.defineProperty(this,Ui.SEQ,{value:HC.seq}),this.sortMapEntries=typeof o==="function"?o:o===!0?YC:null}clone(){let e=Object.create(Vi.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}zC.Schema=Vi});var Ol=y(function(XC){var JC=A(),Hi=Pt(),Mt=vt();function QC(e,t){let r=[],n=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);if(c)r.push(c),n=!0;else if(e.directives.docStart)n=!0}if(n)r.push("---");let i=Hi.createStringifyContext(e,t),{commentString:o}=i.options;if(e.commentBefore){if(r.length!==1)r.unshift("");let c=o(e.commentBefore);r.unshift(Mt.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(JC.isNode(e.contents)){if(e.contents.spaceBefore&&n)r.push("");if(e.contents.commentBefore){let p=o(e.contents.commentBefore);r.push(Mt.indentComment(p,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,l=Hi.stringify(e.contents,i,()=>a=null,c);if(a)l+=Mt.lineComment(l,"",o(a));if((l[0]==="|"||l[0]===">")&&r[r.length-1]==="---")r[r.length-1]=`--- ${l}`;else r.push(l)}else r.push(Hi.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=o(e.comment);if(c.includes(`
|
|
57
|
+
`))r.push("..."),r.push(Mt.indentComment(c,""));else r.push(`... ${c}`)}else r.push("...");else{let c=e.comment;if(c&&s)c=c.replace(/^\n+/,"");if(c){if((!s||a)&&r[r.length-1]!=="")r.push("");r.push(Mt.indentComment(o(c),""))}}return r.join(`
|
|
58
58
|
`)+`
|
|
59
|
-
`}
|
|
59
|
+
`}XC.stringifyDocument=QC});var _t=y(function(aR){var eR=xt(),et=vr(),Q=A(),tR=Se(),rR=he(),nR=Ki(),iR=Ol(),Gi=kr(),oR=di(),sR=wt(),Yi=ui();class zi{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Q.NODE_TYPE,{value:Q.DOC});let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(r===void 0&&t)r=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"},r);this.options=i;let{version:o}=i;if(r?._directives){if(this.directives=r._directives.atDocument(),this.directives.yaml.explicit)o=this.directives.yaml.version}else this.directives=new Yi.Directives({version:o});this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,n,r)}clone(){let e=Object.create(zi.prototype,{[Q.NODE_TYPE]:{value:Q.DOC}});if(e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives)e.directives=this.directives.clone();if(e.schema=this.schema.clone(),e.contents=Q.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range)e.range=this.range.slice();return e}add(e){if(tt(this.contents))this.contents.add(e)}addIn(e,t){if(tt(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=Gi.anchorNames(this);e.anchor=!t||r.has(t)?Gi.findNewAnchor(t||"a",r):t}return new eR.Alias(e.anchor)}createNode(e,t,r){let n=void 0;if(typeof t==="function")e=t.call({"":e},"",e),n=t;else if(Array.isArray(t)){let g=(b)=>typeof b==="number"||b instanceof String||b instanceof Number,h=t.filter(g).map(String);if(h.length>0)t=t.concat(h);n=t}else if(r===void 0&&t)r=t,t=void 0;let{aliasDuplicateObjects:i,anchorPrefix:o,flow:s,keepUndefined:a,onTagObj:c,tag:l}=r??{},{onAnchor:p,setAnchors:d,sourceObjects:f}=Gi.createNodeAnchors(this,o||"a"),u={aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:p,onTagObj:c,replacer:n,schema:this.schema,sourceObjects:f},m=sR.createNode(e,l,u);if(s&&Q.isCollection(m))m.flow=!0;return d(),m}createPair(e,t,r={}){let n=this.createNode(e,null,r),i=this.createNode(t,null,r);return new tR.Pair(n,i)}delete(e){return tt(this.contents)?this.contents.delete(e):!1}deleteIn(e){if(et.isEmptyPath(e)){if(this.contents==null)return!1;return this.contents=null,!0}return tt(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Q.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){if(et.isEmptyPath(e))return!t&&Q.isScalar(this.contents)?this.contents.value:this.contents;return Q.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Q.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){if(et.isEmptyPath(e))return this.contents!==void 0;return Q.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){if(this.contents==null)this.contents=et.collectionFromPath(this.schema,[e],t);else if(tt(this.contents))this.contents.set(e,t)}setIn(e,t){if(et.isEmptyPath(e))this.contents=t;else if(this.contents==null)this.contents=et.collectionFromPath(this.schema,Array.from(e),t);else if(tt(this.contents))this.contents.setIn(e,t)}setSchema(e,t={}){if(typeof e==="number")e=String(e);let r;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new Yi.Directives({version:"1.1"});r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new Yi.Directives({version:e});r={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;r=null;break;default:{let n=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new nR.Schema(Object.assign(r,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n==="number"?n:100},a=rR.toJS(this.contents,t??"",s);if(typeof i==="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o==="function"?oR.applyReviver(o,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return iR.stringifyDocument(this,e)}}function tt(e){if(Q.isCollection(e))return!0;throw Error("Expected a YAML collection as document contents")}aR.Document=zi});var Ft=y(function(uR){class Xr extends Error{constructor(e,t,r,n){super();this.name=e,this.code=r,this.message=n,this.pos=t}}class Tl extends Xr{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class Ll extends Xr{constructor(e,t,r){super("YAMLWarning",e,t,r)}}var lR=(e,t)=>(r)=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map((a)=>t.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80)s=s.substring(0,79)+"\u2026";if(n>1&&/^ *$/.test(s.substring(0,o))){let a=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);if(a.length>80)a=a.substring(0,79)+`\u2026
|
|
60
60
|
`;s=a+s}if(/[^ ]/.test(s)){let a=1,c=r.linePos[1];if(c?.line===n&&c.col>i)a=Math.max(1,Math.min(c.col-i,80-o));let l=" ".repeat(o)+"^".repeat(a);r.message+=`:
|
|
61
61
|
|
|
62
62
|
${s}
|
|
63
63
|
${l}
|
|
64
|
-
`}};
|
|
65
|
-
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let r of t.start)if(r.type==="newline")return!0;if(t.sep){for(let r of t.sep)if(r.type==="newline")return!0}if(
|
|
66
|
-
`+g.comment;else a.comment=g.comment;continue}if(g.newlineAfterProp||
|
|
67
|
-
`+x.comment;else R.comment=x.comment;let
|
|
68
|
-
`+I.comment;else l.comment=I.comment;d=I.end;continue}if(!s&&r.options.strict&&
|
|
69
|
-
`+O;else k.comment=O;I.comment=I.comment.substring(O.length+1)}}}if(!s&&!
|
|
70
|
-
`+N.comment;else k.comment=N.comment;let
|
|
71
|
-
`+h.comment;else l.comment=h.comment;l.range=[n.offset,g,h.offset]}else l.range=[n.offset,g,g];return l}
|
|
72
|
-
`.repeat(Math.max(1,s.length-1)):"",h=n+i.length;if(t.source)h+=t.source.length;return{value:g,type:o,comment:i.comment,range:[n,h,h]}}let c=t.indent+i.indent,l=t.offset+i.length,
|
|
73
|
-
`;for(let g=
|
|
74
|
-
`;else if(h.length>c||b[0]==="\t"){if(
|
|
75
|
-
`;else if(!u&&
|
|
76
|
-
`)
|
|
77
|
-
|
|
78
|
-
`;d+=
|
|
79
|
-
`,u=!0}else if(b==="")if(
|
|
64
|
+
`}};uR.YAMLError=Xr;uR.YAMLParseError=Tl;uR.YAMLWarning=Ll;uR.prettifyError=lR});var jt=y(function(hR){function mR(e,{flow:t,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,p=a,d="",f="",u=!1,m=!1,g=null,h=null,b=null,R=null,x=null,w=null,v=null;for(let k of e){if(m){if(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma")o(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");m=!1}if(g){if(l&&k.type!=="comment"&&k.type!=="newline")o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation");g=null}switch(k.type){case"space":if(!t&&(r!=="doc-start"||n?.type!=="flow-collection")&&k.source.includes("\t"))g=k;p=!0;break;case"comment":{if(!p)o(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=k.source.substring(1)||" ";if(!d)d=N;else d+=f+N;f="",l=!1;break}case"newline":if(l){if(d)d+=k.source;else if(!w||r!=="seq-item-ind")c=!0}else f+=k.source;if(l=!0,u=!0,h||b)R=k;p=!0;break;case"anchor":if(h)o(k,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(k.source.endsWith(":"))o(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);h=k,v??(v=k.offset),l=!1,p=!1,m=!0;break;case"tag":{if(b)o(k,"MULTIPLE_TAGS","A node can have at most one tag");b=k,v??(v=k.offset),l=!1,p=!1,m=!0;break}case r:if(h||b)o(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`);if(w)o(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${t??"collection"}`);w=k,l=r==="seq-item-ind"||r==="explicit-key-ind",p=!1;break;case"comma":if(t){if(x)o(k,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);x=k,l=!1,p=!1;break}default:o(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),l=!1,p=!1}}let I=e[e.length-1],O=I?I.offset+I.source.length:i;if(m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!==""))o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(g&&(l&&g.indent<=s||n?.type==="block-map"||n?.type==="block-seq"))o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:x,found:w,spaceBefore:c,comment:d,hasNewline:u,anchor:h,tag:b,newlineAfterProp:R,end:O,start:v??O}}hR.resolveProps=mR});var Zr=y(function(bR){function Wi(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
65
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let r of t.start)if(r.type==="newline")return!0;if(t.sep){for(let r of t.sep)if(r.type==="newline")return!0}if(Wi(t.key)||Wi(t.value))return!0}return!1;default:return!0}}bR.containsNewline=Wi});var Ji=y(function(kR){var CR=Zr();function RR(e,t,r){if(t?.type==="flow-collection"){let n=t.end[0];if(n.indent===e&&(n.source==="]"||n.source==="}")&&CR.containsNewline(t))r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}kR.flowIndentCheck=RR});var Qi=y(function(vR){var Nl=A();function wR(e,t,r){let{uniqueKeys:n}=e.options;if(n===!1)return!1;let i=typeof n==="function"?n:(o,s)=>o===s||Nl.isScalar(o)&&Nl.isScalar(s)&&o.value===s.value;return t.some((o)=>i(o.key,r))}vR.mapIncludes=wR});var jl=y(function(OR){var $l=Se(),IR=Re(),Ml=jt(),PR=Zr(),_l=Ji(),AR=Qi(),Fl="All mapping items must start at the same column";function DR({composeNode:e,composeEmptyNode:t},r,n,i,o){let a=new(o?.nodeClass??IR.YAMLMap)(r.schema);if(r.atRoot)r.atRoot=!1;let c=n.offset,l=null;for(let p of n.items){let{start:d,key:f,sep:u,value:m}=p,g=Ml.resolveProps(d,{indicator:"explicit-key-ind",next:f??u?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),h=!g.found;if(h){if(f){if(f.type==="block-seq")i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in f&&f.indent!==n.indent)i(c,"BAD_INDENT",Fl)}if(!g.anchor&&!g.tag&&!u){if(l=g.end,g.comment)if(a.comment)a.comment+=`
|
|
66
|
+
`+g.comment;else a.comment=g.comment;continue}if(g.newlineAfterProp||PR.containsNewline(f))i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(g.found?.indent!==n.indent)i(c,"BAD_INDENT",Fl);r.atKey=!0;let b=g.end,R=f?e(r,f,g,i):t(r,b,d,null,g,i);if(r.schema.compat)_l.flowIndentCheck(n.indent,f,i);if(r.atKey=!1,AR.mapIncludes(r,a.items,R))i(b,"DUPLICATE_KEY","Map keys must be unique");let x=Ml.resolveProps(u??[],{indicator:"map-value-ind",next:m,offset:R.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=x.end,x.found){if(h){if(m?.type==="block-map"&&!x.hasNewline)i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(r.options.strict&&g.start<x.found.offset-1024)i(R.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let w=m?e(r,m,x,i):t(r,c,u,null,x,i);if(r.schema.compat)_l.flowIndentCheck(n.indent,m,i);c=w.range[2];let v=new $l.Pair(R,w);if(r.options.keepSourceTokens)v.srcToken=p;a.items.push(v)}else{if(h)i(R.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(x.comment)if(R.comment)R.comment+=`
|
|
67
|
+
`+x.comment;else R.comment=x.comment;let w=new $l.Pair(R);if(r.options.keepSourceTokens)w.srcToken=p;a.items.push(w)}}if(l&&l<c)i(l,"IMPOSSIBLE","Map comment with trailing content");return a.range=[n.offset,c,l??c],a}OR.resolveBlockMap=DR});var ql=y(function(_R){var LR=ke(),NR=jt(),$R=Ji();function MR({composeNode:e,composeEmptyNode:t},r,n,i,o){let a=new(o?.nodeClass??LR.YAMLSeq)(r.schema);if(r.atRoot)r.atRoot=!1;if(r.atKey)r.atKey=!1;let c=n.offset,l=null;for(let{start:p,value:d}of n.items){let f=NR.resolveProps(p,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)if(d?.type==="block-seq")i(f.end,"BAD_INDENT","All sequence items must start at the same column");else i(c,"MISSING_CHAR","Sequence item without - indicator");else{if(l=f.end,f.comment)a.comment=f.comment;continue}let u=d?e(r,d,f,i):t(r,f.end,p,null,f,i);if(r.schema.compat)$R.flowIndentCheck(n.indent,d,i);c=u.range[2],a.items.push(u)}return a.range=[n.offset,c,l??c],a}_R.resolveBlockSeq=MR});var rt=y(function(qR){function jR(e,t,r,n){let i="";if(e){let o=!1,s="";for(let a of e){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{if(r&&!o)n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=c.substring(1)||" ";if(!i)i=p;else i+=s+p;s="";break}case"newline":if(i)s+=c;o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:i,offset:t}}qR.resolveEnd=jR});var Vl=y(function(WR){var UR=A(),VR=Se(),Bl=Re(),KR=ke(),HR=rt(),Ul=jt(),GR=Zr(),YR=Qi(),Xi="Block collections are not allowed within flow collections",Zi=(e)=>e&&(e.type==="block-map"||e.type==="block-seq");function zR({composeNode:e,composeEmptyNode:t},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",l=new(o?.nodeClass??(s?Bl.YAMLMap:KR.YAMLSeq))(r.schema);l.flow=!0;let p=r.atRoot;if(p)r.atRoot=!1;if(r.atKey)r.atKey=!1;let d=n.offset+n.start.source.length;for(let h=0;h<n.items.length;++h){let b=n.items[h],{start:R,key:x,sep:w,value:v}=b,I=Ul.resolveProps(R,{flow:a,indicator:"explicit-key-ind",next:x??w?.[0],offset:d,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!I.found){if(!I.anchor&&!I.tag&&!w&&!v){if(h===0&&I.comma)i(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(h<n.items.length-1)i(I.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`);if(I.comment)if(l.comment)l.comment+=`
|
|
68
|
+
`+I.comment;else l.comment=I.comment;d=I.end;continue}if(!s&&r.options.strict&&GR.containsNewline(x))i(x,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0){if(I.comma)i(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`)}else{if(!I.comma)i(I.start,"MISSING_CHAR",`Missing , between ${a} items`);if(I.comment){let O="";e:for(let k of R)switch(k.type){case"comma":case"space":break;case"comment":O=k.source.substring(1);break e;default:break e}if(O){let k=l.items[l.items.length-1];if(UR.isPair(k))k=k.value??k.key;if(k.comment)k.comment+=`
|
|
69
|
+
`+O;else k.comment=O;I.comment=I.comment.substring(O.length+1)}}}if(!s&&!w&&!I.found){let O=v?e(r,v,I,i):t(r,I.end,w,null,I,i);if(l.items.push(O),d=O.range[2],Zi(v))i(O.range,"BLOCK_IN_FLOW",Xi)}else{r.atKey=!0;let O=I.end,k=x?e(r,x,I,i):t(r,O,R,null,I,i);if(Zi(x))i(k.range,"BLOCK_IN_FLOW",Xi);r.atKey=!1;let N=Ul.resolveProps(w??[],{flow:a,indicator:"map-value-ind",next:v,offset:k.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(N.found){if(!s&&!I.found&&r.options.strict){if(w)for(let M of w){if(M===N.found)break;if(M.type==="newline"){i(M,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(I.start<N.found.offset-1024)i(N.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(v)if("source"in v&&v.source?.[0]===":")i(v,"MISSING_CHAR",`Missing space after : in ${a}`);else i(N.start,"MISSING_CHAR",`Missing , or : between ${a} items`);let ge=v?e(r,v,N,i):N.found?t(r,N.end,w,null,N,i):null;if(ge){if(Zi(v))i(ge.range,"BLOCK_IN_FLOW",Xi)}else if(N.comment)if(k.comment)k.comment+=`
|
|
70
|
+
`+N.comment;else k.comment=N.comment;let Be=new VR.Pair(k,ge);if(r.options.keepSourceTokens)Be.srcToken=b;if(s){let M=l;if(YR.mapIncludes(r,M.items,k))i(O,"DUPLICATE_KEY","Map keys must be unique");M.items.push(Be)}else{let M=new Bl.YAMLMap(r.schema);M.flow=!0,M.items.push(Be);let zo=(ge??k).range;M.range=[k.range[0],zo[1],zo[2]],l.items.push(M)}d=ge?ge.range[2]:N.end}}let f=s?"}":"]",[u,...m]=n.end,g=d;if(u?.source===f)g=u.offset+u.source.length;else{let h=a[0].toUpperCase()+a.substring(1),b=p?`${h} must end with a ${f}`:`${h} in block collection must be sufficiently indented and end with a ${f}`;if(i(d,p?"MISSING_CHAR":"BAD_INDENT",b),u&&u.source.length!==1)m.unshift(u)}if(m.length>0){let h=HR.resolveEnd(m,g,r.options.strict,i);if(h.comment)if(l.comment)l.comment+=`
|
|
71
|
+
`+h.comment;else l.comment=h.comment;l.range=[n.offset,g,h.offset]}else l.range=[n.offset,g,g];return l}WR.resolveFlowCollection=zR});var Kl=y(function(ok){var QR=A(),XR=L(),ZR=Re(),ek=ke(),tk=jl(),rk=ql(),nk=Vl();function eo(e,t,r,n,i,o){let s=r.type==="block-map"?tk.resolveBlockMap(e,t,r,n,o):r.type==="block-seq"?rk.resolveBlockSeq(e,t,r,n,o):nk.resolveFlowCollection(e,t,r,n,o),a=s.constructor;if(i==="!"||i===a.tagName)return s.tag=a.tagName,s;if(i)s.tag=i;return s}function ik(e,t,r,n,i){let o=n.tag,s=!o?null:t.directives.tagName(o.source,(f)=>i(o,"TAG_RESOLVE_FAILED",f));if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:u}=n,m=f&&o?f.offset>o.offset?f:o:f??o;if(m&&(!u||u.offset<m.offset))i(m,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===ZR.YAMLMap.tagName&&a==="map"||s===ek.YAMLSeq.tagName&&a==="seq")return eo(e,t,r,i,s);let c=t.schema.tags.find((f)=>f.tag===s&&f.collection===a);if(!c){let f=t.schema.knownTags[s];if(f?.collection===a)t.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else{if(f)i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0);else i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0);return eo(e,t,r,i,s)}}let l=eo(e,t,r,i,s,c),p=c.resolve?.(l,(f)=>i(o,"TAG_RESOLVE_FAILED",f),t.options)??l,d=QR.isNode(p)?p:new XR.Scalar(p);if(d.range=l.range,d.tag=s,c?.format)d.format=c.format;return d}ok.composeCollection=ik});var ro=y(function(uk){var to=L();function ak(e,t,r){let n=t.offset,i=ck(t,e.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?to.Scalar.BLOCK_FOLDED:to.Scalar.BLOCK_LITERAL,s=t.source?lk(t.source):[],a=s.length;for(let g=s.length-1;g>=0;--g){let h=s[g][1];if(h===""||h==="\r")a=g;else break}if(a===0){let g=i.chomp==="+"&&s.length>0?`
|
|
72
|
+
`.repeat(Math.max(1,s.length-1)):"",h=n+i.length;if(t.source)h+=t.source.length;return{value:g,type:o,comment:i.comment,range:[n,h,h]}}let c=t.indent+i.indent,l=t.offset+i.length,p=0;for(let g=0;g<a;++g){let[h,b]=s[g];if(b===""||b==="\r"){if(i.indent===0&&h.length>c)c=h.length}else{if(h.length<c)r(l+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(i.indent===0)c=h.length;if(p=g,c===0&&!e.atRoot)r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=h.length+b.length+1}for(let g=s.length-1;g>=a;--g)if(s[g][0].length>c)a=g+1;let d="",f="",u=!1;for(let g=0;g<p;++g)d+=s[g][0].slice(c)+`
|
|
73
|
+
`;for(let g=p;g<a;++g){let[h,b]=s[g];l+=h.length+b.length+1;let R=b[b.length-1]==="\r";if(R)b=b.slice(0,-1);if(b&&h.length<c){let w=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-b.length-(R?2:1),"BAD_INDENT",w),h=""}if(o===to.Scalar.BLOCK_LITERAL)d+=f+h.slice(c)+b,f=`
|
|
74
|
+
`;else if(h.length>c||b[0]==="\t"){if(f===" ")f=`
|
|
75
|
+
`;else if(!u&&f===`
|
|
76
|
+
`)f=`
|
|
77
|
+
|
|
78
|
+
`;d+=f+h.slice(c)+b,f=`
|
|
79
|
+
`,u=!0}else if(b==="")if(f===`
|
|
80
80
|
`)d+=`
|
|
81
|
-
`;else
|
|
82
|
-
`;else d+=
|
|
81
|
+
`;else f=`
|
|
82
|
+
`;else d+=f+b,f=" ",u=!1}switch(i.chomp){case"-":break;case"+":for(let g=a;g<s.length;++g)d+=`
|
|
83
83
|
`+s[g][0].slice(c);if(d[d.length-1]!==`
|
|
84
84
|
`)d+=`
|
|
85
85
|
`;break;default:d+=`
|
|
86
|
-
`}let m=n+i.length+t.source.length;return{value:d,type:o,comment:i.comment,range:[n,m,m]}}function
|
|
86
|
+
`}let m=n+i.length+t.source.length;return{value:d,type:o,comment:i.comment,range:[n,m,m]}}function ck({offset:e,props:t},r,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],o=i[0],s=0,a="",c=-1;for(let f=1;f<i.length;++f){let u=i[f];if(!a&&(u==="-"||u==="+"))a=u;else{let m=Number(u);if(!s&&m)s=m;else if(c===-1)c=e+f}}if(c!==-1)n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,p="",d=i.length;for(let f=1;f<t.length;++f){let u=t[f];switch(u.type){case"space":l=!0;case"newline":d+=u.source.length;break;case"comment":if(r&&!l)n(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");d+=u.source.length,p=u.source.substring(1);break;case"error":n(u,"UNEXPECTED_TOKEN",u.message),d+=u.source.length;break;default:{let m=`Unexpected token in block scalar header: ${u.type}`;n(u,"UNEXPECTED_TOKEN",m);let g=u.source;if(g&&typeof g==="string")d+=g.length}}}return{mode:o,indent:s,chomp:a,comment:p,length:d}}function lk(e){let t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),o=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let s=1;s<t.length;s+=2)o.push([t[s],t[s+1]]);return o}uk.resolveBlockScalar=ak});var io=y(function(Ck){var no=L(),pk=rt();function fk(e,t,r){let{offset:n,type:i,source:o,end:s}=e,a,c,l=(f,u,m)=>r(n+f,u,m);switch(i){case"scalar":a=no.Scalar.PLAIN,c=gk(o,l);break;case"single-quoted-scalar":a=no.Scalar.QUOTE_SINGLE,c=mk(o,l);break;case"double-quoted-scalar":a=no.Scalar.QUOTE_DOUBLE,c=hk(o,l);break;default:return r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let p=n+o.length,d=pk.resolveEnd(s,p,t,r);return{value:c,type:a,comment:d.comment,range:[n,p,d.offset]}}function gk(e,t){let r="";switch(e[0]){case"\t":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${e[0]}`;break}case"@":case"`":{r=`reserved character ${e[0]}`;break}}if(r)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`);return Hl(e)}function mk(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return Hl(e.slice(1,-1)).replace(/''/g,"'")}function Hl(e){let t=/(.*?)\r?\n/sy,r=t.exec(e);if(!r)return e;let n,i;try{n=new RegExp("(?<![ \t])[ \t]+$"),i=new RegExp("^[ \t]+|(?<![ \t])[ \t]+$","g")}catch{n=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let o=r[1].replace(n,""),s=" ",a=t.lastIndex;while(r=t.exec(e)){let l=r[1].replace(i,"");if(l==="")if(s===`
|
|
87
87
|
`)o+=s;else s=`
|
|
88
|
-
`;else o+=s+l,s=" ";a=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=a,r=c.exec(e),o+s+(r?.[1]??"")}function
|
|
88
|
+
`;else o+=s+l,s=" ";a=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=a,r=c.exec(e),o+s+(r?.[1]??"")}function hk(e,t){let r="";for(let n=1;n<e.length-1;++n){let i=e[n];if(i==="\r"&&e[n+1]===`
|
|
89
89
|
`)continue;if(i===`
|
|
90
|
-
`){let{fold:o,offset:s}=
|
|
90
|
+
`){let{fold:o,offset:s}=yk(e,n);r+=o,n=s}else if(i==="\\"){let o=e[++n],s=bk[o];if(s)r+=s;else if(o===`
|
|
91
91
|
`){o=e[n+1];while(o===" "||o==="\t")o=e[++n+1]}else if(o==="\r"&&e[n+1]===`
|
|
92
|
-
`){o=e[++n+1];while(o===" "||o==="\t")o=e[++n+1]}else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;r+=
|
|
92
|
+
`){o=e[++n+1];while(o===" "||o==="\t")o=e[++n+1]}else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;r+=Sk(e,n+1,a,t),n+=a}else{let a=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(i===" "||i==="\t"){let o=n,s=e[n+1];while(s===" "||s==="\t")s=e[++n+1];if(s!==`
|
|
93
93
|
`&&!(s==="\r"&&e[n+2]===`
|
|
94
|
-
`))r+=n>o?e.slice(o,n+1):i}else r+=i}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return r}function
|
|
94
|
+
`))r+=n>o?e.slice(o,n+1):i}else r+=i}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return r}function yk(e,t){let r="",n=e[t+1];while(n===" "||n==="\t"||n===`
|
|
95
95
|
`||n==="\r"){if(n==="\r"&&e[t+2]!==`
|
|
96
96
|
`)break;if(n===`
|
|
97
97
|
`)r+=`
|
|
98
|
-
`;t+=1,n=e[t+1]}if(!r)r=" ";return{fold:r,offset:t}}var
|
|
99
|
-
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
98
|
+
`;t+=1,n=e[t+1]}if(!r)r=" ";return{fold:r,offset:t}}var bk={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Sk(e,t,r,n){let i=e.substr(t,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Ck.resolveFlowScalar=fk});var Yl=y(function(Ik){var $e=A(),Gl=L(),kk=ro(),xk=io();function wk(e,t,r,n){let{value:i,type:o,comment:s,range:a}=t.type==="block-scalar"?kk.resolveBlockScalar(e,t,n):xk.resolveFlowScalar(t,e.options.strict,n),c=r?e.directives.tagName(r.source,(d)=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;if(e.options.stringKeys&&e.atKey)l=e.schema[$e.SCALAR];else if(c)l=vk(e.schema,i,c,r,n);else if(t.type==="scalar")l=Ek(e,i,t,n);else l=e.schema[$e.SCALAR];let p;try{let d=l.resolve(i,(f)=>n(r??t,"TAG_RESOLVE_FAILED",f),e.options);p=$e.isScalar(d)?d:new Gl.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??t,"TAG_RESOLVE_FAILED",f),p=new Gl.Scalar(i)}if(p.range=a,p.source=i,o)p.type=o;if(c)p.tag=c;if(l.format)p.format=l.format;if(s)p.comment=s;return p}function vk(e,t,r,n,i){if(r==="!")return e[$e.SCALAR];let o=[];for(let a of e.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(t))return a;let s=e.knownTags[r];if(s&&!s.collection)return e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s;return i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),e[$e.SCALAR]}function Ek({atKey:e,directives:t,schema:r},n,i,o){let s=r.tags.find((a)=>(a.default===!0||e&&a.default==="key")&&a.test?.test(n))||r[$e.SCALAR];if(r.compat){let a=r.compat.find((c)=>c.default&&c.test?.test(n))??r[$e.SCALAR];if(s.tag!==a.tag){let c=t.tagString(s.tag),l=t.tagString(a.tag),p=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",p,!0)}}return s}Ik.composeScalar=wk});var zl=y(function(Dk){function Ak(e,t,r){if(t){r??(r=t.length);for(let n=r-1;n>=0;--n){let i=t[n];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}i=t[++n];while(i?.type==="space")e+=i.source.length,i=t[++n];break}}return e}Dk.emptyScalarPosition=Ak});var Ql=y(function(jk){var Tk=xt(),Lk=A(),Nk=Kl(),Wl=Yl(),$k=rt(),Mk=zl(),_k={composeNode:Jl,composeEmptyNode:oo};function Jl(e,t,r,n){let i=e.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,p=!0;switch(t.type){case"alias":if(l=Fk(e,t,n),a||c)n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(l=Wl.composeScalar(e,t,c,n),a)l.anchor=a.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(l=Nk.composeCollection(_k,e,t,r,n),a)l.anchor=a.source.substring(1)}catch(d){let f=d instanceof Error?d.message:String(d);n(t,"RESOURCE_EXHAUSTION",f)}break;default:{let d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",d),p=!1}}if(l??(l=oo(e,t.offset,void 0,null,r,n)),a&&l.anchor==="")n(a,"BAD_ALIAS","Anchor cannot be an empty string");if(i&&e.options.stringKeys&&(!Lk.isScalar(l)||typeof l.value!=="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str"))n(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(o)l.spaceBefore=!0;if(s)if(t.type==="scalar"&&t.source==="")l.comment=s;else l.commentBefore=s;if(e.options.keepSourceTokens&&p)l.srcToken=t;return l}function oo(e,t,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let p={type:"scalar",offset:Mk.emptyScalarPosition(t,r,n),indent:-1,source:""},d=Wl.composeScalar(e,p,a,l);if(s){if(d.anchor=s.source.substring(1),d.anchor==="")l(s,"BAD_ALIAS","Anchor cannot be an empty string")}if(i)d.spaceBefore=!0;if(o)d.comment=o,d.range[2]=c;return d}function Fk({options:e},{offset:t,source:r,end:n},i){let o=new Tk.Alias(r.substring(1));if(o.source==="")i(t,"BAD_ALIAS","Alias cannot be an empty string");if(o.source.endsWith(":"))i(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+r.length,a=$k.resolveEnd(n,s,e.strict,i);if(o.range=[t,s,a.offset],a.comment)o.comment=a.comment;return o}jk.composeEmptyNode=oo;jk.composeNode=Jl});var Zl=y(function(Gk){var Uk=_t(),Xl=Ql(),Vk=rt(),Kk=jt();function Hk(e,t,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:t},e),c=new Uk.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},p=Kk.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});if(p.found){if(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline)s(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}c.contents=i?Xl.composeNode(l,i,p,s):Xl.composeEmptyNode(l,p.end,n,null,p,s);let d=c.contents.range[2],f=Vk.resolveEnd(o,d,!1,s);if(f.comment)c.comment=f.comment;return c.range=[r,d,f.offset],c}Gk.composeDoc=Hk});var so=y(function(Zk){var zk=Xt("process"),Wk=ui(),Jk=_t(),qt=Ft(),eu=A(),Qk=Zl(),Xk=rt();function Bt(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:r}=e;return[t,t+(typeof r==="string"?r.length:1)]}function tu(e){let t="",r=!1,n=!1;for(let i=0;i<e.length;++i){let o=e[i];switch(o[0]){case"#":t+=(t===""?"":n?`
|
|
100
100
|
|
|
101
101
|
`:`
|
|
102
|
-
`)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":if(e[i+1]?.[0]!=="#")i+=1;r=!1;break;default:if(!r)n=!0;r=!1}}return{comment:t,afterEmptyLine:n}}class
|
|
103
|
-
${r}`:r;else if(n||e.directives.docStart||!i)e.commentBefore=r;else if(
|
|
102
|
+
`)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":if(e[i+1]?.[0]!=="#")i+=1;r=!1;break;default:if(!r)n=!0;r=!1}}return{comment:t,afterEmptyLine:n}}class ru{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,n,i)=>{let o=Bt(t);if(i)this.warnings.push(new qt.YAMLWarning(o,r,n));else this.errors.push(new qt.YAMLParseError(o,r,n))},this.directives=new Wk.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:n}=tu(this.prelude);if(r){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${r}`:r;else if(n||e.directives.docStart||!i)e.commentBefore=r;else if(eu.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];if(eu.isPair(o))o=o.key;let s=o.commentBefore;o.commentBefore=s?`${r}
|
|
104
104
|
${s}`:r}else{let o=i.commentBefore;i.commentBefore=o?`${r}
|
|
105
|
-
${o}`:r}}if(t){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:
|
|
106
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
105
|
+
${o}`:r}}if(t){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:tu(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let n of e)yield*this.next(n);yield*this.end(t,r)}*next(e){if(zk.env.LOG_STREAM)console.dir(e,{depth:null});switch(e.type){case"directive":this.directives.add(e.source,(t,r,n)=>{let i=Bt(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Qk.composeDoc(this.options,this.directives,e,this.onError);if(this.atDirectives&&!t.directives.docStart)this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(t,!1),this.doc)yield this.doc;this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new qt.YAMLParseError(Bt(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(r);else this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){this.errors.push(new qt.YAMLParseError(Bt(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=Xk.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
|
|
106
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new qt.YAMLParseError(Bt(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 r=Object.assign({_directives:this.directives},this.options),n=new Jk.Document(void 0,r);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");n.range=[0,t,t],this.decorate(n,!1),yield n}}}Zk.Composer=ru});var ou=y(function(cx){var tx=ro(),rx=io(),nx=Ft(),nu=It();function ix(e,t=!0,r){if(e){let n=(i,o,s)=>{let a=typeof i==="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new nx.YAMLParseError([a,a+1],o,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return rx.resolveFlowScalar(e,t,n);case"block-scalar":return tx.resolveBlockScalar({options:{strict:t}},e,n)}}return null}function ox(e,t){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=t,a=nu.stringifyString({type:s,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
107
107
|
`}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
|
|
108
|
-
`),
|
|
109
|
-
`,
|
|
110
|
-
`});return{type:"block-scalar",offset:o,indent:n,props:
|
|
108
|
+
`),p=a.substring(0,l),d=a.substring(l+1)+`
|
|
109
|
+
`,f=[{type:"block-scalar-header",offset:o,indent:n,source:p}];if(!iu(f,c))f.push({type:"newline",offset:-1,indent:n,source:`
|
|
110
|
+
`});return{type:"block-scalar",offset:o,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function sx(e,t,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in e?e.indent:null;if(n&&typeof a==="number")a+=2;if(!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.props[0];if(l.type!=="block-scalar-header")throw Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=nu.stringifyString({type:s,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":ax(e,c);break;case'"':ao(e,c,"double-quoted-scalar");break;case"'":ao(e,c,"single-quoted-scalar");break;default:ao(e,c,"scalar")}}function ax(e,t){let r=t.indexOf(`
|
|
111
111
|
`),n=t.substring(0,r),i=t.substring(r+1)+`
|
|
112
|
-
`;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw Error("Invalid block scalar header");o.source=n,e.source=i}else{let{offset:o}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];if(!
|
|
113
|
-
`});for(let c of Object.keys(e))if(c!=="type"&&c!=="offset")delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:i})}}function
|
|
114
|
-
`};delete e.items,Object.assign(e,{type:r,source:t,end:[i]});break}default:{let n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter((o)=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))if(o!=="type"&&o!=="offset")delete e[o];Object.assign(e,{type:r,indent:n,source:t,end:i})}}}
|
|
112
|
+
`;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw Error("Invalid block scalar header");o.source=n,e.source=i}else{let{offset:o}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];if(!iu(a,"end"in e?e.end:void 0))a.push({type:"newline",offset:-1,indent:s,source:`
|
|
113
|
+
`});for(let c of Object.keys(e))if(c!=="type"&&c!=="offset")delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:i})}}function iu(e,t){if(t)for(let r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}function ao(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{let n=e.props.slice(1),i=t.length;if(e.props[0].type==="block-scalar-header")i-=e.props[0].source.length;for(let o of n)o.offset+=i;delete e.props,Object.assign(e,{type:r,source:t,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
114
|
+
`};delete e.items,Object.assign(e,{type:r,source:t,end:[i]});break}default:{let n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter((o)=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))if(o!=="type"&&o!=="offset")delete e[o];Object.assign(e,{type:r,indent:n,source:t,end:i})}}}cx.createScalarToken=ox;cx.resolveAsScalar=ix;cx.setScalarValue=sx});var su=y(function(fx){var px=(e)=>("type"in e)?tn(e):en(e);function tn(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=tn(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=en(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=en(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=en(e);if(e.end)for(let r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let r of e.end)t+=r.source;return t}}}function en({start:e,key:t,sep:r,value:n}){let i="";for(let o of e)i+=o.source;if(t)i+=tn(t);if(r)for(let o of r)i+=o.source;if(n)i+=tn(n);return i}fx.stringify=px});var lu=y(function(hx){var co=Symbol("break visit"),mx=Symbol("skip children"),au=Symbol("remove item");function Me(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};cu(Object.freeze([]),e,t)}Me.BREAK=co;Me.SKIP=mx;Me.REMOVE=au;Me.itemAtPath=(e,t)=>{let r=e;for(let[n,i]of t){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};Me.parentCollection=(e,t)=>{let r=Me.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw Error("Parent collection not found")};function cu(e,t,r){let n=r(t,e);if(typeof n==="symbol")return n;for(let i of["key","value"]){let o=t[i];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=cu(Object.freeze(e.concat([[i,s]])),o.items[s],r);if(typeof a==="number")s=a-1;else if(a===co)return co;else if(a===au)o.items.splice(s,1),s-=1}if(typeof n==="function"&&i==="key")n=n(t,e)}}return typeof n==="function"?n(t,e):n}hx.visit=Me});var rn=y(function(wx){var lo=ou(),bx=su(),Sx=lu(),uo="\uFEFF",po="\x02",fo="\x18",go="\x1F",Cx=(e)=>!!e&&("items"in e),Rx=(e)=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function kx(e){switch(e){case uo:return"<BOM>";case po:return"<DOC>";case fo:return"<FLOW_END>";case go:return"<SCALAR>";default:return JSON.stringify(e)}}function xx(e){switch(e){case uo:return"byte-order-mark";case po:return"doc-mode";case fo:return"flow-error-end";case go:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
115
115
|
`:case`\r
|
|
116
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}
|
|
117
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
118
|
-
\r `),
|
|
116
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}wx.createScalarToken=lo.createScalarToken;wx.resolveAsScalar=lo.resolveAsScalar;wx.setScalarValue=lo.setScalarValue;wx.stringify=bx.stringify;wx.visit=Sx.visit;wx.BOM=uo;wx.DOCUMENT=po;wx.FLOW_END=fo;wx.SCALAR=go;wx.isCollection=Cx;wx.isScalar=Rx;wx.prettyToken=kx;wx.tokenType=xx});var ho=y(function(qx){var Ut=rn();function ne(e){switch(e){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case"\t":return!0;default:return!1}}var uu=new Set("0123456789ABCDEFabcdef"),Fx=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),nn=new Set(",[]{}"),jx=new Set(` ,[]{}
|
|
118
|
+
\r `),mo=(e)=>!e||jx.has(e);class du{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 r=this.next??"stream";while(r&&(t||this.hasChars(1)))r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t===`
|
|
119
119
|
`)return!0;if(t==="\r")return this.buffer[e+1]===`
|
|
120
120
|
`;return!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;while(t===" ")t=this.buffer[++r+e];if(t==="\r"){let n=this.buffer[r+e+1];if(n===`
|
|
121
121
|
`||!n&&!this.atEnd)return e+r+1}return t===`
|
|
122
122
|
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&ne(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;if(typeof e!=="number"||e!==-1&&e<this.pos)e=this.buffer.indexOf(`
|
|
123
|
-
`,this.pos),this.lineEndPos=e;if(e===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[e-1]==="\r")e-=1;return this.buffer.substring(this.pos,e)}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===
|
|
123
|
+
`,this.pos),this.lineEndPos=e;if(e===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[e-1]==="\r")e-=1;return this.buffer.substring(this.pos,e)}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Ut.BOM)yield*this.pushCount(1),e=e.substring(1);if(e[0]==="%"){let t=e.length,r=e.indexOf("#");while(r!==-1){let i=e[r-1];if(i===" "||i==="\t"){t=r-1;break}else r=e.indexOf("#",r+1)}while(!0){let i=e[t-1];if(i===" "||i==="\t")t-=1;else break}let n=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Ut.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==="...")&&ne(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ne(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ne(t)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(mo),"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,r=-1;do{if(e=yield*this.pushNewline(),e>0)t=yield*this.pushSpaces(!1),this.indentValue=r=t;else t=0;t+=yield*this.pushSpaces(!0)}while(e+t>0);let n=this.getLine();if(n===null)return this.setNext("flow");if(r!==-1&&r<this.indentNext&&n[0]!=="#"||r===0&&(n.startsWith("---")||n.startsWith("..."))&&ne(n[3])){if(!(r===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield Ut.FLOW_END,yield*this.parseLineStart()}let i=0;while(n[i]===",")i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),n[i]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(mo),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||ne(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==="'")while(t!==-1&&this.buffer[t+1]==="'")t=this.buffer.indexOf("'",t+2);else while(t!==-1){let i=0;while(this.buffer[t-1-i]==="\\")i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),n=r.indexOf(`
|
|
124
124
|
`,this.pos);if(n!==-1){while(n!==-1){let i=this.continueScalar(n+1);if(i===-1)break;n=r.indexOf(`
|
|
125
125
|
`,i)}if(n!==-1)t=n-(r[n-1]==="\r"?2:1)}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;while(!0){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil((t)=>ne(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":t+=1;break;case`
|
|
126
126
|
`:e=i,t=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
127
127
|
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=t;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
128
128
|
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;r=this.buffer[n];while(r===" ")r=this.buffer[++n];if(r==="\t"){while(r==="\t"||r===" "||r==="\r"||r===`
|
|
129
129
|
`)r=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];if(o==="\r")o=this.buffer[--i];let s=i;while(o===" ")o=this.buffer[--i];if(o===`
|
|
130
|
-
`&&i>=this.pos&&i+1+t>s)e=i;else break}while(!0);return yield
|
|
130
|
+
`&&i>=this.pos&&i+1+t>s)e=i;else break}while(!0);return yield Ut.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,r=this.pos-1,n;while(n=this.buffer[++r])if(n===":"){let i=this.buffer[r+1];if(ne(i)||e&&nn.has(i))break;t=r}else if(ne(n)){let i=this.buffer[r+1];if(n==="\r")if(i===`
|
|
131
131
|
`)r+=1,n=`
|
|
132
|
-
`,i=this.buffer[r+1];else t=r;if(i==="#"||e&&
|
|
133
|
-
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&
|
|
132
|
+
`,i=this.buffer[r+1];else t=r;if(i==="#"||e&&nn.has(i))break;if(n===`
|
|
133
|
+
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&nn.has(n))break;t=r}if(!n&&!this.atEnd)return this.setNext("plain-scalar");return yield Ut.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc"}*pushCount(e){if(e>0)return yield this.buffer.substr(this.pos,e),this.pos+=e,e;return 0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);if(r)return yield r,this.pos+=r.length,r.length;else if(t)yield"";return 0}*pushIndicators(){let e=0;e:while(!0){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(mo),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(ne(r)||t&&nn.has(r)){if(!t)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];while(!ne(t)&&t!==">")t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];while(t)if(Fx.has(t))t=this.buffer[++e];else if(t==="%"&&uu.has(this.buffer[e+1])&&uu.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];if(e===`
|
|
134
134
|
`)return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)===`
|
|
135
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r==="\t");let n=t-this.pos;if(n>0)yield this.buffer.substr(this.pos,n),this.pos=t;return n}*pushUntil(e){let t=this.pos,r=this.buffer[t];while(!e(r))r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}
|
|
135
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r==="\t");let n=t-this.pos;if(n>0)yield this.buffer.substr(this.pos,n),this.pos=t;return n}*pushUntil(e){let t=this.pos,r=this.buffer[t];while(!e(r))r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}qx.Lexer=du});var yo=y(function(Ux){class pu{constructor(){this.lineStarts=[],this.addNewLine=(e)=>this.lineStarts.push(e),this.linePos=(e)=>{let t=0,r=this.lineStarts.length;while(t<r){let i=t+r>>1;if(this.lineStarts[i]<e)t=i+1;else r=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}Ux.LineCounter=pu});var bo=y(function(Gx){var Kx=Xt("process"),fu=rn(),Hx=ho();function xe(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function gu(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function hu(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function on(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function nt(e){if(e.length===0)return[];let t=e.length;e:while(--t>=0)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}while(e[++t]?.type==="space");return e.splice(t,e.length)}function sn(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let r=0;r<t.length;++r)e.push(t[r])}function mu(e){if(e.start.type==="flow-seq-start"){for(let t of e.items)if(t.sep&&!t.value&&!xe(t.start,"explicit-key-ind")&&!xe(t.sep,"map-value-ind")){if(t.key)t.value=t.key;if(delete t.key,hu(t.value))if(t.value.end)sn(t.value.end,t.sep);else t.value.end=t.sep;else sn(t.start,t.sep);delete t.sep}}}class yu{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 Hx.Lexer,this.onNewLine=e}*parse(e,t=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let r of this.lexer.lex(e,t))yield*this.next(r);if(!t)yield*this.end()}*next(e){if(this.source=e,Kx.env.LOG_TOKENS)console.log("|",fu.prettyToken(e));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=fu.tokenType(e);if(!t){let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}else if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+e.length);break;case"space":if(this.atNewLine&&e[0]===" ")this.indent+=e.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=e.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let r=this.peek(1);if(t.type==="block-scalar")t.indent="indent"in r?r.indent:0;else if(t.type==="flow-collection"&&r.type==="document")t.indent=0;if(t.type==="flow-collection")mu(t);switch(r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{let n=r.items[r.items.length-1];if(n.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=r.items[r.items.length-1];if(n.value)r.items.push({start:[],value:t});else n.value=t;break}case"flow-collection":{let n=r.items[r.items.length-1];if(!n||n.value)r.items.push({start:[],key:t,sep:[]});else if(n.sep)n.value=t;else Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let n=t.items[t.items.length-1];if(n&&!n.sep&&!n.value&&n.start.length>0&&gu(n.start)===-1&&(t.indent===0||n.start.every((i)=>i.type!=="comment"||i.indent<t.indent))){if(r.type==="document")r.end=n.start;else r.items.push({start:n.start});t.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")e.start.push(this.sourceToken);this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{if(gu(e.start)!==-1)yield*this.pop(),yield*this.step();else e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);if(t)this.stack.push(t);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=on(this.peek(2)),r=nt(t),n;if(e.end)n=e.end,n.push(this.sourceToken),delete e.end;else n=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
136
136
|
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
137
|
-
`,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 r="end"in t.value?t.value.end:void 0;if((Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment")r?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){
|
|
137
|
+
`,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 r="end"in t.value?t.value.end:void 0;if((Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment")r?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){sn(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,n=r&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(n&&t.sep&&!t.value){let o=[];for(let s=0;s<t.sep.length;++s){let a=t.sep[s];switch(a.type){case"newline":o.push(s);break;case"space":break;case"comment":if(a.indent>e.indent)o.length=0;break;default:o.length=0}}if(o.length>=2)i=t.sep.splice(o[1])}switch(this.type){case"anchor":case"tag":if(n||t.value)i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0;else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"explicit-key-ind":if(!t.sep&&!t.explicitKey)t.start.push(this.sourceToken),t.explicitKey=!0;else if(n||t.value)i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(!t.sep)if(xe(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=nt(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(xe(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(hu(t.key)&&!xe(t.sep,"newline")){let o=nt(t.start),{key:s,sep:a}=t;a.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:s,sep:a}]})}else if(i.length>0)t.sep=t.sep.concat(i,this.sourceToken);else t.sep.push(this.sourceToken);else if(!t.sep)Object.assign(t,{key:null,sep:[this.sourceToken]});else if(t.value||n)e.items.push({start:i,key:null,sep:[this.sourceToken]});else if(xe(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else t.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);if(n||t.value)e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0;else if(t.sep)this.stack.push(o);else 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&&!xe(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(r)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 r="end"in t.value?t.value.end:void 0;if((Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment")r?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){sn(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;if(t.value||xe(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!t||t.sep)e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return;case"map-value-ind":if(!t||t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!t||t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:n,sep:[]});else if(t.sep)this.stack.push(n);else Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);if(r)this.stack.push(r);else yield*this.pop(),yield*this.step()}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let n=on(r),i=nt(n);mu(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let s={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]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
138
138
|
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
139
|
-
`,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=
|
|
139
|
+
`,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=on(e),r=nt(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=on(e),r=nt(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((r)=>r.type==="newline"||r.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}Gx.Parser=yu});var ku=y(function(tw){var bu=so(),zx=_t(),Vt=Ft(),Wx=hi(),Jx=A(),Qx=yo(),Su=bo();function Cu(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Qx.LineCounter||null,prettyErrors:t}}function Xx(e,t={}){let{lineCounter:r,prettyErrors:n}=Cu(t),i=new Su.Parser(r?.addNewLine),o=new bu.Composer(t),s=Array.from(o.compose(i.parse(e)));if(n&&r)for(let a of s)a.errors.forEach(Vt.prettifyError(e,r)),a.warnings.forEach(Vt.prettifyError(e,r));if(s.length>0)return s;return Object.assign([],{empty:!0},o.streamInfo())}function Ru(e,t={}){let{lineCounter:r,prettyErrors:n}=Cu(t),i=new Su.Parser(r?.addNewLine),o=new bu.Composer(t),s=null;for(let a of o.compose(i.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Vt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(n&&r)s.errors.forEach(Vt.prettifyError(e,r)),s.warnings.forEach(Vt.prettifyError(e,r));return s}function Zx(e,t,r){let n=void 0;if(typeof t==="function")n=t;else if(r===void 0&&t&&typeof t==="object")r=t;let i=Ru(e,r);if(!i)return null;if(i.warnings.forEach((o)=>Wx.warn(i.options.logLevel,o)),i.errors.length>0)if(i.options.logLevel!=="silent")throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:n},r))}function ew(e,t,r){let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(r===void 0&&t)r=t;if(typeof r==="string")r=r.length;if(typeof r==="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=r??t??{};if(!i)return}if(Jx.isDocument(e)&&!n)return e.toString(r);return new zx.Document(e,n,r).toString(r)}tw.parse=Zx;tw.parseAllDocuments=Xx;tw.parseDocument=Ru;tw.stringify=ew});var sw,aw,cw,So,lw,we,uw,dw,pw,fw,z0,gw,mw,hw,an,xu,yw,bw,Sw,Cw,Rw,kw,xw,ww,vw,Ew,Iw,Pw,Aw,Dw,Ow,Tw,Lw,Nw,$w,Mw,_w,Fw,it,jw,qw,Bw,Uw,Vw;var cn=V(()=>{sw=so(),aw=_t(),cw=Ki(),So=Ft(),lw=xt(),we=A(),uw=Se(),dw=L(),pw=Re(),fw=ke(),z0=rn(),gw=ho(),mw=yo(),hw=bo(),an=ku(),xu=Rt();yw=sw.Composer,bw=aw.Document,Sw=cw.Schema,Cw=So.YAMLError,Rw=So.YAMLParseError,kw=So.YAMLWarning,xw=lw.Alias,ww=we.isAlias,vw=we.isCollection,Ew=we.isDocument,Iw=we.isMap,Pw=we.isNode,Aw=we.isPair,Dw=we.isScalar,Ow=we.isSeq,Tw=uw.Pair,Lw=dw.Scalar,Nw=pw.YAMLMap,$w=fw.YAMLSeq,Mw=gw.Lexer,_w=mw.LineCounter,Fw=hw.Parser,it=an.parse,jw=an.parseAllDocuments,qw=an.parseDocument,Bw=an.stringify,Uw=xu.visit,Vw=xu.visitAsync});function ln(e){return typeof e==="string"&&e.trim()?e.trim():void 0}function Kw(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function _e(e){let t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!t)return{meta:"",body:e.trim()};return{meta:(t[1]??"").trim(),body:(t[2]??"").trim()}}function Kt(e){let{meta:t}=_e(e);if(!t)throw Error("design-md file is missing YAML frontmatter");let r=it(t);if(!r||typeof r!=="object")throw Error("design-md frontmatter must be a YAML object");let n=typeof r.title==="string"?r.title.trim():"",i=typeof r.name==="string"?r.name.trim():"",o=n||i;if(!o)throw Error("design-md frontmatter must include a non-empty 'title' or 'name' field");let s=ln(r.id)??ln(r.slug)??Kw(o);if(!s)throw Error("design-md frontmatter must include a non-empty 'id' field");let a={id:s,title:o,category:ln(r.category)??"general",tags:Array.isArray(r.tags)?r.tags:[],origin:typeof r.origin==="string"?r.origin:"local"};if(i)a.name=i;if(typeof r.version==="string"&&r.version.trim())a.version=r.version.trim();let c=ln(r.description);if(c)a.description=c;if(typeof r.sourceUrl==="string")a.sourceUrl=r.sourceUrl;if(Array.isArray(r.exemptRules)){let l=r.exemptRules.filter((p)=>typeof p==="string"&&p.trim().length>0);if(l.length>0)a.exemptRules=l.map((p)=>p.trim())}if(Array.isArray(r.extractedTokens))a.extractedTokens=r.extractedTokens;if(typeof r.layer==="string")if(wu.includes(r.layer))a.layer=r.layer;else console.warn(`[design-md] ignoring invalid layer "${r.layer}" on id="${a.id}"; expected one of ${wu.join("|")}`);return a}var wu;var Ht=V(()=>{cn();wu=["auto","user","override"]});function ve(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{}}function un(e){return Object.fromEntries(Object.entries(ve(e)).flatMap(([t,r])=>typeof r==="string"||typeof r==="number"?[[t,String(r)]]:[]))}function vu(e){return Array.isArray(e)?e.filter((t)=>typeof t==="string"&&t.trim().length>0):[]}function zw(e){return[...e.matchAll(/^```ya?ml[^\n]*\n([\s\S]*?)^```/gim)].map((t)=>t[1]??"")}function Ww(e){let{meta:t,body:r}=_e(e),n=[],i=[];for(let[o,s]of[t,...zw(r)].entries()){if(!s.trim())continue;let a;try{a=ve(it(s))}catch(c){if(o===0)n.push({severity:"error",message:`frontmatter is not valid YAML: ${c.message}`});continue}if(o===0||Object.keys(a).some((c)=>Eu.has(c)))i.push(a)}return{sources:i,issues:n}}function Jw(e){let t={};for(let[r,n]of Object.entries(ve(e)))if(typeof n==="string")t[r]={fontFamily:n};else{let i={};for(let[o,s]of Object.entries(ve(n)))if(Yw.has(o)&&(typeof s==="string"||typeof s==="number"))i[o]=s;t[r]=i}return t}function Co(e){let{sources:t}=Ww(e),r=Object.assign({},...t);if(!Object.keys(r).some((c)=>Eu.has(c)))return;let n={colors:un(r.colors),typography:Jw(r.typography),rounded:un(r.rounded),spacing:Object.fromEntries(Object.entries(ve(r.spacing)).flatMap(([c,l])=>typeof l==="string"||typeof l==="number"?[[c,l]]:[])),components:Object.fromEntries(Object.entries(ve(r.components)).map(([c,l])=>[c,un(l)]))},i=Object.fromEntries(Object.entries(ve(r.themes)).map(([c,l])=>[c,un(l)]));if(Object.keys(i).length)n.themes=i;let o=ve(r.forbidden),s=vu(o.colors),a=vu(o.fonts);if(s.length||a.length)n.forbidden={colors:s,fonts:a};return n}var Hw,Gw,Eu,Yw;var Ro=V(()=>{cn();Ht();Hw=["colors","typography","rounded","spacing","components"],Gw=["themes","forbidden"],Eu=new Set([...Hw,...Gw]),Yw=new Set(["fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","fontFeature","fontVariation"])});function ko(e){let t=new Set,r=[];for(let{pattern:n,group:i}of Qw){let o=new RegExp(n.source,n.flags),s;while((s=o.exec(e))!==null){let a=(s[1]??"").trim(),c=(s[2]??"").trim(),l=`${a}:${c}`;if(!t.has(l))t.add(l),r.push({name:a,value:c,group:i})}}return r}var Qw;var xo=V(()=>{Qw=[{pattern:/`?(--[\w-]+)`?\s*:\s*([#\w()%., ]+)/g,group:"css-var"},{pattern:/`?([\w-]+(?:Color|Bg|Text|Border|Shadow|Radius|Font|Size|Space))`?\s*[=:]\s*["']?([^"'\n,]+)["']?/gi,group:"token"}]});import{readFileSync as Xw}from"fs";function Gt(e){let t=Xw(e,"utf-8"),{body:r}=_e(t),n=Kt(t),i=Co(t),o=n.extractedTokens??(i&&Object.keys(i.colors).length?Object.entries(i.colors).map(([a,c])=>({name:a,value:c,group:"color"})):ko(r)),s={id:n.id,title:n.title,category:n.category,tags:n.tags??[],origin:n.origin??"local",body:r,filePath:e};if(n.sourceUrl)s.sourceUrl=n.sourceUrl;if(n.description)s.description=n.description;if(i)s.tokens=i;if(n.exemptRules)s.exemptRules=n.exemptRules;if(n.layer)s.layer=n.layer;if(o.length>0)s.extractedTokens=o;return s}var Yt=V(()=>{Ht();Ro();xo()});var wo=V(()=>{Yt()});var vo=()=>{};var Eo=()=>{};function dn(e){return`# ${e.trim()||"project"} DESIGN
|
|
140
140
|
|
|
141
141
|
Per-project visual contract. Owned by this consumer. UIBot house seeds
|
|
142
142
|
(\`frontend-principles\`, \`control-console\`) are generation defaults only;
|
|
@@ -193,7 +193,7 @@ Page title 20px. Body 14px. Helper \u2265 12px. No marketing display serif.
|
|
|
193
193
|
- No purple-gradient SaaS, ALL-CAPS chrome eyebrows, or emoji as icons.
|
|
194
194
|
- No unscoped \`html, body, *\` CSS. Scope tokens to the product root.
|
|
195
195
|
- No second design system beside this file.
|
|
196
|
-
`}var
|
|
196
|
+
`}var Iu=V(()=>{Yt()});import{fileURLToPath as Zw}from"url";import{existsSync as ev,readdirSync as tv}from"fs";import{join as rv}from"path";function pn(e=Pu){if(!ev(e))return[];let t=[];for(let r of tv(e).sort()){if(r.startsWith("_")||!r.endsWith(".design.md"))continue;try{t.push(Gt(rv(e,r)))}catch(n){console.warn(`[design-md] skipping seed ${r}: ${n.message}`)}}return t}var Pu;var Au=V(()=>{Yt();Pu=Zw(new URL("../content",import.meta.url))});import{mkdirSync as Du,writeFileSync as nv}from"fs";import{dirname as iv,join as ov}from"path";async function Ou(e,t=globalThis.fetch){let r=e.trim(),n=sv.exec(r);if(n){let i=n[1],o=n[2],s=(n[3]??"").replace(/^\/+|\/+$/g,""),a=`https://api.github.com/repos/${i}/${o}/contents`+(s?`/${s}`:""),c=await t(a,{headers:{accept:"application/vnd.github+json","user-agent":"uibot-design-md-sync"}});if(!c.ok)throw Error(`Failed to list github:${i}/${o}${s?"/"+s:""} (HTTP ${c.status})`);let l=await c.json(),p=Array.isArray(l)?l:[l],d=[];for(let f of p){if(!f||typeof f!=="object")continue;let u=f;if(u.type==="file"&&u.name&&Tu(u.name)&&u.download_url)d.push(u.download_url)}if(d.length===0)throw Error(`No *.design.md / design markdown files found at github:${i}/${o}`+(s?`/${s}`:""));return{kind:"github",label:`github:${i}/${o}${s?"/"+s:""}`,fileUrls:d}}if(/^https?:\/\//i.test(r))return{kind:"url",label:r,fileUrls:[r]};throw Error(`Unsupported --from value "${e}". Use github:owner/repo[/path] or an https:// URL.`)}function Tu(e){let t=e.toLowerCase();return t.endsWith(".design.md")||t.endsWith(".md")&&!t.startsWith("readme")}function Lu(e,t){let{meta:r,body:n}=_e(e);if(!r)return`---
|
|
197
197
|
sourceUrl: ${JSON.stringify(t.sourceUrl)}
|
|
198
198
|
license: ${JSON.stringify(t.license)}
|
|
199
199
|
---
|
|
@@ -203,11 +203,11 @@ ${i.join(`
|
|
|
203
203
|
---
|
|
204
204
|
${n?n+(n.endsWith(`
|
|
205
205
|
`)?"":`
|
|
206
|
-
`):""}`}async function
|
|
207
|
-
`)}function we(e){if(/^[\w.-]+$/.test(e))return e;return JSON.stringify(e)}var Pu=K(()=>{sn()});var ln=K(()=>{ni();So();Co();Ro();Kt();Cu();So();ku();Co();Ro();bo();Iu();Pu()});import{lstatSync as pp,mkdirSync as ls,readFileSync as fp,realpathSync as gp,writeFileSync as us}from"fs";import{basename as mp,dirname as $n,isAbsolute as hp,resolve as ue,sep as as}from"path";function Jt(e){let t=e.lockfilePath??"uibot.artifacts.lock.json",r=e.manifest.items??[],n=new Map;for(let s of r)n.set(s.name,s);if(e.lockfile===null)return{ok:!1,lockfilePath:t,registryName:e.manifest.name,lockCount:0,manifestCount:r.length,drifts:[{name:"*",kind:"missing-in-lock",detail:"lockfile missing or unreadable"}]};let i=[],o=new Set;for(let s of e.lockfile.artifacts??[]){o.add(s.name);let a=n.get(s.name);if(!a){i.push({name:s.name,kind:"missing-in-manifest",lockVersion:s.version,detail:`locked ${s.name}@${s.version} not present in registry manifest`});continue}let c=Pd(a);if(c&&c!==s.version)i.push({name:s.name,kind:"version-mismatch",lockVersion:s.version,manifestVersion:c,detail:`${s.name}: lock ${s.version} \u2260 registry ${c}`})}return{ok:i.length===0,lockfilePath:t,registryName:e.manifest.name,lockCount:(e.lockfile.artifacts??[]).length,manifestCount:r.length,drifts:i}}function Pd(e){return e.artifact?.version??e.version}import{readFileSync as Ad,realpathSync as Yo}from"fs";import{resolve as Be,relative as Dd,dirname as Od,extname as Td,sep as wn}from"path";function Ld(e){if(e.endsWith(".css"))return"style";if(e.endsWith(".tsx")||e.endsWith(".jsx"))return"component";if(/(^|\/)use-[^/]+\.ts$/.test(e))return"hook";return"lib"}function En(e){let t=e.readFile??((c)=>Ad(c,"utf8")),r=new Map,n=(c,l=Be(e.sourceDir))=>{let f=Dd(l,Be(c));if(f===".."||f.startsWith(`..${wn}`)||f.startsWith(wn))throw Error(`Block dependency outside sourceDir: ${c}`);return f.replaceAll(wn,"/")},i=(c)=>{if(n(Be(e.sourceDir,c)),!e.readFile)n(Yo(Be(e.sourceDir,c)),Yo(e.sourceDir));let l=r.get(c);if(l!==void 0)return l;let f=t(Be(e.sourceDir,c));return r.set(c,f),f},o=(c)=>{let l=new Map,f=(d)=>{if(l.has(d))return;let p=i(d);l.set(d,{path:d,type:Ld(d),content:p});let u=p.matchAll(/(?:\bfrom\s*|\bimport\s*)["'](\.[^"']+)["']/g);for(let m of u){let g=n(Be(e.sourceDir,Od(d),m[1]??"")),h=Td(g)?[g]:[`${g}.ts`,`${g}.tsx`,`${g}/index.ts`,`${g}/index.tsx`],b;for(let R of h)try{i(R),b=R;break}catch(x){if(x instanceof Error&&x.message.includes("outside sourceDir"))throw x}if(!b)throw Error(`Unresolved block dependency: ${d} -> ${m[1]}`);f(b)}};return f(c),[...l.values()]},s=(c)=>{let l=new Set;for(let f of c){if(typeof f.content!=="string")continue;for(let d of f.content.matchAll(/(?:\bfrom\s*|\bimport\s*)["']([^."'/][^"']*|@[^"']+)["']/g)){let p=d[1]??"";if(p.startsWith("node:"))continue;let u=p.startsWith("@")?p.split("/").slice(0,2).join("/"):p.split("/")[0]??"";if(u==="react"||u==="react-dom"||u.startsWith("@uibot/"))continue;l.add(u)}}return[...l].sort()},a=[];for(let c of Object.keys(e.catalog)){let l=e.blockFileMap[c];if(l===void 0)continue;let f=e.catalog[c];if(f===void 0)continue;let d=i(l),p=o(l),u=s(p);a.push({name:c,category:f.category,description:f.description,sourceCode:d,files:p,catalogEntry:f,...u.length>0?{dependencies:u}:{}})}return a}function Go(e){return e.flatMap((t)=>En(t))}import{readdirSync as Nd,readFileSync as $d,statSync as Md}from"fs";import{basename as _d,join as Fd}from"path";var qd="0.1.0";function Qt(e){let{dir:t}=e,r;try{r=Nd(t)}catch{return[]}let n=e.defaultVersion??qd,i=e.defaultLevel??"L4",o=e.defaultCategory??"template",s=[];for(let a of r){if(!/\.ya?ml$/i.test(a))continue;let c=Fd(t,a);try{if(!Md(c).isFile())continue}catch{continue}let l=$d(c,"utf8");if(!l.trim())continue;let f=_d(a).replace(/\.ya?ml$/i,""),d=Bd(f),p=jd(f),u=Ud(l)??`${p} template`;s.push({name:d,version:n,title:p,description:u,yaml:l,absolutePath:c,templateContract:{name:d,description:u,level:i,category:o,keywords:[d,f.toLowerCase(),"uibot-template",...e.extraKeywords??[]],composedFrom:Vd(l)}})}return s.sort((a,c)=>a.name.localeCompare(c.name))}function ct(e){let t=new Map;for(let r of e)for(let n of Qt(r)){let i=t.get(n.name);if(i)throw Error(`duplicate template source name "${n.name}": ${i.absolutePath} and ${n.absolutePath}`);t.set(n.name,n)}return[...t.values()].sort((r,n)=>r.name.localeCompare(n.name))}function Xt(e){return{kind:"template",name:e.name,version:e.version,files:[{path:`${e.name}.yaml`,type:"template",content:e.yaml,target:`${e.name}.yaml`}],templateContract:e.templateContract}}function In(e){return{name:e.name,kind:"template",title:e.title,description:e.description,artifact:Xt(e)}}function Bd(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()}function jd(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,(t)=>t.toUpperCase())}function Ud(e){return(e.match(/^\s*title:\s*["']?(.+?)["']?\s*$/m)??e.match(/^\s*-\s*id:.*\n\s*path:.*\n\s*title:\s*["']?(.+?)["']?\s*$/m))?.[1]?.trim()}function Vd(e){let t=new Set;for(let r of e.matchAll(/^\s*-\s*type:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}for(let r of e.matchAll(/^\s*template:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}return[...t].sort()}var Kd="0.1.0";function Hd(e,t={}){return{kind:"component",name:e.name,version:t.defaultVersion??Kd,runtime:t.runtime??"react",files:e.files,...e.dependencies?{dependencies:e.dependencies}:{},...e.registryDependencies?{registryDependencies:e.registryDependencies}:{},...e.catalogEntry.tags?{tags:e.catalogEntry.tags}:{},catalogEntry:e.catalogEntry}}function Yd(e,t={}){return{name:e.name,kind:"component",title:e.catalogEntry.name,description:e.description??e.catalogEntry.description,artifact:Hd(e,t)}}function zo(e,t){let r={...t.runtime?{runtime:t.runtime}:{},...t.defaultVersion?{defaultVersion:t.defaultVersion}:{}},n=e.map((o)=>Yd(o,r)),i=(t.templates??[]).map((o)=>In(o));return{name:t.name,items:[...n,...i]}}var Wd={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},DI=Array.from(new Set(Object.values(Wd).flat()));var Wo=["component","template","design-guide","example","skill"],Pn=["experimental","candidate","recommended"];var Jo=["missing","declared","verified","external-consumer"],Qo=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure","packed-install","typecheck","browser"],je=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])})]);var BP=new Set(Qo),jP=new Set(Jo);var Jd=/^(unknown|unlicensed|none|n\/?a)$/i;function An(e){let t=e?.trim();if(!t||Jd.test(t))return;return t}var Qd="uibot.resource.index.v1";class Ue extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceIndexError"}}function H(e,t){return e<t?-1:e>t?1:0}function _(e){return e.normalize("NFKC").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").replace(/([\p{Ll}\p{N}])([\p{Lu}])/gu,"$1 $2").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim().replace(/\s+/g," ")}function Xd(e){let t=_(e).replace(/ /g,"-");if(!t)throw new Ue("invalid-resource-source-id",e);return t}function ce(e,t){return`${e}:${Xd(t)}`}function Zt(e){let t=new Map;for(let r of e){let n=r?.trim();if(!n)continue;let i=_(n);if(!i||t.has(i))continue;t.set(i,n)}return[...t.entries()].sort(([r],[n])=>H(r,n)).map(([,r])=>r)}function lt(e){return{level:"declared",maturity:"experimental",checks:{source:"declared",license:e?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"},evidence:[]}}function Zd(e){let t=An(e.license);return{type:e.type,id:e.id,...e.version?{version:e.version}:{},...e.url?{url:e.url}:{},...t?{license:t}:{}}}function ut(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},tags:Zt(e.tags),aliases:Zt(e.aliases),capabilities:Zt(e.capabilities),dependencies:[...new Set(e.dependencies)].sort(H),source:Zd(e.source),receipt:e.receipt}}function ep(e){return(e.body.split(/\r?\n/).map((r)=>r.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function tp(e){return Object.freeze(e.tags),Object.freeze(e.aliases),Object.freeze(e.capabilities),Object.freeze(e.dependencies),Object.freeze(e.source),Object.freeze(e.receipt.checks),Object.freeze(e.receipt.evidence),Object.freeze(e.receipt),Object.freeze(e)}function rp(e){let t=new Map;for(let r of Object.keys(e).sort(H)){let n=e[r];if(!n)continue;let i=ce("component",r);for(let o of Zt([r,n.name])){let s=_(o),a=t.get(s)??[];if(!a.includes(i))a.push(i);t.set(s,a.sort(H))}}return t}function np(e,t,r){let n=r.get(_(e))??[];if(n.length===0)throw new Ue("dangling-resource-dependency",`${t} -> ${ce("component",e)}`);if(n.length>1)throw new Ue("ambiguous-resource-dependency",`${t} -> ${e}: ${n.join(",")}`);return n[0]}function ip(e,t,r,n){let i=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(n,i))return ce("template",i);return np(e,t,r)}function dt(e,t,r){return An(r?.[e]??t)}function Xo(e){return Object.entries(e).filter(([,t])=>t.level==="L4").sort(([t],[r])=>H(t,r)).map(([t,r])=>({id:`${t}-example`,title:`${r.name} Example`,description:r.description,category:r.category,tags:r.keywords,aliases:[`${t} example`,`${r.name} example`],capabilities:["example:template"],dependencies:[ce("template",t)]}))}function Zo(e){let t=e.components??{},r=e.templates??{},n=e.designGuides??[],i=e.examples??[],o=e.skills??[],s=e.licenses,a=rp(t),c=[];for(let u of Object.keys(t).sort(H)){let m=t[u];if(!m)continue;let g=ce("component",u),h=dt(g,void 0,s);c.push(ut({id:g,kind:"component",title:m.name,description:m.description,category:m.category,tags:m.tags??[],aliases:[u,m.name],capabilities:["catalog:component"],dependencies:[],source:{type:"catalog",id:u,...h?{license:h}:{}},receipt:lt(Boolean(h))}))}for(let u of Object.keys(r).sort(H)){let m=r[u];if(!m)continue;let g=ce("template",u),h=dt(g,void 0,s);c.push(ut({id:g,kind:"template",title:m.name,description:m.description,category:m.category,tags:m.keywords,aliases:[u,m.name],capabilities:[],dependencies:(m.composedFrom??[]).map((b)=>ip(b,g,a,r)),source:{type:"template-contract",id:u,...h?{license:h}:{}},receipt:lt(Boolean(h))}))}for(let u of[...n].sort((m,g)=>H(m.id,g.id))){let m=ce("design-guide",u.id),g=dt(m,void 0,s);c.push(ut({id:m,kind:"design-guide",title:u.title,description:ep(u),category:u.category,tags:u.tags,aliases:[u.id,u.title],capabilities:["designMd:source"],dependencies:[],source:{type:"design-md",id:u.id,...u.sourceUrl?{url:u.sourceUrl}:{},...g?{license:g}:{}},receipt:lt(Boolean(g))}))}for(let u of[...i].sort((m,g)=>H(m.id,g.id))){let m=ce("example",u.id),g=dt(m,u.license,s);c.push(ut({id:m,kind:"example",title:u.title,description:u.description,...u.category?{category:u.category}:{},tags:u.tags??[],aliases:[u.id,u.title,...u.aliases??[]],capabilities:u.capabilities??[],dependencies:u.dependencies??[],source:{type:"example",id:u.id,...u.version?{version:u.version}:{},...u.sourceUrl?{url:u.sourceUrl}:{},...g?{license:g}:{}},receipt:lt(Boolean(g))}))}for(let u of[...o].sort((m,g)=>H(m.id,g.id))){let m=ce("skill",u.id),g=dt(m,void 0,s);c.push(ut({id:m,kind:"skill",title:u.title,description:u.description?.trim()||u.title,tags:[...u.tags??[],...u.triggers??[]],aliases:[u.id,u.title,...u.triggers??[]],capabilities:["skill:definition"],dependencies:[],source:{type:"skill",id:u.id,...u.version?{version:u.version}:{},...g?{license:g}:{}},receipt:lt(Boolean(g))}))}c.sort((u,m)=>H(u.id,m.id));let l=new Set;for(let u of c){if(l.has(u.id))throw new Ue("duplicate-resource-id",u.id);l.add(u.id)}for(let u of c)for(let m of u.dependencies)if(!l.has(m))throw new Ue("dangling-resource-dependency",`${u.id} -> ${m}`);let f=new Map;for(let u of c)for(let m of u.aliases){let g=_(m);if(!g)continue;let h=f.get(g)??new Set;h.add(u.id),f.set(g,h)}let d=Object.freeze(Object.fromEntries([...f.entries()].sort(([u],[m])=>H(u,m)).map(([u,m])=>[u,Object.freeze([...m].sort(H))]))),p=Object.freeze(c.map(tp));return Object.freeze({schemaVersion:Qd,resources:p,aliases:d})}var op=[["data table","data grid","datatable","table","\u8868\u683C","\u6570\u636E\u8868","\u6570\u636E\u8868\u683C"],["button","action button","\u6309\u94AE","\u64CD\u4F5C\u6309\u94AE"],["dashboard","admin dashboard","\u4EEA\u8868\u76D8","\u540E\u53F0","\u7BA1\u7406\u540E\u53F0"],["kanban","kanban board","\u770B\u677F","\u4EFB\u52A1\u770B\u677F"],["form","input form","\u8868\u5355","\u8F93\u5165\u8868\u5355"],["navigation","nav","sidebar","\u5BFC\u822A","\u4FA7\u8FB9\u680F"]],sp=Object.freeze(op.map((e)=>Object.freeze([...e]))),es=new Map;for(let e of sp){let t=Object.freeze([...new Set(e.map(_).filter(Boolean))].sort());for(let r of t)es.set(r,t)}function Dn(e){let t=_(e);return es.get(t)??Object.freeze([t])}class ee extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceQueryError"}}var Nn=Object.freeze({"exact-id":1000,"exact-title":900,alias:800,tag:600,capability:500,category:400,token:200,fuzzy:100}),ap=Object.freeze(Object.keys(Nn)),ts=new Map(ap.map((e,t)=>[e,t])),rs=new Map([["component",0],["template",1],["design-guide",2],["example",3],["skill",4]]);function Y(e,t){return e<t?-1:e>t?1:0}function ns(e){return new Set((e??[]).map(_).filter(Boolean))}function On(e,t){let r=ns(t);if(r.size===0)return!0;let n=ns(e);return[...r].some((i)=>n.has(i))}function cp(e,t){if(t.kinds?.length&&!t.kinds.includes(e.kind))return!1;if(!On(e.tags,t.tags))return!1;if(!On(e.category?[e.category]:[],t.categories))return!1;if(!On(e.capabilities,t.capabilities))return!1;if(t.maturities?.length&&!t.maturities.includes(e.receipt.maturity))return!1;return!0}function lp(e){return Boolean(e.kinds?.length||e.tags?.length||e.categories?.length||e.capabilities?.length||e.maturities?.length)}function le(e,t,r,n=Nn[t]){if(e.some((i)=>i.code===t&&i.value===r))return;e.push({code:t,value:r,score:n})}function Tn(e,t){return e.find((r)=>_(r)===t)}function Ln(e){return[e.id,e.title,...e.aliases,...e.tags,...e.category?[e.category]:[],...e.capabilities]}function up(e,t,r){if(Math.abs(e.length-t.length)>r)return r+1;let n=Array.from({length:t.length+1},(i,o)=>o);for(let i=1;i<=e.length;i+=1){let o=[i],s=i;for(let a=1;a<=t.length;a+=1){let c=(n[a-1]??r+1)+(e[i-1]===t[a-1]?0:1),l=Math.min((n[a]??r+1)+1,(o[a-1]??r+1)+1,c);o.push(l),s=Math.min(s,l)}if(s>r)return r+1;n=o}return n[t.length]??r+1}function dp(e,t){let r=_(t),n=[];if(_(e.id)===r)le(n,"exact-id",e.id);if(_(e.title)===r)le(n,"exact-title",e.title);let i=Tn(e.aliases,r);if(i)le(n,"alias",i);let o=Tn(e.tags,r);if(o)le(n,"tag",o);let s=Tn(e.capabilities,r);if(s)le(n,"capability",s);if(e.category&&_(e.category)===r)le(n,"category",e.category);if(!i){let l=Dn(r).filter((d)=>d!==r),f=new Set(Ln(e).map(_));if(l.some((d)=>f.has(d)))le(n,"alias",t.trim())}let a=r.split(" ").filter(Boolean),c=_(Ln(e).join(" "));if(a.length>0&&a.every((l)=>c.includes(l)))le(n,"token",t.trim());if(n.length===0&&r.length>=4){let l;for(let f of Ln(e)){let d=_(f);if(d.length<4)continue;let p=up(r,d,2);if(p<=2&&(!l||p<l.distance||p===l.distance&&Y(f,l.value)<0))l={value:f,distance:p}}if(l)le(n,"fuzzy",l.value,Nn.fuzzy-l.distance)}return n.sort((l,f)=>{if(l.score!==f.score)return f.score-l.score;return(ts.get(l.code)??99)-(ts.get(f.code)??99)||Y(l.value,f.value)})}function is(e,t,r){if(t.has(r))return[r];let n=_(r),i=e.aliases[n];if(i?.length)return[...i];let o=new Set;for(let s of Dn(n))for(let a of e.aliases[s]??[])o.add(a);return[...o].sort(Y)}function os(e,t){return new ee("resource-alias-ambiguous",`${e.trim()}: ${t.join(",")}`)}function ss(e){let t=new Map(e.resources.map((n)=>[n.id,n]));function r(n){let i=n.trim(),o=is(e,t,i);if(o.length===0)throw new ee("resource-not-found",i);if(o.length>1)throw os(i,o);let s=o[0],a=s?t.get(s):void 0;if(!a)throw new ee("resource-not-found",i);return a}return Object.freeze({manifest:()=>e,search(n){let i=n.text?.trim()??"";if(!i&&!lp(n))throw new ee("resource-query-empty","text or filter is required");if(n.limit!==void 0&&(!Number.isInteger(n.limit)||n.limit<=0))throw new ee("resource-query-invalid-limit",String(n.limit));let o=e.resources.filter((s)=>cp(s,n)).map((s)=>{let a=i?dp(s,i):[];return{resource:s,score:a.reduce((c,l)=>c+l.score,0),reasons:a}}).filter((s)=>!i||s.reasons.length>0).sort((s,a)=>a.score-s.score||Y(s.resource.id,a.resource.id));return n.limit===void 0?o:o.slice(0,n.limit)},get:r,build(n){if(n.length===0||n.every((p)=>!p.trim()))throw new ee("resource-query-empty","at least one build root is required");let i=[],o=new Set;for(let p of n){let u=p.trim(),m=is(e,t,u);if(m.length===0)i.push({id:u,reason:"missing-resource"});else if(m.length>1)throw os(u,m);else{let g=m[0];if(g)o.add(g)}}let s=new Set,a=new Set,c=new Set,l=[],f=[],d=(p,u)=>{if(s.has(p))return;if(a.has(p)){i.push({id:p,...u?{requiredBy:u}:{},reason:"dependency-cycle"});return}let m=t.get(p);if(!m){i.push({id:p,...u?{requiredBy:u}:{},reason:"missing-resource"});return}a.add(p),c.add(p);let g=[...m.dependencies].sort((h,b)=>{let R=t.get(h),x=t.get(b);return(rs.get(R?.kind??"")??99)-(rs.get(x?.kind??"")??99)||Y(h,b)});for(let h of g)f.push({from:p,to:h,relation:"depends-on"}),d(h,p);a.delete(p),s.add(p),l.push(p)};for(let p of[...o].sort(Y))d(p);return{roots:[...o].sort(Y),nodes:[...c].sort(Y).map((p)=>{let u=t.get(p);if(!u)throw new ee("resource-not-found",p);return{id:p,kind:u.kind,maturity:u.receipt.maturity}}),edges:f.sort((p,u)=>Y(p.from,u.from)||Y(p.to,u.to)),order:l,gaps:i.sort((p,u)=>Y(p.id,u.id)||Y(p.requiredBy??"",u.requiredBy??"")||Y(p.reason,u.reason))}}})}function yp(e){if(!e.name)throw Error("Artifact registry manifest requires a name");return e}async function bp(e,t){let r=await fetch(e,t?{headers:t}:{});if(!r.ok)throw Error(`Failed to fetch ${e}: ${r.status} ${r.statusText}`);return await r.json()}async function Mn(e,t){let r=e.endsWith("/registry.json")?e:`${e.replace(/\/$/,"")}/registry.json`,n=await bp(r,t);return yp(n)}class _n{options;id;priority;manifestPromise;constructor(e){this.options=e;this.id=e.id??e.registryUrl,this.priority=e.priority}getManifest(){return this.manifestPromise??=Mn(this.options.registryUrl,this.options.headers),this.manifestPromise}async get(e){return(await this.getManifest()).items.find((r)=>r.name===e)}}class Fn{sources;constructor(e){this.sources=e}async resolve(e){let t=[...this.sources].sort((r,n)=>r.priority-n.priority);for(let r of t){let n=await r.get(e);if(n)return n}return}}var Sp="uibot.artifacts.lock.json";function Cp(e){return ue(e,"components","registry")}function Rp(e){return ue(e,"templates","registry")}function kp(e,t){if(e.kind==="component")return ue(t.componentsDir??Cp(t.workspaceRoot));return ue(t.templatesDir??Rp(t.workspaceRoot))}function xp(e){return ue(e.workspaceRoot,e.lockfilePath??Sp)}function vp(e){try{return JSON.parse(fp(e,"utf8"))}catch{return{version:1,artifacts:[]}}}function wp(e,t){ls($n(e),{recursive:!0}),us(e,`${JSON.stringify(t,null,2)}
|
|
208
|
-
`,"utf8")}function
|
|
209
|
-
`),t=
|
|
210
|
-
`),r=
|
|
206
|
+
`):""}`}async function Po(e){let t=e.fetchImpl??globalThis.fetch,r=e.defaultLicense??"UNKNOWN",n=[],i=0,o=0,s;try{s=await Ou(e.from,t)}catch(a){return{ok:!1,written:0,skipped:0,files:[],error:a instanceof Error?a.message:String(a)}}if(!e.dryRun)Du(e.outDir,{recursive:!0});for(let a of s.fileUrls){let c;try{let m=await t(a,{headers:{"user-agent":"uibot-design-md-sync"}});if(!m.ok){o+=1,n.push({id:a,path:"",sourceUrl:a,status:"skipped",reason:`HTTP ${m.status}`});continue}c=await m.text()}catch(m){return{ok:!1,written:i,skipped:o,files:n,error:`Network failure fetching ${a}: ${m instanceof Error?m.message:String(m)}`}}let l=new TextEncoder().encode(c).byteLength;if(l>Io){o+=1,n.push({id:a,path:"",sourceUrl:a,status:"skipped",reason:`exceeds ${Io} bytes (${l})`});continue}let p=Lu(c,{sourceUrl:a,license:r}),d;try{d=Kt(p).id}catch(m){o+=1,n.push({id:a,path:"",sourceUrl:a,status:"skipped",reason:m instanceof Error?m.message:"invalid frontmatter"});continue}let f=`${d}.design.md`,u=ov(e.outDir,f);if(e.dryRun){n.push({id:d,path:u,sourceUrl:a,status:"dry-run"}),i+=1;continue}Du(iv(u),{recursive:!0}),nv(u,p,"utf8"),i+=1,n.push({id:d,path:u,sourceUrl:a,status:"written"})}return{ok:!0,written:i,skipped:o,files:n}}var Io=65536,sv;var Nu=V(()=>{Ht();sv=/^github:([^/]+)\/([^/@]+)(?:\/(.+))?$/i});function Ao(e){let t=["---"];if(t.push(`id: ${Ee(e.id)}`),t.push(`title: ${Ee(e.title)}`),t.push(`category: ${Ee(e.category)}`),e.tags?.length)t.push(`tags: [${e.tags.map((r)=>Ee(r)).join(", ")}]`);if(e.origin)t.push(`origin: ${Ee(e.origin)}`);if(e.sourceUrl)t.push(`sourceUrl: ${Ee(e.sourceUrl)}`);if(e.exemptRules?.length)t.push(`exemptRules: [${e.exemptRules.map((r)=>Ee(r)).join(", ")}]`);if(e.layer)t.push(`layer: ${Ee(e.layer)}`);return t.push("---"),t.push(""),t.push(e.body?.trimEnd()??""),t.push(""),t.join(`
|
|
207
|
+
`)}function Ee(e){if(/^[\w.-]+$/.test(e))return e;return JSON.stringify(e)}var $u=V(()=>{Ht()});var fn=V(()=>{ai();wo();vo();Eo();Yt();Iu();wo();Au();vo();Eo();xo();Ro();Nu();$u()});import{lstatSync as Sp,mkdirSync as gs,readFileSync as Cp,realpathSync as Rp,writeFileSync as ms}from"fs";import{basename as kp,dirname as jn,isAbsolute as xp,resolve as ue,sep as ps}from"path";function Zt(e){let t=e.lockfilePath??"uibot.artifacts.lock.json",r=e.manifest.items??[],n=new Map;for(let s of r)n.set(s.name,s);if(e.lockfile===null)return{ok:!1,lockfilePath:t,registryName:e.manifest.name,lockCount:0,manifestCount:r.length,drifts:[{name:"*",kind:"missing-in-lock",detail:"lockfile missing or unreadable"}]};let i=[],o=new Set;for(let s of e.lockfile.artifacts??[]){o.add(s.name);let a=n.get(s.name);if(!a){i.push({name:s.name,kind:"missing-in-manifest",lockVersion:s.version,detail:`locked ${s.name}@${s.version} not present in registry manifest`});continue}let c=$d(a);if(c&&c!==s.version)i.push({name:s.name,kind:"version-mismatch",lockVersion:s.version,manifestVersion:c,detail:`${s.name}: lock ${s.version} \u2260 registry ${c}`})}return{ok:i.length===0,lockfilePath:t,registryName:e.manifest.name,lockCount:(e.lockfile.artifacts??[]).length,manifestCount:r.length,drifts:i}}function $d(e){return e.artifact?.version??e.version}import{readFileSync as Md,realpathSync as Qo}from"fs";import{resolve as Ue,relative as _d,dirname as Fd,extname as jd,sep as An}from"path";function qd(e){if(e.endsWith(".css"))return"style";if(e.endsWith(".tsx")||e.endsWith(".jsx"))return"component";if(/(^|\/)use-[^/]+\.ts$/.test(e))return"hook";return"lib"}function Dn(e){let t=e.readFile??((c)=>Md(c,"utf8")),r=new Map,n=(c,l=Ue(e.sourceDir))=>{let p=_d(l,Ue(c));if(p===".."||p.startsWith(`..${An}`)||p.startsWith(An))throw Error(`Block dependency outside sourceDir: ${c}`);return p.replaceAll(An,"/")},i=(c)=>{if(n(Ue(e.sourceDir,c)),!e.readFile)n(Qo(Ue(e.sourceDir,c)),Qo(e.sourceDir));let l=r.get(c);if(l!==void 0)return l;let p=t(Ue(e.sourceDir,c));return r.set(c,p),p},o=(c)=>{let l=new Map,p=(d)=>{if(l.has(d))return;let f=i(d);l.set(d,{path:d,type:qd(d),content:f});let u=f.matchAll(/(?:\bfrom\s*|\bimport\s*)["'](\.[^"']+)["']/g);for(let m of u){let g=n(Ue(e.sourceDir,Fd(d),m[1]??"")),h=jd(g)?[g]:[`${g}.ts`,`${g}.tsx`,`${g}/index.ts`,`${g}/index.tsx`],b;for(let R of h)try{i(R),b=R;break}catch(x){if(x instanceof Error&&x.message.includes("outside sourceDir"))throw x}if(!b)throw Error(`Unresolved block dependency: ${d} -> ${m[1]}`);p(b)}};return p(c),[...l.values()]},s=(c)=>{let l=new Set;for(let p of c){if(typeof p.content!=="string")continue;for(let d of p.content.matchAll(/(?:\bfrom\s*|\bimport\s*)["']([^."'/][^"']*|@[^"']+)["']/g)){let f=d[1]??"";if(f.startsWith("node:"))continue;let u=f.startsWith("@")?f.split("/").slice(0,2).join("/"):f.split("/")[0]??"";if(u==="react"||u==="react-dom"||u.startsWith("@uibot/"))continue;l.add(u)}}return[...l].sort()},a=[];for(let c of Object.keys(e.catalog)){let l=e.blockFileMap[c];if(l===void 0)continue;let p=e.catalog[c];if(p===void 0)continue;let d=i(l),f=o(l),u=s(f);a.push({name:c,category:p.category,description:p.description,sourceCode:d,files:f,catalogEntry:p,...u.length>0?{dependencies:u}:{}})}return a}function Xo(e){return e.flatMap((t)=>Dn(t))}import{readdirSync as Bd,readFileSync as Ud,statSync as Vd}from"fs";import{basename as Kd,join as Hd}from"path";var Gd="0.1.0";function er(e){let{dir:t}=e,r;try{r=Bd(t)}catch{return[]}let n=e.defaultVersion??Gd,i=e.defaultLevel??"L4",o=e.defaultCategory??"template",s=[];for(let a of r){if(!/\.ya?ml$/i.test(a))continue;let c=Hd(t,a);try{if(!Vd(c).isFile())continue}catch{continue}let l=Ud(c,"utf8");if(!l.trim())continue;let p=Kd(a).replace(/\.ya?ml$/i,""),d=Yd(p),f=zd(p),u=Wd(l)??`${f} template`;s.push({name:d,version:n,title:f,description:u,yaml:l,absolutePath:c,templateContract:{name:d,description:u,level:i,category:o,keywords:[d,p.toLowerCase(),"uibot-template",...e.extraKeywords??[]],composedFrom:Jd(l)}})}return s.sort((a,c)=>a.name.localeCompare(c.name))}function dt(e){let t=new Map;for(let r of e)for(let n of er(r)){let i=t.get(n.name);if(i)throw Error(`duplicate template source name "${n.name}": ${i.absolutePath} and ${n.absolutePath}`);t.set(n.name,n)}return[...t.values()].sort((r,n)=>r.name.localeCompare(n.name))}function tr(e){return{kind:"template",name:e.name,version:e.version,files:[{path:`${e.name}.yaml`,type:"template",content:e.yaml,target:`${e.name}.yaml`}],templateContract:e.templateContract}}function On(e){return{name:e.name,kind:"template",title:e.title,description:e.description,artifact:tr(e)}}function Yd(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()}function zd(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,(t)=>t.toUpperCase())}function Wd(e){return(e.match(/^\s*title:\s*["']?(.+?)["']?\s*$/m)??e.match(/^\s*-\s*id:.*\n\s*path:.*\n\s*title:\s*["']?(.+?)["']?\s*$/m))?.[1]?.trim()}function Jd(e){let t=new Set;for(let r of e.matchAll(/^\s*-\s*type:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}for(let r of e.matchAll(/^\s*template:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}return[...t].sort()}var Qd="0.1.0";function Xd(e,t={}){return{kind:"component",name:e.name,version:t.defaultVersion??Qd,runtime:t.runtime??"react",files:e.files,...e.dependencies?{dependencies:e.dependencies}:{},...e.registryDependencies?{registryDependencies:e.registryDependencies}:{},...e.catalogEntry.tags?{tags:e.catalogEntry.tags}:{},catalogEntry:e.catalogEntry}}function Zd(e,t={}){return{name:e.name,kind:"component",title:e.catalogEntry.name,description:e.description??e.catalogEntry.description,artifact:Xd(e,t)}}function Zo(e,t){let r={...t.runtime?{runtime:t.runtime}:{},...t.defaultVersion?{defaultVersion:t.defaultVersion}:{}},n=e.map((o)=>Zd(o,r)),i=(t.templates??[]).map((o)=>On(o));return{name:t.name,items:[...n,...i]}}var rp={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},KI=Array.from(new Set(Object.values(rp).flat()));var es=["component","template","design-guide","example","skill"],Tn=["experimental","candidate","recommended"];var ts=["missing","declared","verified","external-consumer"],rs=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure","packed-install","typecheck","browser"],Ve=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])})]);var eA=new Set(rs),tA=new Set(ts);var np=/^(unknown|unlicensed|none|n\/?a)$/i;function Ln(e){let t=e?.trim();if(!t||np.test(t))return;return t}var ip="uibot.resource.index.v1";class Ke extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceIndexError"}}function H(e,t){return e<t?-1:e>t?1:0}function _(e){return e.normalize("NFKC").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").replace(/([\p{Ll}\p{N}])([\p{Lu}])/gu,"$1 $2").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim().replace(/\s+/g," ")}function op(e){let t=_(e).replace(/ /g,"-");if(!t)throw new Ke("invalid-resource-source-id",e);return t}function ce(e,t){return`${e}:${op(t)}`}function rr(e){let t=new Map;for(let r of e){let n=r?.trim();if(!n)continue;let i=_(n);if(!i||t.has(i))continue;t.set(i,n)}return[...t.entries()].sort(([r],[n])=>H(r,n)).map(([,r])=>r)}function pt(e){return{level:"declared",maturity:"experimental",checks:{source:"declared",license:e?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"},evidence:[]}}function sp(e){let t=Ln(e.license);return{type:e.type,id:e.id,...e.version?{version:e.version}:{},...e.url?{url:e.url}:{},...t?{license:t}:{}}}function ft(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},tags:rr(e.tags),aliases:rr(e.aliases),capabilities:rr(e.capabilities),dependencies:[...new Set(e.dependencies)].sort(H),source:sp(e.source),receipt:e.receipt}}function ap(e){return(e.body.split(/\r?\n/).map((r)=>r.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function cp(e){return Object.freeze(e.tags),Object.freeze(e.aliases),Object.freeze(e.capabilities),Object.freeze(e.dependencies),Object.freeze(e.source),Object.freeze(e.receipt.checks),Object.freeze(e.receipt.evidence),Object.freeze(e.receipt),Object.freeze(e)}function lp(e){let t=new Map;for(let r of Object.keys(e).sort(H)){let n=e[r];if(!n)continue;let i=ce("component",r);for(let o of rr([r,n.name])){let s=_(o),a=t.get(s)??[];if(!a.includes(i))a.push(i);t.set(s,a.sort(H))}}return t}function up(e,t,r){let n=r.get(_(e))??[];if(n.length===0)throw new Ke("dangling-resource-dependency",`${t} -> ${ce("component",e)}`);if(n.length>1)throw new Ke("ambiguous-resource-dependency",`${t} -> ${e}: ${n.join(",")}`);return n[0]}function dp(e,t,r,n){let i=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(n,i))return ce("template",i);return up(e,t,r)}function gt(e,t,r){return Ln(r?.[e]??t)}function ns(e){return Object.entries(e).filter(([,t])=>t.level==="L4").sort(([t],[r])=>H(t,r)).map(([t,r])=>({id:`${t}-example`,title:`${r.name} Example`,description:r.description,category:r.category,tags:r.keywords,aliases:[`${t} example`,`${r.name} example`],capabilities:["example:template"],dependencies:[ce("template",t)]}))}function is(e){let t=e.components??{},r=e.templates??{},n=e.designGuides??[],i=e.examples??[],o=e.skills??[],s=e.licenses,a=lp(t),c=[];for(let u of Object.keys(t).sort(H)){let m=t[u];if(!m)continue;let g=ce("component",u),h=gt(g,void 0,s);c.push(ft({id:g,kind:"component",title:m.name,description:m.description,category:m.category,tags:m.tags??[],aliases:[u,m.name],capabilities:["catalog:component"],dependencies:[],source:{type:"catalog",id:u,...h?{license:h}:{}},receipt:pt(Boolean(h))}))}for(let u of Object.keys(r).sort(H)){let m=r[u];if(!m)continue;let g=ce("template",u),h=gt(g,void 0,s);c.push(ft({id:g,kind:"template",title:m.name,description:m.description,category:m.category,tags:m.keywords,aliases:[u,m.name],capabilities:[],dependencies:(m.composedFrom??[]).map((b)=>dp(b,g,a,r)),source:{type:"template-contract",id:u,...h?{license:h}:{}},receipt:pt(Boolean(h))}))}for(let u of[...n].sort((m,g)=>H(m.id,g.id))){let m=ce("design-guide",u.id),g=gt(m,void 0,s);c.push(ft({id:m,kind:"design-guide",title:u.title,description:ap(u),category:u.category,tags:u.tags,aliases:[u.id,u.title],capabilities:["designMd:source"],dependencies:[],source:{type:"design-md",id:u.id,...u.sourceUrl?{url:u.sourceUrl}:{},...g?{license:g}:{}},receipt:pt(Boolean(g))}))}for(let u of[...i].sort((m,g)=>H(m.id,g.id))){let m=ce("example",u.id),g=gt(m,u.license,s);c.push(ft({id:m,kind:"example",title:u.title,description:u.description,...u.category?{category:u.category}:{},tags:u.tags??[],aliases:[u.id,u.title,...u.aliases??[]],capabilities:u.capabilities??[],dependencies:u.dependencies??[],source:{type:"example",id:u.id,...u.version?{version:u.version}:{},...u.sourceUrl?{url:u.sourceUrl}:{},...g?{license:g}:{}},receipt:pt(Boolean(g))}))}for(let u of[...o].sort((m,g)=>H(m.id,g.id))){let m=ce("skill",u.id),g=gt(m,void 0,s);c.push(ft({id:m,kind:"skill",title:u.title,description:u.description?.trim()||u.title,tags:[...u.tags??[],...u.triggers??[]],aliases:[u.id,u.title,...u.triggers??[]],capabilities:["skill:definition"],dependencies:[],source:{type:"skill",id:u.id,...u.version?{version:u.version}:{},...g?{license:g}:{}},receipt:pt(Boolean(g))}))}c.sort((u,m)=>H(u.id,m.id));let l=new Set;for(let u of c){if(l.has(u.id))throw new Ke("duplicate-resource-id",u.id);l.add(u.id)}for(let u of c)for(let m of u.dependencies)if(!l.has(m))throw new Ke("dangling-resource-dependency",`${u.id} -> ${m}`);let p=new Map;for(let u of c)for(let m of u.aliases){let g=_(m);if(!g)continue;let h=p.get(g)??new Set;h.add(u.id),p.set(g,h)}let d=Object.freeze(Object.fromEntries([...p.entries()].sort(([u],[m])=>H(u,m)).map(([u,m])=>[u,Object.freeze([...m].sort(H))]))),f=Object.freeze(c.map(cp));return Object.freeze({schemaVersion:ip,resources:f,aliases:d})}var pp=[["data table","data grid","datatable","table","\u8868\u683C","\u6570\u636E\u8868","\u6570\u636E\u8868\u683C"],["button","action button","\u6309\u94AE","\u64CD\u4F5C\u6309\u94AE"],["dashboard","admin dashboard","\u4EEA\u8868\u76D8","\u540E\u53F0","\u7BA1\u7406\u540E\u53F0"],["kanban","kanban board","\u770B\u677F","\u4EFB\u52A1\u770B\u677F"],["form","input form","\u8868\u5355","\u8F93\u5165\u8868\u5355"],["navigation","nav","sidebar","\u5BFC\u822A","\u4FA7\u8FB9\u680F"]],fp=Object.freeze(pp.map((e)=>Object.freeze([...e]))),os=new Map;for(let e of fp){let t=Object.freeze([...new Set(e.map(_).filter(Boolean))].sort());for(let r of t)os.set(r,t)}function Nn(e){let t=_(e);return os.get(t)??Object.freeze([t])}class ee extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceQueryError"}}var Fn=Object.freeze({"exact-id":1000,"exact-title":900,alias:800,tag:600,capability:500,category:400,token:200,fuzzy:100}),gp=Object.freeze(Object.keys(Fn)),ss=new Map(gp.map((e,t)=>[e,t])),as=new Map([["component",0],["template",1],["design-guide",2],["example",3],["skill",4]]);function G(e,t){return e<t?-1:e>t?1:0}function cs(e){return new Set((e??[]).map(_).filter(Boolean))}function $n(e,t){let r=cs(t);if(r.size===0)return!0;let n=cs(e);return[...r].some((i)=>n.has(i))}function mp(e,t){if(t.kinds?.length&&!t.kinds.includes(e.kind))return!1;if(!$n(e.tags,t.tags))return!1;if(!$n(e.category?[e.category]:[],t.categories))return!1;if(!$n(e.capabilities,t.capabilities))return!1;if(t.maturities?.length&&!t.maturities.includes(e.receipt.maturity))return!1;return!0}function hp(e){return Boolean(e.kinds?.length||e.tags?.length||e.categories?.length||e.capabilities?.length||e.maturities?.length)}function le(e,t,r,n=Fn[t]){if(e.some((i)=>i.code===t&&i.value===r))return;e.push({code:t,value:r,score:n})}function Mn(e,t){return e.find((r)=>_(r)===t)}function _n(e){return[e.id,e.title,...e.aliases,...e.tags,...e.category?[e.category]:[],...e.capabilities]}function yp(e,t,r){if(Math.abs(e.length-t.length)>r)return r+1;let n=Array.from({length:t.length+1},(i,o)=>o);for(let i=1;i<=e.length;i+=1){let o=[i],s=i;for(let a=1;a<=t.length;a+=1){let c=(n[a-1]??r+1)+(e[i-1]===t[a-1]?0:1),l=Math.min((n[a]??r+1)+1,(o[a-1]??r+1)+1,c);o.push(l),s=Math.min(s,l)}if(s>r)return r+1;n=o}return n[t.length]??r+1}function bp(e,t){let r=_(t),n=[];if(_(e.id)===r)le(n,"exact-id",e.id);if(_(e.title)===r)le(n,"exact-title",e.title);let i=Mn(e.aliases,r);if(i)le(n,"alias",i);let o=Mn(e.tags,r);if(o)le(n,"tag",o);let s=Mn(e.capabilities,r);if(s)le(n,"capability",s);if(e.category&&_(e.category)===r)le(n,"category",e.category);if(!i){let l=Nn(r).filter((d)=>d!==r),p=new Set(_n(e).map(_));if(l.some((d)=>p.has(d)))le(n,"alias",t.trim())}let a=r.split(" ").filter(Boolean),c=_(_n(e).join(" "));if(a.length>0&&a.every((l)=>c.includes(l)))le(n,"token",t.trim());if(n.length===0&&r.length>=4){let l;for(let p of _n(e)){let d=_(p);if(d.length<4)continue;let f=yp(r,d,2);if(f<=2&&(!l||f<l.distance||f===l.distance&&G(p,l.value)<0))l={value:p,distance:f}}if(l)le(n,"fuzzy",l.value,Fn.fuzzy-l.distance)}return n.sort((l,p)=>{if(l.score!==p.score)return p.score-l.score;return(ss.get(l.code)??99)-(ss.get(p.code)??99)||G(l.value,p.value)})}function ls(e,t,r){if(t.has(r))return[r];let n=_(r),i=e.aliases[n];if(i?.length)return[...i];let o=new Set;for(let s of Nn(n))for(let a of e.aliases[s]??[])o.add(a);return[...o].sort(G)}function us(e,t){return new ee("resource-alias-ambiguous",`${e.trim()}: ${t.join(",")}`)}function ds(e){let t=new Map(e.resources.map((n)=>[n.id,n]));function r(n){let i=n.trim(),o=ls(e,t,i);if(o.length===0)throw new ee("resource-not-found",i);if(o.length>1)throw us(i,o);let s=o[0],a=s?t.get(s):void 0;if(!a)throw new ee("resource-not-found",i);return a}return Object.freeze({manifest:()=>e,search(n){let i=n.text?.trim()??"";if(!i&&!hp(n))throw new ee("resource-query-empty","text or filter is required");if(n.limit!==void 0&&(!Number.isInteger(n.limit)||n.limit<=0))throw new ee("resource-query-invalid-limit",String(n.limit));let o=e.resources.filter((s)=>mp(s,n)).map((s)=>{let a=i?bp(s,i):[];return{resource:s,score:a.reduce((c,l)=>c+l.score,0),reasons:a}}).filter((s)=>!i||s.reasons.length>0).sort((s,a)=>a.score-s.score||G(s.resource.id,a.resource.id));return n.limit===void 0?o:o.slice(0,n.limit)},get:r,build(n){if(n.length===0||n.every((f)=>!f.trim()))throw new ee("resource-query-empty","at least one build root is required");let i=[],o=new Set;for(let f of n){let u=f.trim(),m=ls(e,t,u);if(m.length===0)i.push({id:u,reason:"missing-resource"});else if(m.length>1)throw us(u,m);else{let g=m[0];if(g)o.add(g)}}let s=new Set,a=new Set,c=new Set,l=[],p=[],d=(f,u)=>{if(s.has(f))return;if(a.has(f)){i.push({id:f,...u?{requiredBy:u}:{},reason:"dependency-cycle"});return}let m=t.get(f);if(!m){i.push({id:f,...u?{requiredBy:u}:{},reason:"missing-resource"});return}a.add(f),c.add(f);let g=[...m.dependencies].sort((h,b)=>{let R=t.get(h),x=t.get(b);return(as.get(R?.kind??"")??99)-(as.get(x?.kind??"")??99)||G(h,b)});for(let h of g)p.push({from:f,to:h,relation:"depends-on"}),d(h,f);a.delete(f),s.add(f),l.push(f)};for(let f of[...o].sort(G))d(f);return{roots:[...o].sort(G),nodes:[...c].sort(G).map((f)=>{let u=t.get(f);if(!u)throw new ee("resource-not-found",f);return{id:f,kind:u.kind,maturity:u.receipt.maturity}}),edges:p.sort((f,u)=>G(f.from,u.from)||G(f.to,u.to)),order:l,gaps:i.sort((f,u)=>G(f.id,u.id)||G(f.requiredBy??"",u.requiredBy??"")||G(f.reason,u.reason))}}})}function wp(e){if(!e.name)throw Error("Artifact registry manifest requires a name");return e}async function vp(e,t){let r=await fetch(e,t?{headers:t}:{});if(!r.ok)throw Error(`Failed to fetch ${e}: ${r.status} ${r.statusText}`);return await r.json()}async function qn(e,t){let r=e.endsWith("/registry.json")?e:`${e.replace(/\/$/,"")}/registry.json`,n=await vp(r,t);return wp(n)}class Bn{options;id;priority;manifestPromise;constructor(e){this.options=e;this.id=e.id??e.registryUrl,this.priority=e.priority}getManifest(){return this.manifestPromise??=qn(this.options.registryUrl,this.options.headers),this.manifestPromise}async get(e){return(await this.getManifest()).items.find((r)=>r.name===e)}}class Un{sources;constructor(e){this.sources=e}async resolve(e){let t=[...this.sources].sort((r,n)=>r.priority-n.priority);for(let r of t){let n=await r.get(e);if(n)return n}return}}var Ep="uibot.artifacts.lock.json";function Ip(e){return ue(e,"components","registry")}function Pp(e){return ue(e,"templates","registry")}function Ap(e,t){if(e.kind==="component")return ue(t.componentsDir??Ip(t.workspaceRoot));return ue(t.templatesDir??Pp(t.workspaceRoot))}function Dp(e){return ue(e.workspaceRoot,e.lockfilePath??Ep)}function Op(e){try{return JSON.parse(Cp(e,"utf8"))}catch{return{version:1,artifacts:[]}}}function Tp(e,t){gs(jn(e),{recursive:!0}),ms(e,`${JSON.stringify(t,null,2)}
|
|
208
|
+
`,"utf8")}function Lp(e,t){return{version:1,artifacts:[...e.artifacts.filter((n)=>n.name!==t.name),t].sort((n,i)=>n.name.localeCompare(i.name))}}function Np(e){if(e.kind==="component")return{components:{[e.name]:e.catalogEntry}};return{templates:{[e.name]:e.templateContract}}}class Ae extends Error{artifactName;offendingPath;baseDir;constructor(e,t,r){super(`Artifact "${e}" file path escapes workspace: "${t}" resolves outside "${r}"`);this.artifactName=e;this.offendingPath=t;this.baseDir=r;this.name="ArtifactContainmentError"}}function hs(e,t){let r=t.endsWith(ps)?t:t+ps;return e===t||e.startsWith(r)}function fs(e){let t=ue(e),r=[];while(!0)try{return Sp(t),ue(Rp(t),...r)}catch(n){if(n.code!=="ENOENT")throw n;let i=jn(t);if(i===t)throw n;r.unshift(kp(t)),t=i}}function ys(e,t,r,n){try{let i=fs(t),o=fs(e);if(!hs(o,i))throw new Ae(r,n,t)}catch(i){if(i instanceof Ae)throw i;throw new Ae(r,n,t)}}function de(e,t,r){if(e.includes("\x00"))throw new Ae(r,e,t);if(xp(e))throw new Ae(r,e,t);let n=ue(t,e);if(!hs(n,t))throw new Ae(r,e,t);return ys(n,t,r,e),n}function $p(e,t){let r=[];for(let n of e.files){let i=n.target??n.path;r.push(de(i,t,e.name))}return r}function nr(e,t){let r=ue(t.workspaceRoot),n=Ap(e,t);ys(n,r,e.name,n);let i=de(e.name,n,e.name),o=$p(e,i),s=[];for(let d=0;d<e.files.length;d++){let f=e.files[d],u=o[d];gs(jn(u),{recursive:!0}),ms(u,f.content??"","utf8"),s.push(u)}let a={name:e.name,version:e.version,source:t.source??"registry",installedAt:new Date().toISOString()},c=Dp(t),l=Op(c),p=Lp(l,a);return Tp(c,p),{artifactLock:a,catalogPatch:Np(e),writtenFiles:s}}var Mp={string:"value","positive-integer":"n","resource-kind":"kind","resource-maturity":"maturity"};function _p(e){let t=e.positionals.map((n)=>{let i=`${n.name}${"variadic"in n&&n.variadic?"...":""}`;return n.required?`<${i}>`:`[${i}]`}),r=e.options.map((n)=>`[--${n.name} <${Mp[n.type]}${"cliEncoding"in n&&n.cliEncoding==="comma-separated"?",...":""}>]`);return[e.name,...t,...r,"[--mode <text|json>]","[--dense]"].join(" ")}var Fp=Ve.map((e)=>({name:e.name,usage:_p(e),summary:e.summary,group:"resources"})),jp=[...Fp,{name:"list",usage:"list [--registry <url>]",summary:"List installable artifact registry entries.",group:"artifacts"},{name:"add",usage:"add <name> [--registry <url>] [--cwd <dir>]",summary:"Install an artifact and its registry dependencies.",group:"artifacts"},{name:"publish",usage:"publish [--out <dir>] [--name <manifest-name>]",summary:"Publish the built-in artifact registry to a directory.",group:"artifacts"},{name:"design-md sync",usage:"design-md sync --from <github:owner/repo|https-url> [--cwd <dir>] [--mode json]",summary:"Pull remote design-md with source and license stamps.",group:"design"},{name:"regressions reverify",usage:"regressions reverify [--cwd <dir>] [--skill <id>] [--mode json]",summary:"Re-run resolved regressions and reactivate failures.",group:"skills"},{name:"skills promote",usage:"skills promote <id> [--cwd <dir>] [--mode json]",summary:"Mark a skill promoted and append its usage receipt.",group:"skills"},{name:"skills rollback",usage:"skills rollback <id> [--cwd <dir>] [--mode json]",summary:"Roll back a promoted skill marker with a usage receipt.",group:"skills"},{name:"project export",usage:"project export <dir> [--cwd <dir>] [--mode json]",summary:"Copy project-local .uibot state to a directory.",group:"project"},{name:"link",usage:"link --spec-dir <relative-dir> [--source-dir <dir>] [--cwd <dir>] [--force] [--mode json]",summary:"Register consumer Spec dir + digest pin (L2 Linked).",group:"linked"},{name:"sync push",usage:"sync push [--from <dir>] [--cwd <dir>] [--mode json]",summary:"Copy YAML Spec + lock digest from sourceDir into consumer.",group:"linked"},{name:"sync pull",usage:"sync pull [--to <dir>] [--cwd <dir>] [--mode json]",summary:"Copy YAML Spec from consumer back to sourceDir.",group:"linked"},{name:"doctor",usage:"doctor [--cwd <dir>] [--registry <url>] [--mode json]",summary:"Compare the artifact lockfile with its registry.",group:"diagnostics"},{name:"init",usage:"init <dir> [--template <name>] | init --into <existing-app> [--force] [--mode json]",summary:"Scaffold a project, or L1 Embed recipe into an existing app.",group:"project"}],bs=Object.freeze(jp.map((e)=>Object.freeze(e))),qp=["--mode <text|json> Structured output mode for resource commands.","--dense Compact resource payloads without changing ids/order/codes.","--registry <url> Artifact registry base URL.","--cwd <dir> Workspace root (default: cwd).","--out <dir> Output directory for publish.","--from <src> Remote source for design-md sync, or local Spec source for sync push.","--to <dir> Local Spec destination for sync pull.","--spec-dir <dir> Relative consumer Spec directory for link.","--source-dir <dir> Local studio/CP Spec directory recorded by link.","--control-plane-url <url> Hosted CP base URL for remote Spec sync (no secrets).","--project-id <id> Remote Spec project id (default: default).","--force Overwrite existing .uibot/link.json or init --into files.","--into <dir> Existing app root for L1 Embed scaffold (requires package.json).","--spec-path <rel> Relative Spec YAML path for init --into (default: src/pages/home.uibot.yaml).","--mount-path <rel> Relative mount snippet path for init --into.","--template <name> Template name for greenfield init."];function Vn(){let e=bs.map((n)=>` uibot ${n.usage}`).join(`
|
|
209
|
+
`),t=bs.map((n)=>` ${n.name.padEnd(22)} ${n.summary}`).join(`
|
|
210
|
+
`),r=qp.map((n)=>` ${n}`).join(`
|
|
211
211
|
`);return`uibot \u2014 UIBot resource and artifact CLI
|
|
212
212
|
|
|
213
213
|
Usage:
|
|
@@ -218,17 +218,17 @@ ${t}
|
|
|
218
218
|
|
|
219
219
|
Flags:
|
|
220
220
|
${r}
|
|
221
|
-
`}var
|
|
222
|
-
`,"utf8"),n.push(i);for(let o of t.items){let s=
|
|
223
|
-
`,"utf8"),n.push(s)}return n}async function
|
|
224
|
-
`,"utf-8")}list(e){let t=
|
|
225
|
-
`).filter(Boolean).map((r)=>{try{return JSON.parse(r)}catch{return null}}).filter((r)=>r!==null)}catch{return[]}}active(e){return this.list(e).filter((t)=>t.status==="active")}markResolved(e,t,r){if(t.length===0)return;let n=this.list(e);if(n.length===0)return;let i=new Set(t),o=new Date().toISOString(),s=n.map((c)=>{if(i.has(c.id)&&c.status==="active")return{...c,status:"resolved",resolvedBy:r,resolvedAt:o};return c}),a=
|
|
221
|
+
`}var ir="http://127.0.0.1:3202/api/registry";async function Ss(e,t){if(!e)throw Error("uibot add: missing artifact name");let r=t.registry??ir,n=t.log??((l)=>console.log(l)),i=t.sources??[new Bn({registryUrl:r,priority:0})],o=new Un(i),s=[],a=new Set,c=[e];while(c.length>0){let l=c.shift();if(a.has(l))continue;a.add(l);let p=await o.resolve(l);if(!p)throw Error(`Artifact '${l}' not found in ${r}`);let d=nr(p.artifact,{workspaceRoot:t.workspaceRoot,source:r});s.push({name:p.artifact.name,version:p.artifact.version,files:d.writtenFiles.length});let f=p.artifact.kind==="template"?"template":"component";n(`Installed ${f} ${p.artifact.name}@${p.artifact.version} \u2192 ${d.writtenFiles.length} files`);let u=p.artifact.kind==="component"?p.artifact.registryDependencies:void 0;for(let m of u??[])if(!a.has(m))c.push(m)}return{installed:s}}async function Cs(e={}){let t=e.registry??ir,r=e.fetchManifest??((o)=>qn(o)),n=e.log??((o)=>console.log(o)),i=await r(t);for(let o of i.items)n(`${o.name} ${o.kind} ${o.title??""}`);return i}import{mkdirSync as Bp,writeFileSync as Rs}from"fs";import{resolve as Kn}from"path";function Up(e,t){let r=Kn(e,"artifacts");Bp(r,{recursive:!0});let n=[],i=Kn(e,"registry.json");Rs(i,`${JSON.stringify(t,null,2)}
|
|
222
|
+
`,"utf8"),n.push(i);for(let o of t.items){let s=Kn(r,`${o.name}.json`);Rs(s,`${JSON.stringify(o,null,2)}
|
|
223
|
+
`,"utf8"),n.push(s)}return n}async function ks(e){let t=e.log??((o)=>console.log(o)),r=e.sources;if(!r){if(!e.blockFileMap||!e.catalog||!e.sourceDir)throw Error("uibot publish: provide either `sources` or `blockFileMap` + `catalog` + `sourceDir`");r=Dn({sourceDir:e.sourceDir,blockFileMap:e.blockFileMap,catalog:e.catalog,...e.readFile?{readFile:e.readFile}:{}})}let n=Zo(r,{name:e.manifestName??"local",...e.templates?.length?{templates:e.templates}:{}}),i=[];if(e.writeArtifacts)e.writeArtifacts(e.out,n);else i.push(...Up(e.out,n));return t(`Published ${n.items.length} artifacts \u2192 ${e.out}`),{manifest:n,writtenFiles:i}}fn();import{join as fv}from"path";async function Mu(e){let t=e.cwd??process.cwd(),r=fv(t,".uibot","design-md"),n=await Po({from:e.from,outDir:r,...e.license?{defaultLicense:e.license}:{},...e.dryRun?{dryRun:!0}:{}});if(e.mode==="json")console.log(JSON.stringify(n,null,2));else if(!n.ok)console.error(`uibot design-md sync: ${n.error??"failed"}`);else{console.log(`synced ${n.written} file(s) \u2192 ${r}`+(n.skipped?` (skipped ${n.skipped})`:""));for(let i of n.files)if(i.status==="written"||i.status==="dry-run")console.log(` + ${i.id} \u2190 ${i.sourceUrl}`);else console.log(` - skip ${i.sourceUrl}: ${i.reason??""}`)}return{code:n.ok?0:1,result:n}}import{readdirSync as _v,existsSync as Gu,readFileSync as Fv}from"fs";import{join as Yu}from"path";cn();import{fileURLToPath as yv}from"url";var bv=yv(new URL("../content",import.meta.url));import{appendFileSync as Cv,existsSync as _u,mkdirSync as Rv,readFileSync as kv,writeFileSync as Fu}from"fs";import{join as ju}from"path";function qu(e,t){return ju(e,".uibot","skills",t)}function gn(e,t){return ju(qu(e,t),"regressions.jsonl")}class mn{options;constructor(e){this.options=e}append(e){let t=qu(this.options.rootDir,e.skillId);if(!_u(t))Rv(t,{recursive:!0});Cv(gn(this.options.rootDir,e.skillId),JSON.stringify(e)+`
|
|
224
|
+
`,"utf-8")}list(e){let t=gn(this.options.rootDir,e);if(!_u(t))return[];try{return kv(t,"utf-8").split(`
|
|
225
|
+
`).filter(Boolean).map((r)=>{try{return JSON.parse(r)}catch{return null}}).filter((r)=>r!==null)}catch{return[]}}active(e){return this.list(e).filter((t)=>t.status==="active")}markResolved(e,t,r){if(t.length===0)return;let n=this.list(e);if(n.length===0)return;let i=new Set(t),o=new Date().toISOString(),s=n.map((c)=>{if(i.has(c.id)&&c.status==="active")return{...c,status:"resolved",resolvedBy:r,resolvedAt:o};return c}),a=gn(this.options.rootDir,e);Fu(a,s.map((c)=>JSON.stringify(c)).join(`
|
|
226
226
|
`)+`
|
|
227
|
-
`,"utf-8")}markActive(e,t,r){if(t.length===0)return;let n=this.list(e);if(n.length===0)return;let i=new Set(t),o=new Date().toISOString(),s=n.map((c)=>{if(i.has(c.id)&&c.status==="resolved")return{...c,status:"active",context:[c.context,`reactivated@${o}: ${r}`].filter(Boolean).join(" | ")};return c}),a=
|
|
227
|
+
`,"utf-8")}markActive(e,t,r){if(t.length===0)return;let n=this.list(e);if(n.length===0)return;let i=new Set(t),o=new Date().toISOString(),s=n.map((c)=>{if(i.has(c.id)&&c.status==="resolved")return{...c,status:"active",context:[c.context,`reactivated@${o}: ${r}`].filter(Boolean).join(" | ")};return c}),a=gn(this.options.rootDir,e);Fu(a,s.map((c)=>JSON.stringify(c)).join(`
|
|
228
228
|
`)+`
|
|
229
|
-
`,"utf-8")}resolved(e){return this.list(e).filter((t)=>t.status==="resolved")}}
|
|
230
|
-
`).filter((u)=>u.trim().length>0).map((u)=>u.match(/^(\s*)/)?.[1]?.length??0),o=i.length>0?Math.max(...i):0,s=Math.min(1,o/12),a=
|
|
231
|
-
`,"utf8")}function
|
|
229
|
+
`,"utf-8")}resolved(e){return this.list(e).filter((t)=>t.status==="resolved")}}ai();import{createHash as Ev}from"crypto";function ot(e,t){return Ev("sha256").update(JSON.stringify([e,t])).digest("hex")}function Do(e){return typeof e==="number"&&Number.isFinite(e)&&e>=0&&e<=1}var Iv=new Set(["rule-scan","structural-heuristic","model-text","model-screenshot","legacy-provider","unassessed"]),Pv=new Set(["empty-input","invalid-score","provider-failed","provider-not-run","invalid-evidence","screenshot-unavailable","timeout"]);async function Bu(e,t,r){let n=ot(t,r),i=(o)=>({status:"unavailable",method:"unassessed",subjectHash:n,reason:o});if(!t.trim())return i("empty-input");try{if(e.evaluate){let s=await e.evaluate(t,r);if(!s||s.subjectHash!==n||!Iv.has(s.method))return i("invalid-evidence");if(s.status==="scored"&&s.method!=="unassessed"&&Do(s.score))return{status:"scored",method:s.method,subjectHash:n,score:s.score};if(s.status==="unavailable"&&s.score===void 0&&Pv.has(s.reason))return{status:"unavailable",method:s.method,subjectHash:n,reason:s.reason};return i("invalid-evidence")}let o=await e(t,r);return Do(o)?{status:"scored",method:"legacy-provider",subjectHash:n,score:o}:i("invalid-score")}catch{return i("provider-failed")}}var Av=[{label:"_js operator",re:/_js\s*:/g},{label:"_secret operator",re:/_secret\s*:/g},{label:"external URL",re:/https?:\/\/[^\s'"]+/g}];function Dv(e,t){let r=[];for(let{label:n,re:i}of Av){let o=(e.match(i)??[]).length,s=(t.match(i)??[]).length;if(s>o)r.push(`New ${n} introduced (${o} \u2192 ${s})`)}return r}var Fe={layout:["PageLayout","Card","Box","Tabs","Drawer","Modal"],nav:["PageSiderMenu","Breadcrumb","MenuLink","Link"],data:["Table","List","Stat"],form:["Form","Form.Input","Form.Select","Form.TextArea","Form.Checkbox"],feedback:["Toast","Dialog","Skeleton"],content:["Heading","Paragraph","Markdown","Divider"],action:["Button"]},Ov=["Form.Submit","Button"];function Tv(e){let t=Object.values(Fe).filter((u)=>u.some((m)=>e.includes(m))).length,r=Object.keys(Fe).length,n=Math.min(1,t/(r*0.7)),i=e.split(`
|
|
230
|
+
`).filter((u)=>u.trim().length>0).map((u)=>u.match(/^(\s*)/)?.[1]?.length??0),o=i.length>0?Math.max(...i):0,s=Math.min(1,o/12),a=Fe.form.some((u)=>e.includes(u)),c=Ov.some((u)=>e.includes(u)),l=!a?1:c?1:0.4,p=[...Fe.layout,...Fe.data].some((u)=>e.includes(u)),d=[...Fe.content,...Fe.action].some((u)=>e.includes(u)),f=p&&d?1:p||d?0.6:0.2;return n*0.35+s*0.15+l*0.2+f*0.3}function Uu(e){let t=/```ya?ml[\s\S]*?```/i.test(e),r=/\bpage\s*:/i.test(e),n=/\bblocks\s*:/i.test(e);if(t)return 1;if(r&&n)return 0.9;if(r||n)return 0.5;return 0}function Vu(e,t,r){return e*0.4+t*0.35+r*0.25}class st{visualScoreProvider;constructor(e={}){this.visualScoreProvider=e.visualScoreProvider??void 0}async run(e,t){let r=Uu(t),n=e.expectedBlocks.filter((a)=>t.toLowerCase().includes(a.toLowerCase())),i=e.expectedBlocks.length===0?1:n.length/e.expectedBlocks.length,o=this.visualScoreProvider?await Bu(this.visualScoreProvider,t,e.intent):this.structuralEvidence(t,e.intent),s=o.status==="scored"?o.score:0;return{renderable:r,schemaValid:i,visualHeuristic:s,visualEvidence:o,overallScore:Vu(r,i,s),safetyOk:!0}}runSync(e,t){let r=Uu(t),n=e.expectedBlocks.filter((a)=>t.toLowerCase().includes(a.toLowerCase())),i=e.expectedBlocks.length===0?1:n.length/e.expectedBlocks.length,o=this.visualScoreProvider?{status:"unavailable",method:"unassessed",subjectHash:ot(t,e.intent),reason:"provider-not-run"}:this.structuralEvidence(t,e.intent),s=o.status==="scored"?o.score:0;return{renderable:r,schemaValid:i,visualHeuristic:s,visualEvidence:o,overallScore:Vu(r,i,s),safetyOk:!0}}structuralEvidence(e,t){let r=ot(e,t);return e.trim()?{status:"scored",method:"structural-heuristic",subjectHash:r,score:Tv(e)}:{status:"unavailable",method:"unassessed",subjectHash:r,reason:"empty-input"}}checkSafetyRegressions(e,t){return Dv(e,t)}}function Lv(e={}){if(e.runner)return e.runner;return new st(e.visualScoreProvider!==void 0?{visualScoreProvider:e.visualScoreProvider}:{})}async function hn(e,t,r={}){return Lv(r).run(e,t)}var Hu="title|text|label|content|description|heading|subtitle|placeholder|body|caption|name",bL=new RegExp(`["']?\\b(?:${Hu})["']?\\s*:\\s*["']([^"'\\n]*)["']`,"gi"),SL=new RegExp(`^\\s*-?\\s*(?:${Hu})\\s*:\\s*([^\\s"'{\\[][^\\n]*)$`,"gim");function jv(e){let t=Yu(e,".uibot","skills");if(!Gu(t))return[];return _v(t,{withFileTypes:!0}).filter((r)=>r.isDirectory()).map((r)=>r.name)}function qv(e,t){let r=Yu(e,".uibot","skills",t,"SKILL.md");if(!Gu(r))return"";return Fv(r,"utf8")}async function zu(e={}){let t=e.cwd??process.cwd(),r=new mn({rootDir:t}),n=e.skillId?[e.skillId]:jv(t),i=[],o=0,s=0;for(let c of n){let l=r.resolved(c),p=qv(t,c),d=[];for(let f of l){o+=1;let u={id:f.id,intent:f.intent||"regression-reverify",expectedBlocks:f.expectedBlocks??[],skillId:c},m=await hn(u,p),g=(f.expectedBlocks?.length??0)===0||m.schemaValid>=0.99,h=m.renderable>=0.5||!f.intent.trim();if(!g||!h||m.overallScore<0.3)d.push(f.id),s+=1,i.push({skillId:c,id:f.id,action:"reactivated",reason:`overallScore=${m.overallScore.toFixed(3)} schemaValid=${m.schemaValid.toFixed(3)}`});else i.push({skillId:c,id:f.id,action:"pass"})}if(d.length>0)r.markActive(c,d,"reverify-failed")}let a={ok:!0,checked:o,reactivated:s,details:i};if(e.mode==="json")console.log(JSON.stringify(a,null,2));else{console.log(`reverify: checked ${o}, reactivated ${s}`);for(let c of i)if(c.action==="reactivated")console.log(` ! ${c.skillId}/${c.id} \u2192 active (${c.reason})`)}return{code:0,result:a}}import{appendFileSync as Bv,existsSync as yn,mkdirSync as Ju,readFileSync as Uv,writeFileSync as Wu,cpSync as Vv}from"fs";import{join as Ie,dirname as Kv}from"path";function Hv(e){return Ie(e,".uibot","cli-usage.jsonl")}function at(e,t){let r=Hv(e);Ju(Kv(r),{recursive:!0}),Bv(r,JSON.stringify({...t,at:new Date().toISOString()})+`
|
|
231
|
+
`,"utf8")}function Qu(e,t){return Ie(e,".uibot","skills",t)}async function Xu(e,t={}){let r=t.cwd??process.cwd(),n=Qu(r,e);if(!yn(n)){let o={ok:!1,error:`skill not found: ${e}`};if(t.mode==="json")console.log(JSON.stringify(o));else console.error(`uibot skills promote: ${o.error}`);return at(r,{command:"skills.promote",id:e,ok:!1}),1}let i=Ie(n,"SKILL.md");if(yn(i))Wu(Ie(n,"SKILL.promoted.md"),Uv(i,"utf8"));if(Wu(Ie(n,"PROMOTED"),JSON.stringify({id:e,promotedAt:new Date().toISOString()},null,2)),at(r,{command:"skills.promote",id:e,ok:!0}),t.mode==="json")console.log(JSON.stringify({ok:!0,id:e,action:"promoted"}));else console.log(`promoted skill ${e}`);return 0}async function Zu(e,t={}){let r=t.cwd??process.cwd(),n=Qu(r,e),i=Ie(n,"PROMOTED");if(!yn(i)){let s={ok:!1,error:`no promotion marker for skill: ${e}`};if(t.mode==="json")console.log(JSON.stringify(s));else console.error(`uibot skills rollback: ${s.error}`);return at(r,{command:"skills.rollback",id:e,ok:!1}),1}let{unlinkSync:o}=await import("fs");if(o(i),at(r,{command:"skills.rollback",id:e,ok:!0}),t.mode==="json")console.log(JSON.stringify({ok:!0,id:e,action:"rolled-back"}));else console.log(`rolled back skill ${e}`);return 0}async function ed(e,t={}){let r=t.cwd??process.cwd(),n=Ie(r,".uibot");if(!yn(n)){let i={ok:!1,error:"no .uibot directory in workspace"};if(t.mode==="json")console.log(JSON.stringify(i));else console.error(`uibot project export: ${i.error}`);return at(r,{command:"project.export",outDir:e,ok:!1}),1}if(Ju(e,{recursive:!0}),Vv(n,Ie(e,".uibot"),{recursive:!0}),at(r,{command:"project.export",outDir:e,ok:!0}),t.mode==="json")console.log(JSON.stringify({ok:!0,outDir:e}));else console.log(`exported project state \u2192 ${e}`);return 0}import{existsSync as Gv,readFileSync as Yv}from"fs";import{resolve as zv}from"path";var Wv=process.env.UIBOT_REGISTRY_URL?.trim()||"http://127.0.0.1:3202/api/registry/registry.json";async function td(e={}){let t=e.cwd??process.cwd(),r=zv(t,e.lockfilePath??"uibot.artifacts.lock.json"),n=e.mode??"text",i=null,o=!1;if(!Gv(r))o=!0;else try{i=JSON.parse(Yv(r,"utf8"))}catch{o=!0}let s=e.manifest;if(!s){let c=e.registry??Wv,l=e.fetchImpl??fetch;try{let p=await l(c);if(!p.ok){let d={ok:!1,error:`registry HTTP ${p.status}`,url:c};if(n==="json")console.log(JSON.stringify(d));else console.error(`uibot doctor: failed to fetch registry ${c} (${p.status})`);return 1}s=await p.json()}catch(p){let d=p instanceof Error?p.message:String(p),f="start control-plane (bun run example:control-plane) or pass --registry; offline = not a green doctor";if(n==="json")console.log(JSON.stringify({ok:!1,error:d,url:c,exitCode:1,hint:"start control-plane (bun run example:control-plane) or pass --registry; offline = not a green doctor"}));else console.error(`uibot doctor: cannot reach registry ${c}`),console.error(` ${d}`),console.error(" hint: start control-plane (bun run example:control-plane) or pass --registry; offline = not a green doctor");return 1}}if(o){let c=Zt({lockfile:null,manifest:s,lockfilePath:r});if(n==="json")console.log(JSON.stringify({...c,exitCode:2}));else console.error(`uibot doctor: no lockfile at ${r}`);return 2}let a=Zt({lockfile:i,manifest:s,lockfilePath:r});if(n==="json")console.log(JSON.stringify({...a,exitCode:a.ok?0:1}));else if(a.ok)console.log(`uibot doctor: ok (${a.lockCount} locked, registry ${a.registryName??"?"})`);else{console.error(`uibot doctor: drift detected (${a.drifts.length})`);for(let c of a.drifts)console.error(` - ${c.detail}`)}return a.ok?0:1}import{existsSync as zt,mkdirSync as Lo,writeFileSync as rd,readdirSync as Jv,readFileSync as Qv,statSync as Xv}from"fs";import{dirname as nd,isAbsolute as Zv,join as ct,relative as eE,resolve as Sn,sep as tE}from"path";fn();class X extends Error{constructor(e){super(e);this.name="InitIntoError"}}var rE="src/pages/home.uibot.yaml",nE="src/uibot-mount.example.tsx",iE="uibot.embed.md",id=["@uibot/contracts","@uibot/compiler","@uibot/runtime","@uibot/renderer-react"],oE=`/**
|
|
232
232
|
* Minimal UIBot control-plane entry (scaffold from \`uibot init\`).
|
|
233
233
|
* Wire with your monorepo's createExampleControlPlane or a custom assembly.
|
|
234
234
|
*
|
|
@@ -241,7 +241,7 @@ export async function main(): Promise<void> {
|
|
|
241
241
|
if (import.meta.main) {
|
|
242
242
|
void main();
|
|
243
243
|
}
|
|
244
|
-
`,
|
|
244
|
+
`,sE=`version: "2.0"
|
|
245
245
|
pages:
|
|
246
246
|
- id: home
|
|
247
247
|
path: /
|
|
@@ -258,7 +258,7 @@ pages:
|
|
|
258
258
|
- type: Button
|
|
259
259
|
props:
|
|
260
260
|
label: Get started
|
|
261
|
-
`,
|
|
261
|
+
`,aE=`version: "2.0"
|
|
262
262
|
pages:
|
|
263
263
|
- id: home
|
|
264
264
|
path: /
|
|
@@ -277,7 +277,7 @@ pages:
|
|
|
277
277
|
type: Paragraph
|
|
278
278
|
props:
|
|
279
279
|
text: Keep this *.uibot.yaml beside your routes; host owns router/session/ACL.
|
|
280
|
-
`;function
|
|
280
|
+
`;function cE(e){return`/**
|
|
281
281
|
* L1 Embed mount example \u2014 copy into a route component.
|
|
282
282
|
* Proof: examples/vite-react-live \xB7 smoke:external-consumer --phase app-runtime
|
|
283
283
|
*
|
|
@@ -344,7 +344,7 @@ export async function mountUIBot(rootEl: HTMLElement, registry: unknown): Promis
|
|
|
344
344
|
}),
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
|
-
`}function
|
|
347
|
+
`}function lE(e,t){let r=id.join(" ");return`# UIBot L1 Embed
|
|
348
348
|
|
|
349
349
|
Scaffolded with \`uibot init --into\`.
|
|
350
350
|
|
|
@@ -382,9 +382,9 @@ Apps must **not** depend on Studio or \`@uibot/application\`.
|
|
|
382
382
|
\`uibot link --spec-dir <rel>\` then \`uibot sync push|pull\` for Spec-as-code sync.
|
|
383
383
|
|
|
384
384
|
See \`docs/product/progressive-adoption.md\`.
|
|
385
|
-
`}async function
|
|
386
|
-
`),i("control-plane.ts",
|
|
387
|
-
`);return i("README.md",`# ${
|
|
385
|
+
`}async function od(e){let t=e.log??((p)=>console.log(p)),r=Sn(e.dir);Lo(r,{recursive:!0});let n=[],i=(p,d)=>{let f=ct(r,p);Lo(nd(f),{recursive:!0}),rd(f,d,"utf8"),n.push(f)};i("package.json",`${JSON.stringify({name:bn(r),private:!0,type:"module",scripts:{start:"bun run control-plane.ts"}},null,2)}
|
|
386
|
+
`),i("control-plane.ts",oE),i("DESIGN.md",dn(bn(r)));let o=pn(),a=["frontend-principles","control-console"].map((p)=>o.find((d)=>d.id===p)).filter((p)=>Boolean(p));for(let p of a){let d=ct(".uibot","design-md",`${p.id}.design.md`);i(d,Ao(p))}let c=fE(),l=!1;if(c){let p=er({dir:c}),d=(e.template?p.find((f)=>f.name===e.template):p.find((f)=>f.name==="saas-landing")??p[0])??null;if(d){let f=tr(d),u=nr(f,{workspaceRoot:r,source:"uibot-init"});n.push(...u.writtenFiles),n.push(ct(r,"uibot.artifacts.lock.json")),l=!0,t(`seeded template ${d.name}`)}}if(!l)i(ct("templates","demo.yaml"),sE),i("uibot.artifacts.lock.json",`${JSON.stringify({version:1,artifacts:[]},null,2)}
|
|
387
|
+
`);return i("README.md",`# ${bn(r)}
|
|
388
388
|
|
|
389
389
|
Scaffolded with \`uibot init\`.
|
|
390
390
|
|
|
@@ -394,11 +394,11 @@ Scaffolded with \`uibot init\`.
|
|
|
394
394
|
- \`control-plane.ts\` \u2014 wire your control-plane assembly
|
|
395
395
|
|
|
396
396
|
Next: point dependencies at \`@uibot/*\` packages and run the control-plane.
|
|
397
|
-
`),t(`initialized project at ${r} (${n.length} files)`),{dir:r,files:n}}function
|
|
397
|
+
`),t(`initialized project at ${r} (${n.length} files)`),{dir:r,files:n}}function sd(e){let t=e.log??((n)=>console.log(n)),r=e.error??((n)=>console.error(n));try{let n=uE(e.into);dE(n);let i=To(e.specPath??rE,"specPath"),o=To(e.mountPath??nE,"mountPath"),s=To(e.recipePath??iE,"recipePath"),a=Oo(i,n,"specPath"),c=Oo(o,n,"mountPath"),l=Oo(s,n,"recipePath"),p="DESIGN.md",d=ct(n,p),f=zt(d),u=[{abs:a,rel:i,content:aE},{abs:c,rel:o,content:cE(i)},{abs:l,rel:s,content:lE(i,o)}];if(!f)u.push({abs:d,rel:p,content:dn(bn(n))});if(!e.force){let b=u.filter((R)=>zt(R.abs)).map((R)=>R.rel);if(b.length>0)throw new X(`refusing to overwrite existing files (pass --force): ${b.join(", ")}`)}let m=[];for(let b of u)Lo(nd(b.abs),{recursive:!0}),rd(b.abs,b.content.endsWith(`
|
|
398
398
|
`)?b.content:`${b.content}
|
|
399
|
-
`,"utf8"),m.push(b.abs);let g=[...
|
|
400
|
-
`,"utf8"),t}function
|
|
399
|
+
`,"utf8"),m.push(b.abs);let g=[...id],h={ok:!0,into:n,files:m.map((b)=>pE(n,b)),dependencies:g};if(e.mode==="json")t(JSON.stringify(h));else{t(`initialized L1 Embed into ${n}`);for(let b of h.files)t(` + ${b}`);if(t(`App Runtime deps: ${g.join(" ")}`),f)t("kept existing DESIGN.md");t(`See ${s} for the copy-paste recipe.`)}return{code:0,into:n,files:m,dependencies:g}}catch(n){let i=n instanceof Error?n.message:String(n);if(e.mode==="json")t(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:i}));else r(`uibot init --into: ${i}`);return{code:1,error:i}}}function uE(e){if(!e||e.includes("\x00"))throw new X("--into path is invalid");let t=Sn(e);if(!zt(t))throw new X(`directory does not exist: ${t}`);let r;try{r=Xv(t)}catch{throw new X(`cannot stat --into path: ${t}`)}if(!r.isDirectory())throw new X(`--into must be a directory: ${t}`);return t}function dE(e){let t=ct(e,"package.json");if(!zt(t))throw new X(`missing package.json in ${e} (refuse to scaffold non-app dir)`);try{let r=Qv(t,"utf8");JSON.parse(r)}catch{throw new X(`invalid package.json in ${e}`)}}function Oo(e,t,r){if(!e||e.includes("\x00"))throw new X(`${r} is invalid`);if(Zv(e))throw new X(`${r} must be a relative path (got absolute: ${e})`);try{return de(e,t,r)}catch(n){let i=n instanceof Error?n.message:String(n);throw new X(`${r} escapes app root: ${i}`)}}function To(e,t){let r=e.split(/[/\\]/).join("/");if(!r||r.includes("\x00"))throw new X(`${t} is invalid`);return r}function pE(e,t){return eE(e,t).split(tE).join("/")}function bn(e){return(e.replace(/\/+$/,"").split("/").pop()||"uibot-app").replace(/[^a-zA-Z0-9._-]/g,"-")}function fE(){let e=[Sn(process.cwd(),"examples/templates"),Sn(import.meta.dir,"../../../../examples/templates")];for(let t of e)if(zt(t))try{if(Jv(t).some((r)=>r.endsWith(".yaml")||r.endsWith(".yml")))return t}catch{}return null}import{existsSync as No,mkdirSync as $o,readFileSync as gE,writeFileSync as mE}from"fs";import{dirname as ad,isAbsolute as cd,join as _o,relative as hE,resolve as Cn,sep as Mo}from"path";var Fo="uibot.link.v1",jo=_o(".uibot","link.json"),yE=_o(".uibot","spec.lock");class D extends Error{constructor(e){super(e);this.name="LinkPathError"}}function bE(e,t){let r=t.endsWith(Mo)?t:t+Mo;return e===t||e.startsWith(r)}function Rn(e,t,r){if(!e||e.includes("\x00"))throw new D(`${r} is invalid`);if(cd(e))throw new D(`${r} must be a relative path (got absolute: ${e})`);try{return de(e,t,r)}catch(n){let i=n instanceof Error?n.message:String(n);throw new D(`${r} escapes consumer root: ${i}`)}}function qo(e,t){if(!e||e.includes("\x00"))throw new D("sourceDir is invalid");return cd(e)?Cn(e):Cn(t,e)}function Wt(e){if(!e||e.includes("\x00"))throw new D("controlPlaneUrl is invalid");let t;try{t=new URL(e.trim())}catch{throw new D(`controlPlaneUrl is not a valid URL: ${e}`)}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new D(`controlPlaneUrl must be http(s) (got ${t.protocol})`);if(t.username||t.password)throw new D("controlPlaneUrl must not embed credentials; use UIBOT_CONTROL_PLANE_AUTH_BEARER / UIBOT_STUDIO_AUTH_BEARER");let r=t.pathname.replace(/\/+$/,"");return`${t.origin}${r==="/"?"":r}`}function Jt(e){let t=e.trim();if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/.test(t))throw new D(`projectId invalid (expected /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/, got ${JSON.stringify(e)})`);return t}function kn(e){return _o(e,jo)}function xn(e){let t=kn(e);if(!No(t))throw new D(`missing ${jo}; run \`uibot link\` first`);let r=JSON.parse(gE(t,"utf8"));if(r.schema!==Fo)throw new D(`unsupported link schema: ${String(r.schema)}`);if(!r.consumerRoot||!r.specDir||!r.lockPath)throw new D("link.json missing required fields");if(r.controlPlaneUrl)r.controlPlaneUrl=Wt(r.controlPlaneUrl);if(r.projectId)r.projectId=Jt(r.projectId);return r}function Bo(e){let t=kn(e.consumerRoot);$o(ad(t),{recursive:!0});let r={schema:Fo,consumerRoot:e.consumerRoot,specDir:e.specDir,...e.sourceDir?{sourceDir:e.sourceDir}:{},...e.controlPlaneUrl?{controlPlaneUrl:e.controlPlaneUrl}:{},...e.projectId?{projectId:e.projectId}:{},digest:e.digest,lockPath:e.lockPath,createdAt:e.createdAt,...e.updatedAt?{updatedAt:e.updatedAt}:{}};return mE(t,`${JSON.stringify(r,null,2)}
|
|
400
|
+
`,"utf8"),t}function ld(e){let t=e.log??((o)=>console.log(o)),r=e.error??((o)=>console.error(o)),n=Cn(e.cwd??process.cwd()),i=e.lockPath??yE;try{Rn(e.specDir,n,"specDir"),Rn(i,n,"lockPath");let o=kn(n);if(No(o)&&!e.force){let g=`${jo} already exists (pass --force to overwrite)`;if(e.mode==="json")t(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:g}));else r(`uibot link: ${g}`);return{code:1}}let s;if(e.sourceDir)s=qo(e.sourceDir,n);let a;if(e.controlPlaneUrl)a=Wt(e.controlPlaneUrl);let c;if(e.projectId)c=Jt(e.projectId);let l=new Date().toISOString(),p=No(o)?xn(n):void 0,d={schema:Fo,consumerRoot:n,specDir:e.specDir.split(/[/\\]/).join("/"),...s?{sourceDir:s}:{},...a?{controlPlaneUrl:a}:{},...c?{projectId:c}:{},digest:p?.digest??null,lockPath:i.split(/[/\\]/).join("/"),createdAt:p?.createdAt??l,updatedAt:l},f=Cn(n,d.specDir);if(!bE(f,n))throw new D("specDir escapes consumer root");$o(f,{recursive:!0}),$o(ad(kn(n)),{recursive:!0});let u=Bo(d),m={ok:!0,path:u,consumerRoot:d.consumerRoot,specDir:d.specDir,sourceDir:d.sourceDir??null,controlPlaneUrl:d.controlPlaneUrl??null,projectId:d.projectId??null,digest:d.digest,lockPath:d.lockPath};if(e.mode==="json")t(JSON.stringify(m));else{if(t(`linked consumer \u2192 ${u}`),t(` specDir: ${d.specDir}`),d.sourceDir)t(` sourceDir: ${d.sourceDir}`);if(d.controlPlaneUrl)t(` controlPlaneUrl: ${d.controlPlaneUrl}`);if(d.projectId)t(` projectId: ${d.projectId}`);t(` digest: ${d.digest??"(unset \u2014 run uibot sync push|pull)"}`)}return{code:0,config:d}}catch(o){let s=o instanceof Error?o.message:String(o);if(e.mode==="json")t(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:s}));else r(`uibot link: ${s}`);return{code:1}}}function ae(e){return Rn(e.specDir,e.consumerRoot,"specDir")}function ud(e){return Rn(e.lockPath,e.consumerRoot,"lockPath")}function lt(e,t){return hE(e,t).split(Mo).join("/")}import{createHash as SE}from"crypto";import{copyFileSync as CE,existsSync as Qt,mkdirSync as je,readdirSync as RE,readFileSync as pd,statSync as kE,unlinkSync as xE,writeFileSync as fd}from"fs";import{dirname as Ko,join as wE,relative as vE,resolve as gd,sep as dd}from"path";var EE="uibot.spec.lock.v1",md="uibot.spec.sync.v1",IE="/api/studio/spec-sync",hd=/\.ya?ml$/i;function Uo(e,t){let r=t.endsWith(dd)?t:t+dd;return e===t||e.startsWith(r)}function En(e){if(!Qt(e))return[];let t=[],r=(n)=>{for(let i of RE(n,{withFileTypes:!0})){if(i.name==="node_modules"||i.name===".git")continue;let o=wE(n,i.name);if(i.isDirectory()){r(o);continue}if(i.isFile()&&hd.test(i.name))t.push(o)}};return r(e),t.sort((n,i)=>n.localeCompare(i))}function Vo(e){return SE("sha256").update(e).digest("hex")}function PE(e){let t=En(e).map((i)=>{let o=lt(e,i),s=Vo(pd(i));return{path:o,sha256:s}}),r=t.map((i)=>`${i.path}
|
|
401
401
|
${i.sha256}`).join(`
|
|
402
|
-
`);return{digest:`sha256:${
|
|
403
|
-
`,"utf8")}function Cn(e,t){if(!zt(e)||!cE(e).isDirectory())throw new D(`source Spec directory not found: ${e}`);_e(t,{recursive:!0});let r=[];for(let n of kn(e)){let i=dE(e,n),o=de(i,t,"sync");_e(qo(o),{recursive:!0}),sE(n,o),r.push(st(t,o))}return{copied:r,removedNone:!0}}function hE(e,t){_e(t,{recursive:!0});let r=[],n=new Set;for(let i of e){if(!i.path||i.path.includes("\x00")||typeof i.content!=="string")throw new D("remote Spec file entry is invalid");if(!ld.test(i.path))throw new D(`remote Spec path is not YAML: ${i.path}`);let o=de(i.path,t,"sync");_e(qo(o),{recursive:!0}),sd(o,i.content,"utf8");let s=st(t,o);n.add(s),r.push(s)}for(let i of kn(t)){let o=st(t,i);if(!n.has(o))lE(i)}return{copied:r.sort((i,o)=>i.localeCompare(o))}}function yE(e){return kn(e).map((t)=>{let r=od(t,"utf8");return{path:st(e,t),content:r,sha256:Fo(r)}})}function Rn(e,t){let r=t??e.sourceDir;if(!r)throw new D("no sourceDir: pass --from <dir> (push) / --to <dir> (pull), or re-run `uibot link --source-dir <dir>` (or configure --control-plane-url)");let n=$o(r,e.consumerRoot),i={...e,sourceDir:n,updatedAt:new Date().toISOString()};return{sourceDir:n,config:i}}function bE(e=process.env){return e.UIBOT_CONTROL_PLANE_AUTH_BEARER?.trim()||e.UIBOT_STUDIO_AUTH_BEARER?.trim()||""||void 0}function SE(e,t){let r=Yt(e),n=t?Gt(t):"default",i=new URL(`${r}${fE}`);return i.searchParams.set("projectId",n),i.toString()}async function ud(e){let t={accept:"application/json"};if(e.bearer)t.authorization=`Bearer ${e.bearer}`;let r={method:e.method,headers:t};if(e.method==="PUT")t["content-type"]="application/json",r={...r,body:JSON.stringify(e.body)};let n;try{n=await e.fetchImpl(e.url,r)}catch(s){let a=s instanceof Error?s.message:String(s);throw new D(`control-plane request failed: ${a}`)}if(n.status<200||n.status>=300){let s="";try{let a=await n.text();s=a?`: ${a.slice(0,240)}`:""}catch{}throw new D(`control-plane Spec sync HTTP ${n.status}${s}`)}let i;try{i=await n.json()}catch{throw new D("control-plane Spec sync returned non-JSON body")}let o=i;if(!o||o.schema!==cd||!Array.isArray(o.files))throw new D("control-plane Spec sync response missing uibot.spec.sync.v1 shape");return o}function dd(e,t){let r=t.env??process.env,n=t.controlPlaneUrl??e.controlPlaneUrl;if(!n)return null;let i=t.projectId??e.projectId,o=Yt(n),s={...e,controlPlaneUrl:o,...i?{projectId:Gt(i)}:{},updatedAt:new Date().toISOString()},a=bE(r);return{config:s,url:SE(o,s.projectId),...a?{bearer:a}:{}}}function Ie(e,t,r,n){let i=e.log??((s)=>console.log(s)),o=e.error??((s)=>console.error(s));if(e.mode==="json")i(JSON.stringify({ok:t,...r}));else if(t)for(let s of n)i(s);else o(`uibot sync: ${String(r.error??"failed")}`);return t?0:1}function at(e){let t=ae(e),r=nd(e),{digest:n,files:i}=gE(t),o={schema:pE,digest:n,files:i,updatedAt:new Date().toISOString()};mE(r,o);let s={...e,digest:n,updatedAt:o.updatedAt};return Mo(s),{config:s,lock:o}}async function pd(e={}){try{let t=ad(e.cwd??process.cwd()),r=Sn(t);if(r={...r,consumerRoot:t},e.from){let{sourceDir:f,config:d}=Rn(r,e.from);if(!_o(ae(d),d.consumerRoot))throw new D("specDir escapes consumer root");let p=ae(d),{copied:u}=Cn(f,p),{config:m,lock:g}=at(d);return Ie(e,!0,{action:"push",mode:"local",from:f,to:p,copied:u,digest:g.digest,lockPath:m.lockPath},[`sync push: ${u.length} YAML file(s) ${f} \u2192 ${p}`,`digest: ${g.digest}`])}let n=dd(r,e);if(n&&!e.from){let f=e.fetchImpl??fetch,d=await ud({url:n.url,method:"GET",...n.bearer?{bearer:n.bearer}:{},fetchImpl:f}),p=ae(n.config);if(!_o(p,n.config.consumerRoot))throw new D("specDir escapes consumer root");let{copied:u}=hE(d.files,p),{config:m,lock:g}=at(n.config);return Ie(e,!0,{action:"push",mode:"remote",from:n.url,to:p,copied:u,remoteDigest:d.digest,digest:g.digest,lockPath:m.lockPath,projectId:d.projectId},[`sync push (remote): ${u.length} YAML file(s) ${n.url} \u2192 ${p}`,`digest: ${g.digest}`])}let{sourceDir:i,config:o}=Rn(r,e.from);if(!_o(ae(o),o.consumerRoot))throw new D("specDir escapes consumer root");let s=ae(o),{copied:a}=Cn(i,s),{config:c,lock:l}=at(o);return Ie(e,!0,{action:"push",mode:"local",from:i,to:s,copied:a,digest:l.digest,lockPath:c.lockPath},[`sync push: ${a.length} YAML file(s) ${i} \u2192 ${s}`,`digest: ${l.digest}`])}catch(t){let r=t instanceof Error?t.message:String(t);return Ie(e,!1,{action:"push",error:r},[])}}async function fd(e={}){try{let t=ad(e.cwd??process.cwd()),r=Sn(t);r={...r,consumerRoot:t};let n=e.to??e.from;if(n){let{sourceDir:p,config:u}=Rn(r,n),m=ae(u);if(!zt(m))throw new D(`consumer specDir not found: ${m}`);_e(p,{recursive:!0});let{copied:g}=Cn(m,p),{config:h,lock:b}=at(u);return Ie(e,!0,{action:"pull",mode:"local",from:m,to:p,copied:g,digest:b.digest,lockPath:h.lockPath},[`sync pull: ${g.length} YAML file(s) ${m} \u2192 ${p}`,`digest: ${b.digest}`])}let i=dd(r,e);if(i){let p=ae(i.config);if(!zt(p))throw new D(`consumer specDir not found: ${p}`);let u=yE(p),m=e.fetchImpl??fetch,g=await ud({url:i.url,method:"PUT",...i.bearer?{bearer:i.bearer}:{},body:{schema:cd,files:u},fetchImpl:m}),{config:h,lock:b}=at(i.config);return Ie(e,!0,{action:"pull",mode:"remote",from:p,to:i.url,copied:u.map((R)=>R.path),remoteDigest:g.digest,digest:b.digest,lockPath:h.lockPath,projectId:g.projectId},[`sync pull (remote): ${u.length} YAML file(s) ${p} \u2192 ${i.url}`,`digest: ${b.digest}`])}let o=e.to??e.from,{sourceDir:s,config:a}=Rn(r,o),c=ae(a);if(!zt(c))throw new D(`consumer specDir not found: ${c}`);_e(s,{recursive:!0});let{copied:l}=Cn(c,s),{config:f,lock:d}=at(a);return Ie(e,!0,{action:"pull",mode:"local",from:c,to:s,copied:l,digest:d.digest,lockPath:f.lockPath},[`sync pull: ${l.length} YAML file(s) ${c} \u2192 ${s}`,`digest: ${d.digest}`])}catch(t){let r=t instanceof Error?t.message:String(t);return Ie(e,!1,{action:"pull",error:r},[])}}function xn(e){let t={_:[]};for(let r=0;r<e.length;r+=1){let n=e[r];if(!n.startsWith("--")){t._.push(n);continue}let i=n.slice(2),o=i.indexOf("=");if(o>=0){t[i.slice(0,o)]=i.slice(o+1);continue}let s=e[r+1];if(s!==void 0&&!s.startsWith("--"))t[i]=s,r+=1;else t[i]=!0}return t}function P(e,t){let r=e[t];return typeof r==="string"?r:void 0}var md="uibot.resource.envelope.v1",YL=["resource-cli-invalid-mode","resource-cli-invalid-argument","resource-cli-internal-error"];class G extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceCliError"}}function Bo(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},...e.tags.length?{tags:e.tags}:{},...e.capabilities.length?{capabilities:e.capabilities}:{},...e.dependencies.length?{dependencies:e.dependencies}:{},source:e.source,maturity:e.receipt.maturity,receiptLevel:e.receipt.level,...e.receipt.evidence.length?{evidence:e.receipt.evidence}:{}}}function CE(e){return{id:e.resource.id,score:e.score,reasons:e.reasons,resource:Bo(e.resource)}}function hd(){return typeof crypto.randomUUID==="function"?crypto.randomUUID():`resource-${Date.now().toString(36)}`}function yd(e,t){return{dense:t,encoding:t?"dense-v1":"full",resourceIndexSchemaVersion:e.manifest().schemaVersion}}function RE(e,t,r,n){return{schemaVersion:md,requestId:r.requestId??hd(),command:e,ok:!0,data:t,meta:yd(r.queryService,n)}}function kE(e,t,r,n){let i=t instanceof ee||t instanceof G?t.code:"resource-cli-internal-error",o=t instanceof ee||t instanceof G?t.detail:"resource command failed";return{schemaVersion:md,requestId:r.requestId??hd(),command:e,ok:!1,error:{code:i,message:`${i}: ${o}`,detail:o},meta:yd(r.queryService,n)}}function vn(e,t){let r=e[t];if(r===void 0)return;if(typeof r!=="string")throw new G("resource-cli-invalid-argument",`--${t} requires a value`);let n=r.split(",").map((i)=>i.trim()).filter(Boolean);if(n.length===0)throw new G("resource-cli-invalid-argument",`--${t} is empty`);return n}function gd(e,t,r){let n=vn(e,t);if(!n)return;for(let i of n)if(!r.includes(i))throw new G("resource-cli-invalid-argument",`--${t}=${i}; expected one of ${r.join(",")}`);return n}function xE(e){let t=gd(e,"kind",Wo),r=vn(e,"tag"),n=vn(e,"category"),i=vn(e,"capability"),o=gd(e,"maturity",Pn),s=P(e,"limit"),a;if(e.limit!==void 0){if(!s||!/^\d+$/.test(s)||Number(s)<=0)throw new G("resource-cli-invalid-argument",`--limit=${s??"<missing>"}; expected a positive integer`);a=Number(s)}let c=e._.join(" ").trim();return{...c?{text:c}:{},...t?{kinds:t}:{},...r?{tags:r}:{},...n?{categories:n}:{},...i?{capabilities:i}:{},...o?{maturities:o}:{},...a!==void 0?{limit:a}:{}}}function vE(e,t,r){if(e==="manifest"){let n=t;for(let i of n.index.resources)r(`${i.id} ${i.kind} ${i.receipt.maturity} ${i.title}`);return}if(e==="search"){let n=t;for(let i of n.matches)r(`${i.resource.id} ${i.score} ${i.reasons.map((o)=>o.code).join(",")} ${i.resource.title}`);return}r(JSON.stringify(t,null,2))}async function bd(e,t,r){let n=xn(t),i=r.log??((f)=>console.log(f)),o=r.errorLog??((f)=>console.error(f)),s=n.dense,a=s===!0,c=P(n,"mode"),l=c??"text";try{let f=je.find((g)=>g.name===e),d=new Set(["mode","dense",...f.options.map((g)=>g.name)]),p=Object.keys(n).find((g)=>g!=="_"&&!d.has(g));if(p)throw new G("resource-cli-invalid-argument",`unsupported flag --${p} for ${e}`);if(n.mode!==void 0&&c===void 0)throw new G("resource-cli-invalid-mode","--mode requires text or json");if(l!=="text"&&l!=="json")throw new G("resource-cli-invalid-mode",`${l}; expected text or json`);if(s!==void 0&&s!==!0)throw new G("resource-cli-invalid-argument","--dense does not take a value");let u;switch(e){case"manifest":{if(n._.length>0)throw new G("resource-cli-invalid-argument","manifest does not accept positionals");let g=r.queryService.manifest();u={operations:je,index:a?{schemaVersion:g.schemaVersion,resources:g.resources.map(Bo),aliasLookup:Object.entries(g.aliases)}:g};break}case"search":{let g=r.queryService.search(xE(n));u={matches:a?g.map(CE):g};break}case"get":{if(n._.length!==1)throw new G("resource-cli-invalid-argument","get requires exactly one id or quoted alias");let g=r.queryService.get(n._[0]);u={resource:a?Bo(g):g};break}case"build":{u={plan:r.queryService.build(n._)};break}}let m=RE(e,u,r,a);if(l==="json")i(JSON.stringify(m));else vE(e,u,i);return 0}catch(f){let d=f instanceof Error?f:Error(String(f)),p=kE(e,d,r,a);if(l==="json"||c!==void 0)i(JSON.stringify(p));else o(p.error.message);return 1}}import{existsSync as wE}from"fs";import{resolve as Fe}from"path";function Sd(e){for(let t of e)if(wE(t))return t;return null}function jo(e=process.cwd()){return Sd([Fe(e,"examples/templates"),Fe(import.meta.dir,"templates"),Fe(import.meta.dir,"../../../examples/templates")])}function Uo(e=process.cwd()){return Sd([Fe(e,"examples/shells"),Fe(import.meta.dir,"shells"),Fe(import.meta.dir,"../../../examples/shells")])}function EE(e){let t={};for(let r of e)for(let[n,i]of Object.entries(r)){if(t[n])throw Error(`duplicate built-in catalog source id: ${n}`);t[n]=i}return t}async function Cd(){let[e,t,r]=await Promise.all([import("@uibot/blocks-shadcn"),import("@uibot/blocks-studio"),Promise.resolve().then(() => (ln(),{}))]),n=[],i=jo();if(i)n.push({dir:i});let o=Uo();if(o)n.push({dir:o,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});let s=ct(n),a=Object.fromEntries(s.map((c)=>[c.name,c.templateContract]));return ss(Zo({components:EE([e.CATALOG_ENTRIES,t.STUDIO_CATALOG_ENTRIES]),templates:a,designGuides:cn(Fe(import.meta.dir,"../../design-md/content")),examples:Xo(a)}))}async function IE(){let[e,t,r,n]=await Promise.all([import("@uibot/blocks-shadcn"),import("@uibot/blocks-shadcn/registry-source"),import("@uibot/blocks-studio"),import("@uibot/blocks-studio/registry-source")]);return Go([{sourceDir:t.SOURCE_DIR,blockFileMap:t.BLOCK_FILE,catalog:e.CATALOG_ENTRIES},{sourceDir:n.SOURCE_DIR,blockFileMap:n.BLOCK_FILE,catalog:r.STUDIO_CATALOG_ENTRIES}])}function Z(e,t){if(P(e,"mode")==="json")console.log(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:t}));else console.error(t);return 1}async function PE(e){let[t,...r]=e,n=xn(r),i=P(n,"registry");switch(t){case"manifest":case"search":case"get":case"build":{let o=await Cd();return bd(t,r,{queryService:o})}case"list":return await ms({...i?{registry:i}:{}}),0;case"add":{let o=n._[0];if(!o)return Z(n,"uibot add: missing artifact <name>");return await gs(o,{...i?{registry:i}:{},workspaceRoot:P(n,"cwd")??process.cwd()}),0}case"publish":{let o=await IE(),s=[],a=jo();if(a)s.push({dir:a});let c=Uo();if(c)s.push({dir:c,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});let l=ct(s);return await ys({out:P(n,"out")??"dist/registry",manifestName:P(n,"name")??"uibot",sources:o,...l.length?{templates:l}:{}}),0}case"design-md":{if(n._[0]!=="sync")return Z(n,"uibot design-md: expected subcommand 'sync'");let s=P(n,"from");if(!s)return Z(n,"uibot design-md sync: missing --from <github:owner/repo|https-url>");let c=P(n,"mode")==="json"?"json":"text",l=P(n,"license"),{code:f}=await Au({from:s,cwd:P(n,"cwd")??process.cwd(),mode:c,...l?{license:l}:{},dryRun:n["dry-run"]===!0});return f}case"regressions":{if(n._[0]!=="reverify")return Z(n,"uibot regressions: expected subcommand 'reverify'");let s=P(n,"mode")==="json"?"json":"text",a=P(n,"skill"),{code:c}=await ju({cwd:P(n,"cwd")??process.cwd(),mode:s,...a?{skillId:a}:{}});return c}case"skills":{let o=n._[0],s=n._[1],a=P(n,"mode")==="json"?"json":"text",c=P(n,"cwd")??process.cwd();if(o==="promote"){if(!s)return Z(n,"uibot skills promote: missing <id>");return Hu(s,{cwd:c,mode:a})}if(o==="rollback"){if(!s)return Z(n,"uibot skills rollback: missing <id>");return Yu(s,{cwd:c,mode:a})}return Z(n,"uibot skills: expected promote|rollback <id>")}case"project":{let o=n._[0],s=n._[1];if(o!=="export"||!s)return Z(n,"uibot project: expected export <dir>");let a=P(n,"mode")==="json"?"json":"text";return Gu(s,{cwd:P(n,"cwd")??process.cwd(),mode:a})}case"link":{let o=P(n,"spec-dir")??n._[0];if(!o||typeof o!=="string")return Z(n,"uibot link: missing --spec-dir <relative-dir> (or positional <spec-dir>)");let s=P(n,"source-dir"),a=P(n,"control-plane-url"),c=P(n,"project-id"),l=P(n,"lock-path"),{code:f}=rd({cwd:P(n,"cwd")??process.cwd(),specDir:o,...s?{sourceDir:s}:{},...a?{controlPlaneUrl:a}:{},...c?{projectId:c}:{},...l?{lockPath:l}:{},force:n.force===!0,mode:P(n,"mode")==="json"?"json":"text"});return f}case"sync":{let o=n._[0];if(o!=="push"&&o!=="pull")return Z(n,"uibot sync: expected subcommand 'push' or 'pull'");let s=P(n,"mode")==="json"?"json":"text",a=P(n,"cwd")??process.cwd(),c=P(n,"from"),l=P(n,"to"),f=P(n,"control-plane-url"),d=P(n,"project-id");if(o==="push")return pd({cwd:a,mode:s,...c?{from:c}:{},...f?{controlPlaneUrl:f}:{},...d?{projectId:d}:{}});return fd({cwd:a,mode:s,...l?{to:l}:{},...c&&!l?{from:c}:{},...f?{controlPlaneUrl:f}:{},...d?{projectId:d}:{}})}case"doctor":{let o=P(n,"registry");return zu({cwd:P(n,"cwd")??process.cwd(),mode:P(n,"mode")==="json"?"json":"text",...o?{registry:o}:{}})}case"init":{let o=P(n,"into");if(o){let c=P(n,"spec-path"),l=P(n,"mount-path"),{code:f}=Zu({into:o,...c?{specPath:c}:{},...l?{mountPath:l}:{},force:n.force===!0,mode:P(n,"mode")==="json"?"json":"text"});return f}let s=n._[0];if(!s)return Z(n,"uibot init: missing <dir> (or use --into <existing-app>)");let a=P(n,"template");return await Xu({dir:s,...a?{template:a}:{}}),0}case"help":case"--help":case"-h":case void 0:return console.log(qn()),0;default:{let o=`uibot: unknown command '${t}'`;if(P(n,"mode")==="json")return Z(n,o);return console.error(`${o}
|
|
404
|
-
`),console.error(
|
|
402
|
+
`);return{digest:`sha256:${Vo(r||"empty")}`,files:t}}function AE(e,t){je(Ko(e),{recursive:!0}),fd(e,`${JSON.stringify(t,null,2)}
|
|
403
|
+
`,"utf8")}function wn(e,t){if(!Qt(e)||!kE(e).isDirectory())throw new D(`source Spec directory not found: ${e}`);je(t,{recursive:!0});let r=[];for(let n of En(e)){let i=vE(e,n),o=de(i,t,"sync");je(Ko(o),{recursive:!0}),CE(n,o),r.push(lt(t,o))}return{copied:r,removedNone:!0}}function DE(e,t){je(t,{recursive:!0});let r=[],n=new Set;for(let i of e){if(!i.path||i.path.includes("\x00")||typeof i.content!=="string")throw new D("remote Spec file entry is invalid");if(!hd.test(i.path))throw new D(`remote Spec path is not YAML: ${i.path}`);let o=de(i.path,t,"sync");je(Ko(o),{recursive:!0}),fd(o,i.content,"utf8");let s=lt(t,o);n.add(s),r.push(s)}for(let i of En(t)){let o=lt(t,i);if(!n.has(o))xE(i)}return{copied:r.sort((i,o)=>i.localeCompare(o))}}function OE(e){return En(e).map((t)=>{let r=pd(t,"utf8");return{path:lt(e,t),content:r,sha256:Vo(r)}})}function vn(e,t){let r=t??e.sourceDir;if(!r)throw new D("no sourceDir: pass --from <dir> (push) / --to <dir> (pull), or re-run `uibot link --source-dir <dir>` (or configure --control-plane-url)");let n=qo(r,e.consumerRoot),i={...e,sourceDir:n,updatedAt:new Date().toISOString()};return{sourceDir:n,config:i}}function TE(e=process.env){return e.UIBOT_CONTROL_PLANE_AUTH_BEARER?.trim()||e.UIBOT_STUDIO_AUTH_BEARER?.trim()||""||void 0}function LE(e,t){let r=Wt(e),n=t?Jt(t):"default",i=new URL(`${r}${IE}`);return i.searchParams.set("projectId",n),i.toString()}async function yd(e){let t={accept:"application/json"};if(e.bearer)t.authorization=`Bearer ${e.bearer}`;let r={method:e.method,headers:t};if(e.method==="PUT")t["content-type"]="application/json",r={...r,body:JSON.stringify(e.body)};let n;try{n=await e.fetchImpl(e.url,r)}catch(s){let a=s instanceof Error?s.message:String(s);throw new D(`control-plane request failed: ${a}`)}if(n.status<200||n.status>=300){let s="";try{let a=await n.text();s=a?`: ${a.slice(0,240)}`:""}catch{}throw new D(`control-plane Spec sync HTTP ${n.status}${s}`)}let i;try{i=await n.json()}catch{throw new D("control-plane Spec sync returned non-JSON body")}let o=i;if(!o||o.schema!==md||!Array.isArray(o.files))throw new D("control-plane Spec sync response missing uibot.spec.sync.v1 shape");return o}function bd(e,t){let r=t.env??process.env,n=t.controlPlaneUrl??e.controlPlaneUrl;if(!n)return null;let i=t.projectId??e.projectId,o=Wt(n),s={...e,controlPlaneUrl:o,...i?{projectId:Jt(i)}:{},updatedAt:new Date().toISOString()},a=TE(r);return{config:s,url:LE(o,s.projectId),...a?{bearer:a}:{}}}function Pe(e,t,r,n){let i=e.log??((s)=>console.log(s)),o=e.error??((s)=>console.error(s));if(e.mode==="json")i(JSON.stringify({ok:t,...r}));else if(t)for(let s of n)i(s);else o(`uibot sync: ${String(r.error??"failed")}`);return t?0:1}function ut(e){let t=ae(e),r=ud(e),{digest:n,files:i}=PE(t),o={schema:EE,digest:n,files:i,updatedAt:new Date().toISOString()};AE(r,o);let s={...e,digest:n,updatedAt:o.updatedAt};return Bo(s),{config:s,lock:o}}async function Sd(e={}){try{let t=gd(e.cwd??process.cwd()),r=xn(t);if(r={...r,consumerRoot:t},e.from){let{sourceDir:p,config:d}=vn(r,e.from);if(!Uo(ae(d),d.consumerRoot))throw new D("specDir escapes consumer root");let f=ae(d),{copied:u}=wn(p,f),{config:m,lock:g}=ut(d);return Pe(e,!0,{action:"push",mode:"local",from:p,to:f,copied:u,digest:g.digest,lockPath:m.lockPath},[`sync push: ${u.length} YAML file(s) ${p} \u2192 ${f}`,`digest: ${g.digest}`])}let n=bd(r,e);if(n&&!e.from){let p=e.fetchImpl??fetch,d=await yd({url:n.url,method:"GET",...n.bearer?{bearer:n.bearer}:{},fetchImpl:p}),f=ae(n.config);if(!Uo(f,n.config.consumerRoot))throw new D("specDir escapes consumer root");let{copied:u}=DE(d.files,f),{config:m,lock:g}=ut(n.config);return Pe(e,!0,{action:"push",mode:"remote",from:n.url,to:f,copied:u,remoteDigest:d.digest,digest:g.digest,lockPath:m.lockPath,projectId:d.projectId},[`sync push (remote): ${u.length} YAML file(s) ${n.url} \u2192 ${f}`,`digest: ${g.digest}`])}let{sourceDir:i,config:o}=vn(r,e.from);if(!Uo(ae(o),o.consumerRoot))throw new D("specDir escapes consumer root");let s=ae(o),{copied:a}=wn(i,s),{config:c,lock:l}=ut(o);return Pe(e,!0,{action:"push",mode:"local",from:i,to:s,copied:a,digest:l.digest,lockPath:c.lockPath},[`sync push: ${a.length} YAML file(s) ${i} \u2192 ${s}`,`digest: ${l.digest}`])}catch(t){let r=t instanceof Error?t.message:String(t);return Pe(e,!1,{action:"push",error:r},[])}}async function Cd(e={}){try{let t=gd(e.cwd??process.cwd()),r=xn(t);r={...r,consumerRoot:t};let n=e.to??e.from;if(n){let{sourceDir:f,config:u}=vn(r,n),m=ae(u);if(!Qt(m))throw new D(`consumer specDir not found: ${m}`);je(f,{recursive:!0});let{copied:g}=wn(m,f),{config:h,lock:b}=ut(u);return Pe(e,!0,{action:"pull",mode:"local",from:m,to:f,copied:g,digest:b.digest,lockPath:h.lockPath},[`sync pull: ${g.length} YAML file(s) ${m} \u2192 ${f}`,`digest: ${b.digest}`])}let i=bd(r,e);if(i){let f=ae(i.config);if(!Qt(f))throw new D(`consumer specDir not found: ${f}`);let u=OE(f),m=e.fetchImpl??fetch,g=await yd({url:i.url,method:"PUT",...i.bearer?{bearer:i.bearer}:{},body:{schema:md,files:u},fetchImpl:m}),{config:h,lock:b}=ut(i.config);return Pe(e,!0,{action:"pull",mode:"remote",from:f,to:i.url,copied:u.map((R)=>R.path),remoteDigest:g.digest,digest:b.digest,lockPath:h.lockPath,projectId:g.projectId},[`sync pull (remote): ${u.length} YAML file(s) ${f} \u2192 ${i.url}`,`digest: ${b.digest}`])}let o=e.to??e.from,{sourceDir:s,config:a}=vn(r,o),c=ae(a);if(!Qt(c))throw new D(`consumer specDir not found: ${c}`);je(s,{recursive:!0});let{copied:l}=wn(c,s),{config:p,lock:d}=ut(a);return Pe(e,!0,{action:"pull",mode:"local",from:c,to:s,copied:l,digest:d.digest,lockPath:p.lockPath},[`sync pull: ${l.length} YAML file(s) ${c} \u2192 ${s}`,`digest: ${d.digest}`])}catch(t){let r=t instanceof Error?t.message:String(t);return Pe(e,!1,{action:"pull",error:r},[])}}function In(e){let t={_:[]};for(let r=0;r<e.length;r+=1){let n=e[r];if(!n.startsWith("--")){t._.push(n);continue}let i=n.slice(2),o=i.indexOf("=");if(o>=0){t[i.slice(0,o)]=i.slice(o+1);continue}let s=e[r+1];if(s!==void 0&&!s.startsWith("--"))t[i]=s,r+=1;else t[i]=!0}return t}function P(e,t){let r=e[t];return typeof r==="string"?r:void 0}var kd="uibot.resource.envelope.v1",yN=["resource-cli-invalid-mode","resource-cli-invalid-argument","resource-cli-internal-error"];class Y extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceCliError"}}function Ho(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},...e.tags.length?{tags:e.tags}:{},...e.capabilities.length?{capabilities:e.capabilities}:{},...e.dependencies.length?{dependencies:e.dependencies}:{},source:e.source,maturity:e.receipt.maturity,receiptLevel:e.receipt.level,...e.receipt.evidence.length?{evidence:e.receipt.evidence}:{}}}function NE(e){return{id:e.resource.id,score:e.score,reasons:e.reasons,resource:Ho(e.resource)}}function xd(){return typeof crypto.randomUUID==="function"?crypto.randomUUID():`resource-${Date.now().toString(36)}`}function wd(e,t){return{dense:t,encoding:t?"dense-v1":"full",resourceIndexSchemaVersion:e.manifest().schemaVersion}}function $E(e,t,r,n){return{schemaVersion:kd,requestId:r.requestId??xd(),command:e,ok:!0,data:t,meta:wd(r.queryService,n)}}function ME(e,t,r,n){let i=t instanceof ee||t instanceof Y?t.code:"resource-cli-internal-error",o=t instanceof ee||t instanceof Y?t.detail:"resource command failed";return{schemaVersion:kd,requestId:r.requestId??xd(),command:e,ok:!1,error:{code:i,message:`${i}: ${o}`,detail:o},meta:wd(r.queryService,n)}}function Pn(e,t){let r=e[t];if(r===void 0)return;if(typeof r!=="string")throw new Y("resource-cli-invalid-argument",`--${t} requires a value`);let n=r.split(",").map((i)=>i.trim()).filter(Boolean);if(n.length===0)throw new Y("resource-cli-invalid-argument",`--${t} is empty`);return n}function Rd(e,t,r){let n=Pn(e,t);if(!n)return;for(let i of n)if(!r.includes(i))throw new Y("resource-cli-invalid-argument",`--${t}=${i}; expected one of ${r.join(",")}`);return n}function _E(e){let t=Rd(e,"kind",es),r=Pn(e,"tag"),n=Pn(e,"category"),i=Pn(e,"capability"),o=Rd(e,"maturity",Tn),s=P(e,"limit"),a;if(e.limit!==void 0){if(!s||!/^\d+$/.test(s)||Number(s)<=0)throw new Y("resource-cli-invalid-argument",`--limit=${s??"<missing>"}; expected a positive integer`);a=Number(s)}let c=e._.join(" ").trim();return{...c?{text:c}:{},...t?{kinds:t}:{},...r?{tags:r}:{},...n?{categories:n}:{},...i?{capabilities:i}:{},...o?{maturities:o}:{},...a!==void 0?{limit:a}:{}}}function FE(e,t,r){if(e==="manifest"){let n=t;for(let i of n.index.resources)r(`${i.id} ${i.kind} ${i.receipt.maturity} ${i.title}`);return}if(e==="search"){let n=t;for(let i of n.matches)r(`${i.resource.id} ${i.score} ${i.reasons.map((o)=>o.code).join(",")} ${i.resource.title}`);return}r(JSON.stringify(t,null,2))}async function vd(e,t,r){let n=In(t),i=r.log??((p)=>console.log(p)),o=r.errorLog??((p)=>console.error(p)),s=n.dense,a=s===!0,c=P(n,"mode"),l=c??"text";try{let p=Ve.find((g)=>g.name===e),d=new Set(["mode","dense",...p.options.map((g)=>g.name)]),f=Object.keys(n).find((g)=>g!=="_"&&!d.has(g));if(f)throw new Y("resource-cli-invalid-argument",`unsupported flag --${f} for ${e}`);if(n.mode!==void 0&&c===void 0)throw new Y("resource-cli-invalid-mode","--mode requires text or json");if(l!=="text"&&l!=="json")throw new Y("resource-cli-invalid-mode",`${l}; expected text or json`);if(s!==void 0&&s!==!0)throw new Y("resource-cli-invalid-argument","--dense does not take a value");let u;switch(e){case"manifest":{if(n._.length>0)throw new Y("resource-cli-invalid-argument","manifest does not accept positionals");let g=r.queryService.manifest();u={operations:Ve,index:a?{schemaVersion:g.schemaVersion,resources:g.resources.map(Ho),aliasLookup:Object.entries(g.aliases)}:g};break}case"search":{let g=r.queryService.search(_E(n));u={matches:a?g.map(NE):g};break}case"get":{if(n._.length!==1)throw new Y("resource-cli-invalid-argument","get requires exactly one id or quoted alias");let g=r.queryService.get(n._[0]);u={resource:a?Ho(g):g};break}case"build":{u={plan:r.queryService.build(n._)};break}}let m=$E(e,u,r,a);if(l==="json")i(JSON.stringify(m));else FE(e,u,i);return 0}catch(p){let d=p instanceof Error?p:Error(String(p)),f=ME(e,d,r,a);if(l==="json"||c!==void 0)i(JSON.stringify(f));else o(f.error.message);return 1}}import{existsSync as jE}from"fs";import{resolve as qe}from"path";function Ed(e){for(let t of e)if(jE(t))return t;return null}function Go(e=process.cwd()){return Ed([qe(e,"examples/templates"),qe(import.meta.dir,"templates"),qe(import.meta.dir,"../../../examples/templates")])}function Yo(e=process.cwd()){return Ed([qe(e,"examples/shells"),qe(import.meta.dir,"shells"),qe(import.meta.dir,"../../../examples/shells")])}function qE(e){let t={};for(let r of e)for(let[n,i]of Object.entries(r)){if(t[n])throw Error(`duplicate built-in catalog source id: ${n}`);t[n]=i}return t}async function Id(){let[e,t,r]=await Promise.all([import("@uibot/blocks-shadcn"),import("@uibot/blocks-studio"),Promise.resolve().then(() => (fn(),{}))]),n=[],i=Go();if(i)n.push({dir:i});let o=Yo();if(o)n.push({dir:o,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});let s=dt(n),a=Object.fromEntries(s.map((c)=>[c.name,c.templateContract]));return ds(is({components:qE([e.CATALOG_ENTRIES,t.STUDIO_CATALOG_ENTRIES]),templates:a,designGuides:pn(qe(import.meta.dir,"../../design-md/content")),examples:ns(a)}))}async function BE(){let[e,t,r,n]=await Promise.all([import("@uibot/blocks-shadcn"),import("@uibot/blocks-shadcn/registry-source"),import("@uibot/blocks-studio"),import("@uibot/blocks-studio/registry-source")]);return Xo([{sourceDir:t.SOURCE_DIR,blockFileMap:t.BLOCK_FILE,catalog:e.CATALOG_ENTRIES},{sourceDir:n.SOURCE_DIR,blockFileMap:n.BLOCK_FILE,catalog:r.STUDIO_CATALOG_ENTRIES}])}function Z(e,t){if(P(e,"mode")==="json")console.log(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:t}));else console.error(t);return 1}async function UE(e){let[t,...r]=e,n=In(r),i=P(n,"registry");switch(t){case"manifest":case"search":case"get":case"build":{let o=await Id();return vd(t,r,{queryService:o})}case"list":return await Cs({...i?{registry:i}:{}}),0;case"add":{let o=n._[0];if(!o)return Z(n,"uibot add: missing artifact <name>");return await Ss(o,{...i?{registry:i}:{},workspaceRoot:P(n,"cwd")??process.cwd()}),0}case"publish":{let o=await BE(),s=[],a=Go();if(a)s.push({dir:a});let c=Yo();if(c)s.push({dir:c,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});let l=dt(s);return await ks({out:P(n,"out")??"dist/registry",manifestName:P(n,"name")??"uibot",sources:o,...l.length?{templates:l}:{}}),0}case"design-md":{if(n._[0]!=="sync")return Z(n,"uibot design-md: expected subcommand 'sync'");let s=P(n,"from");if(!s)return Z(n,"uibot design-md sync: missing --from <github:owner/repo|https-url>");let c=P(n,"mode")==="json"?"json":"text",l=P(n,"license"),{code:p}=await Mu({from:s,cwd:P(n,"cwd")??process.cwd(),mode:c,...l?{license:l}:{},dryRun:n["dry-run"]===!0});return p}case"regressions":{if(n._[0]!=="reverify")return Z(n,"uibot regressions: expected subcommand 'reverify'");let s=P(n,"mode")==="json"?"json":"text",a=P(n,"skill"),{code:c}=await zu({cwd:P(n,"cwd")??process.cwd(),mode:s,...a?{skillId:a}:{}});return c}case"skills":{let o=n._[0],s=n._[1],a=P(n,"mode")==="json"?"json":"text",c=P(n,"cwd")??process.cwd();if(o==="promote"){if(!s)return Z(n,"uibot skills promote: missing <id>");return Xu(s,{cwd:c,mode:a})}if(o==="rollback"){if(!s)return Z(n,"uibot skills rollback: missing <id>");return Zu(s,{cwd:c,mode:a})}return Z(n,"uibot skills: expected promote|rollback <id>")}case"project":{let o=n._[0],s=n._[1];if(o!=="export"||!s)return Z(n,"uibot project: expected export <dir>");let a=P(n,"mode")==="json"?"json":"text";return ed(s,{cwd:P(n,"cwd")??process.cwd(),mode:a})}case"link":{let o=P(n,"spec-dir")??n._[0];if(!o||typeof o!=="string")return Z(n,"uibot link: missing --spec-dir <relative-dir> (or positional <spec-dir>)");let s=P(n,"source-dir"),a=P(n,"control-plane-url"),c=P(n,"project-id"),l=P(n,"lock-path"),{code:p}=ld({cwd:P(n,"cwd")??process.cwd(),specDir:o,...s?{sourceDir:s}:{},...a?{controlPlaneUrl:a}:{},...c?{projectId:c}:{},...l?{lockPath:l}:{},force:n.force===!0,mode:P(n,"mode")==="json"?"json":"text"});return p}case"sync":{let o=n._[0];if(o!=="push"&&o!=="pull")return Z(n,"uibot sync: expected subcommand 'push' or 'pull'");let s=P(n,"mode")==="json"?"json":"text",a=P(n,"cwd")??process.cwd(),c=P(n,"from"),l=P(n,"to"),p=P(n,"control-plane-url"),d=P(n,"project-id");if(o==="push")return Sd({cwd:a,mode:s,...c?{from:c}:{},...p?{controlPlaneUrl:p}:{},...d?{projectId:d}:{}});return Cd({cwd:a,mode:s,...l?{to:l}:{},...c&&!l?{from:c}:{},...p?{controlPlaneUrl:p}:{},...d?{projectId:d}:{}})}case"doctor":{let o=P(n,"registry");return td({cwd:P(n,"cwd")??process.cwd(),mode:P(n,"mode")==="json"?"json":"text",...o?{registry:o}:{}})}case"init":{let o=P(n,"into");if(o){let c=P(n,"spec-path"),l=P(n,"mount-path"),{code:p}=sd({into:o,...c?{specPath:c}:{},...l?{mountPath:l}:{},force:n.force===!0,mode:P(n,"mode")==="json"?"json":"text"});return p}let s=n._[0];if(!s)return Z(n,"uibot init: missing <dir> (or use --into <existing-app>)");let a=P(n,"template");return await od({dir:s,...a?{template:a}:{}}),0}case"help":case"--help":case"-h":case void 0:return console.log(Vn()),0;default:{let o=`uibot: unknown command '${t}'`;if(P(n,"mode")==="json")return Z(n,o);return console.error(`${o}
|
|
404
|
+
`),console.error(Vn()),1}}}if(import.meta.main)UE(process.argv.slice(2)).then((e)=>{if(e!==0)process.exit(e)}).catch((e)=>{console.error(e instanceof Error?e.message:String(e)),process.exit(1)});export{UE as main};
|