zen-code 4.10.1 → 5.0.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/app.js +151 -2699
- package/dist/chunk-069q9hkz.js +1 -0
- package/dist/chunk-06trk066.js +1 -0
- package/dist/chunk-0kfw8bwn.js +2 -0
- package/dist/chunk-0mq8786q.js +281 -0
- package/dist/chunk-0qz8rr2k.js +1 -0
- package/dist/chunk-1d47g6nc.js +2 -0
- package/dist/chunk-1gssqf6g.js +88 -0
- package/dist/chunk-1rcc9xzn.js +79 -0
- package/dist/chunk-2bjeg40f.js +1 -0
- package/dist/chunk-2gd8vzrf.js +2 -0
- package/dist/chunk-2gprcgep.js +6 -0
- package/dist/chunk-3k3c686f.js +1 -0
- package/dist/chunk-43h0n2td.js +1 -0
- package/dist/chunk-492hjs9k.js +26 -0
- package/dist/chunk-4eaqmt3c.js +16 -0
- package/dist/chunk-4fs853nh.js +2 -0
- package/dist/chunk-5fe27s34.js +2 -0
- package/dist/chunk-5hqvapp1.js +7 -0
- package/dist/chunk-6b3vfr39.js +2 -0
- package/dist/chunk-6j695pam.js +5 -0
- package/dist/chunk-6saqxa3z.js +2 -0
- package/dist/chunk-78ksrp8v.js +41 -0
- package/dist/chunk-7cx9kda0.js +228 -0
- package/dist/chunk-7qba2raw.js +2 -0
- package/dist/chunk-81b2s97q.js +1 -0
- package/dist/chunk-88w3txtb.js +160 -0
- package/dist/chunk-8ygdre0g.js +1 -0
- package/dist/chunk-9011y634.js +6 -0
- package/dist/chunk-9zcr1qh6.js +1 -0
- package/dist/chunk-a0nr8jva.js +2 -0
- package/dist/chunk-agevsn2e.js +1 -0
- package/dist/chunk-akc3s5aw.js +6 -0
- package/dist/chunk-b0beqmg2.js +2 -0
- package/dist/chunk-b175s7dm.js +1 -0
- package/dist/chunk-bk32cwxa.js +5 -0
- package/dist/chunk-bn077sjq.js +213 -0
- package/dist/chunk-c9yrpb3g.js +18 -0
- package/dist/chunk-cb0f54ar.js +3 -0
- package/dist/chunk-ctqtahz4.js +1 -0
- package/dist/chunk-d2sr8fnm.js +3 -0
- package/dist/chunk-d5gzkkgg.js +1 -0
- package/dist/chunk-dh2f4xyb.js +3 -0
- package/dist/chunk-dr32dt9y.js +1 -0
- package/dist/chunk-dv1vt080.js +1 -0
- package/dist/chunk-dz9sqfph.js +2 -0
- package/dist/chunk-e7mbewmw.js +1 -0
- package/dist/chunk-em03xqy9.js +1 -0
- package/dist/chunk-fkt5b511.js +1 -0
- package/dist/chunk-gphssgy6.js +2 -0
- package/dist/chunk-h2hk7vx4.js +1 -0
- package/dist/chunk-h7ypcqp3.js +279 -0
- package/dist/chunk-j8tq0e8m.js +2 -0
- package/dist/chunk-jd1razfg.js +91 -0
- package/dist/chunk-jhxvctg5.js +8 -0
- package/dist/chunk-kada5fyh.js +1 -0
- package/dist/chunk-kgc6ws03.js +1 -0
- package/dist/chunk-mk8ggmt8.js +17 -0
- package/dist/chunk-mv5m8bf4.js +140 -0
- package/dist/chunk-mv8a5svx.js +1 -0
- package/dist/chunk-n61yv4t5.js +2 -0
- package/dist/chunk-nt2yp4jh.js +1 -0
- package/dist/chunk-p7ew4trx.js +1 -0
- package/dist/chunk-pgnhcznr.js +4 -0
- package/dist/chunk-q8cfxky4.js +8 -0
- package/dist/chunk-q8zsxwd8.js +81 -0
- package/dist/chunk-qfa5v4n5.js +1 -0
- package/dist/chunk-qhzztj83.js +1 -0
- package/dist/chunk-snmkgfbe.js +15 -0
- package/dist/chunk-ss4bh5wb.js +2 -0
- package/dist/chunk-sv0k2v66.js +1 -0
- package/dist/chunk-tbav8trq.js +23 -0
- package/dist/chunk-tmyzfvsy.js +1 -0
- package/dist/chunk-ts4jreym.js +7 -0
- package/dist/chunk-tws3wcnm.js +2 -0
- package/dist/chunk-v0e9bsvt.js +89 -0
- package/dist/chunk-vwj4n000.js +4 -0
- package/dist/chunk-wd6s7gg7.js +175 -0
- package/dist/chunk-y524zd2h.js +54 -0
- package/dist/chunk-yb71zqvt.js +2 -0
- package/dist/chunk-yejgw2hm.js +112 -0
- package/dist/chunk-yfjs6pf8.js +3 -0
- package/dist/chunk-zhqdp4ak.js +2 -0
- package/dist/chunk-zkd3m39v.js +1 -0
- package/dist/cli.js +1 -3116
- package/dist/nonInteractive.js +180 -1950
- package/dist/zen-core.js +644 -0
- package/dist/zen-keyboard.js +3 -358
- package/package.json +5 -3
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import{$l as n0,Yl as O}from"./chunk-4fs853nh.js";var w=O((q9)=>{var Nq=Symbol.for("yaml.alias"),k$=Symbol.for("yaml.document"),k0=Symbol.for("yaml.map"),v$=Symbol.for("yaml.pair"),bq=Symbol.for("yaml.scalar"),v0=Symbol.for("yaml.seq"),x=Symbol.for("yaml.node.type"),sU=(q)=>!!q&&typeof q==="object"&&q[x]===Nq,iU=(q)=>!!q&&typeof q==="object"&&q[x]===k$,rU=(q)=>!!q&&typeof q==="object"&&q[x]===k0,nU=(q)=>!!q&&typeof q==="object"&&q[x]===v$,m$=(q)=>!!q&&typeof q==="object"&&q[x]===bq,oU=(q)=>!!q&&typeof q==="object"&&q[x]===v0;function p$(q){if(q&&typeof q==="object")switch(q[x]){case k0:case v0:return!0}return!1}function tU(q){if(q&&typeof q==="object")switch(q[x]){case Nq:case k0:case bq:case v0:return!0}return!1}var eU=(q)=>(m$(q)||p$(q))&&!!q.anchor;q9.ALIAS=Nq;q9.DOC=k$;q9.MAP=k0;q9.NODE_TYPE=x;q9.PAIR=v$;q9.SCALAR=bq;q9.SEQ=v0;q9.hasAnchor=eU;q9.isAlias=sU;q9.isCollection=p$;q9.isDocument=iU;q9.isMap=rU;q9.isNode=tU;q9.isPair=nU;q9.isScalar=m$;q9.isSeq=oU});var W0=O((R9)=>{var j=w(),C=Symbol("break visit"),d$=Symbol("skip children"),h=Symbol("remove node");function m0(q,$){let U=l$($);if(j.isDocument(q)){if(X0(null,q.contents,U,Object.freeze([q]))===h)q.contents=null}else X0(null,q,U,Object.freeze([]))}m0.BREAK=C;m0.SKIP=d$;m0.REMOVE=h;function X0(q,$,U,H){let X=a$(q,$,U,H);if(j.isNode(X)||j.isPair(X))return c$(q,H,X),X0(q,X,U,H);if(typeof X!=="symbol"){if(j.isCollection($)){H=Object.freeze(H.concat($));for(let Z=0;Z<$.items.length;++Z){let G=X0(Z,$.items[Z],U,H);if(typeof G==="number")Z=G-1;else if(G===C)return C;else if(G===h)$.items.splice(Z,1),Z-=1}}else if(j.isPair($)){H=Object.freeze(H.concat($));let Z=X0("key",$.key,U,H);if(Z===C)return C;else if(Z===h)$.key=null;let G=X0("value",$.value,U,H);if(G===C)return C;else if(G===h)$.value=null}}return X}async function p0(q,$){let U=l$($);if(j.isDocument(q)){if(await Z0(null,q.contents,U,Object.freeze([q]))===h)q.contents=null}else await Z0(null,q,U,Object.freeze([]))}p0.BREAK=C;p0.SKIP=d$;p0.REMOVE=h;async function Z0(q,$,U,H){let X=await a$(q,$,U,H);if(j.isNode(X)||j.isPair(X))return c$(q,H,X),Z0(q,X,U,H);if(typeof X!=="symbol"){if(j.isCollection($)){H=Object.freeze(H.concat($));for(let Z=0;Z<$.items.length;++Z){let G=await Z0(Z,$.items[Z],U,H);if(typeof G==="number")Z=G-1;else if(G===C)return C;else if(G===h)$.items.splice(Z,1),Z-=1}}else if(j.isPair($)){H=Object.freeze(H.concat($));let Z=await Z0("key",$.key,U,H);if(Z===C)return C;else if(Z===h)$.key=null;let G=await Z0("value",$.value,U,H);if(G===C)return C;else if(G===h)$.value=null}}return X}function l$(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function a$(q,$,U,H){if(typeof U==="function")return U(q,$,H);if(j.isMap($))return U.Map?.(q,$,H);if(j.isSeq($))return U.Seq?.(q,$,H);if(j.isPair($))return U.Pair?.(q,$,H);if(j.isScalar($))return U.Scalar?.(q,$,H);if(j.isAlias($))return U.Alias?.(q,$,H);return}function c$(q,$,U){let H=$[$.length-1];if(j.isCollection(H))H.items[q]=U;else if(j.isPair(H))if(q==="key")H.key=U;else H.value=U;else if(j.isDocument(H))H.contents=U;else{let X=j.isAlias(H)?"alias":"scalar";throw Error(`Cannot replace node with ${X} parent`)}}R9.visit=m0;R9.visitAsync=p0});var Sq=O((A9)=>{var s$=w(),D9=W0(),P9={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},F9=(q)=>q.replace(/[!,[\]{}]/g,($)=>P9[$]);class E{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},E.defaultYaml,q),this.tags=Object.assign({},E.defaultTags,$)}clone(){let q=new E(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new E(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:E.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},E.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:E.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},E.defaultTags),this.atNextDocument=!1;let U=q.trim().split(/[ \t]+/),H=U.shift();switch(H){case"%TAG":{if(U.length!==2){if($(0,"%TAG directive should contain exactly two parts"),U.length<2)return!1}let[X,Z]=U;return this.tags[X]=Z,!0}case"%YAML":{if(this.yaml.explicit=!0,U.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[X]=U;if(X==="1.1"||X==="1.2")return this.yaml.version=X,!0;else{let Z=/^\d+\.\d+$/.test(X);return $(6,`Unsupported YAML version ${X}`,Z),!1}}default:return $(0,`Unknown directive ${H}`,!0),!1}}tagName(q,$){if(q==="!")return"!";if(q[0]!=="!")return $(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let Z=q.slice(2,-1);if(Z==="!"||Z==="!!")return $(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")$("Verbatim tags must end with a >");return Z}let[,U,H]=q.match(/^(.*!)([^!]*)$/s);if(!H)$(`The ${q} tag has no suffix`);let X=this.tags[U];if(X)try{return X+decodeURIComponent(H)}catch(Z){return $(String(Z)),null}if(U==="!")return q;return $(`Could not resolve tag: ${q}`),null}tagString(q){for(let[$,U]of Object.entries(this.tags))if(q.startsWith(U))return $+F9(q.substring(U.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],U=Object.entries(this.tags),H;if(q&&U.length>0&&s$.isNode(q.contents)){let X={};D9.visit(q.contents,(Z,G)=>{if(s$.isNode(G)&&G.tag)X[G.tag]=!0}),H=Object.keys(X)}else H=[];for(let[X,Z]of U){if(X==="!!"&&Z==="tag:yaml.org,2002:")continue;if(!q||H.some((G)=>G.startsWith(Z)))$.push(`%TAG ${X} ${Z}`)}return $.join(`
|
|
2
|
+
`)}}E.defaultYaml={explicit:!1,version:"1.2"};E.defaultTags={"!!":"tag:yaml.org,2002:"};A9.Directives=E});var d0=O((b9)=>{var i$=w(),w9=W0();function K9(q){if(/[\x00-\x19\s,[\]{}]/.test(q)){let U=`Anchor must not contain whitespace or control characters: ${JSON.stringify(q)}`;throw Error(U)}return!0}function r$(q){let $=new Set;return w9.visit(q,{Value(U,H){if(H.anchor)$.add(H.anchor)}}),$}function n$(q,$){for(let U=1;;++U){let H=`${q}${U}`;if(!$.has(H))return H}}function N9(q,$){let U=[],H=new Map,X=null;return{onAnchor:(Z)=>{U.push(Z),X??(X=r$(q));let G=n$($,X);return X.add(G),G},setAnchors:()=>{for(let Z of U){let G=H.get(Z);if(typeof G==="object"&&G.anchor&&(i$.isScalar(G.node)||i$.isCollection(G.node)))G.node.anchor=G.anchor;else{let z=Error("Failed to resolve repeated object (this should not happen)");throw z.source=Z,z}}},sourceObjects:H}}b9.anchorIsValid=K9;b9.anchorNames=r$;b9.createNodeAnchors=N9;b9.findNewAnchor=n$});var jq=O((g9)=>{function O0(q,$,U,H){if(H&&typeof H==="object")if(Array.isArray(H))for(let X=0,Z=H.length;X<Z;++X){let G=H[X],z=O0(q,H,String(X),G);if(z===void 0)delete H[X];else if(z!==G)H[X]=z}else if(H instanceof Map)for(let X of Array.from(H.keys())){let Z=H.get(X),G=O0(q,H,X,Z);if(G===void 0)H.delete(X);else if(G!==Z)H.set(X,G)}else if(H instanceof Set)for(let X of Array.from(H)){let Z=O0(q,H,X,X);if(Z===void 0)H.delete(X);else if(Z!==X)H.delete(X),H.add(Z)}else for(let[X,Z]of Object.entries(H)){let G=O0(q,H,X,Z);if(G===void 0)delete H[X];else if(G!==Z)H[X]=G}return q.call($,U,H)}g9.applyReviver=O0});var m=O((h9)=>{var y9=w();function o$(q,$,U){if(Array.isArray(q))return q.map((H,X)=>o$(H,String(X),U));if(q&&typeof q.toJSON==="function"){if(!U||!y9.hasAnchor(q))return q.toJSON($,U);let H={aliasCount:0,count:1,res:void 0};U.anchors.set(q,H),U.onCreate=(Z)=>{H.res=Z,delete U.onCreate};let X=q.toJSON($,U);if(U.onCreate)U.onCreate(X);return X}if(typeof q==="bigint"&&!U?.keep)return Number(q);return q}h9.toJS=o$});var l0=O((v9)=>{var x9=jq(),t$=w(),k9=m();class e${constructor(q){Object.defineProperty(this,t$.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:$,maxAliasCount:U,onAnchor:H,reviver:X}={}){if(!t$.isDocument(q))throw TypeError("A document argument is required");let Z={anchors:new Map,doc:q,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof U==="number"?U:100},G=k9.toJS(this,"",Z);if(typeof H==="function")for(let{count:z,res:J}of Z.anchors.values())H(J,z);return typeof X==="function"?x9.applyReviver(X,{"":G},"",G):G}}v9.NodeBase=e$});var R0=O((c9)=>{var p9=d0(),d9=W0(),G0=w(),l9=l0(),a9=m();class q2 extends l9.NodeBase{constructor(q){super(G0.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,$){let U;if($?.aliasResolveCache)U=$.aliasResolveCache;else if(U=[],d9.visit(q,{Node:(X,Z)=>{if(G0.isAlias(Z)||G0.hasAnchor(Z))U.push(Z)}}),$)$.aliasResolveCache=U;let H=void 0;for(let X of U){if(X===this)break;if(X.anchor===this.source)H=X}return H}toJSON(q,$){if(!$)return{source:this.source};let{anchors:U,doc:H,maxAliasCount:X}=$,Z=this.resolve(H,$);if(!Z){let z=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(z)}let G=U.get(Z);if(!G)a9.toJS(Z,null,$),G=U.get(Z);if(G?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(X>=0){if(G.count+=1,G.aliasCount===0)G.aliasCount=a0(H,Z,U);if(G.count*G.aliasCount>X)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return G.res}toString(q,$,U){let H=`*${this.source}`;if(q){if(p9.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let X=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(X)}if(q.implicitKey)return`${H} `}return H}}function a0(q,$,U){if(G0.isAlias($)){let H=$.resolve(q),X=U&&H&&U.get(H);return X?X.count*X.aliasCount:0}else if(G0.isCollection($)){let H=0;for(let X of $.items){let Z=a0(q,X,U);if(Z>H)H=Z}return H}else if(G0.isPair($)){let H=a0(q,$.key,U),X=a0(q,$.value,U);return Math.max(H,X)}return 1}c9.Alias=q2});var N=O((t9)=>{var i9=w(),r9=l0(),n9=m(),o9=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class n extends r9.NodeBase{constructor(q){super(i9.SCALAR);this.value=q}toJSON(q,$){return $?.keep?this.value:n9.toJS(this.value,q,$)}toString(){return String(this.value)}}n.BLOCK_FOLDED="BLOCK_FOLDED";n.BLOCK_LITERAL="BLOCK_LITERAL";n.PLAIN="PLAIN";n.QUOTE_DOUBLE="QUOTE_DOUBLE";n.QUOTE_SINGLE="QUOTE_SINGLE";t9.Scalar=n;t9.isScalarValue=o9});var _0=O((ZH)=>{var $H=R0(),o=w(),$2=N(),UH="tag:yaml.org,2002:";function HH(q,$,U){if($){let H=U.filter((Z)=>Z.tag===$),X=H.find((Z)=>!Z.format)??H[0];if(!X)throw Error(`Tag ${$} not found`);return X}return U.find((H)=>H.identify?.(q)&&!H.format)}function XH(q,$,U){if(o.isDocument(q))q=q.contents;if(o.isNode(q))return q;if(o.isPair(q)){let T=U.schema[o.MAP].createNode?.(U.schema,null,U);return T.items.push(q),T}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:H,onAnchor:X,onTagObj:Z,schema:G,sourceObjects:z}=U,J=void 0;if(H&&q&&typeof q==="object")if(J=z.get(q),J)return J.anchor??(J.anchor=X(q)),new $H.Alias(J.anchor);else J={anchor:null,node:null},z.set(q,J);if($?.startsWith("!!"))$=UH+$.slice(2);let Q=HH(q,$,G.tags);if(!Q){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let T=new $2.Scalar(q);if(J)J.node=T;return T}Q=q instanceof Map?G[o.MAP]:(Symbol.iterator in Object(q))?G[o.SEQ]:G[o.MAP]}if(Z)Z(Q),delete U.onTagObj;let V=Q?.createNode?Q.createNode(U.schema,q,U):typeof Q?.nodeClass?.from==="function"?Q.nodeClass.from(U.schema,q,U):new $2.Scalar(q);if($)V.tag=$;else if(!Q.default)V.tag=Q.tag;if(J)J.node=V;return V}ZH.createNode=XH});var c0=O((QH)=>{var zH=_0(),u=w(),JH=l0();function Cq(q,$,U){let H=U;for(let X=$.length-1;X>=0;--X){let Z=$[X];if(typeof Z==="number"&&Number.isInteger(Z)&&Z>=0){let G=[];G[Z]=H,H=G}else H=new Map([[Z,H]])}return zH.createNode(H,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var U2=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class H2 extends JH.NodeBase{constructor(q,$){super(q);Object.defineProperty(this,"schema",{value:$,configurable:!0,enumerable:!1,writable:!0})}clone(q){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)$.schema=q;if($.items=$.items.map((U)=>u.isNode(U)||u.isPair(U)?U.clone(q):U),this.range)$.range=this.range.slice();return $}addIn(q,$){if(U2(q))this.add($);else{let[U,...H]=q,X=this.get(U,!0);if(u.isCollection(X))X.addIn(H,$);else if(X===void 0&&this.schema)this.set(U,Cq(this.schema,H,$));else throw Error(`Expected YAML collection at ${U}. Remaining path: ${H}`)}}deleteIn(q){let[$,...U]=q;if(U.length===0)return this.delete($);let H=this.get($,!0);if(u.isCollection(H))return H.deleteIn(U);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${U}`)}getIn(q,$){let[U,...H]=q,X=this.get(U,!0);if(H.length===0)return!$&&u.isScalar(X)?X.value:X;else return u.isCollection(X)?X.getIn(H,$):void 0}hasAllNullValues(q){return this.items.every(($)=>{if(!u.isPair($))return!1;let U=$.value;return U==null||q&&u.isScalar(U)&&U.value==null&&!U.commentBefore&&!U.comment&&!U.tag})}hasIn(q){let[$,...U]=q;if(U.length===0)return this.has($);let H=this.get($,!0);return u.isCollection(H)?H.hasIn(U):!1}setIn(q,$){let[U,...H]=q;if(H.length===0)this.set(U,$);else{let X=this.get(U,!0);if(u.isCollection(X))X.setIn(H,$);else if(X===void 0&&this.schema)this.set(U,Cq(this.schema,H,$));else throw Error(`Expected YAML collection at ${U}. Remaining path: ${H}`)}}}QH.Collection=H2;QH.collectionFromPath=Cq;QH.isEmptyPath=U2});var L0=O((WH)=>{var VH=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function Eq(q,$){if(/^\n+$/.test(q))return q.substring(1);return $?q.replace(/^(?! *$)/gm,$):q}var IH=(q,$,U)=>q.endsWith(`
|
|
3
|
+
`)?Eq(U,$):U.includes(`
|
|
4
|
+
`)?`
|
|
5
|
+
`+Eq(U,$):(q.endsWith(" ")?"":" ")+U;WH.indentComment=Eq;WH.lineComment=IH;WH.stringifyComment=VH});var Z2=O((DH)=>{function LH(q,$,U="flow",{indentAtStart:H,lineWidth:X=80,minContentWidth:Z=20,onFold:G,onOverflow:z}={}){if(!X||X<0)return q;if(X<Z)Z=0;let J=Math.max(1+Z,1+X-$.length);if(q.length<=J)return q;let Q=[],V={},T=X-$.length;if(typeof H==="number")if(H>X-Math.max(2,Z))Q.push(0);else T=X-H;let B=void 0,W=void 0,R=!1,Y=-1,I=-1,L=-1;if(U==="block"){if(Y=X2(q,Y,$.length),Y!==-1)T=Y+J}for(let P;P=q[Y+=1];){if(U==="quoted"&&P==="\\"){switch(I=Y,q[Y+1]){case"x":Y+=3;break;case"u":Y+=5;break;case"U":Y+=9;break;default:Y+=1}L=Y}if(P===`
|
|
6
|
+
`){if(U==="block")Y=X2(q,Y,$.length);T=Y+$.length+J,B=void 0}else{if(P===" "&&W&&W!==" "&&W!==`
|
|
7
|
+
`&&W!=="\t"){let F=q[Y+1];if(F&&F!==" "&&F!==`
|
|
8
|
+
`&&F!=="\t")B=Y}if(Y>=T)if(B)Q.push(B),T=B+J,B=void 0;else if(U==="quoted"){while(W===" "||W==="\t")W=P,P=q[Y+=1],R=!0;let F=Y>L+1?Y-2:I-1;if(V[F])return q;Q.push(F),V[F]=!0,T=F+J,B=void 0}else R=!0}W=P}if(R&&z)z();if(Q.length===0)return q;if(G)G();let D=q.slice(0,Q[0]);for(let P=0;P<Q.length;++P){let F=Q[P],A=Q[P+1]||q.length;if(F===0)D=`
|
|
9
|
+
${$}${q.slice(0,A)}`;else{if(U==="quoted"&&V[F])D+=`${q[F]}\\`;D+=`
|
|
10
|
+
${$}${q.slice(F+1,A)}`}}return D}function X2(q,$,U){let H=$,X=$+1,Z=q[X];while(Z===" "||Z==="\t")if($<X+U)Z=q[++$];else{do Z=q[++$];while(Z&&Z!==`
|
|
11
|
+
`);H=$,X=$+1,Z=q[X]}return H}DH.FOLD_BLOCK="block";DH.FOLD_FLOW="flow";DH.FOLD_QUOTED="quoted";DH.foldFlowLines=LH});var P0=O((bH)=>{var f=N(),p=Z2(),i0=(q,$)=>({indentAtStart:$?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),r0=(q)=>/^(%|---|\.\.\.)/m.test(q);function wH(q,$,U){if(!$||$<0)return!1;let H=$-U,X=q.length;if(X<=H)return!1;for(let Z=0,G=0;Z<X;++Z)if(q[Z]===`
|
|
12
|
+
`){if(Z-G>H)return!0;if(G=Z+1,X-G<=H)return!1}return!0}function D0(q,$){let U=JSON.stringify(q);if($.options.doubleQuotedAsJSON)return U;let{implicitKey:H}=$,X=$.options.doubleQuotedMinMultiLineLength,Z=$.indent||(r0(q)?" ":""),G="",z=0;for(let J=0,Q=U[J];Q;Q=U[++J]){if(Q===" "&&U[J+1]==="\\"&&U[J+2]==="n")G+=U.slice(z,J)+"\\ ",J+=1,z=J,Q="\\";if(Q==="\\")switch(U[J+1]){case"u":{G+=U.slice(z,J);let V=U.substr(J+2,4);switch(V){case"0000":G+="\\0";break;case"0007":G+="\\a";break;case"000b":G+="\\v";break;case"001b":G+="\\e";break;case"0085":G+="\\N";break;case"00a0":G+="\\_";break;case"2028":G+="\\L";break;case"2029":G+="\\P";break;default:if(V.substr(0,2)==="00")G+="\\x"+V.substr(2);else G+=U.substr(J,6)}J+=5,z=J+1}break;case"n":if(H||U[J+2]==='"'||U.length<X)J+=1;else{G+=U.slice(z,J)+`
|
|
13
|
+
|
|
14
|
+
`;while(U[J+2]==="\\"&&U[J+3]==="n"&&U[J+4]!=='"')G+=`
|
|
15
|
+
`,J+=2;if(G+=Z,U[J+2]===" ")G+="\\";J+=1,z=J+1}break;default:J+=1}}return G=z?G+U.slice(z):U,H?G:p.foldFlowLines(G,Z,p.FOLD_QUOTED,i0($,!1))}function gq(q,$){if($.options.singleQuote===!1||$.implicitKey&&q.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test(q))return D0(q,$);let U=$.indent||(r0(q)?" ":""),H="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
|
+
${U}`)+"'";return $.implicitKey?H:p.foldFlowLines(H,U,p.FOLD_FLOW,i0($,!1))}function z0(q,$){let{singleQuote:U}=$.options,H;if(U===!1)H=D0;else{let X=q.includes('"'),Z=q.includes("'");if(X&&!Z)H=gq;else if(Z&&!X)H=D0;else H=U?gq:D0}return H(q,$)}var fq;try{fq=new RegExp(`(^|(?<!
|
|
18
|
+
))
|
|
19
|
+
+(?!
|
|
20
|
+
|$)`,"g")}catch{fq=/\n+(?!\n|$)/g}function s0({comment:q,type:$,value:U},H,X,Z){let{blockQuote:G,commentString:z,lineWidth:J}=H.options;if(!G||/\n[\t ]+$/.test(U))return z0(U,H);let Q=H.indent||(H.forceBlockIndent||r0(U)?" ":""),V=G==="literal"?!0:G==="folded"||$===f.Scalar.BLOCK_FOLDED?!1:$===f.Scalar.BLOCK_LITERAL?!0:!wH(U,J,Q.length);if(!U)return V?`|
|
|
21
|
+
`:`>
|
|
22
|
+
`;let T,B;for(B=U.length;B>0;--B){let A=U[B-1];if(A!==`
|
|
23
|
+
`&&A!=="\t"&&A!==" ")break}let W=U.substring(B),R=W.indexOf(`
|
|
24
|
+
`);if(R===-1)T="-";else if(U===W||R!==W.length-1){if(T="+",Z)Z()}else T="";if(W){if(U=U.slice(0,-W.length),W[W.length-1]===`
|
|
25
|
+
`)W=W.slice(0,-1);W=W.replace(fq,`$&${Q}`)}let Y=!1,I,L=-1;for(I=0;I<U.length;++I){let A=U[I];if(A===" ")Y=!0;else if(A===`
|
|
26
|
+
`)L=I;else break}let D=U.substring(0,L<I?L+1:I);if(D)U=U.substring(D.length),D=D.replace(/\n+/g,`$&${Q}`);let F=(Y?Q?"2":"1":"")+T;if(q){if(F+=" "+z(q.replace(/ ?[\r\n]+/g," ")),X)X()}if(!V){let A=U.replace(/\n+/g,`
|
|
27
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${Q}`),M=!1,K=i0(H,!0);if(G!=="folded"&&$!==f.Scalar.BLOCK_FOLDED)K.onOverflow=()=>{M=!0};let _=p.foldFlowLines(`${D}${A}${W}`,Q,p.FOLD_BLOCK,K);if(!M)return`>${F}
|
|
28
|
+
${Q}${_}`}return U=U.replace(/\n+/g,`$&${Q}`),`|${F}
|
|
29
|
+
${Q}${D}${U}${W}`}function KH(q,$,U,H){let{type:X,value:Z}=q,{actualString:G,implicitKey:z,indent:J,indentStep:Q,inFlow:V}=$;if(z&&Z.includes(`
|
|
30
|
+
`)||V&&/[[\]{},]/.test(Z))return z0(Z,$);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Z))return z||V||!Z.includes(`
|
|
31
|
+
`)?z0(Z,$):s0(q,$,U,H);if(!z&&!V&&X!==f.Scalar.PLAIN&&Z.includes(`
|
|
32
|
+
`))return s0(q,$,U,H);if(r0(Z)){if(J==="")return $.forceBlockIndent=!0,s0(q,$,U,H);else if(z&&J===Q)return z0(Z,$)}let T=Z.replace(/\n+/g,`$&
|
|
33
|
+
${J}`);if(G){let B=(Y)=>Y.default&&Y.tag!=="tag:yaml.org,2002:str"&&Y.test?.test(T),{compat:W,tags:R}=$.doc.schema;if(R.some(B)||W?.some(B))return z0(Z,$)}return z?T:p.foldFlowLines(T,J,p.FOLD_FLOW,i0($,!1))}function NH(q,$,U,H){let{implicitKey:X,inFlow:Z}=$,G=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:z}=q;if(z!==f.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(G.value))z=f.Scalar.QUOTE_DOUBLE}let J=(V)=>{switch(V){case f.Scalar.BLOCK_FOLDED:case f.Scalar.BLOCK_LITERAL:return X||Z?z0(G.value,$):s0(G,$,U,H);case f.Scalar.QUOTE_DOUBLE:return D0(G.value,$);case f.Scalar.QUOTE_SINGLE:return gq(G.value,$);case f.Scalar.PLAIN:return KH(G,$,U,H);default:return null}},Q=J(z);if(Q===null){let{defaultKeyType:V,defaultStringType:T}=$.options,B=X&&V||T;if(Q=J(B),Q===null)throw Error(`Unsupported default string type ${B}`)}return Q}bH.stringifyString=NH});var F0=O((uH)=>{var jH=d0(),d=w(),CH=L0(),EH=P0();function gH(q,$){let U=Object.assign({blockQuote:!0,commentString:CH.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},q.schema.toStringOptions,$),H;switch(U.collectionStyle){case"block":H=!1;break;case"flow":H=!0;break;default:H=null}return{anchors:new Set,doc:q,flowCollectionPadding:U.flowCollectionPadding?" ":"",indent:"",indentStep:typeof U.indent==="number"?" ".repeat(U.indent):" ",inFlow:H,options:U}}function fH(q,$){if($.tag){let X=q.filter((Z)=>Z.tag===$.tag);if(X.length>0)return X.find((Z)=>Z.format===$.format)??X[0]}let U=void 0,H;if(d.isScalar($)){H=$.value;let X=q.filter((Z)=>Z.identify?.(H));if(X.length>1){let Z=X.filter((G)=>G.test);if(Z.length>0)X=Z}U=X.find((Z)=>Z.format===$.format)??X.find((Z)=>!Z.format)}else H=$,U=q.find((X)=>X.nodeClass&&H instanceof X.nodeClass);if(!U){let X=H?.constructor?.name??(H===null?"null":typeof H);throw Error(`Tag not resolved for ${X} value`)}return U}function yH(q,$,{anchors:U,doc:H}){if(!H.directives)return"";let X=[],Z=(d.isScalar(q)||d.isCollection(q))&&q.anchor;if(Z&&jH.anchorIsValid(Z))U.add(Z),X.push(`&${Z}`);let G=q.tag??($.default?null:$.tag);if(G)X.push(H.directives.tagString(G));return X.join(" ")}function hH(q,$,U,H){if(d.isPair(q))return q.toString($,U,H);if(d.isAlias(q)){if($.doc.directives)return q.toString($);if($.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if($.resolvedAliases)$.resolvedAliases.add(q);else $.resolvedAliases=new Set([q]);q=q.resolve($.doc)}}let X=void 0,Z=d.isNode(q)?q:$.doc.createNode(q,{onTagObj:(J)=>X=J});X??(X=fH($.doc.schema.tags,Z));let G=yH(Z,X,$);if(G.length>0)$.indentAtStart=($.indentAtStart??0)+G.length+1;let z=typeof X.stringify==="function"?X.stringify(Z,$,U,H):d.isScalar(Z)?EH.stringifyString(Z,$,U,H):Z.toString($,U,H);if(!G)return z;return d.isScalar(Z)||z[0]==="{"||z[0]==="["?`${G} ${z}`:`${G}
|
|
34
|
+
${$.indent}${z}`}uH.createStringifyContext=gH;uH.stringify=hH});var J2=O((mH)=>{var k=w(),G2=N(),z2=F0(),A0=L0();function vH({key:q,value:$},U,H,X){let{allNullValues:Z,doc:G,indent:z,indentStep:J,options:{commentString:Q,indentSeq:V,simpleKeys:T}}=U,B=k.isNode(q)&&q.comment||null;if(T){if(B)throw Error("With simple keys, key nodes cannot have comments");if(k.isCollection(q)||!k.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let W=!T&&(!q||B&&$==null&&!U.inFlow||k.isCollection(q)||(k.isScalar(q)?q.type===G2.Scalar.BLOCK_FOLDED||q.type===G2.Scalar.BLOCK_LITERAL:typeof q==="object"));U=Object.assign({},U,{allNullValues:!1,implicitKey:!W&&(T||!Z),indent:z+J});let R=!1,Y=!1,I=z2.stringify(q,U,()=>R=!0,()=>Y=!0);if(!W&&!U.inFlow&&I.length>1024){if(T)throw Error("With simple keys, single line scalar must not span more than 1024 characters");W=!0}if(U.inFlow){if(Z||$==null){if(R&&H)H();return I===""?"?":W?`? ${I}`:I}}else if(Z&&!T||$==null&&W){if(I=`? ${I}`,B&&!R)I+=A0.lineComment(I,U.indent,Q(B));else if(Y&&X)X();return I}if(R)B=null;if(W){if(B)I+=A0.lineComment(I,U.indent,Q(B));I=`? ${I}
|
|
35
|
+
${z}:`}else if(I=`${I}:`,B)I+=A0.lineComment(I,U.indent,Q(B));let L,D,P;if(k.isNode($))L=!!$.spaceBefore,D=$.commentBefore,P=$.comment;else if(L=!1,D=null,P=null,$&&typeof $==="object")$=G.createNode($);if(U.implicitKey=!1,!W&&!B&&k.isScalar($))U.indentAtStart=I.length+1;if(Y=!1,!V&&J.length>=2&&!U.inFlow&&!W&&k.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)U.indent=U.indent.substring(2);let F=!1,A=z2.stringify($,U,()=>F=!0,()=>Y=!0),M=" ";if(B||L||D){if(M=L?`
|
|
36
|
+
`:"",D){let K=Q(D);M+=`
|
|
37
|
+
${A0.indentComment(K,U.indent)}`}if(A===""&&!U.inFlow){if(M===`
|
|
38
|
+
`&&P)M=`
|
|
39
|
+
|
|
40
|
+
`}else M+=`
|
|
41
|
+
${U.indent}`}else if(!W&&k.isCollection($)){let K=A[0],_=A.indexOf(`
|
|
42
|
+
`),b=_!==-1,v=U.inFlow??$.flow??$.items.length===0;if(b||!v){let H0=!1;if(b&&(K==="&"||K==="!")){let S=A.indexOf(" ");if(K==="&"&&S!==-1&&S<_&&A[S+1]==="!")S=A.indexOf(" ",S+1);if(S===-1||_<S)H0=!0}if(!H0)M=`
|
|
43
|
+
${U.indent}`}}else if(A===""||A[0]===`
|
|
44
|
+
`)M="";if(I+=M+A,U.inFlow){if(F&&H)H()}else if(P&&!F)I+=A0.lineComment(I,U.indent,Q(P));else if(Y&&X)X();return I}mH.stringifyPair=vH});var yq=O((aH)=>{var Q2=n0("process");function dH(q,...$){if(q==="debug")console.log(...$)}function lH(q,$){if(q==="debug"||q==="warn")if(typeof Q2.emitWarning==="function")Q2.emitWarning($);else console.warn($)}aH.debug=dH;aH.warn=lH});var e0=O((rH)=>{var M0=w(),T2=N(),o0="<<",t0={identify:(q)=>q===o0||typeof q==="symbol"&&q.description===o0,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new T2.Scalar(Symbol(o0)),{addToJSMap:B2}),stringify:()=>o0},iH=(q,$)=>(t0.identify($)||M0.isScalar($)&&(!$.type||$.type===T2.Scalar.PLAIN)&&t0.identify($.value))&&q?.doc.schema.tags.some((U)=>U.tag===t0.tag&&U.default);function B2(q,$,U){if(U=q&&M0.isAlias(U)?U.resolve(q.doc):U,M0.isSeq(U))for(let H of U.items)hq(q,$,H);else if(Array.isArray(U))for(let H of U)hq(q,$,H);else hq(q,$,U)}function hq(q,$,U){let H=q&&M0.isAlias(U)?U.resolve(q.doc):U;if(!M0.isMap(H))throw Error("Merge sources must be maps or map aliases");let X=H.toJSON(null,q,Map);for(let[Z,G]of X)if($ instanceof Map){if(!$.has(Z))$.set(Z,G)}else if($ instanceof Set)$.add(Z);else if(!Object.prototype.hasOwnProperty.call($,Z))Object.defineProperty($,Z,{value:G,writable:!0,enumerable:!0,configurable:!0});return $}rH.addMergeToJSMap=B2;rH.isMergeKey=iH;rH.merge=t0});var xq=O((H4)=>{var eH=yq(),Y2=e0(),q4=F0(),V2=w(),uq=m();function $4(q,$,{key:U,value:H}){if(V2.isNode(U)&&U.addToJSMap)U.addToJSMap(q,$,H);else if(Y2.isMergeKey(q,U))Y2.addMergeToJSMap(q,$,H);else{let X=uq.toJS(U,"",q);if($ instanceof Map)$.set(X,uq.toJS(H,X,q));else if($ instanceof Set)$.add(X);else{let Z=U4(U,X,q),G=uq.toJS(H,Z,q);if(Z in $)Object.defineProperty($,Z,{value:G,writable:!0,enumerable:!0,configurable:!0});else $[Z]=G}}return $}function U4(q,$,U){if($===null)return"";if(typeof $!=="object")return String($);if(V2.isNode(q)&&U?.doc){let H=q4.createStringifyContext(U.doc,{});H.anchors=new Set;for(let Z of U.anchors.keys())H.anchors.add(Z.anchor);H.inFlow=!0,H.inStringifyKey=!0;let X=q.toString(H);if(!U.mapKeyWarned){let Z=JSON.stringify(X);if(Z.length>40)Z=Z.substring(0,36)+'..."';eH.warn(U.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Z}. Set mapAsMap: true to use object keys.`),U.mapKeyWarned=!0}return X}return JSON.stringify($)}H4.addPairToJSMap=$4});var l=O((J4)=>{var I2=_0(),Z4=J2(),G4=xq(),qq=w();function z4(q,$,U){let H=I2.createNode(q,void 0,U),X=I2.createNode($,void 0,U);return new $q(H,X)}class $q{constructor(q,$=null){Object.defineProperty(this,qq.NODE_TYPE,{value:qq.PAIR}),this.key=q,this.value=$}clone(q){let{key:$,value:U}=this;if(qq.isNode($))$=$.clone(q);if(qq.isNode(U))U=U.clone(q);return new $q($,U)}toJSON(q,$){let U=$?.mapAsMap?new Map:{};return G4.addPairToJSMap($,U,this)}toString(q,$,U){return q?.doc?Z4.stringifyPair(this,q,$,U):JSON.stringify(this)}}J4.Pair=$q;J4.createPair=z4});var kq=O((I4)=>{var t=w(),W2=F0(),Uq=L0();function B4(q,$,U){return($.inFlow??q.flow?V4:Y4)(q,$,U)}function Y4({comment:q,items:$},U,{blockItemPrefix:H,flowChars:X,itemIndent:Z,onChompKeep:G,onComment:z}){let{indent:J,options:{commentString:Q}}=U,V=Object.assign({},U,{indent:Z,type:null}),T=!1,B=[];for(let R=0;R<$.length;++R){let Y=$[R],I=null;if(t.isNode(Y)){if(!T&&Y.spaceBefore)B.push("");if(Hq(U,B,Y.commentBefore,T),Y.comment)I=Y.comment}else if(t.isPair(Y)){let D=t.isNode(Y.key)?Y.key:null;if(D){if(!T&&D.spaceBefore)B.push("");Hq(U,B,D.commentBefore,T)}}T=!1;let L=W2.stringify(Y,V,()=>I=null,()=>T=!0);if(I)L+=Uq.lineComment(L,Z,Q(I));if(T&&I)T=!1;B.push(H+L)}let W;if(B.length===0)W=X.start+X.end;else{W=B[0];for(let R=1;R<B.length;++R){let Y=B[R];W+=Y?`
|
|
45
|
+
${J}${Y}`:`
|
|
46
|
+
`}}if(q){if(W+=`
|
|
47
|
+
`+Uq.indentComment(Q(q),J),z)z()}else if(T&&G)G();return W}function V4({items:q},$,{flowChars:U,itemIndent:H}){let{indent:X,indentStep:Z,flowCollectionPadding:G,options:{commentString:z}}=$;H+=Z;let J=Object.assign({},$,{indent:H,inFlow:!0,type:null}),Q=!1,V=0,T=[];for(let R=0;R<q.length;++R){let Y=q[R],I=null;if(t.isNode(Y)){if(Y.spaceBefore)T.push("");if(Hq($,T,Y.commentBefore,!1),Y.comment)I=Y.comment}else if(t.isPair(Y)){let D=t.isNode(Y.key)?Y.key:null;if(D){if(D.spaceBefore)T.push("");if(Hq($,T,D.commentBefore,!1),D.comment)Q=!0}let P=t.isNode(Y.value)?Y.value:null;if(P){if(P.comment)I=P.comment;if(P.commentBefore)Q=!0}else if(Y.value==null&&D?.comment)I=D.comment}if(I)Q=!0;let L=W2.stringify(Y,J,()=>I=null);if(R<q.length-1)L+=",";if(I)L+=Uq.lineComment(L,H,z(I));if(!Q&&(T.length>V||L.includes(`
|
|
48
|
+
`)))Q=!0;T.push(L),V=T.length}let{start:B,end:W}=U;if(T.length===0)return B+W;else{if(!Q){let R=T.reduce((Y,I)=>Y+I.length+2,2);Q=$.options.lineWidth>0&&R>$.options.lineWidth}if(Q){let R=B;for(let Y of T)R+=Y?`
|
|
49
|
+
${Z}${X}${Y}`:`
|
|
50
|
+
`;return`${R}
|
|
51
|
+
${X}${W}`}else return`${B}${G}${T.join(" ")}${G}${W}`}}function Hq({indent:q,options:{commentString:$}},U,H,X){if(H&&X)H=H.replace(/^\n+/,"");if(H){let Z=Uq.indentComment($(H),q);U.push(Z.trimStart())}}I4.stringifyCollection=B4});var c=O((D4)=>{var O4=kq(),R4=xq(),_4=c0(),a=w(),Xq=l(),L4=N();function w0(q,$){let U=a.isScalar($)?$.value:$;for(let H of q)if(a.isPair(H)){if(H.key===$||H.key===U)return H;if(a.isScalar(H.key)&&H.key.value===U)return H}return}class O2 extends _4.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(a.MAP,q);this.items=[]}static from(q,$,U){let{keepUndefined:H,replacer:X}=U,Z=new this(q),G=(z,J)=>{if(typeof X==="function")J=X.call($,z,J);else if(Array.isArray(X)&&!X.includes(z))return;if(J!==void 0||H)Z.items.push(Xq.createPair(z,J,U))};if($ instanceof Map)for(let[z,J]of $)G(z,J);else if($&&typeof $==="object")for(let z of Object.keys($))G(z,$[z]);if(typeof q.sortMapEntries==="function")Z.items.sort(q.sortMapEntries);return Z}add(q,$){let U;if(a.isPair(q))U=q;else if(!q||typeof q!=="object"||!("key"in q))U=new Xq.Pair(q,q?.value);else U=new Xq.Pair(q.key,q.value);let H=w0(this.items,U.key),X=this.schema?.sortMapEntries;if(H){if(!$)throw Error(`Key ${U.key} already set`);if(a.isScalar(H.value)&&L4.isScalarValue(U.value))H.value.value=U.value;else H.value=U.value}else if(X){let Z=this.items.findIndex((G)=>X(U,G)<0);if(Z===-1)this.items.push(U);else this.items.splice(Z,0,U)}else this.items.push(U)}delete(q){let $=w0(this.items,q);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(q,$){let H=w0(this.items,q)?.value;return(!$&&a.isScalar(H)?H.value:H)??void 0}has(q){return!!w0(this.items,q)}set(q,$){this.add(new Xq.Pair(q,$),!0)}toJSON(q,$,U){let H=U?new U:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(H);for(let X of this.items)R4.addPairToJSMap($,H,X);return H}toString(q,$,U){if(!q)return JSON.stringify(this);for(let H of this.items)if(!a.isPair(H))throw Error(`Map items must all be pairs; found ${JSON.stringify(H)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return O4.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:U,onComment:$})}}D4.YAMLMap=O2;D4.findPair=w0});var J0=O((w4)=>{var A4=w(),R2=c(),M4={collection:"map",default:!0,nodeClass:R2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,$){if(!A4.isMap(q))$("Expected a mapping for this tag");return q},createNode:(q,$,U)=>R2.YAMLMap.from(q,$,U)};w4.map=M4});var s=O((E4)=>{var N4=_0(),b4=kq(),S4=c0(),Gq=w(),j4=N(),C4=m();class _2 extends S4.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(Gq.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let $=Zq(q);if(typeof $!=="number")return!1;return this.items.splice($,1).length>0}get(q,$){let U=Zq(q);if(typeof U!=="number")return;let H=this.items[U];return!$&&Gq.isScalar(H)?H.value:H}has(q){let $=Zq(q);return typeof $==="number"&&$<this.items.length}set(q,$){let U=Zq(q);if(typeof U!=="number")throw Error(`Expected a valid index, not ${q}.`);let H=this.items[U];if(Gq.isScalar(H)&&j4.isScalarValue($))H.value=$;else this.items[U]=$}toJSON(q,$){let U=[];if($?.onCreate)$.onCreate(U);let H=0;for(let X of this.items)U.push(C4.toJS(X,String(H++),$));return U}toString(q,$,U){if(!q)return JSON.stringify(this);return b4.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:U,onComment:$})}static from(q,$,U){let{replacer:H}=U,X=new this(q);if($&&Symbol.iterator in Object($)){let Z=0;for(let G of $){if(typeof H==="function"){let z=$ instanceof Set?G:String(Z++);G=H.call($,z,G)}X.items.push(N4.createNode(G,void 0,U))}}return X}}function Zq(q){let $=Gq.isScalar(q)?q.value:q;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}E4.YAMLSeq=_2});var Q0=O((h4)=>{var f4=w(),L2=s(),y4={collection:"seq",default:!0,nodeClass:L2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,$){if(!f4.isSeq(q))$("Expected a sequence for this tag");return q},createNode:(q,$,U)=>L2.YAMLSeq.from(q,$,U)};h4.seq=y4});var K0=O((v4)=>{var x4=P0(),k4={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,$,U,H){return $=Object.assign({actualString:!0},$),x4.stringifyString(q,$,U,H)}};v4.string=k4});var zq=O((p4)=>{var D2=N(),P2={identify:(q)=>q==null,createNode:()=>new D2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new D2.Scalar(null),stringify:({source:q},$)=>typeof q==="string"&&P2.test.test(q)?q:$.options.nullStr};p4.nullTag=P2});var vq=O((a4)=>{var l4=N(),F2={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new l4.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:$},U){if(q&&F2.test.test(q)){let H=q[0]==="t"||q[0]==="T";if($===H)return q}return $?U.options.trueStr:U.options.falseStr}};a4.boolTag=F2});var T0=O((i4)=>{function s4({format:q,minFractionDigits:$,tag:U,value:H}){if(typeof H==="bigint")return String(H);let X=typeof H==="number"?H:Number(H);if(!isFinite(X))return isNaN(X)?".nan":X<0?"-.inf":".inf";let Z=Object.is(H,-0)?"-0":JSON.stringify(H);if(!q&&$&&(!U||U==="tag:yaml.org,2002:float")&&/^\d/.test(Z)){let G=Z.indexOf(".");if(G<0)G=Z.length,Z+=".";let z=$-(Z.length-G-1);while(z-- >0)Z+="0"}return Z}i4.stringifyNumber=s4});var pq=O((q1)=>{var n4=N(),mq=T0(),o4={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:mq.stringifyNumber},t4={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():mq.stringifyNumber(q)}},e4={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let $=new n4.Scalar(parseFloat(q)),U=q.indexOf(".");if(U!==-1&&q[q.length-1]==="0")$.minFractionDigits=q.length-U-1;return $},stringify:mq.stringifyNumber};q1.float=e4;q1.floatExp=t4;q1.floatNaN=o4});var lq=O((z1)=>{var A2=T0(),Jq=(q)=>typeof q==="bigint"||Number.isInteger(q),dq=(q,$,U,{intAsBigInt:H})=>H?BigInt(q):parseInt(q.substring($),U);function M2(q,$,U){let{value:H}=q;if(Jq(H)&&H>=0)return U+H.toString($);return A2.stringifyNumber(q)}var X1={identify:(q)=>Jq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,$,U)=>dq(q,2,8,U),stringify:(q)=>M2(q,8,"0o")},Z1={identify:Jq,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,$,U)=>dq(q,0,10,U),stringify:A2.stringifyNumber},G1={identify:(q)=>Jq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,$,U)=>dq(q,2,16,U),stringify:(q)=>M2(q,16,"0x")};z1.int=Z1;z1.intHex=G1;z1.intOct=X1});var w2=O((R1)=>{var B1=J0(),Y1=zq(),V1=Q0(),I1=K0(),W1=vq(),aq=pq(),cq=lq(),O1=[B1.map,V1.seq,I1.string,Y1.nullTag,W1.boolTag,cq.intOct,cq.int,cq.intHex,aq.floatNaN,aq.floatExp,aq.float];R1.schema=O1});var N2=O((w1)=>{var L1=N(),D1=J0(),P1=Q0();function K2(q){return typeof q==="bigint"||Number.isInteger(q)}var Qq=({value:q})=>JSON.stringify(q),F1=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:Qq},{identify:(q)=>q==null,createNode:()=>new L1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Qq},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:Qq},{identify:K2,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(q,$,{intAsBigInt:U})=>U?BigInt(q):parseInt(q,10),stringify:({value:q})=>K2(q)?q.toString():JSON.stringify(q)},{identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(q)=>parseFloat(q),stringify:Qq}],A1={default:!0,tag:"",test:/^/,resolve(q,$){return $(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},M1=[D1.map,P1.seq].concat(F1,A1);w1.schema=M1});var iq=O((S1)=>{var N0=n0("buffer"),sq=N(),N1=P0(),b1={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,$){if(typeof N0.Buffer==="function")return N0.Buffer.from(q,"base64");else if(typeof atob==="function"){let U=atob(q.replace(/[\n\r]/g,"")),H=new Uint8Array(U.length);for(let X=0;X<U.length;++X)H[X]=U.charCodeAt(X);return H}else return $("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:$,value:U},H,X,Z){if(!U)return"";let G=U,z;if(typeof N0.Buffer==="function")z=G instanceof N0.Buffer?G.toString("base64"):N0.Buffer.from(G.buffer).toString("base64");else if(typeof btoa==="function"){let J="";for(let Q=0;Q<G.length;++Q)J+=String.fromCharCode(G[Q]);z=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=sq.Scalar.BLOCK_LITERAL),$!==sq.Scalar.QUOTE_DOUBLE){let J=Math.max(H.options.lineWidth-H.indent.length,H.options.minContentWidth),Q=Math.ceil(z.length/J),V=Array(Q);for(let T=0,B=0;T<Q;++T,B+=J)V[T]=z.substr(B,J);z=V.join($===sq.Scalar.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return N1.stringifyString({comment:q,type:$,value:z},H,X,Z)}};S1.binary=b1});var Bq=O((f1)=>{var Tq=w(),rq=l(),C1=N(),E1=s();function b2(q,$){if(Tq.isSeq(q))for(let U=0;U<q.items.length;++U){let H=q.items[U];if(Tq.isPair(H))continue;else if(Tq.isMap(H)){if(H.items.length>1)$("Each pair must have its own sequence indicator");let X=H.items[0]||new rq.Pair(new C1.Scalar(null));if(H.commentBefore)X.key.commentBefore=X.key.commentBefore?`${H.commentBefore}
|
|
53
|
+
${X.key.commentBefore}`:H.commentBefore;if(H.comment){let Z=X.value??X.key;Z.comment=Z.comment?`${H.comment}
|
|
54
|
+
${Z.comment}`:H.comment}H=X}q.items[U]=Tq.isPair(H)?H:new rq.Pair(H)}else $("Expected a sequence for this tag");return q}function S2(q,$,U){let{replacer:H}=U,X=new E1.YAMLSeq(q);X.tag="tag:yaml.org,2002:pairs";let Z=0;if($&&Symbol.iterator in Object($))for(let G of $){if(typeof H==="function")G=H.call($,String(Z++),G);let z,J;if(Array.isArray(G))if(G.length===2)z=G[0],J=G[1];else throw TypeError(`Expected [key, value] tuple: ${G}`);else if(G&&G instanceof Object){let Q=Object.keys(G);if(Q.length===1)z=Q[0],J=G[z];else throw TypeError(`Expected tuple with one key, not ${Q.length} keys`)}else z=G;X.items.push(rq.createPair(z,J,U))}return X}var g1={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:b2,createNode:S2};f1.createPairs=S2;f1.pairs=g1;f1.resolvePairs=b2});var oq=O((v1)=>{var j2=w(),nq=m(),b0=c(),x1=s(),C2=Bq();class e extends x1.YAMLSeq{constructor(){super();this.add=b0.YAMLMap.prototype.add.bind(this),this.delete=b0.YAMLMap.prototype.delete.bind(this),this.get=b0.YAMLMap.prototype.get.bind(this),this.has=b0.YAMLMap.prototype.has.bind(this),this.set=b0.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(q,$){if(!$)return super.toJSON(q);let U=new Map;if($?.onCreate)$.onCreate(U);for(let H of this.items){let X,Z;if(j2.isPair(H))X=nq.toJS(H.key,"",$),Z=nq.toJS(H.value,X,$);else X=nq.toJS(H,"",$);if(U.has(X))throw Error("Ordered maps must not include duplicate keys");U.set(X,Z)}return U}static from(q,$,U){let H=C2.createPairs(q,$,U),X=new this;return X.items=H.items,X}}e.tag="tag:yaml.org,2002:omap";var k1={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:e,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let U=C2.resolvePairs(q,$),H=[];for(let{key:X}of U.items)if(j2.isScalar(X))if(H.includes(X.value))$(`Ordered maps must not include duplicate keys: ${X.value}`);else H.push(X.value);return Object.assign(new e,U)},createNode:(q,$,U)=>e.from(q,$,U)};v1.YAMLOMap=e;v1.omap=k1});var h2=O((d1)=>{var E2=N();function g2({value:q,source:$},U){if($&&(q?f2:y2).test.test($))return $;return q?U.options.trueStr:U.options.falseStr}var f2={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new E2.Scalar(!0),stringify:g2},y2={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new E2.Scalar(!1),stringify:g2};d1.falseTag=y2;d1.trueTag=f2});var u2=O((n1)=>{var c1=N(),tq=T0(),s1={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:tq.stringifyNumber},i1={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():tq.stringifyNumber(q)}},r1={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new c1.Scalar(parseFloat(q.replace(/_/g,""))),U=q.indexOf(".");if(U!==-1){let H=q.substring(U+1).replace(/_/g,"");if(H[H.length-1]==="0")$.minFractionDigits=H.length}return $},stringify:tq.stringifyNumber};n1.float=r1;n1.floatExp=i1;n1.floatNaN=s1});var k2=O((XX)=>{var x2=T0(),S0=(q)=>typeof q==="bigint"||Number.isInteger(q);function Yq(q,$,U,{intAsBigInt:H}){let X=q[0];if(X==="-"||X==="+")$+=1;if(q=q.substring($).replace(/_/g,""),H){switch(U){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let G=BigInt(q);return X==="-"?BigInt(-1)*G:G}let Z=parseInt(q,U);return X==="-"?-1*Z:Z}function eq(q,$,U){let{value:H}=q;if(S0(H)){let X=H.toString($);return H<0?"-"+U+X.substr(1):U+X}return x2.stringifyNumber(q)}var qX={identify:S0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,U)=>Yq(q,2,2,U),stringify:(q)=>eq(q,2,"0b")},$X={identify:S0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,U)=>Yq(q,1,8,U),stringify:(q)=>eq(q,8,"0")},UX={identify:S0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,U)=>Yq(q,0,10,U),stringify:x2.stringifyNumber},HX={identify:S0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,U)=>Yq(q,2,16,U),stringify:(q)=>eq(q,16,"0x")};XX.int=UX;XX.intBin=qX;XX.intHex=HX;XX.intOct=$X});var q$=O((TX)=>{var Wq=w(),Vq=l(),Iq=c();class q0 extends Iq.YAMLMap{constructor(q){super(q);this.tag=q0.tag}add(q){let $;if(Wq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new Vq.Pair(q.key,null);else $=new Vq.Pair(q,null);if(!Iq.findPair(this.items,$.key))this.items.push($)}get(q,$){let U=Iq.findPair(this.items,q);return!$&&Wq.isPair(U)?Wq.isScalar(U.key)?U.key.value:U.key:U}set(q,$){if(typeof $!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof $}`);let U=Iq.findPair(this.items,q);if(U&&!$)this.items.splice(this.items.indexOf(U),1);else if(!U&&$)this.items.push(new Vq.Pair(q))}toJSON(q,$){return super.toJSON(q,$,Set)}toString(q,$,U){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),$,U);else throw Error("Set items must all have null values")}static from(q,$,U){let{replacer:H}=U,X=new this(q);if($&&Symbol.iterator in Object($))for(let Z of $){if(typeof H==="function")Z=H.call($,Z,Z);X.items.push(Vq.createPair(Z,null,U))}return X}}q0.tag="tag:yaml.org,2002:set";var QX={collection:"map",identify:(q)=>q instanceof Set,nodeClass:q0,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,U)=>q0.from(q,$,U),resolve(q,$){if(Wq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new q0,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};TX.YAMLSet=q0;TX.set=QX});var U$=O((OX)=>{var VX=T0();function $$(q,$){let U=q[0],H=U==="-"||U==="+"?q.substring(1):q,X=(G)=>$?BigInt(G):Number(G),Z=H.replace(/_/g,"").split(":").reduce((G,z)=>G*X(60)+X(z),X(0));return U==="-"?X(-1)*Z:Z}function v2(q){let{value:$}=q,U=(G)=>G;if(typeof $==="bigint")U=(G)=>BigInt(G);else if(isNaN($)||!isFinite($))return VX.stringifyNumber(q);let H="";if($<0)H="-",$*=U(-1);let X=U(60),Z=[$%X];if($<60)Z.unshift(0);else if($=($-Z[0])/X,Z.unshift($%X),$>=60)$=($-Z[0])/X,Z.unshift($);return H+Z.map((G)=>String(G).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var IX={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,$,{intAsBigInt:U})=>$$(q,U),stringify:v2},WX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>$$(q,!1),stringify:v2},m2={identify:(q)=>q instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(q){let $=q.match(m2.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,U,H,X,Z,G,z]=$.map(Number),J=$[7]?Number(($[7]+"00").substr(1,3)):0,Q=Date.UTC(U,H-1,X,Z||0,G||0,z||0,J),V=$[8];if(V&&V!=="Z"){let T=$$(V,!1);if(Math.abs(T)<30)T*=60;Q-=60000*T}return new Date(Q)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};OX.floatTime=WX;OX.intTime=IX;OX.timestamp=m2});var d2=O((jX)=>{var DX=J0(),PX=zq(),FX=Q0(),AX=K0(),MX=iq(),p2=h2(),H$=u2(),Oq=k2(),wX=e0(),KX=oq(),NX=Bq(),bX=q$(),X$=U$(),SX=[DX.map,FX.seq,AX.string,PX.nullTag,p2.trueTag,p2.falseTag,Oq.intBin,Oq.intOct,Oq.int,Oq.intHex,H$.floatNaN,H$.floatExp,H$.float,MX.binary,wX.merge,KX.omap,NX.pairs,bX.set,X$.intTime,X$.floatTime,X$.timestamp];jX.schema=SX});var e2=O((kX)=>{var s2=J0(),EX=zq(),i2=Q0(),gX=K0(),fX=vq(),Z$=pq(),G$=lq(),yX=w2(),hX=N2(),r2=iq(),j0=e0(),n2=oq(),o2=Bq(),l2=d2(),t2=q$(),Rq=U$(),a2=new Map([["core",yX.schema],["failsafe",[s2.map,i2.seq,gX.string]],["json",hX.schema],["yaml11",l2.schema],["yaml-1.1",l2.schema]]),c2={binary:r2.binary,bool:fX.boolTag,float:Z$.float,floatExp:Z$.floatExp,floatNaN:Z$.floatNaN,floatTime:Rq.floatTime,int:G$.int,intHex:G$.intHex,intOct:G$.intOct,intTime:Rq.intTime,map:s2.map,merge:j0.merge,null:EX.nullTag,omap:n2.omap,pairs:o2.pairs,seq:i2.seq,set:t2.set,timestamp:Rq.timestamp},uX={"tag:yaml.org,2002:binary":r2.binary,"tag:yaml.org,2002:merge":j0.merge,"tag:yaml.org,2002:omap":n2.omap,"tag:yaml.org,2002:pairs":o2.pairs,"tag:yaml.org,2002:set":t2.set,"tag:yaml.org,2002:timestamp":Rq.timestamp};function xX(q,$,U){let H=a2.get($);if(H&&!q)return U&&!H.includes(j0.merge)?H.concat(j0.merge):H.slice();let X=H;if(!X)if(Array.isArray(q))X=[];else{let Z=Array.from(a2.keys()).filter((G)=>G!=="yaml11").map((G)=>JSON.stringify(G)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${Z} or define customTags array`)}if(Array.isArray(q))for(let Z of q)X=X.concat(Z);else if(typeof q==="function")X=q(X.slice());if(U)X=X.concat(j0.merge);return X.reduce((Z,G)=>{let z=typeof G==="string"?c2[G]:G;if(!z){let J=JSON.stringify(G),Q=Object.keys(c2).map((V)=>JSON.stringify(V)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${Q}`)}if(!Z.includes(z))Z.push(z);return Z},[])}kX.coreKnownTags=uX;kX.getTags=xX});var Q$=O((cX)=>{var z$=w(),pX=J0(),dX=Q0(),lX=K0(),_q=e2(),aX=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class J${constructor({compat:q,customTags:$,merge:U,resolveKnownTags:H,schema:X,sortMapEntries:Z,toStringDefaults:G}){this.compat=Array.isArray(q)?_q.getTags(q,"compat"):q?_q.getTags(null,q):null,this.name=typeof X==="string"&&X||"core",this.knownTags=H?_q.coreKnownTags:{},this.tags=_q.getTags($,this.name,U),this.toStringOptions=G??null,Object.defineProperty(this,z$.MAP,{value:pX.map}),Object.defineProperty(this,z$.SCALAR,{value:lX.string}),Object.defineProperty(this,z$.SEQ,{value:dX.seq}),this.sortMapEntries=typeof Z==="function"?Z:Z===!0?aX:null}clone(){let q=Object.create(J$.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}cX.Schema=J$});var qU=O((nX)=>{var iX=w(),T$=F0(),C0=L0();function rX(q,$){let U=[],H=$.directives===!0;if($.directives!==!1&&q.directives){let J=q.directives.toString(q);if(J)U.push(J),H=!0;else if(q.directives.docStart)H=!0}if(H)U.push("---");let X=T$.createStringifyContext(q,$),{commentString:Z}=X.options;if(q.commentBefore){if(U.length!==1)U.unshift("");let J=Z(q.commentBefore);U.unshift(C0.indentComment(J,""))}let G=!1,z=null;if(q.contents){if(iX.isNode(q.contents)){if(q.contents.spaceBefore&&H)U.push("");if(q.contents.commentBefore){let V=Z(q.contents.commentBefore);U.push(C0.indentComment(V,""))}X.forceBlockIndent=!!q.comment,z=q.contents.comment}let J=z?void 0:()=>G=!0,Q=T$.stringify(q.contents,X,()=>z=null,J);if(z)Q+=C0.lineComment(Q,"",Z(z));if((Q[0]==="|"||Q[0]===">")&&U[U.length-1]==="---")U[U.length-1]=`--- ${Q}`;else U.push(Q)}else U.push(T$.stringify(q.contents,X));if(q.directives?.docEnd)if(q.comment){let J=Z(q.comment);if(J.includes(`
|
|
55
|
+
`))U.push("..."),U.push(C0.indentComment(J,""));else U.push(`... ${J}`)}else U.push("...");else{let J=q.comment;if(J&&G)J=J.replace(/^\n+/,"");if(J){if((!G||z)&&U[U.length-1]!=="")U.push("");U.push(C0.indentComment(Z(J),""))}}return U.join(`
|
|
56
|
+
`)+`
|
|
57
|
+
`}nX.stringifyDocument=rX});var E0=O((ZZ)=>{var tX=R0(),B0=c0(),g=w(),eX=l(),qZ=m(),$Z=Q$(),UZ=qU(),B$=d0(),HZ=jq(),XZ=_0(),Y$=Sq();class V${constructor(q,$,U){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,g.NODE_TYPE,{value:g.DOC});let H=null;if(typeof $==="function"||Array.isArray($))H=$;else if(U===void 0&&$)U=$,$=void 0;let X=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},U);this.options=X;let{version:Z}=X;if(U?._directives){if(this.directives=U._directives.atDocument(),this.directives.yaml.explicit)Z=this.directives.yaml.version}else this.directives=new Y$.Directives({version:Z});this.setSchema(Z,U),this.contents=q===void 0?null:this.createNode(q,H,U)}clone(){let q=Object.create(V$.prototype,{[g.NODE_TYPE]:{value:g.DOC}});if(q.commentBefore=this.commentBefore,q.comment=this.comment,q.errors=this.errors.slice(),q.warnings=this.warnings.slice(),q.options=Object.assign({},this.options),this.directives)q.directives=this.directives.clone();if(q.schema=this.schema.clone(),q.contents=g.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(Y0(this.contents))this.contents.add(q)}addIn(q,$){if(Y0(this.contents))this.contents.addIn(q,$)}createAlias(q,$){if(!q.anchor){let U=B$.anchorNames(this);q.anchor=!$||U.has($)?B$.findNewAnchor($||"a",U):$}return new tX.Alias(q.anchor)}createNode(q,$,U){let H=void 0;if(typeof $==="function")q=$.call({"":q},"",q),H=$;else if(Array.isArray($)){let Y=(L)=>typeof L==="number"||L instanceof String||L instanceof Number,I=$.filter(Y).map(String);if(I.length>0)$=$.concat(I);H=$}else if(U===void 0&&$)U=$,$=void 0;let{aliasDuplicateObjects:X,anchorPrefix:Z,flow:G,keepUndefined:z,onTagObj:J,tag:Q}=U??{},{onAnchor:V,setAnchors:T,sourceObjects:B}=B$.createNodeAnchors(this,Z||"a"),W={aliasDuplicateObjects:X??!0,keepUndefined:z??!1,onAnchor:V,onTagObj:J,replacer:H,schema:this.schema,sourceObjects:B},R=XZ.createNode(q,Q,W);if(G&&g.isCollection(R))R.flow=!0;return T(),R}createPair(q,$,U={}){let H=this.createNode(q,null,U),X=this.createNode($,null,U);return new eX.Pair(H,X)}delete(q){return Y0(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(B0.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return Y0(this.contents)?this.contents.deleteIn(q):!1}get(q,$){return g.isCollection(this.contents)?this.contents.get(q,$):void 0}getIn(q,$){if(B0.isEmptyPath(q))return!$&&g.isScalar(this.contents)?this.contents.value:this.contents;return g.isCollection(this.contents)?this.contents.getIn(q,$):void 0}has(q){return g.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(B0.isEmptyPath(q))return this.contents!==void 0;return g.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,$){if(this.contents==null)this.contents=B0.collectionFromPath(this.schema,[q],$);else if(Y0(this.contents))this.contents.set(q,$)}setIn(q,$){if(B0.isEmptyPath(q))this.contents=$;else if(this.contents==null)this.contents=B0.collectionFromPath(this.schema,Array.from(q),$);else if(Y0(this.contents))this.contents.setIn(q,$)}setSchema(q,$={}){if(typeof q==="number")q=String(q);let U;switch(q){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new Y$.Directives({version:"1.1"});U={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=q;else this.directives=new Y$.Directives({version:q});U={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;U=null;break;default:{let H=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${H}`)}}if($.schema instanceof Object)this.schema=$.schema;else if(U)this.schema=new $Z.Schema(Object.assign(U,$));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:$,mapAsMap:U,maxAliasCount:H,onAnchor:X,reviver:Z}={}){let G={anchors:new Map,doc:this,keep:!q,mapAsMap:U===!0,mapKeyWarned:!1,maxAliasCount:typeof H==="number"?H:100},z=qZ.toJS(this.contents,$??"",G);if(typeof X==="function")for(let{count:J,res:Q}of G.anchors.values())X(Q,J);return typeof Z==="function"?HZ.applyReviver(Z,{"":z},"",z):z}toJSON(q,$){return this.toJS({json:!0,jsonArg:q,mapAsMap:!1,onAnchor:$})}toString(q={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in q&&(!Number.isInteger(q.indent)||Number(q.indent)<=0)){let $=JSON.stringify(q.indent);throw Error(`"indent" option must be a positive integer, not ${$}`)}return UZ.stringifyDocument(this,q)}}function Y0(q){if(g.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}ZZ.Document=V$});var g0=O((JZ)=>{class Lq extends Error{constructor(q,$,U,H){super();this.name=q,this.code=U,this.message=H,this.pos=$}}class $U extends Lq{constructor(q,$,U){super("YAMLParseError",q,$,U)}}class UU extends Lq{constructor(q,$,U){super("YAMLWarning",q,$,U)}}var zZ=(q,$)=>(U)=>{if(U.pos[0]===-1)return;U.linePos=U.pos.map((z)=>$.linePos(z));let{line:H,col:X}=U.linePos[0];U.message+=` at line ${H}, column ${X}`;let Z=X-1,G=q.substring($.lineStarts[H-1],$.lineStarts[H]).replace(/[\n\r]+$/,"");if(Z>=60&&G.length>80){let z=Math.min(Z-39,G.length-79);G="…"+G.substring(z),Z-=z-1}if(G.length>80)G=G.substring(0,79)+"…";if(H>1&&/^ *$/.test(G.substring(0,Z))){let z=q.substring($.lineStarts[H-2],$.lineStarts[H-1]);if(z.length>80)z=z.substring(0,79)+`…
|
|
58
|
+
`;G=z+G}if(/[^ ]/.test(G)){let z=1,J=U.linePos[1];if(J?.line===H&&J.col>X)z=Math.max(1,Math.min(J.col-X,80-Z));let Q=" ".repeat(Z)+"^".repeat(z);U.message+=`:
|
|
59
|
+
|
|
60
|
+
${G}
|
|
61
|
+
${Q}
|
|
62
|
+
`}};JZ.YAMLError=Lq;JZ.YAMLParseError=$U;JZ.YAMLWarning=UU;JZ.prettifyError=zZ});var f0=O((IZ)=>{function VZ(q,{flow:$,indicator:U,next:H,offset:X,onError:Z,parentIndent:G,startOnNewline:z}){let J=!1,Q=z,V=z,T="",B="",W=!1,R=!1,Y=null,I=null,L=null,D=null,P=null,F=null,A=null;for(let _ of q){if(R){if(_.type!=="space"&&_.type!=="newline"&&_.type!=="comma")Z(_.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");R=!1}if(Y){if(Q&&_.type!=="comment"&&_.type!=="newline")Z(Y,"TAB_AS_INDENT","Tabs are not allowed as indentation");Y=null}switch(_.type){case"space":if(!$&&(U!=="doc-start"||H?.type!=="flow-collection")&&_.source.includes("\t"))Y=_;V=!0;break;case"comment":{if(!V)Z(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let b=_.source.substring(1)||" ";if(!T)T=b;else T+=B+b;B="",Q=!1;break}case"newline":if(Q){if(T)T+=_.source;else if(!F||U!=="seq-item-ind")J=!0}else B+=_.source;if(Q=!0,W=!0,I||L)D=_;V=!0;break;case"anchor":if(I)Z(_,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(_.source.endsWith(":"))Z(_.offset+_.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);I=_,A??(A=_.offset),Q=!1,V=!1,R=!0;break;case"tag":{if(L)Z(_,"MULTIPLE_TAGS","A node can have at most one tag");L=_,A??(A=_.offset),Q=!1,V=!1,R=!0;break}case U:if(I||L)Z(_,"BAD_PROP_ORDER",`Anchors and tags must be after the ${_.source} indicator`);if(F)Z(_,"UNEXPECTED_TOKEN",`Unexpected ${_.source} in ${$??"collection"}`);F=_,Q=U==="seq-item-ind"||U==="explicit-key-ind",V=!1;break;case"comma":if($){if(P)Z(_,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);P=_,Q=!1,V=!1;break}default:Z(_,"UNEXPECTED_TOKEN",`Unexpected ${_.type} token`),Q=!1,V=!1}}let M=q[q.length-1],K=M?M.offset+M.source.length:X;if(R&&H&&H.type!=="space"&&H.type!=="newline"&&H.type!=="comma"&&(H.type!=="scalar"||H.source!==""))Z(H.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(Y&&(Q&&Y.indent<=G||H?.type==="block-map"||H?.type==="block-seq"))Z(Y,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:P,found:F,spaceBefore:J,comment:T,hasNewline:W,anchor:I,tag:L,newlineAfterProp:D,end:K,start:A??K}}IZ.resolveProps=VZ});var Dq=O((OZ)=>{function I$(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
|
|
63
|
+
`))return!0;if(q.end){for(let $ of q.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of q.items){for(let U of $.start)if(U.type==="newline")return!0;if($.sep){for(let U of $.sep)if(U.type==="newline")return!0}if(I$($.key)||I$($.value))return!0}return!1;default:return!0}}OZ.containsNewline=I$});var W$=O((DZ)=>{var _Z=Dq();function LZ(q,$,U){if($?.type==="flow-collection"){let H=$.end[0];if(H.indent===q&&(H.source==="]"||H.source==="}")&&_Z.containsNewline($))U(H,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}DZ.flowIndentCheck=LZ});var O$=O((AZ)=>{var HU=w();function FZ(q,$,U){let{uniqueKeys:H}=q.options;if(H===!1)return!1;let X=typeof H==="function"?H:(Z,G)=>Z===G||HU.isScalar(Z)&&HU.isScalar(G)&&Z.value===G.value;return $.some((Z)=>X(Z.key,U))}AZ.mapIncludes=FZ});var JU=O((SZ)=>{var XU=l(),wZ=c(),ZU=f0(),KZ=Dq(),GU=W$(),NZ=O$(),zU="All mapping items must start at the same column";function bZ({composeNode:q,composeEmptyNode:$},U,H,X,Z){let z=new(Z?.nodeClass??wZ.YAMLMap)(U.schema);if(U.atRoot)U.atRoot=!1;let J=H.offset,Q=null;for(let V of H.items){let{start:T,key:B,sep:W,value:R}=V,Y=ZU.resolveProps(T,{indicator:"explicit-key-ind",next:B??W?.[0],offset:J,onError:X,parentIndent:H.indent,startOnNewline:!0}),I=!Y.found;if(I){if(B){if(B.type==="block-seq")X(J,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in B&&B.indent!==H.indent)X(J,"BAD_INDENT",zU)}if(!Y.anchor&&!Y.tag&&!W){if(Q=Y.end,Y.comment)if(z.comment)z.comment+=`
|
|
64
|
+
`+Y.comment;else z.comment=Y.comment;continue}if(Y.newlineAfterProp||KZ.containsNewline(B))X(B??T[T.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(Y.found?.indent!==H.indent)X(J,"BAD_INDENT",zU);U.atKey=!0;let L=Y.end,D=B?q(U,B,Y,X):$(U,L,T,null,Y,X);if(U.schema.compat)GU.flowIndentCheck(H.indent,B,X);if(U.atKey=!1,NZ.mapIncludes(U,z.items,D))X(L,"DUPLICATE_KEY","Map keys must be unique");let P=ZU.resolveProps(W??[],{indicator:"map-value-ind",next:R,offset:D.range[2],onError:X,parentIndent:H.indent,startOnNewline:!B||B.type==="block-scalar"});if(J=P.end,P.found){if(I){if(R?.type==="block-map"&&!P.hasNewline)X(J,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(U.options.strict&&Y.start<P.found.offset-1024)X(D.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let F=R?q(U,R,P,X):$(U,J,W,null,P,X);if(U.schema.compat)GU.flowIndentCheck(H.indent,R,X);J=F.range[2];let A=new XU.Pair(D,F);if(U.options.keepSourceTokens)A.srcToken=V;z.items.push(A)}else{if(I)X(D.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(P.comment)if(D.comment)D.comment+=`
|
|
65
|
+
`+P.comment;else D.comment=P.comment;let F=new XU.Pair(D);if(U.options.keepSourceTokens)F.srcToken=V;z.items.push(F)}}if(Q&&Q<J)X(Q,"IMPOSSIBLE","Map comment with trailing content");return z.range=[H.offset,J,Q??J],z}SZ.resolveBlockMap=bZ});var QU=O((yZ)=>{var CZ=s(),EZ=f0(),gZ=W$();function fZ({composeNode:q,composeEmptyNode:$},U,H,X,Z){let z=new(Z?.nodeClass??CZ.YAMLSeq)(U.schema);if(U.atRoot)U.atRoot=!1;if(U.atKey)U.atKey=!1;let J=H.offset,Q=null;for(let{start:V,value:T}of H.items){let B=EZ.resolveProps(V,{indicator:"seq-item-ind",next:T,offset:J,onError:X,parentIndent:H.indent,startOnNewline:!0});if(!B.found)if(B.anchor||B.tag||T)if(T?.type==="block-seq")X(B.end,"BAD_INDENT","All sequence items must start at the same column");else X(J,"MISSING_CHAR","Sequence item without - indicator");else{if(Q=B.end,B.comment)z.comment=B.comment;continue}let W=T?q(U,T,B,X):$(U,B.end,V,null,B,X);if(U.schema.compat)gZ.flowIndentCheck(H.indent,T,X);J=W.range[2],z.items.push(W)}return z.range=[H.offset,J,Q??J],z}yZ.resolveBlockSeq=fZ});var V0=O((xZ)=>{function uZ(q,$,U,H){let X="";if(q){let Z=!1,G="";for(let z of q){let{source:J,type:Q}=z;switch(Q){case"space":Z=!0;break;case"comment":{if(U&&!Z)H(z,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let V=J.substring(1)||" ";if(!X)X=V;else X+=G+V;G="";break}case"newline":if(X)G+=J;Z=!0;break;default:H(z,"UNEXPECTED_TOKEN",`Unexpected ${Q} at node end`)}$+=J.length}}return{comment:X,offset:$}}xZ.resolveEnd=uZ});var YU=O((sZ)=>{var vZ=w(),mZ=l(),TU=c(),pZ=s(),dZ=V0(),BU=f0(),lZ=Dq(),aZ=O$(),R$="Block collections are not allowed within flow collections",_$=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function cZ({composeNode:q,composeEmptyNode:$},U,H,X,Z){let G=H.start.source==="{",z=G?"flow map":"flow sequence",Q=new(Z?.nodeClass??(G?TU.YAMLMap:pZ.YAMLSeq))(U.schema);Q.flow=!0;let V=U.atRoot;if(V)U.atRoot=!1;if(U.atKey)U.atKey=!1;let T=H.offset+H.start.source.length;for(let I=0;I<H.items.length;++I){let L=H.items[I],{start:D,key:P,sep:F,value:A}=L,M=BU.resolveProps(D,{flow:z,indicator:"explicit-key-ind",next:P??F?.[0],offset:T,onError:X,parentIndent:H.indent,startOnNewline:!1});if(!M.found){if(!M.anchor&&!M.tag&&!F&&!A){if(I===0&&M.comma)X(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${z}`);else if(I<H.items.length-1)X(M.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${z}`);if(M.comment)if(Q.comment)Q.comment+=`
|
|
66
|
+
`+M.comment;else Q.comment=M.comment;T=M.end;continue}if(!G&&U.options.strict&&lZ.containsNewline(P))X(P,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(I===0){if(M.comma)X(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${z}`)}else{if(!M.comma)X(M.start,"MISSING_CHAR",`Missing , between ${z} items`);if(M.comment){let K="";q:for(let _ of D)switch(_.type){case"comma":case"space":break;case"comment":K=_.source.substring(1);break q;default:break q}if(K){let _=Q.items[Q.items.length-1];if(vZ.isPair(_))_=_.value??_.key;if(_.comment)_.comment+=`
|
|
67
|
+
`+K;else _.comment=K;M.comment=M.comment.substring(K.length+1)}}}if(!G&&!F&&!M.found){let K=A?q(U,A,M,X):$(U,M.end,F,null,M,X);if(Q.items.push(K),T=K.range[2],_$(A))X(K.range,"BLOCK_IN_FLOW",R$)}else{U.atKey=!0;let K=M.end,_=P?q(U,P,M,X):$(U,K,D,null,M,X);if(_$(P))X(_.range,"BLOCK_IN_FLOW",R$);U.atKey=!1;let b=BU.resolveProps(F??[],{flow:z,indicator:"map-value-ind",next:A,offset:_.range[2],onError:X,parentIndent:H.indent,startOnNewline:!1});if(b.found){if(!G&&!M.found&&U.options.strict){if(F)for(let S of F){if(S===b.found)break;if(S.type==="newline"){X(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(M.start<b.found.offset-1024)X(b.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(A)if("source"in A&&A.source?.[0]===":")X(A,"MISSING_CHAR",`Missing space after : in ${z}`);else X(b.start,"MISSING_CHAR",`Missing , or : between ${z} items`);let v=A?q(U,A,b,X):b.found?$(U,b.end,F,null,b,X):null;if(v){if(_$(A))X(v.range,"BLOCK_IN_FLOW",R$)}else if(b.comment)if(_.comment)_.comment+=`
|
|
68
|
+
`+b.comment;else _.comment=b.comment;let H0=new mZ.Pair(_,v);if(U.options.keepSourceTokens)H0.srcToken=L;if(G){let S=Q;if(aZ.mapIncludes(U,S.items,_))X(K,"DUPLICATE_KEY","Map keys must be unique");S.items.push(H0)}else{let S=new TU.YAMLMap(U.schema);S.flow=!0,S.items.push(H0);let x$=(v??_).range;S.range=[_.range[0],x$[1],x$[2]],Q.items.push(S)}T=v?v.range[2]:b.end}}let B=G?"}":"]",[W,...R]=H.end,Y=T;if(W?.source===B)Y=W.offset+W.source.length;else{let I=z[0].toUpperCase()+z.substring(1),L=V?`${I} must end with a ${B}`:`${I} in block collection must be sufficiently indented and end with a ${B}`;if(X(T,V?"MISSING_CHAR":"BAD_INDENT",L),W&&W.source.length!==1)R.unshift(W)}if(R.length>0){let I=dZ.resolveEnd(R,Y,U.options.strict,X);if(I.comment)if(Q.comment)Q.comment+=`
|
|
69
|
+
`+I.comment;else Q.comment=I.comment;Q.range=[H.offset,Y,I.offset]}else Q.range=[H.offset,Y,Y];return Q}sZ.resolveFlowCollection=cZ});var VU=O((H5)=>{var rZ=w(),nZ=N(),oZ=c(),tZ=s(),eZ=JU(),q5=QU(),$5=YU();function L$(q,$,U,H,X,Z){let G=U.type==="block-map"?eZ.resolveBlockMap(q,$,U,H,Z):U.type==="block-seq"?q5.resolveBlockSeq(q,$,U,H,Z):$5.resolveFlowCollection(q,$,U,H,Z),z=G.constructor;if(X==="!"||X===z.tagName)return G.tag=z.tagName,G;if(X)G.tag=X;return G}function U5(q,$,U,H,X){let Z=H.tag,G=!Z?null:$.directives.tagName(Z.source,(B)=>X(Z,"TAG_RESOLVE_FAILED",B));if(U.type==="block-seq"){let{anchor:B,newlineAfterProp:W}=H,R=B&&Z?B.offset>Z.offset?B:Z:B??Z;if(R&&(!W||W.offset<R.offset))X(R,"MISSING_CHAR","Missing newline after block sequence props")}let z=U.type==="block-map"?"map":U.type==="block-seq"?"seq":U.start.source==="{"?"map":"seq";if(!Z||!G||G==="!"||G===oZ.YAMLMap.tagName&&z==="map"||G===tZ.YAMLSeq.tagName&&z==="seq")return L$(q,$,U,X,G);let J=$.schema.tags.find((B)=>B.tag===G&&B.collection===z);if(!J){let B=$.schema.knownTags[G];if(B?.collection===z)$.schema.tags.push(Object.assign({},B,{default:!1})),J=B;else{if(B)X(Z,"BAD_COLLECTION_TYPE",`${B.tag} used for ${z} collection, but expects ${B.collection??"scalar"}`,!0);else X(Z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${G}`,!0);return L$(q,$,U,X,G)}}let Q=L$(q,$,U,X,G,J),V=J.resolve?.(Q,(B)=>X(Z,"TAG_RESOLVE_FAILED",B),$.options)??Q,T=rZ.isNode(V)?V:new nZ.Scalar(V);if(T.range=Q.range,T.tag=G,J?.format)T.format=J.format;return T}H5.composeCollection=U5});var P$=O((J5)=>{var D$=N();function Z5(q,$,U){let H=$.offset,X=G5($,q.options.strict,U);if(!X)return{value:"",type:null,comment:"",range:[H,H,H]};let Z=X.mode===">"?D$.Scalar.BLOCK_FOLDED:D$.Scalar.BLOCK_LITERAL,G=$.source?z5($.source):[],z=G.length;for(let Y=G.length-1;Y>=0;--Y){let I=G[Y][1];if(I===""||I==="\r")z=Y;else break}if(z===0){let Y=X.chomp==="+"&&G.length>0?`
|
|
70
|
+
`.repeat(Math.max(1,G.length-1)):"",I=H+X.length;if($.source)I+=$.source.length;return{value:Y,type:Z,comment:X.comment,range:[H,I,I]}}let J=$.indent+X.indent,Q=$.offset+X.length,V=0;for(let Y=0;Y<z;++Y){let[I,L]=G[Y];if(L===""||L==="\r"){if(X.indent===0&&I.length>J)J=I.length}else{if(I.length<J)U(Q+I.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(X.indent===0)J=I.length;if(V=Y,J===0&&!q.atRoot)U(Q,"BAD_INDENT","Block scalar values in collections must be indented");break}Q+=I.length+L.length+1}for(let Y=G.length-1;Y>=z;--Y)if(G[Y][0].length>J)z=Y+1;let T="",B="",W=!1;for(let Y=0;Y<V;++Y)T+=G[Y][0].slice(J)+`
|
|
71
|
+
`;for(let Y=V;Y<z;++Y){let[I,L]=G[Y];Q+=I.length+L.length+1;let D=L[L.length-1]==="\r";if(D)L=L.slice(0,-1);if(L&&I.length<J){let F=`Block scalar lines must not be less indented than their ${X.indent?"explicit indentation indicator":"first line"}`;U(Q-L.length-(D?2:1),"BAD_INDENT",F),I=""}if(Z===D$.Scalar.BLOCK_LITERAL)T+=B+I.slice(J)+L,B=`
|
|
72
|
+
`;else if(I.length>J||L[0]==="\t"){if(B===" ")B=`
|
|
73
|
+
`;else if(!W&&B===`
|
|
74
|
+
`)B=`
|
|
75
|
+
|
|
76
|
+
`;T+=B+I.slice(J)+L,B=`
|
|
77
|
+
`,W=!0}else if(L==="")if(B===`
|
|
78
|
+
`)T+=`
|
|
79
|
+
`;else B=`
|
|
80
|
+
`;else T+=B+L,B=" ",W=!1}switch(X.chomp){case"-":break;case"+":for(let Y=z;Y<G.length;++Y)T+=`
|
|
81
|
+
`+G[Y][0].slice(J);if(T[T.length-1]!==`
|
|
82
|
+
`)T+=`
|
|
83
|
+
`;break;default:T+=`
|
|
84
|
+
`}let R=H+X.length+$.source.length;return{value:T,type:Z,comment:X.comment,range:[H,R,R]}}function G5({offset:q,props:$},U,H){if($[0].type!=="block-scalar-header")return H($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:X}=$[0],Z=X[0],G=0,z="",J=-1;for(let B=1;B<X.length;++B){let W=X[B];if(!z&&(W==="-"||W==="+"))z=W;else{let R=Number(W);if(!G&&R)G=R;else if(J===-1)J=q+B}}if(J!==-1)H(J,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${X}`);let Q=!1,V="",T=X.length;for(let B=1;B<$.length;++B){let W=$[B];switch(W.type){case"space":Q=!0;case"newline":T+=W.source.length;break;case"comment":if(U&&!Q)H(W,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");T+=W.source.length,V=W.source.substring(1);break;case"error":H(W,"UNEXPECTED_TOKEN",W.message),T+=W.source.length;break;default:{let R=`Unexpected token in block scalar header: ${W.type}`;H(W,"UNEXPECTED_TOKEN",R);let Y=W.source;if(Y&&typeof Y==="string")T+=Y.length}}}return{mode:Z,indent:G,chomp:z,comment:V,length:T}}function z5(q){let $=q.split(/\n( *)/),U=$[0],H=U.match(/^( *)/),Z=[H?.[1]?[H[1],U.slice(H[1].length)]:["",U]];for(let G=1;G<$.length;G+=2)Z.push([$[G],$[G+1]]);return Z}J5.resolveBlockScalar=Z5});var A$=O((_5)=>{var F$=N(),T5=V0();function B5(q,$,U){let{offset:H,type:X,source:Z,end:G}=q,z,J,Q=(B,W,R)=>U(H+B,W,R);switch(X){case"scalar":z=F$.Scalar.PLAIN,J=Y5(Z,Q);break;case"single-quoted-scalar":z=F$.Scalar.QUOTE_SINGLE,J=V5(Z,Q);break;case"double-quoted-scalar":z=F$.Scalar.QUOTE_DOUBLE,J=I5(Z,Q);break;default:return U(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${X}`),{value:"",type:null,comment:"",range:[H,H+Z.length,H+Z.length]}}let V=H+Z.length,T=T5.resolveEnd(G,V,$,U);return{value:J,type:z,comment:T.comment,range:[H,V,T.offset]}}function Y5(q,$){let U="";switch(q[0]){case"\t":U="a tab character";break;case",":U="flow indicator character ,";break;case"%":U="directive indicator character %";break;case"|":case">":{U=`block scalar indicator ${q[0]}`;break}case"@":case"`":{U=`reserved character ${q[0]}`;break}}if(U)$(0,"BAD_SCALAR_START",`Plain value cannot start with ${U}`);return IU(q)}function V5(q,$){if(q[q.length-1]!=="'"||q.length===1)$(q.length,"MISSING_CHAR","Missing closing 'quote");return IU(q.slice(1,-1)).replace(/''/g,"'")}function IU(q){let $,U;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
85
|
+
`,"sy"),U=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
86
|
+
`,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,U=/[ \t]*(.*?)[ \t]*\r?\n/sy}let H=$.exec(q);if(!H)return q;let X=H[1],Z=" ",G=$.lastIndex;U.lastIndex=G;while(H=U.exec(q)){if(H[1]==="")if(Z===`
|
|
87
|
+
`)X+=Z;else Z=`
|
|
88
|
+
`;else X+=Z+H[1],Z=" ";G=U.lastIndex}let z=/[ \t]*(.*)/sy;return z.lastIndex=G,H=z.exec(q),X+Z+(H?.[1]??"")}function I5(q,$){let U="";for(let H=1;H<q.length-1;++H){let X=q[H];if(X==="\r"&&q[H+1]===`
|
|
89
|
+
`)continue;if(X===`
|
|
90
|
+
`){let{fold:Z,offset:G}=W5(q,H);U+=Z,H=G}else if(X==="\\"){let Z=q[++H],G=O5[Z];if(G)U+=G;else if(Z===`
|
|
91
|
+
`){Z=q[H+1];while(Z===" "||Z==="\t")Z=q[++H+1]}else if(Z==="\r"&&q[H+1]===`
|
|
92
|
+
`){Z=q[++H+1];while(Z===" "||Z==="\t")Z=q[++H+1]}else if(Z==="x"||Z==="u"||Z==="U"){let z={x:2,u:4,U:8}[Z];U+=R5(q,H+1,z,$),H+=z}else{let z=q.substr(H-1,2);$(H-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${z}`),U+=z}}else if(X===" "||X==="\t"){let Z=H,G=q[H+1];while(G===" "||G==="\t")G=q[++H+1];if(G!==`
|
|
93
|
+
`&&!(G==="\r"&&q[H+2]===`
|
|
94
|
+
`))U+=H>Z?q.slice(Z,H+1):X}else U+=X}if(q[q.length-1]!=='"'||q.length===1)$(q.length,"MISSING_CHAR",'Missing closing "quote');return U}function W5(q,$){let U="",H=q[$+1];while(H===" "||H==="\t"||H===`
|
|
95
|
+
`||H==="\r"){if(H==="\r"&&q[$+2]!==`
|
|
96
|
+
`)break;if(H===`
|
|
97
|
+
`)U+=`
|
|
98
|
+
`;$+=1,H=q[$+1]}if(!U)U=" ";return{fold:U,offset:$}}var O5={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function R5(q,$,U,H){let X=q.substr($,U),G=X.length===U&&/^[0-9a-fA-F]+$/.test(X)?parseInt(X,16):NaN;if(isNaN(G)){let z=q.substr($-2,U+2);return H($-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${z}`),z}return String.fromCodePoint(G)}_5.resolveFlowScalar=B5});var OU=O((w5)=>{var $0=w(),WU=N(),D5=P$(),P5=A$();function F5(q,$,U,H){let{value:X,type:Z,comment:G,range:z}=$.type==="block-scalar"?D5.resolveBlockScalar(q,$,H):P5.resolveFlowScalar($,q.options.strict,H),J=U?q.directives.tagName(U.source,(T)=>H(U,"TAG_RESOLVE_FAILED",T)):null,Q;if(q.options.stringKeys&&q.atKey)Q=q.schema[$0.SCALAR];else if(J)Q=A5(q.schema,X,J,U,H);else if($.type==="scalar")Q=M5(q,X,$,H);else Q=q.schema[$0.SCALAR];let V;try{let T=Q.resolve(X,(B)=>H(U??$,"TAG_RESOLVE_FAILED",B),q.options);V=$0.isScalar(T)?T:new WU.Scalar(T)}catch(T){let B=T instanceof Error?T.message:String(T);H(U??$,"TAG_RESOLVE_FAILED",B),V=new WU.Scalar(X)}if(V.range=z,V.source=X,Z)V.type=Z;if(J)V.tag=J;if(Q.format)V.format=Q.format;if(G)V.comment=G;return V}function A5(q,$,U,H,X){if(U==="!")return q[$0.SCALAR];let Z=[];for(let z of q.tags)if(!z.collection&&z.tag===U)if(z.default&&z.test)Z.push(z);else return z;for(let z of Z)if(z.test?.test($))return z;let G=q.knownTags[U];if(G&&!G.collection)return q.tags.push(Object.assign({},G,{default:!1,test:void 0})),G;return X(H,"TAG_RESOLVE_FAILED",`Unresolved tag: ${U}`,U!=="tag:yaml.org,2002:str"),q[$0.SCALAR]}function M5({atKey:q,directives:$,schema:U},H,X,Z){let G=U.tags.find((z)=>(z.default===!0||q&&z.default==="key")&&z.test?.test(H))||U[$0.SCALAR];if(U.compat){let z=U.compat.find((J)=>J.default&&J.test?.test(H))??U[$0.SCALAR];if(G.tag!==z.tag){let J=$.tagString(G.tag),Q=$.tagString(z.tag),V=`Value may be parsed as either ${J} or ${Q}`;Z(X,"TAG_RESOLVE_FAILED",V,!0)}}return G}w5.composeScalar=F5});var RU=O((b5)=>{function N5(q,$,U){if($){U??(U=$.length);for(let H=U-1;H>=0;--H){let X=$[H];switch(X.type){case"space":case"comment":case"newline":q-=X.source.length;continue}X=$[++H];while(X?.type==="space")q+=X.source.length,X=$[++H];break}}return q}b5.emptyScalarPosition=N5});var DU=O((u5)=>{var j5=R0(),C5=w(),E5=VU(),_U=OU(),g5=V0(),f5=RU(),y5={composeNode:LU,composeEmptyNode:M$};function LU(q,$,U,H){let X=q.atKey,{spaceBefore:Z,comment:G,anchor:z,tag:J}=U,Q,V=!0;switch($.type){case"alias":if(Q=h5(q,$,H),z||J)H($,"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(Q=_U.composeScalar(q,$,J,H),z)Q.anchor=z.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(Q=E5.composeCollection(y5,q,$,U,H),z)Q.anchor=z.source.substring(1);break;default:{let T=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;H($,"UNEXPECTED_TOKEN",T),Q=M$(q,$.offset,void 0,null,U,H),V=!1}}if(z&&Q.anchor==="")H(z,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&q.options.stringKeys&&(!C5.isScalar(Q)||typeof Q.value!=="string"||Q.tag&&Q.tag!=="tag:yaml.org,2002:str"))H(J??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Z)Q.spaceBefore=!0;if(G)if($.type==="scalar"&&$.source==="")Q.comment=G;else Q.commentBefore=G;if(q.options.keepSourceTokens&&V)Q.srcToken=$;return Q}function M$(q,$,U,H,{spaceBefore:X,comment:Z,anchor:G,tag:z,end:J},Q){let V={type:"scalar",offset:f5.emptyScalarPosition($,U,H),indent:-1,source:""},T=_U.composeScalar(q,V,z,Q);if(G){if(T.anchor=G.source.substring(1),T.anchor==="")Q(G,"BAD_ALIAS","Anchor cannot be an empty string")}if(X)T.spaceBefore=!0;if(Z)T.comment=Z,T.range[2]=J;return T}function h5({options:q},{offset:$,source:U,end:H},X){let Z=new j5.Alias(U.substring(1));if(Z.source==="")X($,"BAD_ALIAS","Alias cannot be an empty string");if(Z.source.endsWith(":"))X($+U.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let G=$+U.length,z=g5.resolveEnd(H,G,q.strict,X);if(Z.range=[$,G,z.offset],z.comment)Z.comment=z.comment;return Z}u5.composeEmptyNode=M$;u5.composeNode=LU});var FU=O((l5)=>{var v5=E0(),PU=DU(),m5=V0(),p5=f0();function d5(q,$,{offset:U,start:H,value:X,end:Z},G){let z=Object.assign({_directives:$},q),J=new v5.Document(void 0,z),Q={atKey:!1,atRoot:!0,directives:J.directives,options:J.options,schema:J.schema},V=p5.resolveProps(H,{indicator:"doc-start",next:X??Z?.[0],offset:U,onError:G,parentIndent:0,startOnNewline:!0});if(V.found){if(J.directives.docStart=!0,X&&(X.type==="block-map"||X.type==="block-seq")&&!V.hasNewline)G(V.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}J.contents=X?PU.composeNode(Q,X,V,G):PU.composeEmptyNode(Q,V.end,H,null,V,G);let T=J.contents.range[2],B=m5.resolveEnd(Z,T,!1,G);if(B.comment)J.comment=B.comment;return J.range=[U,T,B.offset],J}l5.composeDoc=d5});var w$=O((o5)=>{var c5=n0("process"),s5=Sq(),i5=E0(),y0=g0(),AU=w(),r5=FU(),n5=V0();function h0(q){if(typeof q==="number")return[q,q+1];if(Array.isArray(q))return q.length===2?q:[q[0],q[1]];let{offset:$,source:U}=q;return[$,$+(typeof U==="string"?U.length:1)]}function MU(q){let $="",U=!1,H=!1;for(let X=0;X<q.length;++X){let Z=q[X];switch(Z[0]){case"#":$+=($===""?"":H?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(Z.substring(1)||" "),U=!0,H=!1;break;case"%":if(q[X+1]?.[0]!=="#")X+=1;U=!1;break;default:if(!U)H=!0;U=!1}}return{comment:$,afterEmptyLine:H}}class wU{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,U,H,X)=>{let Z=h0($);if(X)this.warnings.push(new y0.YAMLWarning(Z,U,H));else this.errors.push(new y0.YAMLParseError(Z,U,H))},this.directives=new s5.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,$){let{comment:U,afterEmptyLine:H}=MU(this.prelude);if(U){let X=q.contents;if($)q.comment=q.comment?`${q.comment}
|
|
103
|
+
${U}`:U;else if(H||q.directives.docStart||!X)q.commentBefore=U;else if(AU.isCollection(X)&&!X.flow&&X.items.length>0){let Z=X.items[0];if(AU.isPair(Z))Z=Z.key;let G=Z.commentBefore;Z.commentBefore=G?`${U}
|
|
104
|
+
${G}`:U}else{let Z=X.commentBefore;X.commentBefore=Z?`${U}
|
|
105
|
+
${Z}`:U}}if($)Array.prototype.push.apply(q.errors,this.errors),Array.prototype.push.apply(q.warnings,this.warnings);else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:MU(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,$=!1,U=-1){for(let H of q)yield*this.next(H);yield*this.end($,U)}*next(q){if(c5.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,($,U,H)=>{let X=h0(q);X[0]+=$,this.onError(X,"BAD_DIRECTIVE",U,H)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let $=r5.composeDoc(this.options,this.directives,q,this.onError);if(this.atDirectives&&!$.directives.docStart)this.onError(q,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate($,!1),this.doc)yield this.doc;this.doc=$,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(q.source);break;case"error":{let $=q.source?`${q.message}: ${JSON.stringify(q.source)}`:q.message,U=new y0.YAMLParseError(h0(q),"UNEXPECTED_TOKEN",$);if(this.atDirectives||!this.doc)this.errors.push(U);else this.doc.errors.push(U);break}case"doc-end":{if(!this.doc){this.errors.push(new y0.YAMLParseError(h0(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=n5.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),$.comment){let U=this.doc.comment;this.doc.comment=U?`${U}
|
|
106
|
+
${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new y0.YAMLParseError(h0(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,$=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(q){let U=Object.assign({_directives:this.directives},this.options),H=new i5.Document(void 0,U);if(this.atDirectives)this.onError($,"MISSING_CHAR","Missing directives-end indicator line");H.range=[0,$,$],this.decorate(H,!1),yield H}}}o5.Composer=wU});var bU=O((G6)=>{var e5=P$(),q6=A$(),$6=g0(),KU=P0();function U6(q,$=!0,U){if(q){let H=(X,Z,G)=>{let z=typeof X==="number"?X:Array.isArray(X)?X[0]:X.offset;if(U)U(z,Z,G);else throw new $6.YAMLParseError([z,z+1],Z,G)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return q6.resolveFlowScalar(q,$,H);case"block-scalar":return e5.resolveBlockScalar({options:{strict:$}},q,H)}}return null}function H6(q,$){let{implicitKey:U=!1,indent:H,inFlow:X=!1,offset:Z=-1,type:G="PLAIN"}=$,z=KU.stringifyString({type:G,value:q},{implicitKey:U,indent:H>0?" ".repeat(H):"",inFlow:X,options:{blockQuote:!0,lineWidth:-1}}),J=$.end??[{type:"newline",offset:-1,indent:H,source:`
|
|
107
|
+
`}];switch(z[0]){case"|":case">":{let Q=z.indexOf(`
|
|
108
|
+
`),V=z.substring(0,Q),T=z.substring(Q+1)+`
|
|
109
|
+
`,B=[{type:"block-scalar-header",offset:Z,indent:H,source:V}];if(!NU(B,J))B.push({type:"newline",offset:-1,indent:H,source:`
|
|
110
|
+
`});return{type:"block-scalar",offset:Z,indent:H,props:B,source:T}}case'"':return{type:"double-quoted-scalar",offset:Z,indent:H,source:z,end:J};case"'":return{type:"single-quoted-scalar",offset:Z,indent:H,source:z,end:J};default:return{type:"scalar",offset:Z,indent:H,source:z,end:J}}}function X6(q,$,U={}){let{afterKey:H=!1,implicitKey:X=!1,inFlow:Z=!1,type:G}=U,z="indent"in q?q.indent:null;if(H&&typeof z==="number")z+=2;if(!G)switch(q.type){case"single-quoted-scalar":G="QUOTE_SINGLE";break;case"double-quoted-scalar":G="QUOTE_DOUBLE";break;case"block-scalar":{let Q=q.props[0];if(Q.type!=="block-scalar-header")throw Error("Invalid block scalar header");G=Q.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:G="PLAIN"}let J=KU.stringifyString({type:G,value:$},{implicitKey:X||z===null,indent:z!==null&&z>0?" ".repeat(z):"",inFlow:Z,options:{blockQuote:!0,lineWidth:-1}});switch(J[0]){case"|":case">":Z6(q,J);break;case'"':K$(q,J,"double-quoted-scalar");break;case"'":K$(q,J,"single-quoted-scalar");break;default:K$(q,J,"scalar")}}function Z6(q,$){let U=$.indexOf(`
|
|
111
|
+
`),H=$.substring(0,U),X=$.substring(U+1)+`
|
|
112
|
+
`;if(q.type==="block-scalar"){let Z=q.props[0];if(Z.type!=="block-scalar-header")throw Error("Invalid block scalar header");Z.source=H,q.source=X}else{let{offset:Z}=q,G="indent"in q?q.indent:-1,z=[{type:"block-scalar-header",offset:Z,indent:G,source:H}];if(!NU(z,"end"in q?q.end:void 0))z.push({type:"newline",offset:-1,indent:G,source:`
|
|
113
|
+
`});for(let J of Object.keys(q))if(J!=="type"&&J!=="offset")delete q[J];Object.assign(q,{type:"block-scalar",indent:G,props:z,source:X})}}function NU(q,$){if($)for(let U of $)switch(U.type){case"space":case"comment":q.push(U);break;case"newline":return q.push(U),!0}return!1}function K$(q,$,U){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=U,q.source=$;break;case"block-scalar":{let H=q.props.slice(1),X=$.length;if(q.props[0].type==="block-scalar-header")X-=q.props[0].source.length;for(let Z of H)Z.offset+=X;delete q.props,Object.assign(q,{type:U,source:$,end:H});break}case"block-map":case"block-seq":{let X={type:"newline",offset:q.offset+$.length,indent:q.indent,source:`
|
|
114
|
+
`};delete q.items,Object.assign(q,{type:U,source:$,end:[X]});break}default:{let H="indent"in q?q.indent:-1,X="end"in q&&Array.isArray(q.end)?q.end.filter((Z)=>Z.type==="space"||Z.type==="comment"||Z.type==="newline"):[];for(let Z of Object.keys(q))if(Z!=="type"&&Z!=="offset")delete q[Z];Object.assign(q,{type:U,indent:H,source:$,end:X})}}}G6.createScalarToken=H6;G6.resolveAsScalar=U6;G6.setScalarValue=X6});var SU=O((B6)=>{var T6=(q)=>("type"in q)?Fq(q):Pq(q);function Fq(q){switch(q.type){case"block-scalar":{let $="";for(let U of q.props)$+=Fq(U);return $+q.source}case"block-map":case"block-seq":{let $="";for(let U of q.items)$+=Pq(U);return $}case"flow-collection":{let $=q.start.source;for(let U of q.items)$+=Pq(U);for(let U of q.end)$+=U.source;return $}case"document":{let $=Pq(q);if(q.end)for(let U of q.end)$+=U.source;return $}default:{let $=q.source;if("end"in q&&q.end)for(let U of q.end)$+=U.source;return $}}}function Pq({start:q,key:$,sep:U,value:H}){let X="";for(let Z of q)X+=Z.source;if($)X+=Fq($);if(U)for(let Z of U)X+=Z.source;if(H)X+=Fq(H);return X}B6.stringify=T6});var EU=O((I6)=>{var N$=Symbol("break visit"),V6=Symbol("skip children"),jU=Symbol("remove item");function U0(q,$){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};CU(Object.freeze([]),q,$)}U0.BREAK=N$;U0.SKIP=V6;U0.REMOVE=jU;U0.itemAtPath=(q,$)=>{let U=q;for(let[H,X]of $){let Z=U?.[H];if(Z&&"items"in Z)U=Z.items[X];else return}return U};U0.parentCollection=(q,$)=>{let U=U0.itemAtPath(q,$.slice(0,-1)),H=$[$.length-1][0],X=U?.[H];if(X&&"items"in X)return X;throw Error("Parent collection not found")};function CU(q,$,U){let H=U($,q);if(typeof H==="symbol")return H;for(let X of["key","value"]){let Z=$[X];if(Z&&"items"in Z){for(let G=0;G<Z.items.length;++G){let z=CU(Object.freeze(q.concat([[X,G]])),Z.items[G],U);if(typeof z==="number")G=z-1;else if(z===N$)return N$;else if(z===jU)Z.items.splice(G,1),G-=1}if(typeof H==="function"&&X==="key")H=H($,q)}}return typeof H==="function"?H($,q):H}I6.visit=U0});var Aq=O((F6)=>{var b$=bU(),O6=SU(),R6=EU(),S$="\uFEFF",j$="\x02",C$="\x18",E$="\x1F",_6=(q)=>!!q&&("items"in q),L6=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function D6(q){switch(q){case S$:return"<BOM>";case j$:return"<DOC>";case C$:return"<FLOW_END>";case E$:return"<SCALAR>";default:return JSON.stringify(q)}}function P6(q){switch(q){case S$:return"byte-order-mark";case j$:return"doc-mode";case C$:return"flow-error-end";case E$:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
115
|
+
`:case`\r
|
|
116
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(q[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}F6.createScalarToken=b$.createScalarToken;F6.resolveAsScalar=b$.resolveAsScalar;F6.setScalarValue=b$.setScalarValue;F6.stringify=O6.stringify;F6.visit=R6.visit;F6.BOM=S$;F6.DOCUMENT=j$;F6.FLOW_END=C$;F6.SCALAR=E$;F6.isCollection=_6;F6.isScalar=L6;F6.prettyToken=D6;F6.tokenType=P6});var f$=O((x6)=>{var u0=Aq();function y(q){switch(q){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case"\t":return!0;default:return!1}}var gU=new Set("0123456789ABCDEFabcdef"),h6=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Mq=new Set(",[]{}"),u6=new Set(` ,[]{}
|
|
118
|
+
\r `),g$=(q)=>!q||u6.has(q);class fU{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(q,$=!1){if(q){if(typeof q!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+q:q,this.lineEndPos=null}this.atEnd=!$;let U=this.next??"stream";while(U&&($||this.hasChars(1)))U=yield*this.parseNext(U)}atLineEnd(){let q=this.pos,$=this.buffer[q];while($===" "||$==="\t")$=this.buffer[++q];if(!$||$==="#"||$===`
|
|
119
|
+
`)return!0;if($==="\r")return this.buffer[q+1]===`
|
|
120
|
+
`;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let $=this.buffer[q];if(this.indentNext>0){let U=0;while($===" ")$=this.buffer[++U+q];if($==="\r"){let H=this.buffer[U+q+1];if(H===`
|
|
121
|
+
`||!H&&!this.atEnd)return q+U+1}return $===`
|
|
122
|
+
`||U>=this.indentNext||!$&&!this.atEnd?q+U:-1}if($==="-"||$==="."){let U=this.buffer.substr(q,3);if((U==="---"||U==="...")&&y(this.buffer[q+3]))return-1}return q}getLine(){let q=this.lineEndPos;if(typeof q!=="number"||q!==-1&&q<this.pos)q=this.buffer.indexOf(`
|
|
123
|
+
`,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){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 q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===u0.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let $=q.length,U=q.indexOf("#");while(U!==-1){let X=q[U-1];if(X===" "||X==="\t"){$=U-1;break}else U=q.indexOf("#",U+1)}while(!0){let X=q[$-1];if(X===" "||X==="\t")$-=1;else break}let H=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-H),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-$),yield*this.pushNewline(),"stream"}return yield u0.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let q=this.charAt(0);if(!q&&!this.atEnd)return this.setNext("line-start");if(q==="-"||q==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let $=this.peek(3);if(($==="---"||$==="...")&&y(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,$==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!y(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[q,$]=this.peek(2);if(!$&&!this.atEnd)return this.setNext("block-start");if((q==="-"||q==="?"||q===":")&&y($)){let U=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=U,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let q=this.getLine();if(q===null)return this.setNext("doc");let $=yield*this.pushIndicators();switch(q[$]){case"#":yield*this.pushCount(q.length-$);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(g$),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return $+=yield*this.parseBlockScalarHeader(),$+=yield*this.pushSpaces(!0),yield*this.pushCount(q.length-$),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let q,$,U=-1;do{if(q=yield*this.pushNewline(),q>0)$=yield*this.pushSpaces(!1),this.indentValue=U=$;else $=0;$+=yield*this.pushSpaces(!0)}while(q+$>0);let H=this.getLine();if(H===null)return this.setNext("flow");if(U!==-1&&U<this.indentNext&&H[0]!=="#"||U===0&&(H.startsWith("---")||H.startsWith("..."))&&y(H[3])){if(!(U===this.indentNext-1&&this.flowLevel===1&&(H[0]==="]"||H[0]==="}")))return this.flowLevel=0,yield u0.FLOW_END,yield*this.parseLineStart()}let X=0;while(H[X]===",")X+=yield*this.pushCount(1),X+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(X+=yield*this.pushIndicators(),H[X]){case void 0:return"flow";case"#":return yield*this.pushCount(H.length-X),"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(g$),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Z=this.charAt(1);if(this.flowKey||y(Z)||Z===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let q=this.charAt(0),$=this.buffer.indexOf(q,this.pos+1);if(q==="'")while($!==-1&&this.buffer[$+1]==="'")$=this.buffer.indexOf("'",$+2);else while($!==-1){let X=0;while(this.buffer[$-1-X]==="\\")X+=1;if(X%2===0)break;$=this.buffer.indexOf('"',$+1)}let U=this.buffer.substring(0,$),H=U.indexOf(`
|
|
124
|
+
`,this.pos);if(H!==-1){while(H!==-1){let X=this.continueScalar(H+1);if(X===-1)break;H=U.indexOf(`
|
|
125
|
+
`,X)}if(H!==-1)$=H-(U[H-1]==="\r"?2:1)}if($===-1){if(!this.atEnd)return this.setNext("quoted-scalar");$=this.buffer.length}return yield*this.pushToIndex($+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let q=this.pos;while(!0){let $=this.buffer[++q];if($==="+")this.blockScalarKeep=!0;else if($>"0"&&$<="9")this.blockScalarIndent=Number($)-1;else if($!=="-")break}return yield*this.pushUntil(($)=>y($)||$==="#")}*parseBlockScalar(){let q=this.pos-1,$=0,U;q:for(let X=this.pos;U=this.buffer[X];++X)switch(U){case" ":$+=1;break;case`
|
|
126
|
+
`:q=X,$=0;break;case"\r":{let Z=this.buffer[X+1];if(!Z&&!this.atEnd)return this.setNext("block-scalar");if(Z===`
|
|
127
|
+
`)break}default:break q}if(!U&&!this.atEnd)return this.setNext("block-scalar");if($>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=$;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let X=this.continueScalar(q+1);if(X===-1)break;q=this.buffer.indexOf(`
|
|
128
|
+
`,X)}while(q!==-1);if(q===-1){if(!this.atEnd)return this.setNext("block-scalar");q=this.buffer.length}}let H=q+1;U=this.buffer[H];while(U===" ")U=this.buffer[++H];if(U==="\t"){while(U==="\t"||U===" "||U==="\r"||U===`
|
|
129
|
+
`)U=this.buffer[++H];q=H-1}else if(!this.blockScalarKeep)do{let X=q-1,Z=this.buffer[X];if(Z==="\r")Z=this.buffer[--X];let G=X;while(Z===" ")Z=this.buffer[--X];if(Z===`
|
|
130
|
+
`&&X>=this.pos&&X+1+$>G)q=X;else break}while(!0);return yield u0.SCALAR,yield*this.pushToIndex(q+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let q=this.flowLevel>0,$=this.pos-1,U=this.pos-1,H;while(H=this.buffer[++U])if(H===":"){let X=this.buffer[U+1];if(y(X)||q&&Mq.has(X))break;$=U}else if(y(H)){let X=this.buffer[U+1];if(H==="\r")if(X===`
|
|
131
|
+
`)U+=1,H=`
|
|
132
|
+
`,X=this.buffer[U+1];else $=U;if(X==="#"||q&&Mq.has(X))break;if(H===`
|
|
133
|
+
`){let Z=this.continueScalar(U+1);if(Z===-1)break;U=Math.max(U,Z-2)}}else{if(q&&Mq.has(H))break;$=U}if(!H&&!this.atEnd)return this.setNext("plain-scalar");return yield u0.SCALAR,yield*this.pushToIndex($+1,!0),q?"flow":"doc"}*pushCount(q){if(q>0)return yield this.buffer.substr(this.pos,q),this.pos+=q,q;return 0}*pushToIndex(q,$){let U=this.buffer.slice(this.pos,q);if(U)return yield U,this.pos+=U.length,U.length;else if($)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(g$))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,$=this.charAt(1);if(y($)||q&&Mq.has($)){if(!q)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let q=this.pos+2,$=this.buffer[q];while(!y($)&&$!==">")$=this.buffer[++q];return yield*this.pushToIndex($===">"?q+1:q,!1)}else{let q=this.pos+1,$=this.buffer[q];while($)if(h6.has($))$=this.buffer[++q];else if($==="%"&&gU.has(this.buffer[q+1])&&gU.has(this.buffer[q+2]))$=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
|
|
134
|
+
`)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===`
|
|
135
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let $=this.pos-1,U;do U=this.buffer[++$];while(U===" "||q&&U==="\t");let H=$-this.pos;if(H>0)yield this.buffer.substr(this.pos,H),this.pos=$;return H}*pushUntil(q){let $=this.pos,U=this.buffer[$];while(!q(U))U=this.buffer[++$];return yield*this.pushToIndex($,!1)}}x6.Lexer=fU});var y$=O((v6)=>{class yU{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let $=0,U=this.lineStarts.length;while($<U){let X=$+U>>1;if(this.lineStarts[X]<q)$=X+1;else U=X}if(this.lineStarts[$]===q)return{line:$+1,col:1};if($===0)return{line:0,col:q};let H=this.lineStarts[$-1];return{line:$,col:q-H+1}}}}v6.LineCounter=yU});var h$=O((l6)=>{var p6=n0("process"),hU=Aq(),d6=f$();function i(q,$){for(let U=0;U<q.length;++U)if(q[U].type===$)return!0;return!1}function uU(q){for(let $=0;$<q.length;++$)switch(q[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function kU(q){switch(q?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function wq(q){switch(q.type){case"document":return q.start;case"block-map":{let $=q.items[q.items.length-1];return $.sep??$.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function I0(q){if(q.length===0)return[];let $=q.length;q:while(--$>=0)switch(q[$].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++$]?.type==="space");return q.splice($,q.length)}function xU(q){if(q.start.type==="flow-seq-start"){for(let $ of q.items)if($.sep&&!$.value&&!i($.start,"explicit-key-ind")&&!i($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,kU($.value))if($.value.end)Array.prototype.push.apply($.value.end,$.sep);else $.value.end=$.sep;else Array.prototype.push.apply($.start,$.sep);delete $.sep}}}class vU{constructor(q){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new d6.Lexer,this.onNewLine=q}*parse(q,$=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let U of this.lexer.lex(q,$))yield*this.next(U);if(!$)yield*this.end()}*next(q){if(this.source=q,p6.env.LOG_TOKENS)console.log("|",hU.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let $=hU.tokenType(q);if(!$){let U=`Not a YAML token: ${q}`;yield*this.pop({type:"error",offset:this.offset,message:U,source:q}),this.offset+=q.length}else if($==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=$,yield*this.step(),$){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+q.length);break;case"space":if(this.atNewLine&&q[0]===" ")this.indent+=q.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=q.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=q.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let q=this.peek(1);if(this.type==="doc-end"&&q?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!q)return yield*this.stream();switch(q.type){case"document":return yield*this.document(q);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(q);case"block-scalar":return yield*this.blockScalar(q);case"block-map":return yield*this.blockMap(q);case"block-seq":return yield*this.blockSequence(q);case"flow-collection":return yield*this.flowCollection(q);case"doc-end":return yield*this.documentEnd(q)}yield*this.pop()}peek(q){return this.stack[this.stack.length-q]}*pop(q){let $=q??this.stack.pop();if(!$)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield $;else{let U=this.peek(1);if($.type==="block-scalar")$.indent="indent"in U?U.indent:0;else if($.type==="flow-collection"&&U.type==="document")$.indent=0;if($.type==="flow-collection")xU($);switch(U.type){case"document":U.value=$;break;case"block-scalar":U.props.push($);break;case"block-map":{let H=U.items[U.items.length-1];if(H.value){U.items.push({start:[],key:$,sep:[]}),this.onKeyLine=!0;return}else if(H.sep)H.value=$;else{Object.assign(H,{key:$,sep:[]}),this.onKeyLine=!H.explicitKey;return}break}case"block-seq":{let H=U.items[U.items.length-1];if(H.value)U.items.push({start:[],value:$});else H.value=$;break}case"flow-collection":{let H=U.items[U.items.length-1];if(!H||H.value)U.items.push({start:[],key:$,sep:[]});else if(H.sep)H.value=$;else Object.assign(H,{key:$,sep:[]});return}default:yield*this.pop(),yield*this.pop($)}if((U.type==="document"||U.type==="block-map"||U.type==="block-seq")&&($.type==="block-map"||$.type==="block-seq")){let H=$.items[$.items.length-1];if(H&&!H.sep&&!H.value&&H.start.length>0&&uU(H.start)===-1&&($.indent===0||H.start.every((X)=>X.type!=="comment"||X.indent<$.indent))){if(U.type==="document")U.end=H.start;else U.items.push({start:H.start});$.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(uU(q.start)!==-1)yield*this.pop(),yield*this.step();else q.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":q.start.push(this.sourceToken);return}let $=this.startBlockValue(q);if($)this.stack.push($);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(q){if(this.type==="map-value-ind"){let $=wq(this.peek(2)),U=I0($),H;if(q.end)H=q.end,H.push(this.sourceToken),delete q.end;else H=[this.sourceToken];let X={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:U,key:q,sep:H}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=X}else yield*this.lineEnd(q)}*blockScalar(q){switch(this.type){case"space":case"comment":case"newline":q.props.push(this.sourceToken);return;case"scalar":if(q.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let $=this.source.indexOf(`
|
|
136
|
+
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
137
|
+
`,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let U="end"in $.value?$.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,q.indent)){let H=q.items[q.items.length-2]?.value?.end;if(Array.isArray(H)){Array.prototype.push.apply(H,$.start),H.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let U=!this.onKeyLine&&this.indent===q.indent,H=U&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",X=[];if(H&&$.sep&&!$.value){let Z=[];for(let G=0;G<$.sep.length;++G){let z=$.sep[G];switch(z.type){case"newline":Z.push(G);break;case"space":break;case"comment":if(z.indent>q.indent)Z.length=0;break;default:Z.length=0}}if(Z.length>=2)X=$.sep.splice(Z[1])}switch(this.type){case"anchor":case"tag":if(H||$.value)X.push(this.sourceToken),q.items.push({start:X}),this.onKeyLine=!0;else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"explicit-key-ind":if(!$.sep&&!$.explicitKey)$.start.push(this.sourceToken),$.explicitKey=!0;else if(H||$.value)X.push(this.sourceToken),q.items.push({start:X,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($.explicitKey)if(!$.sep)if(i($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let Z=I0($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]})}else if($.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(i($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]});else if(kU($.key)&&!i($.sep,"newline")){let Z=I0($.start),G=$.key,z=$.sep;z.push(this.sourceToken),delete $.key,delete $.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:G,sep:z}]})}else if(X.length>0)$.sep=$.sep.concat(X,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||H)q.items.push({start:X,key:null,sep:[this.sourceToken]});else if(i($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else $.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Z=this.flowScalar(this.type);if(H||$.value)q.items.push({start:X,key:Z,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(Z);else Object.assign($,{key:Z,sep:[]}),this.onKeyLine=!0;return}default:{let Z=this.startBlockValue(q);if(Z){if(Z.type==="block-seq"){if(!$.explicitKey&&$.sep&&!i($.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(U)q.items.push({start:X});this.stack.push(Z);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if($.value){let U="end"in $.value?$.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment($.start,q.indent)){let H=q.items[q.items.length-2]?.value?.end;if(Array.isArray(H)){Array.prototype.push.apply(H,$.start),H.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return;case"anchor":case"tag":if($.value||this.indent<=q.indent)break;$.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if($.value||i($.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return}if(this.indent>q.indent){let U=this.startBlockValue(q);if(U){this.stack.push(U);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let $=q.items[q.items.length-1];if(this.type==="flow-error-end"){let U;do yield*this.pop(),U=this.peek(1);while(U?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!$||$.sep)q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return;case"map-value-ind":if(!$||$.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else Object.assign($,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!$||$.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let H=this.flowScalar(this.type);if(!$||$.value)q.items.push({start:[],key:H,sep:[]});else if($.sep)this.stack.push(H);else Object.assign($,{key:H,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let U=this.startBlockValue(q);if(U)this.stack.push(U);else yield*this.pop(),yield*this.step()}else{let U=this.peek(2);if(U.type==="block-map"&&(this.type==="map-value-ind"&&U.indent===q.indent||this.type==="newline"&&!U.items[U.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&U.type!=="flow-collection"){let H=wq(U),X=I0(H);xU(q);let Z=q.end.splice(1,q.end.length);Z.push(this.sourceToken);let G={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:X,key:q,sep:Z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=G}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let $=this.source.indexOf(`
|
|
138
|
+
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
139
|
+
`,$)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let $=wq(q),U=I0($);return U.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let $=wq(q),U=I0($);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,$){if(this.type!=="comment")return!1;if(this.indent<=$)return!1;return q.every((U)=>U.type==="newline"||U.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}l6.Parser=vU});var aU=O((e6)=>{var mU=w$(),c6=E0(),x0=g0(),s6=yq(),i6=w(),r6=y$(),pU=h$();function dU(q){let $=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||$&&new r6.LineCounter||null,prettyErrors:$}}function n6(q,$={}){let{lineCounter:U,prettyErrors:H}=dU($),X=new pU.Parser(U?.addNewLine),Z=new mU.Composer($),G=Array.from(Z.compose(X.parse(q)));if(H&&U)for(let z of G)z.errors.forEach(x0.prettifyError(q,U)),z.warnings.forEach(x0.prettifyError(q,U));if(G.length>0)return G;return Object.assign([],{empty:!0},Z.streamInfo())}function lU(q,$={}){let{lineCounter:U,prettyErrors:H}=dU($),X=new pU.Parser(U?.addNewLine),Z=new mU.Composer($),G=null;for(let z of Z.compose(X.parse(q),!0,q.length))if(!G)G=z;else if(G.options.logLevel!=="silent"){G.errors.push(new x0.YAMLParseError(z.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(H&&U)G.errors.forEach(x0.prettifyError(q,U)),G.warnings.forEach(x0.prettifyError(q,U));return G}function o6(q,$,U){let H=void 0;if(typeof $==="function")H=$;else if(U===void 0&&$&&typeof $==="object")U=$;let X=lU(q,U);if(!X)return null;if(X.warnings.forEach((Z)=>s6.warn(X.options.logLevel,Z)),X.errors.length>0)if(X.options.logLevel!=="silent")throw X.errors[0];else X.errors=[];return X.toJS(Object.assign({reviver:H},U))}function t6(q,$,U){let H=null;if(typeof $==="function"||Array.isArray($))H=$;else if(U===void 0&&$)U=$;if(typeof U==="string")U=U.length;if(typeof U==="number"){let X=Math.round(U);U=X<1?void 0:X>8?{indent:8}:{indent:X}}if(q===void 0){let{keepUndefined:X}=U??$??{};if(!X)return}if(i6.isDocument(q)&&!H)return q.toString(U);return new c6.Document(q,H,U).toString(U)}e6.parse=o6;e6.parseAllDocuments=n6;e6.parseDocument=lU;e6.stringify=t6});var c8=O((O8)=>{var X8=w$(),Z8=E0(),G8=Q$(),u$=g0(),z8=R0(),r=w(),J8=l(),Q8=N(),T8=c(),B8=s(),Y8=Aq(),V8=f$(),I8=y$(),W8=h$(),Kq=aU(),cU=W0();O8.Composer=X8.Composer;O8.Document=Z8.Document;O8.Schema=G8.Schema;O8.YAMLError=u$.YAMLError;O8.YAMLParseError=u$.YAMLParseError;O8.YAMLWarning=u$.YAMLWarning;O8.Alias=z8.Alias;O8.isAlias=r.isAlias;O8.isCollection=r.isCollection;O8.isDocument=r.isDocument;O8.isMap=r.isMap;O8.isNode=r.isNode;O8.isPair=r.isPair;O8.isScalar=r.isScalar;O8.isSeq=r.isSeq;O8.Pair=J8.Pair;O8.Scalar=Q8.Scalar;O8.YAMLMap=T8.YAMLMap;O8.YAMLSeq=B8.YAMLSeq;O8.CST=Y8;O8.Lexer=V8.Lexer;O8.LineCounter=I8.LineCounter;O8.Parser=W8.Parser;O8.parse=Kq.parse;O8.parseAllDocuments=Kq.parseAllDocuments;O8.parseDocument=Kq.parseDocument;O8.stringify=Kq.stringify;O8.visit=cU.visit;O8.visitAsync=cU.visitAsync});
|
|
140
|
+
export{c8 as Dk};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v as d,w as e}from"./chunk-zhqdp4ak.js";import{D as o}from"./chunk-6b3vfr39.js";import{E as u}from"./chunk-1d47g6nc.js";import"./chunk-5fe27s34.js";import"./chunk-5hqvapp1.js";import{$ as c,U as l,X as N,Y as J,fa as f,ga as x,ha as s,ia as i,ka as t}from"./chunk-h7ypcqp3.js";import{Wl as S}from"./chunk-4fs853nh.js";var zq=S(l(),1);var U=S(l(),1);var H=S(f(),1),a={openai:"\uD83E\uDD16",anthropic:"\uD83E\uDDE0",gemini:"✨",default:"\uD83D\uDD2E"};var Jq=({defaultValue:O,onSubmit:F,onSwitchProvider:X})=>{let[_,W]=U.useState(O),B=U.useCallback((G)=>{if(!G.trim())return;F(G.trim())},[F]),R=U.useCallback((G,K)=>{if(K.tab)return X?.(K.shift?"left":"right"),!1;if(K.leftArrow)return X?.("left"),!1;if(K.rightArrow)return X?.("right"),!1;return!0},[X]);return H.jsxDEV(N,{paddingX:2,paddingY:1,flexDirection:"column",gap:1,children:[H.jsxDEV(J,{color:"gray",children:"请输入模型名称(Enter 确认):"},void 0,!1,void 0,this),H.jsxDEV(s,{value:_,onChange:W,onSubmit:B,onHotKey:R,maxVisibleLines:1,placeholder:"例如:gpt-4o"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Qq=({onClose:O})=>{let{extraParams:F,config:X,updateConfig:_}=u(),[W,B]=U.useState(""),R=U.useRef([]),G=U.useMemo(()=>{if(!X?.providers||X.providers.length===0)return[];return X.providers.map((q)=>{let $=q.type||"default";return{id:q.id,label:q.id,icon:a[$]||a.default,config:q}})},[X?.providers]);U.useMemo(()=>{if(G.length>0&&!W){let q=G.find(($)=>$.id===F.provider_id);B(q?.id||G[0].id)}},[G,F.provider_id,W]);let K=G.find((q)=>q.id===W),{data:V,isLoading:y,error:v}=d({provider:K?.config||null,enabled:!!W}),b=U.useMemo(()=>{let q=(V||[]).map(($)=>({id:$.id,name:$.name}));return R.current=q,q},[V]),D=U.useCallback(async()=>{return R.current},[]),j=U.useCallback((q,$,C)=>{let M=q.id===F.provider_id+"-"+q.id;return H.jsxDEV(i,{isSelected:C,isCurrent:M,children:[H.jsxDEV(J,{bold:!0,children:[$+1,". ",q.id]},void 0,!0,void 0,this),H.jsxDEV(J,{dimColor:!0,children:[" ",q.name!==q.id?`(${q.name})`:""]},void 0,!0,void 0,this)]},`model-${$}-${q.id}`,!0,void 0,this)},[F.provider_id]),P=U.useCallback((q)=>{return q.id===F.provider_id+"-"+q.id},[F.provider_id]),g=U.useCallback(async(q)=>{await _({model_id:q}),O()},[_,O]),E=U.useCallback(async(q)=>{let C=G.find((M)=>M.id===W)?.config.type||"openai";await _({provider_id:W,provider_type:C,model_id:q.id}),O()},[_,W,O,G]),k=U.useCallback(async(q)=>{if(G.length<=1)return;let $=G.findIndex((p)=>p.id===W),C=q==="left"?($-1+G.length)%G.length:($+1)%G.length,M=G[C];B(M.id),await _({provider_id:M.id,provider_type:M.config.type})},[W,G,_]),m=U.useMemo(()=>{let q=K?.label||"加载中...";return{id:`model-${W}`,title:`模型选择 - ${q}`,icon:K?.icon||"\uD83D\uDD2E",dataSource:D,searchable:!0,searchFields:["id","name"],searchPlaceholder:"搜索模型...",itemHeight:1,visibleCount:10,renderItem:j,isSelected:P,onSelect:E,showCount:!0,keyMap:{leftArrow:($)=>{k("left")},rightArrow:($)=>{k("right")}}}},[W,K,D,j,P,E,k]);if(G.length===0)return H.jsxDEV(N,{flexDirection:"column",paddingX:2,paddingY:1,children:[H.jsxDEV(J,{color:"yellow",children:"⚠️ 未配置任何 Provider"},void 0,!1,void 0,this),H.jsxDEV(J,{color:"gray",dimColor:!0,children:"请先配置 Provider 后再查看模型列表"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let T=K?.config.apiKey;return H.jsxDEV(N,{flexDirection:"column",children:[H.jsxDEV(N,{gap:1,paddingX:1,paddingY:1,children:G.map((q,$)=>H.jsxDEV(J,{bold:q.id===W,color:q.id===W?"cyan":"gray",children:[q.icon," ",q.label,q.id===W&&" [当前]",q.id===W&&!T&&" (未配置 API Key)"]},`provider-tab-${$}-${q.id}`,!0,void 0,this))},void 0,!1,void 0,this),y?H.jsxDEV(N,{paddingX:2,paddingY:1,children:H.jsxDEV(J,{color:"gray",children:"加载模型列表中..."},void 0,!1,void 0,this)},void 0,!1,void 0,this):v||b.length===0?H.jsxDEV(Jq,{defaultValue:X?.model_id||"",onSubmit:g,onSwitchProvider:k},void 0,!1,void 0,this):!T?H.jsxDEV(N,{paddingX:2,paddingY:1,children:H.jsxDEV(J,{color:"yellow",children:"请先配置 API Key"},void 0,!1,void 0,this)},void 0,!1,void 0,this):H.jsxDEV(t,{config:m,onClose:O},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},r=Qq;var z=S(l(),1);var Z=S(f(),1),Wq=({onClose:O})=>{let{config:F,updateConfig:X}=u(),[_,W]=z.useState("list"),[B,R]=z.useState(null),[G,K]=z.useState(0),[V,y]=z.useState(null),v=z.useCallback(()=>y(null),[]);o(v,V?3000:null);let b=z.useRef(_),D=z.useRef(G),j=z.useRef([]),P=z.useRef(!0);z.useEffect(()=>{b.current=_},[_]),z.useEffect(()=>{D.current=G},[G]);let g=F?.providers||[];z.useEffect(()=>{j.current=g},[g]);let E=z.useCallback(()=>{P.current=!0,R(null),W("form"),y(null)},[]),k=z.useCallback(()=>{let Q=j.current,Y=D.current,L=Q[Y];if(!L)return;P.current=!1,R(L),W("form"),y(null)},[]),m=z.useCallback(()=>{W("list"),R(null),y(null)},[]),T=z.useCallback(async(Q)=>{let Y=j.current,L=P.current,A=L?[...Y,Q]:Y.map((w)=>w.id===Q.id?Q:w);if(await X({providers:A}),y(L?`已添加 Provider: ${Q.id}`:`已更新 Provider: ${Q.id}`),L){let w=A.findIndex((I)=>I.id===Q.id);K(w>=0?w:0)}W("list"),R(null),y(null)},[X]),q=z.useCallback(async()=>{let Q=j.current,Y=D.current,L=Q[Y];if(!L)return;if(Q.length<=1){y("无法删除最后一个 Provider");return}let A=Q.filter((I)=>I.id!==L.id);await X({providers:A});let w=Math.min(Y,A.length-1);K(w>=0?w:0),y(`已删除 Provider: ${L.id}`)},[X]),$=z.useRef(E),C=z.useRef(k),M=z.useRef(q),p=z.useRef(m),n=z.useRef(O);z.useEffect(()=>{$.current=E},[E]),z.useEffect(()=>{C.current=k},[k]),z.useEffect(()=>{M.current=q},[q]),z.useEffect(()=>{p.current=m},[m]),z.useEffect(()=>{n.current=O},[O]),x((Q,Y)=>{let L=b.current,A=j.current,w=D.current;if(L==="form"){if(Y.escape)p.current();return}if(Y.upArrow)K((I)=>I>0?I-1:A.length-1);else if(Y.downArrow)K((I)=>I<A.length-1?I+1:0);else if(Q==="n"||Q==="N")$.current();else if((Q==="e"||Q==="E"||Y.return)&&A[w])C.current();else if((Q==="d"||Q==="D")&&A[w])M.current();else if(Y.escape)n.current()},{isActive:!0});let Gq=z.useMemo(()=>{if(g.length===0)return Z.jsxDEV(N,{paddingX:2,paddingY:1,children:Z.jsxDEV(J,{color:"yellow",children:"未配置任何 Provider"},void 0,!1,void 0,this)},void 0,!1,void 0,this);return Z.jsxDEV(N,{flexDirection:"column",paddingX:2,gap:1,children:[g.map((Q,Y)=>{let L=!!Q.apiKey,A=L?"green":"yellow";return Z.jsxDEV(N,{marginBottom:0,gap:1,children:[Z.jsxDEV(J,{color:Y===G?"cyan":"gray",bold:Y===G,children:Y===G?">":" "},void 0,!1,void 0,this),Z.jsxDEV(J,{bold:Y===G,color:Y===G?"cyan":void 0,children:Q.id},void 0,!1,void 0,this),Z.jsxDEV(c,{},void 0,!1,void 0,this),Z.jsxDEV(J,{color:"gray",dimColor:Y!==G,children:[" ",Q.type]},void 0,!0,void 0,this),Z.jsxDEV(J,{color:A,dimColor:Y!==G,children:[" ","[",L?"已配置":"未配置","]"]},void 0,!0,void 0,this)]},`provider-${Y}-${Q.id}`,!0,void 0,this)}),Z.jsxDEV(N,{marginTop:1,children:Z.jsxDEV(J,{color:"gray",dimColor:!0,children:[Z.jsxDEV(J,{color:"cyan",children:"↑↓"},void 0,!1,void 0,this)," 导航 ",Z.jsxDEV(J,{color:"cyan",children:"n"},void 0,!1,void 0,this)," 新增 ",Z.jsxDEV(J,{color:"cyan",children:"d"},void 0,!1,void 0,this)," ","删除 ",Z.jsxDEV(J,{color:"cyan",children:"Esc"},void 0,!1,void 0,this)," 关闭"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},[g,G]);return Z.jsxDEV(N,{flexDirection:"column",children:[Z.jsxDEV(N,{paddingX:2,paddingY:1,children:Z.jsxDEV(J,{bold:!0,color:"cyan",children:"Providers"},void 0,!1,void 0,this)},void 0,!1,void 0,this),_==="list"?Gq:Z.jsxDEV(e,{provider:B||void 0,onCancel:m,onSave:T},void 0,!1,void 0,this),V&&Z.jsxDEV(N,{paddingX:2,paddingY:0,children:Z.jsxDEV(J,{color:"green",children:V},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},qq=Wq;var h=S(f(),1),Xq=({onClose:O,initialTab:F="model"})=>{let[X,_]=zq.useState(F);return x((W,B)=>{if(B.leftArrow&&B.alt)_("model");else if(B.rightArrow&&B.alt)_("provider");else if(B.escape)O()},{isActive:!0}),h.jsxDEV(N,{flexDirection:"column",width:"100%",borderStyle:"single",borderDimColor:!0,children:[h.jsxDEV(N,{flexDirection:"column",paddingX:0,paddingY:0,children:[X==="model"&&h.jsxDEV(r,{onClose:O},void 0,!1,void 0,this),X==="provider"&&h.jsxDEV(qq,{onClose:O},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV(N,{flexDirection:"row",gap:2,paddingX:2,paddingY:1,borderTop:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",borderColor:"gray",children:[h.jsxDEV(J,{bold:X==="model",color:X==="model"?"cyan":"gray",children:"\uD83E\uDD16 Model"},void 0,!1,void 0,this),h.jsxDEV(J,{bold:X==="provider",color:X==="provider"?"cyan":"gray",children:"\uD83D\uDD0C Provider"},void 0,!1,void 0,this),h.jsxDEV(c,{},void 0,!1,void 0,this),h.jsxDEV(J,{dimColor:!0,children:"Alt+ < >"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},jq=Xq;export{jq as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{qa as m,sa as o,ua as w,wa as Gf}from"./chunk-7qba2raw.js";var t=(f,c,i)=>{return($,O)=>{let N=-1;return x(0);async function x(z){if(z<=N)throw Error("next() called multiple times");N=z;let Q,P=!1,S;if(f[z])S=f[z][0][0],$.req.routeIndex=z;else S=z===f.length&&O||void 0;if(S)try{Q=await S($,()=>x(z+1))}catch(J){if(J instanceof Error&&c)$.error=J,Q=await c(J,$),P=!0;else throw J}else if($.finalized===!1&&i)Q=await i($);if(Q&&($.finalized===!1||P))$.res=Q;return $}}};var Pf=Symbol();var zf=async(f,c=Object.create(null))=>{let{all:i=!1,dot:$=!1}=c,N=(f instanceof C?f.raw.headers:f.headers).get("Content-Type");if(N?.startsWith("multipart/form-data")||N?.startsWith("application/x-www-form-urlencoded"))return Tf(f,{all:i,dot:$});return{}};async function Tf(f,c){let i=await f.formData();if(i)return vf(i,c);return{}}function vf(f,c){let i=Object.create(null);if(f.forEach(($,O)=>{if(!(c.all||O.endsWith("[]")))i[O]=$;else gf(i,O,$)}),c.dot)Object.entries(i).forEach(([$,O])=>{if($.includes("."))Mf(i,$,O),delete i[$]});return i}var gf=(f,c,i)=>{if(f[c]!==void 0)if(Array.isArray(f[c]))f[c].push(i);else f[c]=[f[c],i];else if(!c.endsWith("[]"))f[c]=i;else f[c]=[i]},Mf=(f,c,i)=>{let $=f,O=c.split(".");O.forEach((N,x)=>{if(x===O.length-1)$[N]=i;else{if(!$[N]||typeof $[N]!=="object"||Array.isArray($[N])||$[N]instanceof File)$[N]=Object.create(null);$=$[N]}})};var d=(f)=>{let c=f.split("/");if(c[0]==="")c.shift();return c},Qf=(f)=>{let{groups:c,path:i}=Rf(f),$=d(i);return Cf($,c)},Rf=(f)=>{let c=[];return f=f.replace(/\{[^}]+\}/g,(i,$)=>{let O=`@${$}`;return c.push([O,i]),O}),{groups:c,path:f}},Cf=(f,c)=>{for(let i=c.length-1;i>=0;i--){let[$]=c[i];for(let O=f.length-1;O>=0;O--)if(f[O].includes($)){f[O]=f[O].replace($,c[i][1]);break}}return f},H={},Sf=(f,c)=>{if(f==="*")return"*";let i=f.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(i){let $=`${f}#${c}`;if(!H[$])if(i[2])H[$]=c&&c[0]!==":"&&c[0]!=="*"?[$,i[1],new RegExp(`^${i[2]}(?=/${c})`)]:[f,i[1],new RegExp(`^${i[2]}$`)];else H[$]=[f,i[1],!0];return H[$]}return null},k=(f,c)=>{try{return c(f)}catch{return f.replace(/(?:%[0-9A-Fa-f]{2})+/g,(i)=>{try{return c(i)}catch{return i}})}},Hf=(f)=>k(f,decodeURI),e=(f)=>{let c=f.url,i=c.indexOf("/",c.indexOf(":")+4),$=i;for(;$<c.length;$++){let O=c.charCodeAt($);if(O===37){let N=c.indexOf("?",$),x=c.indexOf("#",$),z=N===-1?x===-1?void 0:x:x===-1?N:Math.min(N,x),Q=c.slice(i,z);return Hf(Q.includes("%25")?Q.replace(/%25/g,"%2525"):Q)}else if(O===63||O===35)break}return c.slice(i,$)};var Jf=(f)=>{let c=e(f);return c.length>1&&c.at(-1)==="/"?c.slice(0,-1):c},j=(f,c,...i)=>{if(i.length)c=j(c,...i);return`${f?.[0]==="/"?"":"/"}${f}${c==="/"?"":`${f?.at(-1)==="/"?"":"/"}${c?.[0]==="/"?c.slice(1):c}`}`},I=(f)=>{if(f.charCodeAt(f.length-1)!==63||!f.includes(":"))return null;let c=f.split("/"),i=[],$="";return c.forEach((O)=>{if(O!==""&&!/\:/.test(O))$+="/"+O;else if(/\:/.test(O))if(/\?/.test(O)){if(i.length===0&&$==="")i.push("/");else i.push($);let N=O.replace("?","");$+="/"+N,i.push($)}else $+="/"+O}),i.filter((O,N,x)=>x.indexOf(O)===N)},p=(f)=>{if(!/[%+]/.test(f))return f;if(f.indexOf("+")!==-1)f=f.replace(/\+/g," ");return f.indexOf("%")!==-1?k(f,a):f},Xf=(f,c,i)=>{let $;if(!i&&c&&!/[%+]/.test(c)){let x=f.indexOf("?",8);if(x===-1)return;if(!f.startsWith(c,x+1))x=f.indexOf(`&${c}`,x+1);while(x!==-1){let z=f.charCodeAt(x+c.length+1);if(z===61){let Q=x+c.length+2,P=f.indexOf("&",Q);return p(f.slice(Q,P===-1?void 0:P))}else if(z==38||isNaN(z))return"";x=f.indexOf(`&${c}`,x+1)}if($=/[%+]/.test(f),!$)return}let O={};$??=/[%+]/.test(f);let N=f.indexOf("?",8);while(N!==-1){let x=f.indexOf("&",N+1),z=f.indexOf("=",N);if(z>x&&x!==-1)z=-1;let Q=f.slice(N+1,z===-1?x===-1?void 0:x:z);if($)Q=p(Q);if(N=x,Q==="")continue;let P;if(z===-1)P="";else if(P=f.slice(z+1,x===-1?void 0:x),$)P=p(P);if(i){if(!(O[Q]&&Array.isArray(O[Q])))O[Q]=[];O[Q].push(P)}else O[Q]??=P}return c?O[c]:O},Vf=Xf,Wf=(f,c)=>{return Xf(f,c,!0)},a=decodeURIComponent;var Zf=(f)=>k(f,a),C=class{raw;#f;#c;routeIndex=0;path;bodyCache={};constructor(f,c="/",i=[[]]){this.raw=f,this.path=c,this.#c=i,this.#f={}}param(f){return f?this.#i(f):this.#N()}#i(f){let c=this.#c[0][this.routeIndex][1][f],i=this.#O(c);return i&&/\%/.test(i)?Zf(i):i}#N(){let f={},c=Object.keys(this.#c[0][this.routeIndex][1]);for(let i of c){let $=this.#O(this.#c[0][this.routeIndex][1][i]);if($!==void 0)f[i]=/\%/.test($)?Zf($):$}return f}#O(f){return this.#c[1]?this.#c[1][f]:f}query(f){return Vf(this.url,f)}queries(f){return Wf(this.url,f)}header(f){if(f)return this.raw.headers.get(f)??void 0;let c={};return this.raw.headers.forEach((i,$)=>{c[$]=i}),c}async parseBody(f){return this.bodyCache.parsedBody??=await zf(this,f)}#$=(f)=>{let{bodyCache:c,raw:i}=this,$=c[f];if($)return $;let O=Object.keys(c)[0];if(O)return c[O].then((N)=>{if(O==="json")N=JSON.stringify(N);return new Response(N)[f]()});return c[f]=i[f]()};json(){return this.#$("text").then((f)=>JSON.parse(f))}text(){return this.#$("text")}arrayBuffer(){return this.#$("arrayBuffer")}blob(){return this.#$("blob")}formData(){return this.#$("formData")}addValidatedData(f,c){this.#f[f]=c}valid(f){return this.#f[f]}get url(){return this.raw.url}get method(){return this.raw.method}get[Pf](){return this.#c}get matchedRoutes(){return this.#c[0].map(([[,f]])=>f)}get routePath(){return this.#c[0].map(([[,f]])=>f)[this.routeIndex].path}};var Kf={Stringify:1,BeforeStream:2,Stream:3},kf=(f,c)=>{let i=new String(f);return i.isEscaped=!0,i.callbacks=c,i};var ff=async(f,c,i,$,O)=>{if(typeof f==="object"&&!(f instanceof String)){if(!(f instanceof Promise))f=f.toString();if(f instanceof Promise)f=await f}let N=f.callbacks;if(!N?.length)return Promise.resolve(f);if(O)O[0]+=f;else O=[f];let x=Promise.all(N.map((z)=>z({phase:c,buffer:O,context:$}))).then((z)=>Promise.all(z.filter(Boolean).map((Q)=>ff(Q,c,!1,$,O))).then(()=>O[0]));if(i)return kf(await x,N);else return x};var If="text/plain; charset=UTF-8",cf=(f,c)=>{return{"Content-Type":f,...c}},D=(f,c)=>new Response(f,c),Ef=class{#f;#c;env={};#i;finalized=!1;error;#N;#O;#$;#S;#z;#Q;#P;#J;#X;constructor(f,c){if(this.#f=f,c)this.#O=c.executionCtx,this.env=c.env,this.#Q=c.notFoundHandler,this.#X=c.path,this.#J=c.matchResult}get req(){return this.#c??=new C(this.#f,this.#X,this.#J),this.#c}get event(){if(this.#O&&"respondWith"in this.#O)return this.#O;else throw Error("This context has no FetchEvent")}get executionCtx(){if(this.#O)return this.#O;else throw Error("This context has no ExecutionContext")}get res(){return this.#$||=D(null,{headers:this.#P??=new Headers})}set res(f){if(this.#$&&f){f=D(f.body,f);for(let[c,i]of this.#$.headers.entries()){if(c==="content-type")continue;if(c==="set-cookie"){let $=this.#$.headers.getSetCookie();f.headers.delete("set-cookie");for(let O of $)f.headers.append("set-cookie",O)}else f.headers.set(c,i)}}this.#$=f,this.finalized=!0}render=(...f)=>{return this.#z??=(c)=>this.html(c),this.#z(...f)};setLayout=(f)=>this.#S=f;getLayout=()=>this.#S;setRenderer=(f)=>{this.#z=f};header=(f,c,i)=>{if(this.finalized)this.#$=D(this.#$.body,this.#$);let $=this.#$?this.#$.headers:this.#P??=new Headers;if(c===void 0)$.delete(f);else if(i?.append)$.append(f,c);else $.set(f,c)};status=(f)=>{this.#N=f};set=(f,c)=>{this.#i??=new Map,this.#i.set(f,c)};get=(f)=>{return this.#i?this.#i.get(f):void 0};get var(){if(!this.#i)return{};return Object.fromEntries(this.#i)}#x(f,c,i){let $=this.#$?new Headers(this.#$.headers):this.#P??new Headers;if(typeof c==="object"&&"headers"in c){let N=c.headers instanceof Headers?c.headers:new Headers(c.headers);for(let[x,z]of N)if(x.toLowerCase()==="set-cookie")$.append(x,z);else $.set(x,z)}if(i)for(let[N,x]of Object.entries(i))if(typeof x==="string")$.set(N,x);else{$.delete(N);for(let z of x)$.append(N,z)}let O=typeof c==="number"?c:c?.status??this.#N;return D(f,{status:O,headers:$})}newResponse=(...f)=>this.#x(...f);body=(f,c,i)=>this.#x(f,c,i);#V(){return!this.#P&&!this.#N&&!this.finalized}text=(f,c,i)=>{return this.#V()&&!c&&!i?D(f):this.#x(f,c,cf(If,i))};json=(f,c,i)=>{return this.#V()&&!c&&!i?Response.json(f):this.#x(JSON.stringify(f),c,cf("application/json",i))};html=(f,c,i)=>{let $=(O)=>this.#x(O,c,cf("text/html; charset=UTF-8",i));return typeof f==="object"?ff(f,Kf.Stringify,!1,{}).then($):$(f)};redirect=(f,c)=>{let i=String(f);return this.header("Location",!/[^\x00-\xFF]/.test(i)?i:encodeURI(i)),this.newResponse(null,c??302)};notFound=()=>{return this.#Q??=()=>D(),this.#Q(this)}};var X="ALL",Yf="all",Af=["get","post","put","delete","options","patch"],n="Can not add a route since the matcher is already built.",y=class extends Error{};var bf="__COMPOSED_HANDLER";var nf=(f)=>{return f.text("404 Not Found",404)},lf=(f,c)=>{if("getResponse"in f){let i=f.getResponse();return c.newResponse(i.body,i)}return console.error(f),c.text("Internal Server Error",500)},jf=class f{get;post;put;delete;options;patch;all;on;use;router;getPath;_basePath="/";#f="/";routes=[];constructor(c={}){[...Af,Yf].forEach((N)=>{this[N]=(x,...z)=>{if(typeof x==="string")this.#f=x;else this.#N(N,this.#f,x);return z.forEach((Q)=>{this.#N(N,this.#f,Q)}),this}}),this.on=(N,x,...z)=>{for(let Q of[x].flat()){this.#f=Q;for(let P of[N].flat())z.map((S)=>{this.#N(P.toUpperCase(),this.#f,S)})}return this},this.use=(N,...x)=>{if(typeof N==="string")this.#f=N;else this.#f="*",x.unshift(N);return x.forEach((z)=>{this.#N(X,this.#f,z)}),this};let{strict:$,...O}=c;Object.assign(this,O),this.getPath=$??!0?c.getPath??e:Jf}#c(){let c=new f({router:this.router,getPath:this.getPath});return c.errorHandler=this.errorHandler,c.#i=this.#i,c.routes=this.routes,c}#i=nf;errorHandler=lf;route(c,i){let $=this.basePath(c);return i.routes.map((O)=>{let N;if(i.errorHandler===lf)N=O.handler;else N=async(x,z)=>(await t([],i.errorHandler)(x,()=>O.handler(x,z))).res,N[bf]=O.handler;$.#N(O.method,O.path,N)}),this}basePath(c){let i=this.#c();return i._basePath=j(this._basePath,c),i}onError=(c)=>{return this.errorHandler=c,this};notFound=(c)=>{return this.#i=c,this};mount(c,i,$){let O,N;if($)if(typeof $==="function")N=$;else if(N=$.optionHandler,$.replaceRequest===!1)O=(Q)=>Q;else O=$.replaceRequest;let x=N?(Q)=>{let P=N(Q);return Array.isArray(P)?P:[P]}:(Q)=>{let P=void 0;try{P=Q.executionCtx}catch{}return[Q.env,P]};O||=(()=>{let Q=j(this._basePath,c),P=Q==="/"?0:Q.length;return(S)=>{let J=new URL(S.url);return J.pathname=J.pathname.slice(P)||"/",new Request(J,S)}})();let z=async(Q,P)=>{let S=await i(O(Q.req.raw),...x(Q));if(S)return S;await P()};return this.#N(X,j(c,"*"),z),this}#N(c,i,$){c=c.toUpperCase(),i=j(this._basePath,i);let O={basePath:this._basePath,path:i,method:c,handler:$};this.router.add(c,i,[$,O]),this.routes.push(O)}#O(c,i){if(c instanceof Error)return this.errorHandler(c,i);throw c}#$(c,i,$,O){if(O==="HEAD")return(async()=>new Response(null,await this.#$(c,i,$,"GET")))();let N=this.getPath(c,{env:$}),x=this.router.match(O,N),z=new Ef(c,{path:N,matchResult:x,env:$,executionCtx:i,notFoundHandler:this.#i});if(x[0].length===1){let P;try{P=x[0][0][0][0](z,async()=>{z.res=await this.#i(z)})}catch(S){return this.#O(S,z)}return P instanceof Promise?P.then((S)=>S||(z.finalized?z.res:this.#i(z))).catch((S)=>this.#O(S,z)):P??this.#i(z)}let Q=t(x[0],this.errorHandler,this.#i);return(async()=>{try{let P=await Q(z);if(!P.finalized)throw Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return P.res}catch(P){return this.#O(P,z)}})()}fetch=(c,...i)=>{return this.#$(c,i[1],i[0],c.method)};request=(c,i,$,O)=>{if(c instanceof Request)return this.fetch(i?new Request(c,i):c,$,O);return c=c.toString(),this.fetch(new Request(/^https?:\/\//.test(c)?c:`http://localhost${j("/",c)}`,i),$,O)};fire=()=>{addEventListener("fetch",(c)=>{c.respondWith(this.#$(c.request,c,void 0,c.request.method))})}};var T=[];function q(f,c){let i=this.buildAllMatchers(),$=(O,N)=>{let x=i[O]||i[X],z=x[2][N];if(z)return z;let Q=N.match(x[0]);if(!Q)return[[],T];let P=Q.indexOf("",1);return[x[1][P],Q]};return this.match=$,$(f,c)}var u="[^/]+",v=".*",g="(?:|/.*)",B=Symbol(),yf=new Set(".\\+*[^]$()");function qf(f,c){if(f.length===1)return c.length===1?f<c?-1:1:-1;if(c.length===1)return 1;if(f===v||f===g)return 1;else if(c===v||c===g)return-1;if(f===u)return 1;else if(c===u)return-1;return f.length===c.length?f<c?-1:1:c.length-f.length}var Bf=class f{#f;#c;#i=Object.create(null);insert(c,i,$,O,N){if(c.length===0){if(this.#f!==void 0)throw B;if(N)return;this.#f=i;return}let[x,...z]=c,Q=x==="*"?z.length===0?["","",v]:["","",u]:x==="/*"?["","",g]:x.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/),P;if(Q){let S=Q[1],J=Q[2]||u;if(S&&Q[2]){if(J===".*")throw B;if(J=J.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(J))throw B}if(P=this.#i[J],!P){if(Object.keys(this.#i).some((V)=>V!==v&&V!==g))throw B;if(N)return;if(P=this.#i[J]=new f,S!=="")P.#c=O.varIndex++}if(!N&&S!=="")$.push([S,P.#c])}else if(P=this.#i[x],!P){if(Object.keys(this.#i).some((S)=>S.length>1&&S!==v&&S!==g))throw B;if(N)return;P=this.#i[x]=new f}P.insert(z,i,$,O,N)}buildRegExpStr(){let i=Object.keys(this.#i).sort(qf).map(($)=>{let O=this.#i[$];return(typeof O.#c==="number"?`(${$})@${O.#c}`:yf.has($)?`\\${$}`:$)+O.buildRegExpStr()});if(typeof this.#f==="number")i.unshift(`#${this.#f}`);if(i.length===0)return"";if(i.length===1)return i[0];return"(?:"+i.join("|")+")"}};var Uf=class{#f={varIndex:0};#c=new Bf;insert(f,c,i){let $=[],O=[];for(let x=0;;){let z=!1;if(f=f.replace(/\{[^}]+\}/g,(Q)=>{let P=`@\\${x}`;return O[x]=[P,Q],x++,z=!0,P}),!z)break}let N=f.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let x=O.length-1;x>=0;x--){let[z]=O[x];for(let Q=N.length-1;Q>=0;Q--)if(N[Q].indexOf(z)!==-1){N[Q]=N[Q].replace(z,O[x][1]);break}}return this.#c.insert(N,c,$,this.#f,i),$}buildRegExp(){let f=this.#c.buildRegExpStr();if(f==="")return[/^$/,[],[]];let c=0,i=[],$=[];return f=f.replace(/#(\d+)|@(\d+)|\.\*\$/g,(O,N,x)=>{if(N!==void 0)return i[++c]=Number(N),"$()";if(x!==void 0)return $[Number(x)]=++c,"";return""}),[new RegExp(`^${f}`),i,$]}};var uf=[/^$/,[],Object.create(null)],Df=Object.create(null);function Lf(f){return Df[f]??=new RegExp(f==="*"?"":`^${f.replace(/\/\*$|([.\\+*[^\]$()])/g,(c,i)=>i?`\\${i}`:"(?:|/.*)")}$`)}function sf(){Df=Object.create(null)}function mf(f){let c=new Uf,i=[];if(f.length===0)return uf;let $=f.map((P)=>[!/\*|\/:/.test(P[0]),...P]).sort(([P,S],[J,V])=>P?1:J?-1:S.length-V.length),O=Object.create(null);for(let P=0,S=-1,J=$.length;P<J;P++){let[V,W,K]=$[P];if(V)O[W]=[K.map(([Y])=>[Y,Object.create(null)]),T];else S++;let E;try{E=c.insert(W,S,V)}catch(Y){throw Y===B?new y(W):Y}if(V)continue;i[S]=K.map(([Y,Z])=>{let A=Object.create(null);Z-=1;for(;Z>=0;Z--){let[F,r]=E[Z];A[F]=r}return[Y,A]})}let[N,x,z]=c.buildRegExp();for(let P=0,S=i.length;P<S;P++)for(let J=0,V=i[P].length;J<V;J++){let W=i[P][J]?.[1];if(!W)continue;let K=Object.keys(W);for(let E=0,Y=K.length;E<Y;E++)W[K[E]]=z[W[K[E]]]}let Q=[];for(let P in x)Q[P]=i[x[P]];return[N,Q,O]}function L(f,c){if(!f)return;for(let i of Object.keys(f).sort(($,O)=>O.length-$.length))if(Lf(i).test(c))return[...f[i]];return}var s=class{name="RegExpRouter";#f;#c;constructor(){this.#f={[X]:Object.create(null)},this.#c={[X]:Object.create(null)}}add(f,c,i){let $=this.#f,O=this.#c;if(!$||!O)throw Error(n);if(!$[f])[$,O].forEach((z)=>{z[f]=Object.create(null),Object.keys(z[X]).forEach((Q)=>{z[f][Q]=[...z[X][Q]]})});if(c==="/*")c="*";let N=(c.match(/\/:/g)||[]).length;if(/\*$/.test(c)){let z=Lf(c);if(f===X)Object.keys($).forEach((Q)=>{$[Q][c]||=L($[Q],c)||L($[X],c)||[]});else $[f][c]||=L($[f],c)||L($[X],c)||[];Object.keys($).forEach((Q)=>{if(f===X||f===Q)Object.keys($[Q]).forEach((P)=>{z.test(P)&&$[Q][P].push([i,N])})}),Object.keys(O).forEach((Q)=>{if(f===X||f===Q)Object.keys(O[Q]).forEach((P)=>z.test(P)&&O[Q][P].push([i,N]))});return}let x=I(c)||[c];for(let z=0,Q=x.length;z<Q;z++){let P=x[z];Object.keys(O).forEach((S)=>{if(f===X||f===S)O[S][P]||=[...L($[S],P)||L($[X],P)||[]],O[S][P].push([i,N-Q+z+1])})}}match=q;buildAllMatchers(){let f=Object.create(null);return Object.keys(this.#c).concat(Object.keys(this.#f)).forEach((c)=>{f[c]||=this.#i(c)}),this.#f=this.#c=void 0,sf(),f}#i(f){let c=[],i=f===X;if([this.#f,this.#c].forEach(($)=>{let O=$[f]?Object.keys($[f]).map((N)=>[N,$[f][N]]):[];if(O.length!==0)i||=!0,c.push(...O);else if(f!==X)c.push(...Object.keys($[X]).map((N)=>[N,$[X][N]]))}),!i)return null;else return mf(c)}};var of=class{name="PreparedRegExpRouter";#f;#c;constructor(f,c){this.#f=f,this.#c=c}#i(f,c){let i=this.#f[f];i[1].forEach(($)=>$&&$.push(c)),Object.values(i[2]).forEach(($)=>$[0].push(c))}#N(f,c,i,$,O){let N=this.#f[f];if(!O)N[2][c][0].push([i,{}]);else $.forEach((x)=>{if(typeof x==="number")N[1][x].push([i,O]);else N[2][x||c][0].push([i,O])})}add(f,c,i){if(!this.#f[f]){let O=this.#f[X],N={};for(let x in O[2])N[x]=[O[2][x][0].slice(),T];this.#f[f]=[O[0],O[1].map((x)=>Array.isArray(x)?x.slice():0),N]}if(c==="/*"||c==="*"){let O=[i,{}];if(f===X)for(let N in this.#f)this.#i(N,O);else this.#i(f,O);return}let $=this.#c[c];if(!$)throw Error(`Path ${c} is not registered`);for(let[O,N]of $)if(f===X)for(let x in this.#f)this.#N(x,c,i,O,N);else this.#N(f,c,i,O,N)}buildAllMatchers(){return this.#f}match=q};var $f=class{name="SmartRouter";#f=[];#c=[];constructor(f){this.#f=f.routers}add(f,c,i){if(!this.#c)throw Error(n);this.#c.push([f,c,i])}match(f,c){if(!this.#c)throw Error("Fatal error");let i=this.#f,$=this.#c,O=i.length,N=0,x;for(;N<O;N++){let z=i[N];try{for(let Q=0,P=$.length;Q<P;Q++)z.add(...$[Q]);x=z.match(f,c)}catch(Q){if(Q instanceof y)continue;throw Q}this.match=z.match.bind(z),this.#f=[z],this.#c=void 0;break}if(N===O)throw Error("Fatal error");return this.name=`SmartRouter + ${this.activeRouter.name}`,x}get activeRouter(){if(this.#c||this.#f.length!==1)throw Error("No active router has been determined yet.");return this.#f[0]}};var M=Object.create(null),rf=(f)=>{for(let c in f)return!0;return!1},wf=class f{#f;#c;#i;#N=0;#O=M;constructor(c,i,$){if(this.#c=$||Object.create(null),this.#f=[],c&&i){let O=Object.create(null);O[c]={handler:i,possibleKeys:[],score:0},this.#f=[O]}this.#i=[]}insert(c,i,$){this.#N=++this.#N;let O=this,N=Qf(i),x=[];for(let z=0,Q=N.length;z<Q;z++){let P=N[z],S=N[z+1],J=Sf(P,S),V=Array.isArray(J)?J[0]:P;if(V in O.#c){if(O=O.#c[V],J)x.push(J[1]);continue}if(O.#c[V]=new f,J)O.#i.push(J),x.push(J[1]);O=O.#c[V]}return O.#f.push({[c]:{handler:$,possibleKeys:x.filter((z,Q,P)=>P.indexOf(z)===Q),score:this.#N}}),O}#$(c,i,$,O,N){for(let x=0,z=i.#f.length;x<z;x++){let Q=i.#f[x],P=Q[$]||Q[X],S={};if(P!==void 0){if(P.params=Object.create(null),c.push(P),O!==M||N&&N!==M)for(let J=0,V=P.possibleKeys.length;J<V;J++){let W=P.possibleKeys[J],K=S[P.score];P.params[W]=N?.[W]&&!K?N[W]:O[W]??N?.[W],S[P.score]=!0}}}}search(c,i){let $=[];this.#O=M;let N=[this],x=d(i),z=[],Q=x.length,P=null;for(let S=0;S<Q;S++){let J=x[S],V=S===Q-1,W=[];for(let E=0,Y=N.length;E<Y;E++){let Z=N[E],A=Z.#c[J];if(A)if(A.#O=Z.#O,V){if(A.#c["*"])this.#$($,A.#c["*"],c,Z.#O);this.#$($,A,c,Z.#O)}else W.push(A);for(let F=0,r=Z.#i.length;F<r;F++){let Nf=Z.#i[F],l=Z.#O===M?{}:{...Z.#O};if(Nf==="*"){let U=Z.#c["*"];if(U)this.#$($,U,c,Z.#O),U.#O=l,W.push(U);continue}let[_f,xf,G]=Nf;if(!J&&!(G instanceof RegExp))continue;let b=Z.#c[_f];if(G instanceof RegExp){if(P===null){P=Array(Q);let R=i[0]==="/"?1:0;for(let _=0;_<Q;_++)P[_]=R,R+=x[_].length+1}let U=i.substring(P[S]),h=G.exec(U);if(h){if(l[xf]=h[0],this.#$($,b,c,Z.#O,l),rf(b.#c)){b.#O=l;let R=h[0].match(/\//)?.length??0;(z[R]||=[]).push(b)}continue}}if(G===!0||G.test(J))if(l[xf]=J,V){if(this.#$($,b,c,l,Z.#O),b.#c["*"])this.#$($,b.#c["*"],c,l,Z.#O)}else b.#O=l,W.push(b)}}let K=z.shift();N=K?W.concat(K):W}if($.length>1)$.sort((S,J)=>{return S.score-J.score});return[$.map(({handler:S,params:J})=>[S,J])]}};var Of=class{name="TrieRouter";#f;constructor(){this.#f=new wf}add(f,c,i){let $=I(c);if($){for(let O=0,N=$.length;O<N;O++)this.#f.insert(f,$[O],i);return}this.#f.insert(f,c,i)}match(f,c){return this.#f.search(f,c)}};var hf=class extends jf{constructor(f={}){super(f);this.router=f.router??new $f({routers:[new s,new Of]})}};async function Ff(f,c,i,$){let O={threadId:c,graphId:i,runId:$};try{let x=(await f.get(c)).values;if(!x?.messages||!Array.isArray(x.messages)||x.messages.length===0)return;let Q=await w.getTitleGenerator()(x,{thread_id:c,graph_id:i,run_id:$});if(Q){if(!await f.setTitleIfNull(c,Q))return}}catch(N){console.warn("Failed to generate thread title:",{...O,error:N instanceof Error?N.message:String(N)})}}var tf={async search(f){let c=Object.entries(m).map(([N,x])=>({assistant_id:N,graph_id:N,config:{},metadata:{},version:1,name:N,description:"",created_at:new Date().toISOString(),updated_at:new Date().toISOString()}));if(f?.graphId)c=c.filter((N)=>N.graph_id===f.graphId);if(f?.metadata&&Object.keys(f.metadata).length>0)c=c.filter((N)=>{return Object.entries(f.metadata).every(([x,z])=>{return N.metadata&&N.metadata[x]===z})});if(f?.sortBy)c.sort((N,x)=>{let z=N[f.sortBy],Q=x[f.sortBy],P=z<Q?-1:z>Q?1:0;return f.sortOrder==="desc"?-P:P});let i=f?.offset??0,$=f?.limit;return $?c.slice(i,i+$):c.slice(i)},async count(f){return(await this.search(f)).length},async get(f){if(!Object.entries(m).find(([i,$])=>i===f))throw Error(`Assistant not found: ${f}`);return{assistant_id:f,graph_id:f,config:{},created_at:new Date().toISOString(),updated_at:new Date().toISOString(),metadata:{},version:1,name:f,description:""}},async delete(f){throw Error("Deleting assistants is not supported. Assistants are generated from registered graphs.")},async update(f,c){throw Error("Updating assistants is not supported. Assistants are generated from registered graphs.")},async getGraph(f,c){let i={};return(await(await o(f,i)).getGraphAsync({...i,xray:c?.xray??void 0})).toJSON()},async getSchemas(f){let i=(await o(f,{})).builder;return console.log(i),{graph_id:f,state_schema:i._inputDefinition,input_schema:i._inputDefinition,output_schema:i._outputDefinition,config_schema:i._configSchema,context_schema:i._configSchema}},async getVersions(f,c){let i=await this.get(f),$=c?.offset??0,O=c?.limit;return O?[i].slice($,$+O):[i].slice($)},async setLatest(f,c){let i=await this.get(f);return i.version=c,i},async create(f){if(console.warn("⚠️ Creating assistants is not supported. Assistants are generated from registered graphs. Returning mock data."),!Object.keys(m).includes(f.graphId)){if(f.ifExists==="raise")throw Error(`Graph not found: ${f.graphId}`)}return{assistant_id:f.assistantId||f.graphId,graph_id:f.graphId,name:f.name||f.graphId,description:f.description||"",metadata:f.metadata||{},config:f.config||{},version:1,created_at:new Date().toISOString(),updated_at:new Date().toISOString()}}},Zi=()=>{let f=()=>{return w.globalThreadsManager};return{assistants:tf,get threads(){return w.globalThreadsManager},runs:{list(c,i){return f().listRuns(c,i)},async cancel(c,i,$,O){return await w.globalMessageQueue.cancelQueue(i)},async*stream(c,i,$){$.config={...$.config??{},configurable:{...$.config?.configurable??{},graph_id:i,thread_id:c}};let O=f(),N=O.createRun(c,i,$);try{for await(let z of Gf(O,N,$,{attempt:0,getGraph:o}))yield z;let x=await N;await Ff(O,c,i,x.run_id)}catch(x){try{let z=await N;await Ff(O,c,i,z.run_id)}catch{}throw x}},async*joinStream(c,i,$){let O=$&&typeof $==="object"&&"signal"in $?$:{},N=($ instanceof AbortSignal?$:O.signal)||new AbortController().signal,x=null,z=null;try{x=await w.globalMessageQueue.getQueue(i);let Q=await x.getAll();for(let P of Q){if(N.aborted)return;if(yield{id:P.id,event:P.event,data:P.data},P.event==="__stream_end__"||P.event==="__stream_error__"||P.event==="__stream_cancel__")return}z=x.onDataReceive();for await(let P of z){if(N.aborted)break;let{event:S,data:J}=P;if(yield{id:P.id,event:S,data:J},P.event==="__stream_end__"||P.event==="__stream_error__"||P.event==="__stream_cancel__")break}}catch(Q){if(!(Q instanceof Error)||!Q.message.includes("does not exist"))console.warn("Join stream failed:",Q)}finally{if(z)try{await z.return(void 0)}catch(Q){}}}}}};
|
|
2
|
+
export{hf as na,Zi as oa};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-y524zd2h.js";import"./chunk-4eaqmt3c.js";import"./chunk-88w3txtb.js";import{uk as t}from"./chunk-v0e9bsvt.js";import"./chunk-jhxvctg5.js";import"./chunk-bk32cwxa.js";import"./chunk-qfa5v4n5.js";import"./chunk-0kfw8bwn.js";import{Bl as e}from"./chunk-78ksrp8v.js";import"./chunk-yb71zqvt.js";import"./chunk-4fs853nh.js";var o=e.object({label:e.string().min(1).max(50).describe("选项显示文本,简洁明了(1-50 字符)")}),i=e.object({description:e.string().min(1).describe("向用户提出的问题,清晰具体,包含必要的上下文"),type:e.enum(["single_select","multi_select"]).describe("选择类型:single_select(单选)或 multi_select(多选)"),options:e.array(o).min(2).max(6).describe("选项列表,至少 2 个,最多 6 个"),allow_custom_input:e.boolean().default(!0).describe("是否允许用户输入自定义文本,默认 true"),placeholder:e.string().optional().describe("自定义输入框的占位符文本")}),s=t(()=>{},{name:"ask_user_questions",description:"Ask the user a question with selectable options",schema:i});var m={name:"interactive",tools:[s]};export{m as InteractiveMiddleware};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{yk as a}from"./chunk-2gprcgep.js";import"./chunk-mv5m8bf4.js";import"./chunk-4fs853nh.js";export{a as FileSystemSkillStore};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{D as n}from"./chunk-6b3vfr39.js";import{E as o}from"./chunk-1d47g6nc.js";import"./chunk-5fe27s34.js";import{K as m,N as d,O as x}from"./chunk-5hqvapp1.js";import{$ as a,U as u,X,Y as G,fa as D,ga as g,ha as E}from"./chunk-h7ypcqp3.js";import{Wl as S}from"./chunk-4fs853nh.js";var H=S(u(),1);var b=S(u(),1);var _=S(D(),1);function Xz(Y){try{let $=JSON.parse(Y);if(typeof $!=="object"||$===null)return{isValid:!1,error:{message:"配置必须是 JSON 对象"}};if(!$.command&&!$.url)return{isValid:!1,error:{message:'配置必须包含 "command" (stdio) 或 "url" (SSE)'}};return{isValid:!0,config:$}}catch($){let L=$ instanceof Error?$.message:String($),B=L.match(/position (\d+)/),Q=B?parseInt(B[1],10):void 0;return{isValid:!1,error:{message:`JSON 格式错误: ${L}`,line:Q}}}}function Yz(Y,$,L){if(!Y||Y.length<2||Y.length>32)return"名称必须为 2-32 个字符";if(!/^[a-zA-Z0-9_-]+$/.test(Y))return"名称只能包含字母、数字、下划线和连字符";if($.includes(Y)&&Y!==L)return"名称已存在";return null}function Zz(Y,$=2){return JSON.stringify(Y,null,$)}var _z=[{key:"serverName",label:"Server ID"},{key:"config",label:"Config (JSON)"}],$z=({mode:Y,serverName:$,serverConfig:L,onCancel:B,onSave:Q})=>{let[O,y]=b.useState({serverName:$||"",configJSON:L?Zz(L):""}),[F,I]=b.useState(0),[j,V]=b.useState(null),M=b.useMemo(()=>{return[]},[]),U=b.useMemo(()=>{return Xz(O.configJSON)},[O.configJSON]),k=b.useCallback(()=>{let A=Yz(O.serverName,M,Y==="edit"?$:void 0);return V(A),A===null},[O.serverName,M,$,Y]),N=b.useCallback(()=>{if(Y==="add"&&!k())return;if(!U.isValid||!U.config)return;Q(O.serverName,U.config)},[Y,O.serverName,U,Q,k]),w=b.useCallback((A)=>{let h=Y==="add"?_z.length-1:1,q=A==="next"?(F+1)%h:(F-1+h)%h;I(q)},[F,Y]),f=()=>{if(Y!=="add")return null;let A=F===0,h=j!==null;return _.jsxDEV(X,{marginBottom:1,children:[_.jsxDEV(G,{color:A?"cyan":h?"red":"gray",children:"Server ID: "},void 0,!1,void 0,this),A?_.jsxDEV(X,{width:40,children:_.jsxDEV(E,{value:O.serverName,onChange:(q)=>{y((K)=>({...K,serverName:q})),V(null)},onSubmit:N,placeholder:"my-server",maxVisibleLines:1,showCursor:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this):_.jsxDEV(G,{children:O.serverName||"my-server"},void 0,!1,void 0,this),h&&_.jsxDEV(G,{color:"red",children:[" ",j]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},p=()=>{let A=Y==="add"?F===1:F===0,h=U.isValid;return _.jsxDEV(X,{flexDirection:"column",marginBottom:1,children:[_.jsxDEV(G,{color:A?"cyan":"gray",children:"Config (JSON):"},void 0,!1,void 0,this),_.jsxDEV(X,{marginTop:1,children:_.jsxDEV(E,{value:O.configJSON,onChange:(q)=>y((K)=>({...K,configJSON:q})),onSubmit:N,placeholder:`{
|
|
2
|
+
"command": "npx",
|
|
3
|
+
"args": ["-y", "..."]
|
|
4
|
+
}`,showCursor:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this),O.configJSON&&_.jsxDEV(X,{marginTop:1,children:h?_.jsxDEV(G,{color:"green",children:"✓ JSON 格式有效"},void 0,!1,void 0,this):_.jsxDEV(G,{color:"red",children:["✗ ",U.error?.message||"JSON 格式错误"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},P=()=>_.jsxDEV(X,{marginTop:1,children:_.jsxDEV(G,{color:"gray",dimColor:!0,children:[_.jsxDEV(G,{color:"cyan",children:"Enter"},void 0,!1,void 0,this)," 保存 ",_.jsxDEV(G,{color:"cyan",children:"Tab"},void 0,!1,void 0,this)," 切换字段"," ",_.jsxDEV(G,{color:"cyan",children:"Esc"},void 0,!1,void 0,this)," 取消"]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return _.jsxDEV(X,{flexDirection:"column",paddingX:2,children:[_.jsxDEV(X,{marginBottom:1,children:_.jsxDEV(G,{bold:!0,color:"cyan",children:Y==="add"?"Add MCP Server":`Edit MCP Server: ${$}`},void 0,!1,void 0,this)},void 0,!1,void 0,this),_.jsxDEV(X,{flexDirection:"column",gap:1,children:[f(),p()]},void 0,!0,void 0,this),P()]},void 0,!0,void 0,this)},l=$z;function i({mcpConfig:Y,updateConfig:$}){let L=m(),B=d({mutationFn:async(Q)=>{return await $({mcp_config:Q}),Q},onSuccess:(Q)=>{L.setQueryData(x.mcp.config(),Q)}});return{mcpConfig:Y,updateMcpConfig:B.mutateAsync,isUpdating:B.isPending}}var z=S(D(),1),Hz=({onClose:Y})=>{let{config:$,updateConfig:L}=o(),B=$?.mcp_config||{},{mcpConfig:Q,updateMcpConfig:O}=i({mcpConfig:B,updateConfig:L}),[y,F]=H.useState("list"),[I,j]=H.useState("add"),[V,M]=H.useState(null),[U,k]=H.useState(0),[N,w]=H.useState(null),[f,p]=H.useState(null),[P,A]=H.useState(null),h=H.useCallback(()=>w(null),[]);n(h,N?3000:null);let q=Object.keys(Q),K=q[U],R=K?Q[K]:null,v=H.useCallback((W)=>{if(W.command)return"stdio";if(W.url)return"SSE";return"unknown"},[]),r=H.useCallback(()=>{j("add"),M(null),F("json"),w(null)},[]),t=H.useCallback(()=>{if(!K||!R)return;j("edit"),M(K),F("json"),w(null)},[K,R]),s=H.useCallback(async()=>{if(!K||!R)return;p(K),A(null),F("test");try{let W=!!(R.command&&R.args),Z=!!R.url;if(!W&&!Z){A({success:!1,message:"配置无效:必须包含 command (stdio) 或 url (SSE)"});return}if(W&&(!R.command||!Array.isArray(R.args))){A({success:!1,message:"配置无效:stdio 模式需要 command 和 args 字段"});return}A({success:!0,message:`配置格式验证通过 (${Z?"SSE":"stdio"} 模式)`,tools:[]})}catch(W){A({success:!1,message:`验证失败: ${W instanceof Error?W.message:String(W)}`})}},[K,R]),C=H.useCallback(()=>{F("list"),M(null),A(null),w(null)},[]),e=H.useCallback(async(W,Z)=>{let J={...Q};if(J[W]=Z,await O(J),w(I==="add"?`已添加服务器: ${W}`:`已更新服务器: ${W}`),I==="add"){let T=Object.keys(J).findIndex((c)=>c===W);k(T>=0?T:0)}C()},[I,Q,O,C]),zz=H.useCallback(async()=>{if(!K)return;let W={...Q};delete W[K],await O(W);let Z=Math.min(U,Object.keys(W).length-1);k(Z>=0?Z:0),w(`已删除服务器: ${K}`)},[K,U,Q,O]);g((W,Z)=>{if(y==="json"||y==="test"){if(Z.escape)C();return}if(Z.upArrow)k((J)=>J>0?J-1:q.length-1);else if(Z.downArrow)k((J)=>J<q.length-1?J+1:0);else if(W==="n"||W==="N")r();else if((W==="e"||W==="E"||Z.return)&&K)t();else if((W==="d"||W==="D")&&K)zz();else if((W==="t"||W==="T")&&K)s();else if(Z.escape)Y()},{isActive:!0});let Gz=H.useMemo(()=>{if(q.length===0)return z.jsxDEV(X,{paddingX:2,paddingY:1,children:[z.jsxDEV(G,{color:"yellow",children:"未配置任何 MCP 服务器"},void 0,!1,void 0,this),z.jsxDEV(X,{marginTop:1,children:z.jsxDEV(G,{color:"gray",dimColor:!0,children:["按 ",z.jsxDEV(G,{color:"cyan",children:"n"},void 0,!1,void 0,this)," 添加新服务器"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return z.jsxDEV(X,{flexDirection:"column",paddingX:2,gap:1,children:[q.map((W,Z)=>{let J=Q[W],T=v(J);return z.jsxDEV(X,{marginBottom:0,gap:1,children:[z.jsxDEV(G,{color:Z===U?"cyan":"gray",bold:Z===U,children:Z===U?">":" "},void 0,!1,void 0,this),z.jsxDEV(G,{bold:Z===U,color:Z===U?"cyan":void 0,children:W},void 0,!1,void 0,this),z.jsxDEV(a,{},void 0,!1,void 0,this),z.jsxDEV(G,{color:T==="stdio"?"green":T==="SSE"?"blue":"yellow",dimColor:Z!==U,children:["[",T.toUpperCase(),"]"]},void 0,!0,void 0,this)]},`server-${Z}-${W}`,!0,void 0,this)}),z.jsxDEV(X,{marginTop:1,children:z.jsxDEV(G,{color:"gray",dimColor:!0,children:[z.jsxDEV(G,{color:"cyan",children:"↑↓"},void 0,!1,void 0,this)," 导航 ",z.jsxDEV(G,{color:"cyan",children:"n"},void 0,!1,void 0,this)," 新增 ",z.jsxDEV(G,{color:"cyan",children:"e"},void 0,!1,void 0,this)," ","编辑 ",z.jsxDEV(G,{color:"cyan",children:"d"},void 0,!1,void 0,this)," 删除 ",z.jsxDEV(G,{color:"cyan",children:"t"},void 0,!1,void 0,this)," 测试"," ",z.jsxDEV(G,{color:"cyan",children:"Esc"},void 0,!1,void 0,this)," 关闭"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},[q,Q,U,v]),Wz=H.useMemo(()=>{if(!f||!P)return z.jsxDEV(X,{paddingX:2,paddingY:1,children:z.jsxDEV(G,{color:"yellow",children:"正在验证配置..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(P.success)return z.jsxDEV(X,{flexDirection:"column",paddingX:2,gap:1,children:[z.jsxDEV(X,{children:z.jsxDEV(G,{color:"green",children:["✓ ",P.message]},void 0,!0,void 0,this)},void 0,!1,void 0,this),P.tools&&P.tools.length>0&&z.jsxDEV(X,{flexDirection:"column",marginTop:1,children:[z.jsxDEV(G,{color:"gray",children:["发现 ",P.tools.length," 个工具:"]},void 0,!0,void 0,this),P.tools.slice(0,10).map((W)=>z.jsxDEV(X,{paddingLeft:2,children:z.jsxDEV(G,{color:"gray",children:["- ",W]},void 0,!0,void 0,this)},W,!1,void 0,this)),P.tools.length>10&&z.jsxDEV(X,{paddingLeft:2,children:z.jsxDEV(G,{color:"gray",children:["... 还有 ",P.tools.length-10," 个工具"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV(X,{marginTop:1,children:z.jsxDEV(G,{color:"gray",dimColor:!0,children:["按 ",z.jsxDEV(G,{color:"cyan",children:"Enter"},void 0,!1,void 0,this)," 关闭"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);else return z.jsxDEV(X,{flexDirection:"column",paddingX:2,gap:1,children:[z.jsxDEV(X,{children:z.jsxDEV(G,{color:"red",children:"✗ 验证失败"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV(X,{children:z.jsxDEV(G,{color:"yellow",children:P.message},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV(X,{marginTop:1,children:[z.jsxDEV(G,{color:"gray",children:"建议检查:"},void 0,!1,void 0,this),z.jsxDEV(G,{color:"gray",children:"- 配置格式是否正确"},void 0,!1,void 0,this),z.jsxDEV(G,{color:"gray",children:"- 命令是否已安装(stdio 模式)"},void 0,!1,void 0,this),z.jsxDEV(G,{color:"gray",children:"- URL 是否可访问(SSE 模式)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV(X,{marginTop:1,children:z.jsxDEV(G,{color:"gray",dimColor:!0,children:["按 ",z.jsxDEV(G,{color:"cyan",children:"Enter"},void 0,!1,void 0,this)," 关闭"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},[f,P]);return g((W,Z)=>{if(y==="test"&&Z.return)C()},{isActive:y==="test"}),z.jsxDEV(X,{flexDirection:"column",children:[z.jsxDEV(X,{paddingX:2,paddingY:1,children:z.jsxDEV(G,{bold:!0,color:"cyan",children:"MCP Servers"},void 0,!1,void 0,this)},void 0,!1,void 0,this),y==="list"?Gz:y==="json"?z.jsxDEV(l,{mode:I,serverName:V||void 0,serverConfig:R||void 0,onCancel:C,onSave:e},void 0,!1,void 0,this):Wz,N&&z.jsxDEV(X,{paddingX:2,paddingY:0,children:z.jsxDEV(G,{color:"green",children:N},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},kz=Hz;export{kz as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{U as c0,X as j,Y as E,fa as t}from"./chunk-h7ypcqp3.js";import{$g as B}from"./chunk-bn077sjq.js";import{$l as M,Wl as h,Yl as T}from"./chunk-4fs853nh.js";var b=T((IA,X0)=>{var n0=M("child_process").spawn;function p0(A,G,X,L){if(typeof X==="function")L=X,X=void 0;let J=!1,H=n0(A,G,X),K="",Y="";H.stdout.on("data",function($){K+=$.toString()}),H.stderr.on("data",function($){Y+=$.toString()}),H.on("error",function($){if(J)return;J=!0,L(Error($))}),H.on("close",function($,Q){if(J)return;if(J=!0,Y)return L(Error(Y));L(null,K,$)})}X0.exports=p0});var k=T((EA,L0)=>{var y={},w={},g={},n=0,R=null;function a0(A,G){if(G<=0)return;if(w[A]!==void 0)y[A]=Date.now()+(G||60000);return w[A]}function i0(A,G,X,L){if(G===void 0||X<=0)return;if(y[A]=Date.now()+(X||60000),w[A]===void 0)n++,G0(X);if(w[A]=G,L)g[A]=L}function G0(A){if(n>0){if(R===null){if(R=setInterval(d0,(A||60000)/2),typeof R.unref==="function")R.unref()}return}if(R!==null)clearInterval(R),R=null}function d0(){let A=Date.now(),G=Object.keys(y);for(let X=0;X<G.length;X++){let L=G[X];if(y[L]<A){if(n--,g[L])g[L](w[L]);delete w[L],delete y[L],delete g[L]}}G0()}function c(A){for(let G in A)delete A[G]}function o0(){if(R!==null)clearInterval(R),R=null;c(w),c(y),c(g)}L0.exports={get:a0,set:i0,clear:o0}});var W0=T((SA,Q0)=>{var K0=M("os"),r0=b(),H0=k(),f=K0.platform();function J0(A,G){let X=0,L=A.split(/-|:|\./),J=L.length-1;if(J>=0&&G&&f==="darwin")X+=parseInt(L[J--],10)*10;if(J>=0)X+=parseInt(L[J--],10)*1000;if(J>=0)X+=parseInt(L[J--],10)*60000;if(J>=0)X+=parseInt(L[J--],10)*3600000;if(J>=0)X+=parseInt(L[J--],10)*86400000;return X}function s0(A,G,X){let L=A.join(","),J=["-o","etime,pid,ppid,pcpu,rss,time","-p",L];if(f==="aix"||f==="os400")J=["-o","etime,pid,ppid,pcpu,rssize,time","-p",L];r0("ps",J,function(H,K,Y){if(H){if(f==="os390"&&/no matching processes found/.test(H))H=Error("No matching pid found"),H.code="ENOENT";return X(H)}if(Y===1){let U=Error("No matching pid found");return U.code="ENOENT",X(U)}if(Y!==0)return X(Error("pidusage ps command exited with code "+Y));let $=Date.now();K=K.split(K0.EOL);let Q={};for(let U=1;U<K.length;U++){let q=K[U].trim().split(/\s+/);if(!q||q.length!==6)continue;let W=parseInt(q[1],10),N=H0.get(W,G.maxage);if(N===void 0)N={};let Z=parseInt(q[2],10),v=parseInt(q[4],10)*1024,_=J0(q[0]),C=J0(q[5],!0),D=C-(N.ctime||0),V=Math.abs(N.elapsed!==void 0?_-N.elapsed:_),P=V>0?D/V*100:0;Q[W]={cpu:P,memory:v,ppid:Z,pid:W,ctime:C,elapsed:_,timestamp:$},H0.set(W,Q[W],G.maxage)}X(null,Q)})}Q0.exports=s0});var p=T((jA,Y0)=>{function t0(A,G,X){if(typeof G==="function")X=G,G={};let L;if(!Array.isArray(A))L=Object.keys(A);let J=L?L.length:A.length,H=J,K=L?{}:[];function Y($,Q,U){if(K[$]=U,--H===0||Q&&!G.graceful){if(G.graceful&&Q&&J>1)Q=null;X&&X(Q,K),X=null}}if(L)L.forEach(function($){A[$](function(Q,U){Y($,Q,U)})});else A.forEach(function($,Q){$(function(U,q){Y(Q,U,q)})})}Y0.exports=t0});var Z0=T((wA,N0)=>{var e0=M("os"),AA=M("fs"),XA=M("child_process").exec,q0=p();function GA(A,G){if(A!==null){$0(function(X,L){if(X)return G(X);A.uptime=L,G(null,A)});return}q0([LA,$0],function(X,L){if(X)return G(X);A={clockTick:L[0].clockTick,pageSize:L[0].pageSize,uptime:L[1]},G(null,A)})}N0.exports=GA;function $0(A){AA.readFile("/proc/uptime","utf8",function(G,X){if(G||X===void 0){if(!process.env.PIDUSAGE_SILENT)console.warn("[pidusage] We couldn't find uptime from /proc/uptime, using os.uptime() value");return A(null,e0.uptime()||new Date/1000)}return A(null,parseFloat(X.split(" ")[0]))})}function LA(A){q0([function(X){U0("CLK_TCK",{default:100},X)},function(X){U0("PAGESIZE",{default:4096},X)}],function(G,X){if(G)return A(G);A(null,{clockTick:X[0],pageSize:X[1]})})}function U0(A,G,X){if(typeof G==="function")X=G,G={default:""};XA("getconf "+A,function(L,J,H){if(L!==null){if(!process.env.PIDUSAGE_SILENT)console.error('Error while calling "getconf '+A+'"',L);return X(null,G.default)}if(J=parseInt(J),!isNaN(J))return X(null,J);return X(null,G.default)})}});var M0=T((a,v0)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var l=M("buffer"),O=l.Buffer;function F0(A,G){for(var X in A)G[X]=A[X]}if(O.from&&O.alloc&&O.allocUnsafe&&O.allocUnsafeSlow)v0.exports=l;else F0(l,a),a.Buffer=z;function z(A,G,X){return O(A,G,X)}z.prototype=Object.create(O.prototype);F0(O,z);z.from=function(A,G,X){if(typeof A==="number")throw TypeError("Argument must not be a number");return O(A,G,X)};z.alloc=function(A,G,X){if(typeof A!=="number")throw TypeError("Argument must be a number");var L=O(A);if(G!==void 0)if(typeof X==="string")L.fill(G,X);else L.fill(G);else L.fill(0);return L};z.allocUnsafe=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return O(A)};z.allocUnsafeSlow=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return l.SlowBuffer(A)}});var R0=T((zA,T0)=>{var d=M("fs"),HA=M("path"),JA=Z0(),KA=p(),_0=k(),I=null,C0=M0().Buffer,i=1024;function QA(){}function WA(A,G,X){if(G.fd)return X(null,G.fd);d.open(A,"r",X)}function YA(A){if(A.fd)d.close(A.fd,QA)}function D0(A,G,X){let L=!1;if(typeof G==="function")X=G,G=C0.alloc(i),L=!0;d.read(A,G,0,i,0,function(J,H,K){if(J){X(J);return}let Y=C0.concat([G,K],L?H:G.length+H);if(H===i){D0(A,Y,X);return}X(null,G)})}function P0(A,G,X){let L=_0.get(A,G.maxage),J=!1;if(L===void 0)J=!0,L={};WA(HA.join("/proc",""+A,"stat"),L,function(H,K){if(H){if(H.code==="ENOENT")H.message="No matching pid found";return X(H,null)}if(H)return X(H);D0(K,function(Y,$){if(Y)return X(Y);let Q=$.toString("utf8"),U=Date.now(),q=Q.lastIndexOf(")");Q=Q.substr(q+2).split(" ");let W={ppid:parseInt(Q[1]),utime:parseFloat(Q[11])*1000/I.clockTick,stime:parseFloat(Q[12])*1000/I.clockTick,cutime:parseFloat(Q[13])*1000/I.clockTick,cstime:parseFloat(Q[14])*1000/I.clockTick,start:parseFloat(Q[19])*1000/I.clockTick,rss:parseFloat(Q[21]),uptime:I.uptime*1000,fd:K},N=W.rss*I.pageSize,Z=G.childrens?W.cutime+W.cstime:0,v=W.stime-(L.stime||0)+W.utime-(L.utime||0)+Z,_=Math.abs(L.uptime!==void 0?W.uptime-L.uptime:W.start-W.uptime),C=_>0?v/_*100:0;if(_0.set(A,W,G.maxage,YA),J)return P0(A,G,X);return X(null,{cpu:C,memory:N,ctime:W.utime+W.stime,elapsed:W.uptime-W.start,timestamp:U,pid:A,ppid:W.ppid})})})}function $A(A,G,X){JA(I,function(L,J){if(L)return X(L);I=J;let H={};A.forEach(function(K,Y){H[K]=function($){P0(K,G,$)}}),KA(H,{graceful:!0},X)})}T0.exports=$A});var S0=T((BA,E0)=>{var O0=M("os"),UA=b(),V0=k();function qA(A){let G=A.substring(0,4),X=A.substring(4,6),L=A.substring(6,8),J=A.substring(8,10),H=A.substring(10,12),K=A.substring(12,14),Y=A.substring(15,21),$=A.substring(21,22),Q=parseInt(A.substring(22,25),10),U=Math.floor(Q/60),q=Q%60;return new Date(G+"-"+X+"-"+L+"T"+J+":"+H+":"+K+"."+Y+$+(U>9?U:"0"+U)+(q>9?q:"0"+q))}function I0(A,G,X){let L="ProcessId="+A[0];for(let H=1;H<A.length;H++)L+=" or ProcessId="+A[H];let J=["PROCESS","where",'"'+L+'"',"get","CreationDate,KernelModeTime,ParentProcessId,ProcessId,UserModeTime,WorkingSetSize"];UA("wmic",J,{windowsHide:!0,windowsVerbatimArguments:!0},function(H,K,Y){if(H){if(H.message.indexOf("No Instance(s) Available.")!==-1){let W=Error("No matching pid found");return W.code="ENOENT",X(W)}return X(H)}if(Y!==0)return X(Error("pidusage wmic command exited with code "+Y));let $=Date.now(),Q=Math.floor(O0.uptime()||$/1000);K=K.split(O0.EOL);let U=!1,q={};for(let W=1;W<K.length;W++){let N=K[W].trim().split(/\s+/);if(!N||N.length!==6)continue;let Z=qA(N[0]),v=parseInt(N[2],10),_=parseInt(N[3],10),C=Math.round(parseInt(N[1],10)/1e4),D=Math.round(parseInt(N[4],10)/1e4),V=parseInt(N[5],10),P=V0.get(_,G.maxage);if(P===void 0)U=!0,P={ctime:C+D,uptime:Q};let m=(C+D-P.ctime)/1000,S=Q-P.uptime,u=S>0?m/S*100:0;V0.set(_,{ctime:D+C,uptime:Q},G.maxage),q[_]={cpu:u,memory:V,ppid:v,pid:_,ctime:D+C,elapsed:$-Z.getTime(),timestamp:$}}if(U)return I0(A,G,function(W,N){if(W)return X(W);X(null,Object.assign(q,N))});X(null,q)})}E0.exports=I0});var y0=T((yA,B0)=>{var j0=M("os"),NA=b(),w0=k();function ZA(A){let G=A.substring(0,4),X=A.substring(4,6),L=A.substring(6,8),J=A.substring(8,10),H=A.substring(10,12),K=A.substring(12,14),Y=A.substring(15,21),$=A.substring(21,22),Q=parseInt(A.substring(22,25),10),U=Math.floor(Q/60),q=Q%60;return new Date(G+"-"+X+"-"+L+"T"+J+":"+H+":"+K+"."+Y+$+(U>9?U:"0"+U)+(q>9?q:"0"+q))}function z0(A,G,X){let L="ProcessId="+A[0];for(let K=1;K<A.length;K++)L+=" or ProcessId="+A[K];let J="CreationDate,KernelModeTime,ParentProcessId,ProcessId,UserModeTime,WorkingSetSize",H=["win32_process","-Filter","'"+L+"'","| select "+J,"| format-table"];NA("gwmi",H,{windowsHide:!0,windowsVerbatimArguments:!0,shell:"powershell.exe"},function(K,Y,$){if(K){if(K.message.indexOf("No Instance(s) Available.")!==-1){let Z=Error("No matching pid found");return Z.code="ENOENT",X(Z)}return X(K)}if($!==0)return X(Error("pidusage gwmi command exited with code "+$));let Q=Date.now(),U=Math.floor(j0.uptime()||Q/1000);Y=Y.split(j0.EOL).slice(1);let q=Y.findIndex((Z)=>!!Z);if(Y=Y.slice(q+2),!Y.length){let Z=Error("No matching pid found");return Z.code="ENOENT",X(Z)}let W=!1,N={};for(let Z=0;Z<Y.length;Z++){let v=Y[Z].trim().split(/\s+/);if(!v||v.length===1)continue;let _=ZA(v[0]),C=parseInt(v[2],10),D=parseInt(v[3],10),V=Math.round(parseInt(v[1],10)/1e4),P=Math.round(parseInt(v[4],10)/1e4),m=parseInt(v[5],10),S=w0.get(D,G.maxage);if(S===void 0)W=!0,S={ctime:V+P,uptime:U};let u=(V+P-S.ctime)/1000,s=U-S.uptime,u0=s>0?u/s*100:0;w0.set(D,{ctime:P+V,uptime:U},G.maxage),N[D]={cpu:u0,memory:m,ppid:C,pid:D,ctime:P+V,elapsed:Q-_.getTime(),timestamp:Q}}if(W)return z0(A,G,function(Z,v){if(Z)return X(Z);X(null,Object.assign(N,v))});X(null,N)})}B0.exports=z0});var h0=T((kA,g0)=>{var FA=M("fs"),k0=M("os"),vA=M("child_process").spawn,o={ps:()=>W0(),procfile:()=>R0(),wmic:()=>S0(),gwmi:()=>y0()},MA={aix:"ps",os400:"ps",android:"procfile",alpine:"procfile",darwin:"ps",freebsd:"ps",os390:"ps",linux:"procfile",netbsd:"procfile",openbsd:"ps",sunos:"ps",win:"wmic"},x=k0.platform();if(FA.existsSync("/etc/alpine-release"))x="alpine";if(x.match(/^win/))x="win";var x0;try{x0=o[MA[x]]()}catch(A){}function _A(A,G,X){let L=x0;if(x!=="win"&&G.usePs===!0)L=o.ps();if(x==="win"){let H;try{H=vA("wmic",function(K){if(K)throw Error(K)})}catch(K){L=o.gwmi()}finally{if(H)H.kill()}}if(L===void 0)return X(Error(k0.platform()+" is not supported yet, please open an issue (https://github.com/soyuka/pidusage)"));let J=!1;if(!Array.isArray(A))J=!0,A=[A];if(A.length===0)return X(TypeError("You must provide at least one pid"));for(let H=0;H<A.length;H++)if(A[H]=parseInt(A[H],10),isNaN(A[H])||A[H]<0)return X(TypeError("One of the pids provided is invalid"));L(A,G,function(H,K){if(H)return X(H);if(J)X(null,K[A[0]]);else X(null,K)})}g0.exports=_A});var f0=T((xA,r)=>{var b0=h0();function CA(A,G,X){if(typeof G==="function")X=G,G={};if(G===void 0)G={};if(G=Object.assign({usePs:/^true$/i.test(process.env.PIDUSAGE_USE_PS),maxage:process.env.PIDUSAGE_MAXAGE},G),typeof X==="function"){b0(A,G,X);return}return new Promise(function(L,J){b0(A,G,function(H,K){if(H)return J(H);L(K)})})}r.exports=CA;r.exports.clear=k().clear});var e=h(c0(),1);var F=h(t(),1);class A0 extends e.Component{state={hasError:!1,error:null,errorInfo:null};static getDerivedStateFromError(A){return{hasError:!0,error:A}}componentDidCatch(A,G){let{name:X="ErrorBoundary"}=this.props;console.error(`
|
|
2
|
+
========================================`),console.error(`[${X}] React Error Caught`),console.error("========================================"),console.error("Error:",A.message),console.error("Stack:",A.stack),console.error("Component Stack:",G.componentStack),console.error(`========================================
|
|
3
|
+
`),import("./chunk-agevsn2e.js").then(({logAgentError:L})=>{L(X,A)}).catch((L)=>{console.warn("Failed to log React error:",L)}),this.setState({errorInfo:G})}render(){let{hasError:A,error:G,errorInfo:X}=this.state,{name:L="ErrorBoundary",fallback:J,children:H}=this.props;if(A){if(J)return F.jsxDEV(F.Fragment,{children:J},void 0,!1,void 0,this);return F.jsxDEV(j,{flexDirection:"column",padding:1,borderStyle:"double",borderColor:"red",children:[F.jsxDEV(j,{marginBottom:1,children:F.jsxDEV(E,{color:"red",bold:!0,children:["✗ [",L,"] Render Error"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F.jsxDEV(j,{marginBottom:1,children:F.jsxDEV(E,{color:"red",children:["Message: ",G?.message||"Unknown error"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),G?.stack&&F.jsxDEV(j,{flexDirection:"column",marginBottom:1,children:[F.jsxDEV(E,{color:"yellow",bold:!0,children:"Stack Trace:"},void 0,!1,void 0,this),F.jsxDEV(E,{color:"gray",children:G.stack.split(`
|
|
4
|
+
`).slice(0,5).join(`
|
|
5
|
+
`)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X?.componentStack&&F.jsxDEV(j,{flexDirection:"column",children:[F.jsxDEV(E,{color:"yellow",bold:!0,children:"Component Stack:"},void 0,!1,void 0,this),F.jsxDEV(E,{color:"gray",dimColor:!0,children:X.componentStack.split(`
|
|
6
|
+
`).slice(0,5).join(`
|
|
7
|
+
`)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.jsxDEV(j,{marginTop:1,children:F.jsxDEV(E,{color:"blue",dimColor:!0,children:"Press Ctrl+C to exit"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}return F.jsxDEV(F.Fragment,{children:H},void 0,!1,void 0,this)}}var VA=A0;var l0=h(f0(),1);var DA=5000;class m0{constructor(){this.startGC()}startGC(){setInterval(()=>{for(let[G]of B)try{process.kill(G,0)}catch(X){if(X.code==="ESRCH")B.delete(G)}},DA).unref()}async getProcessList(){let A=[];for(let[G,X]of B)try{let L=await l0.default(G);A.push({pid:G,command:X.command,startTime:X.startTime,duration:Date.now()-X.startTime,cpu:L.cpu,memory:L.memory,status:this.checkStatus(X)})}catch{A.push({pid:G,command:X.command,startTime:X.startTime,duration:Date.now()-X.startTime,cpu:0,memory:0,status:"stopped"})}return A}killProcess(A){let G=B.get(A);if(!G)return!1;return G.process.kill("SIGTERM"),B.delete(A),!0}getProcessOutput(A){let G=B.get(A);if(!G)return null;return{stdout:G.stdout.join(""),stderr:G.stderr.join("")}}checkStatus(A){try{return process.kill(A.process.pid,0),"running"}catch{return"stopped"}}}var hA=new m0;
|
|
8
|
+
export{VA as P,hA as Q};
|